feat: create order stubs (#65)
This commit is contained in:
@@ -1 +1 @@
|
||||
export * from './order-view';
|
||||
export * from './order';
|
||||
@@ -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
18
src/models/api/order.ts
Normal 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
1
src/models/common.ts
Normal file
@@ -0,0 +1 @@
|
||||
export type IsoDate = string; // YYYY-MM-DDThh:mm:ss.mmmZ
|
||||
@@ -1,4 +1,4 @@
|
||||
export type RegistrationNumber = string; // А012ВЕ
|
||||
export type RegistrationNumber = string; // А012ВЕ16
|
||||
|
||||
export type Color = string; // #000000
|
||||
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user