add order form page models, reorder landing models (#8)

This commit is contained in:
RustamRu 2024-12-08 09:55:13 +03:00
parent 440e87ef76
commit b79c957779
8 changed files with 53 additions and 8 deletions

View File

@ -1,3 +1 @@
export * from './i18n';
export * as Order from './order';
export * as Review from './review';
export * from './i18n';

18
src/models/landing/car.ts Normal file
View File

@ -0,0 +1,18 @@
export type RegistrationNumber = string; // А012ВЕ
export type Color = string; // #000000
export const enum BodyStyle {
UNKNOWN = 0,
SEDAN = 1,
HATCHBACK = 2,
CROSSOVER = 3,
SUV = 4,
STATION_WAGON = 5,
COUPE = 6,
MINIVAN = 7,
PICKUP = 8,
LIFTBACK = 9,
SPORTS_CAR = 10,
OTHER = 99
}

View File

@ -0,0 +1 @@
export type PhoneNumber = string; // +79876543210

View File

@ -1 +1,6 @@
export * as Car from './car';
export * as Customer from './customer';
export * as Washing from './washing';
export * as Order from './order'; // import: Car, Customer, Washing
export * as Review from './review';
export * from './stubs';

View File

@ -0,0 +1,23 @@
import { Car, Customer, Washing } from ".";
export type Id = string;
export type Create = {
customer: {
phone: Customer.PhoneNumber,
};
car: {
number: Car.RegistrationNumber,
body: Car.BodyStyle,
color: Car.Color,
},
washing: {
location: Washing.Location
begin: Washing.AvailableBeginDateTime,
end: Washing.AvailableEndDateTime,
}
};
export type View = {
id: Id;
};

View File

@ -0,0 +1,5 @@
export type Location = string; // ?
export type AvailableBeginDateTime = string; // YYYY-MM-DDThh:mm
export type AvailableEndDateTime = string; // YYYY-MM-DDThh:mm

View File

@ -1,5 +0,0 @@
export type Id = string;
export type View = {
id: Id;
};