- Readiness: all 18 checks (medicine lots, treatment log gaps, labels, harvest withdrawal), medicine subjects masked without veterinary-medicines:read, report PDF (counts only), summary cached 60 s, 409 codes READINESS_*. - Frontend: /compliance page with acknowledge/revoke, dashboard line and nav; veterinary medicine catalogue, lots, movement book with inventory and disposal; label designer check panel, print card with gap list and proof print, food business master data, product legal name. - Service worker: cacheability is path-based (the backend sends no-store on every answer); compliance, medicine, restriction, notice and label check/print paths and restricted document kinds are never cached. - ARCHITECTURE.md §2, §12.10–12.11, Annahmen 86–90. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
80 lines
1.8 KiB
TypeScript
80 lines
1.8 KiB
TypeScript
import type { LotDetailView, LotView, MedicineSuggestion, MedicineView } from "./types";
|
|
|
|
export function medicine(overrides: Partial<MedicineView> = {}): MedicineView {
|
|
return {
|
|
id: "m1",
|
|
name: "Apivar",
|
|
activeIngredient: "Amitraz",
|
|
authorisationNumber: null,
|
|
prescriptionOnly: false,
|
|
withdrawalPeriodDays: 0,
|
|
unit: "PIECE",
|
|
dosePerColony: null,
|
|
doseNote: null,
|
|
applicationMethod: null,
|
|
minTemperatureC: null,
|
|
maxTemperatureC: null,
|
|
defaultSupplier: null,
|
|
notes: null,
|
|
active: true,
|
|
createdAt: "2026-01-01T00:00:00.000Z",
|
|
updatedAt: "2026-01-01T00:00:00.000Z",
|
|
totalRemaining: 12,
|
|
nextExpiry: "2028-01-31",
|
|
lotCount: 1,
|
|
...overrides,
|
|
};
|
|
}
|
|
|
|
export function lot(overrides: Partial<LotView> = {}): LotView {
|
|
return {
|
|
id: "l1",
|
|
medicineId: "m1",
|
|
medicineName: "Apivar",
|
|
unit: "PIECE",
|
|
batchNumber: "CH-42",
|
|
purchasedOn: "2026-08-01",
|
|
quantity: 20,
|
|
remaining: 12,
|
|
expiresOn: "2028-01-31",
|
|
supplier: "Tierarzt Muster",
|
|
purchaseProof: "Rechnung 4711",
|
|
prescribingVet: null,
|
|
notes: null,
|
|
movementCount: 1,
|
|
...overrides,
|
|
};
|
|
}
|
|
|
|
export function lotDetail(overrides: Partial<LotDetailView> = {}): LotDetailView {
|
|
return {
|
|
...lot(),
|
|
movements: [
|
|
{
|
|
id: "mv1",
|
|
type: "TREATMENT",
|
|
quantity: -8,
|
|
treatmentId: "t1",
|
|
reason: null,
|
|
userId: "u1",
|
|
createdAt: "2026-08-10T08:00:00.000Z",
|
|
},
|
|
],
|
|
...overrides,
|
|
};
|
|
}
|
|
|
|
export function suggestion(overrides: Partial<MedicineSuggestion> = {}): MedicineSuggestion {
|
|
return {
|
|
name: "Thymovar",
|
|
treatmentCount: 3,
|
|
latest: {
|
|
activeIngredient: "Thymol",
|
|
withdrawalPeriodDays: 7,
|
|
method: "Streifen",
|
|
amount: "2 Stück",
|
|
},
|
|
...overrides,
|
|
};
|
|
}
|