feat: T4b/T4c wave 9 - phenology reports, autopilot A4-A10, honey ledger, Telegram delivery
- Phenology reports API with corrections and revokes; recompute per apiary via PhenologyRecomputeRequested, allowBackward for corrections; season changes are announced in the morning digest (changes since the previous digest, each once) - Season autopilot A4-A10 with per-apiary sync (Apiary before Colony locks) and WinterCheckRecorded - Honey batch ledger at runtime: initial amount, BOTTLING bookings, manual movements, one gram rounding, untracked bottlings never book - Telegram delivery: planning, Berlin delivery times incl. DST, quiet hours, permission re-check and stale skip at send time, rate limits, cleanup of old deliveries - ARCHITECTURE.md: assumptions 47-50 and updated sections 11.x Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
1971b2d9c4
commit
16cc557462
74 files changed
+9634
-340
No files matched your search
@@ -126,7 +126,13 @@ describe('Bottling (e2e)', () => {
|
||||
data: { extractionId, harvestId },
|
||||
});
|
||||
const honeyBatch = await prisma.honeyBatch.create({
|
||||
data: { batchNumber: `HC-${Date.now()}`, extractionId, amount: 25 },
|
||||
data: {
|
||||
batchNumber: `HC-${Date.now()}`,
|
||||
extractionId,
|
||||
amount: 25,
|
||||
// The movement book keeps this batch: bookings need a start amount.
|
||||
initialAmount: 25,
|
||||
},
|
||||
});
|
||||
honeyBatchId = honeyBatch.id;
|
||||
});
|
||||
@@ -141,6 +147,7 @@ describe('Bottling (e2e)', () => {
|
||||
});
|
||||
await prisma.bottlingBatch.deleteMany({ where: { id: bottlingBatchId } });
|
||||
}
|
||||
await prisma.batchMovement.deleteMany({ where: { honeyBatchId } });
|
||||
await prisma.honeyBatch.deleteMany({ where: { id: honeyBatchId } });
|
||||
await prisma.extractionHarvest.deleteMany({ where: { extractionId } });
|
||||
await prisma.extraction.deleteMany({ where: { id: extractionId } });
|
||||
@@ -198,6 +205,18 @@ describe('Bottling (e2e)', () => {
|
||||
const honeyBatch = honeyBatchResponse.body as HoneyBatchBody;
|
||||
expect(honeyBatch.amount).toBe(0);
|
||||
expect(honeyBatch.status).toBe('BOTTLED');
|
||||
// The booking in the movement book, in grams, with its bottling.
|
||||
const movements = await prisma.batchMovement.findMany({
|
||||
where: { honeyBatchId },
|
||||
});
|
||||
expect(movements).toEqual([
|
||||
expect.objectContaining({
|
||||
type: 'BOTTLING',
|
||||
quantity: -25000,
|
||||
sourceBottlingBatchId: bottlingBatchId,
|
||||
userId: beekeeperId,
|
||||
}),
|
||||
]);
|
||||
});
|
||||
|
||||
it('bottling create records BatchBottled and StockChanged together', async () => {
|
||||
|
||||
Reference in new issue
Block a user