Update FilamentStock and StockEvent models for improved data handling
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good

- Reformatted the filters in FilamentStock for better readability.
- Changed the 'required' property of the stock location in FilamentStock to true, ensuring that stock location is mandatory.
- Added 'updatedAt' column to StockEvent for enhanced tracking of stock events.
This commit is contained in:
Tom Butcher 2026-07-26 18:37:47 +01:00
parent 4c19df717b
commit 50abb22054
2 changed files with 9 additions and 3 deletions

View File

@ -30,7 +30,13 @@ export const FilamentStock = {
'createdAt', 'createdAt',
'updatedAt' 'updatedAt'
], ],
filters: ['_id', 'filament', 'filament._id', 'filamentSku', 'filamentSku._id'], filters: [
'_id',
'filament',
'filament._id',
'filamentSku',
'filamentSku._id'
],
sorters: ['createdAt', 'updatedAt', 'filament', 'filamentSku'], sorters: ['createdAt', 'updatedAt', 'filament', 'filamentSku'],
group: ['filament', 'filamentSku'], group: ['filament', 'filamentSku'],
properties: [ properties: [
@ -107,7 +113,7 @@ export const FilamentStock = {
label: 'Stock location', label: 'Stock location',
type: 'object', type: 'object',
objectType: 'stockLocation', objectType: 'stockLocation',
required: false, required: true,
showHyperlink: true, showHyperlink: true,
columnWidth: 200 columnWidth: 200
}, },

View File

@ -8,7 +8,7 @@ export const StockEvent = {
prefix: 'SEV', prefix: 'SEV',
icon: StockEventIcon, icon: StockEventIcon,
actions: [], actions: [],
columns: ['_reference', 'owner', 'parent', 'value', 'createdAt'], columns: ['_reference', 'owner', 'parent', 'value', 'createdAt', 'updatedAt'],
filters: ['_id', 'owner', 'parent'], filters: ['_id', 'owner', 'parent'],
sorters: ['createdAt'], sorters: ['createdAt'],
properties: [ properties: [