Complete basic request dispatch flow
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-04-07 19:40:38 +02:00
parent 00cf0d9905
commit 9be7ae81ae
11 changed files with 264 additions and 163 deletions

View File

@ -44,6 +44,7 @@ export interface Maker extends Node {
stock: Product[];
createdAt: string;
updatedAt: string;
admins: User[];
};
export interface Retailer extends Node {
@ -53,16 +54,17 @@ export interface Retailer extends Node {
stock: Product[];
createdAt: string;
updatedAt: string;
admins: User[];
};
const DISPATCH_STATUS = ['requested', 'accepted', 'archived'] as const;
export type DispatchStatus = typeof DISPATCH_STATUS[number];
export interface Dispatch {
id: string;
dispatchesCode?: string; //Human readable id
createdAt: string;
updatedAt: string;
id?: string;
code?: string; //Human readable id
createdAt?: string;
updatedAt?: string;
maker: Maker;
retailer: Retailer;
@ -73,8 +75,19 @@ export interface Dispatch {
timeSensitive: boolean;
status: DispatchStatus;
departureDate: string;
arrivalDate: string;
weightAllowance: number;
departureDate?: string;
arrivalDate?: string;
}
export interface CreateDispatch {
code?: string; //Human readable id
maker: Maker | string;
retailer: Retailer | string;
products: Product[] | string[] ;
courier?: User;
timeSensitive: boolean;
status: DispatchStatus;
}