fix: T4a browser check findings
- Withdrawal wording from one backend helper everywhere ("bis
einschließlich TT.MM. – ab TT.MM. wieder erntefähig", year when it
crosses New Year); withdrawal-status returns lastBlockedDay and the
ready text, the frontend no longer computes dates
- Calendar events name colony or apiary, withdrawal events carry
product and detail; compact withdrawal rows on mobile
- One bottling warning per colony and treatment; pre-save hint
- Offline: online-only actions disabled with a reason, cached data
shows its timestamp, open sheets block submit offline
- Mobile: no horizontal scroll at 360 px, touch targets >= 44 px,
toasts and the add button no longer cover content
- Cleanup sheet without destructive preselection; natural sort of
colony codes; collapsible automation rule cards; varroa list newest
first with chart axes; text fixes
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
32c61c8e14
commit
c2f71bcb03
101 files changed
+2189
-271
No files matched your search
@@ -40,6 +40,14 @@ const conflict = (
|
||||
});
|
||||
|
||||
describe('WithdrawalCheckService', () => {
|
||||
// The texts add the year outside the current one: pin 'today'.
|
||||
beforeAll(() => {
|
||||
jest.useFakeTimers({ now: new Date('2026-06-01T10:00:00Z') });
|
||||
});
|
||||
afterAll(() => {
|
||||
jest.useRealTimers();
|
||||
});
|
||||
|
||||
let db: {
|
||||
harvest: { findMany: jest.Mock };
|
||||
treatment: { findMany: jest.Mock; findUnique: jest.Mock };
|
||||
@@ -269,7 +277,8 @@ describe('WithdrawalCheckService', () => {
|
||||
{
|
||||
code: 'WITHDRAWAL_ACTIVE',
|
||||
severity: 'WARNUNG',
|
||||
message: 'B3: Wartezeit nach Oxuvar endet am 20.08.2026.',
|
||||
message:
|
||||
'B3: Wartezeit nach Oxuvar bis einschließlich 19.08. – ab 20.08. wieder erntefähig.',
|
||||
refs: [
|
||||
{ type: 'Colony', id: 'c1' },
|
||||
{ type: 'Treatment', id: 't1' },
|
||||
@@ -279,6 +288,25 @@ describe('WithdrawalCheckService', () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it('warns once per colony and treatment when several harvests feed the batch', async () => {
|
||||
const warnings = await service.warningsFor(asDb(), [
|
||||
conflict({ harvestId: 'h1' }),
|
||||
conflict({ harvestId: 'h2' }),
|
||||
conflict({ harvestId: 'h3', treatmentId: 't2', product: 'Apivar' }),
|
||||
]);
|
||||
|
||||
expect(warnings.map((w) => w.message)).toEqual([
|
||||
'B3: Wartezeit nach Oxuvar bis einschließlich 19.08. – ab 20.08. wieder erntefähig.',
|
||||
'B3: Wartezeit nach Apivar bis einschließlich 19.08. – ab 20.08. wieder erntefähig.',
|
||||
]);
|
||||
expect(warnings[0].refs).toEqual([
|
||||
{ type: 'Colony', id: 'c1' },
|
||||
{ type: 'Treatment', id: 't1' },
|
||||
{ type: 'Harvest', id: 'h1' },
|
||||
{ type: 'Harvest', id: 'h2' },
|
||||
]);
|
||||
});
|
||||
|
||||
it('answers nothing without reading when there is no conflict', async () => {
|
||||
expect(await service.warningsFor(asDb(), [])).toEqual([]);
|
||||
expect(db.colony.findMany).not.toHaveBeenCalled();
|
||||
@@ -300,7 +328,7 @@ describe('WithdrawalCheckService', () => {
|
||||
priority: 'WARNUNG',
|
||||
category: 'WITHDRAWAL',
|
||||
message:
|
||||
'Wartezeit: B3 am 10.08. geerntet, Wartezeit nach Oxuvar endet am 20.08.2026.',
|
||||
'Wartezeit: B3 am 10.08. geerntet, Wartezeit nach Oxuvar bis einschließlich 19.08. – ab 20.08. wieder erntefähig.',
|
||||
relatedType: 'Harvest',
|
||||
relatedId: 'h1',
|
||||
link: '/harvests/h1',
|
||||
@@ -337,7 +365,7 @@ describe('WithdrawalCheckService', () => {
|
||||
{ message: string; dedupeKeyPrefix: string },
|
||||
];
|
||||
expect(input.message).toBe(
|
||||
'Wartezeit: B3 am 10.08. geerntet, Wartezeit nach Oxuvar endet am 20.08.2026. Bereits abgefüllt: Los L-1, L-2.',
|
||||
'Wartezeit: B3 am 10.08. geerntet, Wartezeit nach Oxuvar bis einschließlich 19.08. – ab 20.08. wieder erntefähig. Bereits abgefüllt: Los L-1, L-2.',
|
||||
);
|
||||
// Same key as without the lots: one notification per harvest and colony.
|
||||
expect(input.dedupeKeyPrefix).toBe('withdrawal-conflict:h1:c1');
|
||||
|
||||
Reference in new issue
Block a user