Feat: Adding the collections
This commit is contained in:
67
src/collections/Dispatches.ts
Normal file
67
src/collections/Dispatches.ts
Normal file
@ -0,0 +1,67 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user