GEN-1: export genotypeToFarbschlag for DATA-1 denormalization contract
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -93,5 +93,17 @@ export function farbschlagFor(g: Genotype): FarbschlagMatch {
|
||||
return { name, base, unknown: false }
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience: genotype -> German Farbschlag name (with Schecke/Rex modifiers),
|
||||
* or "Unbekannter Farbschlag". This is the DENORMALIZATION contract for DATA-1:
|
||||
* the backend mirrors this mapping into a stored Farbschlag column (recomputed
|
||||
* whenever the genotype changes) so Gridify list filtering/sorting never has to
|
||||
* parse genotype strings in SQL. The catalog (BASE_COLORS) is self-contained in
|
||||
* this file so it can be ported/kept in sync with the backend.
|
||||
*/
|
||||
export function genotypeToFarbschlag(g: Genotype): string {
|
||||
return farbschlagFor(g).name
|
||||
}
|
||||
|
||||
/** Number of base-colour varieties currently catalogued. */
|
||||
export const CATALOG_SIZE = BASE_COLORS.length
|
||||
|
||||
Reference in New Issue
Block a user