- Introduced OrderItem and Shipment models with associated properties and actions. - Updated ObjectModels to include new models for better integration. - Refactored existing models to remove unnecessary ID references and improve hyperlink support for related objects. - Enhanced various models by removing deprecated fields and ensuring consistency in object references.
71 lines
1.4 KiB
JavaScript
71 lines
1.4 KiB
JavaScript
import StockEventIcon from '../../components/Icons/StockEventIcon'
|
|
|
|
export const StockEvent = {
|
|
name: 'stockEvent',
|
|
label: 'Stock Event',
|
|
prefix: 'SEV',
|
|
icon: StockEventIcon,
|
|
actions: [],
|
|
columns: ['_id', 'owner', 'parent', 'value', 'createdAt'],
|
|
filters: ['_id', 'owner', 'parent'],
|
|
sorters: ['createdAt'],
|
|
properties: [
|
|
{
|
|
name: '_id',
|
|
label: 'ID',
|
|
type: 'id',
|
|
objectType: 'stockEvent',
|
|
columnFixed: 'left',
|
|
value: null,
|
|
showCopy: true
|
|
},
|
|
{
|
|
name: 'createdAt',
|
|
label: 'Created At',
|
|
type: 'dateTime',
|
|
value: null,
|
|
readOnly: true
|
|
},
|
|
{
|
|
name: 'updatedAt',
|
|
label: 'Updated At',
|
|
type: 'dateTime',
|
|
value: null,
|
|
readOnly: true
|
|
},
|
|
{
|
|
name: 'owner',
|
|
label: 'Owner',
|
|
type: 'object',
|
|
objectType: (objectData) => {
|
|
return objectData.ownerType
|
|
},
|
|
columnFixed: 'left',
|
|
value: null,
|
|
showCopy: true,
|
|
showHyperlink: true
|
|
},
|
|
{
|
|
name: 'parent',
|
|
label: 'Parent',
|
|
type: 'object',
|
|
objectType: (objectData) => {
|
|
return objectData?.parentType
|
|
},
|
|
value: null,
|
|
showCopy: true,
|
|
showHyperlink: true
|
|
},
|
|
{
|
|
name: 'value',
|
|
label: 'Value',
|
|
columnWidth: 120,
|
|
type: 'variance',
|
|
showCopy: true,
|
|
suffix: (objectData) => {
|
|
return objectData.unit
|
|
}
|
|
}
|
|
]
|
|
}
|