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)
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user