FEAT-12a: ForSale scaffolding — status+ForSale, abgabe strings, /abgabe route+nav, sale-ad API stub, detail action, jszip
This commit is contained in:
37
gerbil-manager-web/src/api/saleAd.ts
Normal file
37
gerbil-manager-web/src/api/saleAd.ts
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user