Auth flow functional
This commit is contained in:
80
astro/src/astroTypes.ts
Normal file
80
astro/src/astroTypes.ts
Normal file
@ -0,0 +1,80 @@
|
||||
export interface User {
|
||||
name: string;
|
||||
id: string;
|
||||
email: string;
|
||||
phoneNumber: string;
|
||||
}
|
||||
|
||||
export interface Node {
|
||||
name: string;
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface Media {
|
||||
id: string;
|
||||
alt?: string;
|
||||
updatedAt: string;
|
||||
createdAt: string;
|
||||
url?: string;
|
||||
filename?: string;
|
||||
mimeType?: string;
|
||||
filesize?: number;
|
||||
width?: number;
|
||||
height?: number;
|
||||
}
|
||||
|
||||
export interface Product extends Node {
|
||||
id: string;
|
||||
name: string;
|
||||
weight?: number;
|
||||
picture: Media;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
|
||||
// export interface Location = {
|
||||
// latitude: number;
|
||||
// longitude: number;
|
||||
// }
|
||||
|
||||
export interface Maker extends Node {
|
||||
email: string;
|
||||
phoneNumber?: string;
|
||||
location: [number, number];
|
||||
stock: Product[];
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
|
||||
export interface Retailer extends Node {
|
||||
email: string;
|
||||
phoneNumber?: string;
|
||||
location: [number, number];
|
||||
stock: Product[];
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
|
||||
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;
|
||||
|
||||
maker: Maker;
|
||||
retailer: Retailer;
|
||||
products: Product[];
|
||||
|
||||
courier?: User;
|
||||
|
||||
timeSensitive: boolean;
|
||||
status: DispatchStatus;
|
||||
|
||||
departureDate: string;
|
||||
arrivalDate: string;
|
||||
weightAllowance: number;
|
||||
}
|
||||
|
Reference in New Issue
Block a user