67 lines
1.4 KiB
TypeScript
67 lines
1.4 KiB
TypeScript
|
import { CollectionConfig } from 'payload/types';
|
||
|
|
||
|
const Dispatches: CollectionConfig = {
|
||
|
slug: 'dispatches',
|
||
|
// admin: {
|
||
|
// useAsTitle: 'email',
|
||
|
// },
|
||
|
access: {
|
||
|
read: () => true,
|
||
|
},
|
||
|
fields: [
|
||
|
{
|
||
|
name: 'dispatchesCode',
|
||
|
type: 'text',
|
||
|
required: true,
|
||
|
},
|
||
|
{
|
||
|
name: 'products',
|
||
|
type: 'relationship',
|
||
|
relationTo: 'products',
|
||
|
hasMany: true,
|
||
|
},
|
||
|
{
|
||
|
name: 'startingPoint',
|
||
|
type: 'relationship',
|
||
|
relationTo: 'makers',
|
||
|
hasMany: false,
|
||
|
},
|
||
|
{
|
||
|
name: 'endPoint',
|
||
|
type: 'relationship',
|
||
|
relationTo: 'makers',
|
||
|
hasMany: false,
|
||
|
},
|
||
|
{
|
||
|
name: 'courier',
|
||
|
type: 'relationship',
|
||
|
relationTo: 'couriers',
|
||
|
hasMany: false,
|
||
|
},
|
||
|
{
|
||
|
name: 'status', // required
|
||
|
type: 'select', // required
|
||
|
hasMany: true,
|
||
|
// admin: {
|
||
|
// isClearable: true,
|
||
|
// isSortable: true, // use mouse to drag and drop different values, and sort them according to your choice
|
||
|
// },
|
||
|
options: [
|
||
|
{
|
||
|
label: 'Route requested',
|
||
|
value: 'routeRequested',
|
||
|
},
|
||
|
{
|
||
|
label: 'In transit',
|
||
|
value: 'inTransit',
|
||
|
},
|
||
|
{
|
||
|
label: 'Completed',
|
||
|
value: 'completed',
|
||
|
},
|
||
|
],
|
||
|
}
|
||
|
],
|
||
|
};
|
||
|
|
||
|
export default Dispatches;
|