FEAT-12a: ForSale scaffolding — status+ForSale, abgabe strings, /abgabe route+nav, sale-ad API stub, detail action, jszip

This commit is contained in:
2026-06-06 01:07:43 +02:00
parent 188b33618e
commit e4b7558abd
9 changed files with 293 additions and 5 deletions

View File

@@ -0,0 +1,37 @@
/**
* Sale-ad (Abgabe-Inserat) AI assist — FEAT-12a frontend stub.
*
* The backend endpoint (POST /gerbils/sale-ad, Claude-powered) is FEAT-12a-backend
* and lands only once Julian provides an API key. Until then this call 404s/503s
* and the UI shows a German "API-Schlüssel noch nicht konfiguriert" disabled state.
*
* REQUEST SHAPE (defined here; backend must match):
* {
* animals: [{ name, farbschlag, dateOfBirth, notes }],
* statusLine: string, // e.g. "FREI" / "LOCKER RESERVIERT Anna"
* hints: string // free-text style/wishes from the user
* }
* -> { text: string } // the assembled/improved German listing
*/
import { api } from './client'
export interface SaleAdAnimal {
name: string
farbschlag: string | null
dateOfBirth: string | null
notes: string | null
}
export interface SaleAdRequest {
animals: SaleAdAnimal[]
statusLine: string
hints: string
}
export interface SaleAdResponse {
text: string
}
export function generateSaleAd(request: SaleAdRequest): Promise<SaleAdResponse> {
return api.post<SaleAdResponse>('/gerbils/sale-ad', request)
}

View File

@@ -10,9 +10,9 @@
export type Gender = 'unknown' | 'male' | 'female'
export const GENDERS: Gender[] = ['unknown', 'male', 'female']
/** Gerbil.Status — C# enum { Active, Deceased, GivenAway }. */
export type GerbilStatus = 'Active' | 'Deceased' | 'GivenAway'
export const GERBIL_STATUSES: GerbilStatus[] = ['Active', 'Deceased', 'GivenAway']
/** Gerbil.Status — C# enum { Active, Deceased, GivenAway, ForSale }. */
export type GerbilStatus = 'Active' | 'Deceased' | 'GivenAway' | 'ForSale'
export const GERBIL_STATUSES: GerbilStatus[] = ['Active', 'ForSale', 'Deceased', 'GivenAway']
/** ISO date string "YYYY-MM-DD" (maps to C# DateOnly). */
export type DateOnlyString = string