feat: T6 wave 3 – treatment books from lot, label print lock, restricted zone, authority notices
- Treatments book their dose from a medicine lot (delta booking on edit, bulk all-or-nothing, idempotent); Bestandsbuch columns from the lot, FEHLT exactly where treatmentLogGaps reports a gap; Bestandsbuch export needs veterinary-medicines:read. - Label printing: 409 LABEL_PARTICULARS_MISSING on gaps, proof print with watermark, PRINT audit before the PDF, check endpoints; digit rules only from the seeded ComplianceSettings row (fail closed). - Restricted zone (Berlin day): create, update, move, merge and CSV import blocked inside an active restriction; override with reason and compliance:manage, audited, never stored on the colony; split, harvest and dissolve stay free; restriction details only with compliance:read. - Authority notices: settings, herd snapshot, registration/herd change/TSK notices with one open draft per kind under the settings lock. - Label check refinements (geometric reading order, number|unit pairs). - ARCHITECTURE.md §12.6–12.8, Annahmen 71–77; spec §5.6 Berlin day. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
c18860c75c
commit
edc193f128
73 files changed
+9470
-171
No files matched your search
@@ -193,6 +193,36 @@ describe('Import (e2e)', () => {
|
||||
expect(report.rows[0].message).toContain('nicht gefunden');
|
||||
});
|
||||
|
||||
it('refuses to import a colony into an apiary in a restricted zone', async () => {
|
||||
const code = `CSV-V-Zone-${Date.now()}`;
|
||||
const csv = `code,apiaryName,colonyType
|
||||
${code},${apiaryName},PRODUCTION_COLONY`;
|
||||
const restriction = await prisma.apiaryRestriction.create({
|
||||
data: {
|
||||
apiaryId,
|
||||
disease: 'Faulbrut',
|
||||
startsOn: new Date('2000-01-01T00:00:00.000Z'),
|
||||
},
|
||||
});
|
||||
try {
|
||||
const response = await request(app.getHttpServer())
|
||||
.post('/api/v1/import/colonies')
|
||||
.set('Authorization', `Bearer ${adminToken}`)
|
||||
.attach('file', csvFile(csv), {
|
||||
filename: 'colonies.csv',
|
||||
contentType: 'text/csv',
|
||||
})
|
||||
.expect(201);
|
||||
const report = response.body as ImportReportBody;
|
||||
expect(report.created).toBe(0);
|
||||
expect(report.errors).toBe(1);
|
||||
expect(report.rows[0].message).toContain('Sperrbezirk');
|
||||
expect(await prisma.colony.count({ where: { code } })).toBe(0);
|
||||
} finally {
|
||||
await prisma.apiaryRestriction.delete({ where: { id: restriction.id } });
|
||||
}
|
||||
});
|
||||
|
||||
it('imports queens', async () => {
|
||||
const code = `CSV-Q-${Date.now()}`;
|
||||
const csv = `code,breed\n${code},Carnica`;
|
||||
|
||||
Reference in new issue
Block a user