Add auditLines field to new stock audit level creation and mock stock audit module in tests
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good

This commit is contained in:
Tom Butcher 2026-09-01 16:07:42 +01:00
parent 3bd1549c85
commit e1ac5bfba1
2 changed files with 5 additions and 0 deletions

View File

@ -23,6 +23,10 @@ jest.unstable_mockModule('../../utils.js', () => ({
generateId: jest.fn(() => () => 'test-id'), generateId: jest.fn(() => () => 'test-id'),
})); }));
jest.unstable_mockModule('../inventory/stockaudit.schema.js', () => ({
updateDraftStockAuditCurrents: jest.fn().mockResolvedValue(),
}));
const { aggregateRollups, editObject, newObject, deleteObject } = await import('../../database.js'); const { aggregateRollups, editObject, newObject, deleteObject } = await import('../../database.js');
const { listingModel } = await import('../sales/listing.schema.js'); const { listingModel } = await import('../sales/listing.schema.js');
const { listingVarientModel } = await import('../sales/listingvarient.schema.js'); const { listingVarientModel } = await import('../sales/listingvarient.schema.js');

View File

@ -151,6 +151,7 @@ export const newStockAuditLevelRouteHandler = async (req, res) => {
const newData = { const newData = {
name: req.body.name, name: req.body.name,
tags: req.body.tags, tags: req.body.tags,
auditLines: req.body.auditLines,
}; };
const result = await newObject({ const result = await newObject({