feat: create order stubs (#65)

This commit is contained in:
RustamRu
2025-01-19 15:29:58 +03:00
parent 3382ae3ada
commit adb812280d
29 changed files with 540 additions and 1367 deletions

View File

@@ -1 +1 @@
export * from './order-view';
export * from './order';

View File

@@ -1,14 +0,0 @@
import { Order } from "../landing";
export type FetchOrderQueryResponse = {
id: string;
orderDate: string;
carNumber: string;
carBody: number;
carColor?: string;
startWashTime: string;
endWashTime: string;
status: Order.Status;
phone: string;
location: string;
};

18
src/models/api/order.ts Normal file
View File

@@ -0,0 +1,18 @@
/* eslint-disable @typescript-eslint/no-namespace */
import { Order } from "../landing";
export namespace CreateOrder {
export type Response = {
id: Order.Id
};
export type Params = {
body: Order.Create
};
};
export namespace GetOrder {
export type Response = Order.View;
export type Params = {
orderId: Order.Id
};
};

1
src/models/common.ts Normal file
View File

@@ -0,0 +1 @@
export type IsoDate = string; // YYYY-MM-DDThh:mm:ss.mmmZ

View File

@@ -1,4 +1,4 @@
export type RegistrationNumber = string; // А012ВЕ
export type RegistrationNumber = string; // А012ВЕ16
export type Color = string; // #000000

View File

@@ -1,3 +1,5 @@
import { IsoDate } from "../common";
import { Car, Customer, Washing } from ".";
export type Id = string;
@@ -25,14 +27,16 @@ export type Create = {
};
export type View = {
id: Id;
orderDate: string,
status: Status,
phone: Customer.PhoneNumber;
carNumber: Car.RegistrationNumber;
carBody: Car.BodyStyle;
carColor?: Car.Color;
location: Washing.Location;
datetimeBegin: Washing.AvailableBeginDateTime;
datetimeEnd: Washing.AvailableEndDateTime;
startWashTime: Washing.AvailableBeginDateTime;
endWashTime: Washing.AvailableEndDateTime;
status: Status,
notes: string;
created: IsoDate;
updated: IsoDate;
id: Id;
};

View File

@@ -1,5 +1,7 @@
export type Location = string; // ?
import { IsoDate } from "../common";
export type AvailableBeginDateTime = string; // YYYY-MM-DDThh:mm
export type Location = string; // 55.754364, 48.743295 Университетская улица, 1, Иннополис, Верхнеуслонский район, Республика Татарстан (Татарстан), 420500
export type AvailableEndDateTime = string; // YYYY-MM-DDThh:mm
export type AvailableBeginDateTime = IsoDate;
export type AvailableEndDateTime = IsoDate;