SEARCH-2b: Herkunft dropdown -> originBreeder + GET /gerbils/breeders; name search -> nameSearch (client-normalized)

This commit is contained in:
2026-06-06 09:15:54 +02:00
parent ba81f48e0f
commit 681e8c28fb
3 changed files with 31 additions and 16 deletions

View File

@@ -11,6 +11,11 @@ export function getGerbil(id: string): Promise<Gerbil> {
return api.get<Gerbil>(`${resources.gerbils}/${id}`)
}
/** SEARCH-2b: distinct non-empty originBreeder (Herkunft) values, sorted. */
export function listOriginBreeders(): Promise<string[]> {
return api.get<string[]>(`${resources.gerbils}/breeders`)
}
export function createGerbil(body: CreateGerbil): Promise<Gerbil> {
return api.post<Gerbil>(resources.gerbils, body)
}

View File

@@ -31,6 +31,13 @@ export interface Gerbil {
colorVarietyId: string | null
originContactId: string | null
receiverContactId: string | null
/** SEARCH-1/2b: free-text Herkunft (Züchter) from the import; Gridify-filterable. */
originBreeder?: string | null
/**
* SEARCH-1/2b: normalized name (lowercase, [\s._-] stripped) — filter-only,
* not part of the returned payload; present here so it can be a Gridify field.
*/
nameSearch?: string | null
/** Compact GEN-1 genotype string, e.g. "Aa CC Dd EE GG Pp Spsp rere" (or "?"-wildcards). */
genotype: string | null
notes: string | null
@@ -50,6 +57,7 @@ export interface CreateGerbil {
colorVarietyId?: string | null
originContactId?: string | null
receiverContactId?: string | null
originBreeder?: string | null
genotype?: string | null
notes?: string | null
}