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)
}