diff --git a/src/models/index.ts b/src/models/index.ts index ddf5c34..13c310b 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -1,3 +1 @@ -export * from './i18n'; -export * as Order from './order'; -export * as Review from './review'; \ No newline at end of file +export * from './i18n'; \ No newline at end of file diff --git a/src/models/landing/car.ts b/src/models/landing/car.ts new file mode 100644 index 0000000..9058a85 --- /dev/null +++ b/src/models/landing/car.ts @@ -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 +} \ No newline at end of file diff --git a/src/models/landing/customer.ts b/src/models/landing/customer.ts new file mode 100644 index 0000000..f98cf1a --- /dev/null +++ b/src/models/landing/customer.ts @@ -0,0 +1 @@ +export type PhoneNumber = string; // +79876543210 \ No newline at end of file diff --git a/src/models/landing/index.ts b/src/models/landing/index.ts index 11add84..c2ff256 100644 --- a/src/models/landing/index.ts +++ b/src/models/landing/index.ts @@ -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'; \ No newline at end of file diff --git a/src/models/landing/order.ts b/src/models/landing/order.ts new file mode 100644 index 0000000..d286a90 --- /dev/null +++ b/src/models/landing/order.ts @@ -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; +}; \ No newline at end of file diff --git a/src/models/review.ts b/src/models/landing/review.ts similarity index 100% rename from src/models/review.ts rename to src/models/landing/review.ts diff --git a/src/models/landing/washing.ts b/src/models/landing/washing.ts new file mode 100644 index 0000000..c61c638 --- /dev/null +++ b/src/models/landing/washing.ts @@ -0,0 +1,5 @@ +export type Location = string; // ? + +export type AvailableBeginDateTime = string; // YYYY-MM-DDThh:mm + +export type AvailableEndDateTime = string; // YYYY-MM-DDThh:mm \ No newline at end of file diff --git a/src/models/order.ts b/src/models/order.ts deleted file mode 100644 index 5cd62d9..0000000 --- a/src/models/order.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type Id = string; - -export type View = { - id: Id; -}; \ No newline at end of file