Auth flow functional

This commit is contained in:
2024-04-06 17:28:36 +02:00
parent 98e967f7c0
commit 3b5ac81cc3
16 changed files with 646 additions and 406 deletions

80
astro/src/astroTypes.ts Normal file
View 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;
}