@alba-cars/common-modules
Version:
A package containing DTOs, validation classes and common modules and interfaces for Alba Cars
204 lines (203 loc) • 6.02 kB
TypeScript
import { DateFilter, PaginationOptions } from "../../../../global";
import { VehicleMediaCreateDTO } from "../../../vehicle";
import { MarketingData } from "../../../../core";
export declare enum RequestType {
SELL = "sell",
TRADE_IN = "trade_in"
}
export declare enum TradeInOption {
YES = "yes",
NO = "no"
}
export declare enum VehicleOption {
NEW = "new",
USED = "used"
}
export declare class SellCarRequestDTO {
id: string;
name: string;
phone: string;
brand: string;
brandName: string;
model: string;
modelName: string;
modelVersion: string;
modelVersionName: string;
year: string;
mileage: number;
description: string;
specification: string;
specificationName: string;
tradeIn: TradeInOption;
images: string[];
isDeleted?: boolean;
createdAt?: Date;
updatedAt?: Date;
inspectionBookingDate?: Date;
status?: "SUBMITTED" | "DRAFT";
marketing?: MarketingData;
validate(): string[];
static fromPlain(plain: Record<string, unknown>): SellCarRequestDTO;
toPlain(): Record<string, unknown>;
}
export declare class SellCarRequestCreateDTO {
name: string;
phone: string;
brand: string;
brandName: string;
model: string;
modelName: string;
modelVersion?: string;
modelVersionName?: string;
year: string;
mileage: number;
expectedSellingPrice?: number;
description: string;
emirates: string;
specification: string;
specificationName: string;
requestType?: RequestType;
tradeIn: TradeInOption;
additionalDetails?: string;
dealDriveEstimation?: number;
images: string[];
media?: VehicleMediaCreateDTO[];
inspectionBookingDate?: Date;
status?: "SUBMITTED" | "DRAFT";
sessionId?: string;
marketing?: MarketingData;
validate(): string[];
static fromPlain(plain: Record<string, unknown>): SellCarRequestCreateDTO;
toPlain(): Record<string, unknown>;
}
export declare class ExchangeCarRequestCreateDTO {
name: string;
phone: string;
brand: string;
brandName: string;
model: string;
modelName: string;
modelVersion?: string;
modelVersionName?: string;
year: string;
mileage: number;
expectedSellingPrice?: number;
description: string;
emirates: string;
specification: string;
specificationName: string;
requestType?: RequestType;
tradeIn: TradeInOption;
additionalDetails?: string;
dealDriveEstimation?: number;
images: string[];
media?: VehicleMediaCreateDTO[];
bookingDate?: Date;
status?: "SUBMITTED" | "DRAFT";
sessionId?: string;
marketing?: MarketingData;
validate(): string[];
static fromPlain(plain: Record<string, unknown>): SellCarRequestCreateDTO;
toPlain(): Record<string, unknown>;
}
export declare class SellCarRequestUpdateDTO {
name?: string;
phone?: string;
email?: string;
city?: string;
requestType?: RequestType;
makeId?: string;
modelId?: string;
year?: number;
mileage?: number;
specification?: string;
images?: string[];
desiredVehicleId?: string;
color?: string;
transmission?: string;
fuelType?: string;
engineCapacity?: string;
description?: string;
inspectionBookingDate?: Date;
status?: "SUBMITTED" | "DRAFT";
marketing?: MarketingData;
additionalDetails?: {
serviceHistory?: boolean;
numberOfOwners?: number;
accidentHistory?: boolean;
modifications?: string[];
lastServiceDate?: Date;
warrantyValid?: boolean;
tradeIn?: boolean;
inspectionDate?: Date;
inspectionLocation?: string;
finalTradeInOffer?: number;
[key: string]: any;
};
validate(): string[];
static fromPlain(plain: Record<string, unknown>): SellCarRequestUpdateDTO;
toPlain(): Record<string, unknown>;
}
export declare class SellCarRequestResponseDTO {
id: string;
refId: number;
name: string;
phone: string;
brand: string;
brandName: string;
model: string;
modelName: string;
modelVersion: string;
modelVersionName: string;
year: string;
mileage: number;
expectedSellingPrice: number;
description: string;
specification: string;
specificationName: string;
requestType?: RequestType;
tradeIn: TradeInOption;
dealDriveEstimation?: number;
additionalDetails?: string;
isDeleted: boolean;
isActive: boolean;
images: string[];
media?: VehicleMediaCreateDTO[];
inspectionBookingDate?: Date;
createdById?: string | null;
updatedById?: string | null;
deletedById?: string | null;
status?: "SUBMITTED" | "DRAFT";
marketing?: MarketingData;
validate(): string[];
static fromPlain(plain: Record<string, unknown>): SellCarRequestResponseDTO;
toPlain(): Record<string, unknown>;
}
export declare class SellCarFilterDTO {
search?: string;
leadId?: string;
additionalDetails?: string;
isActive?: boolean;
createdAt?: DateFilter;
tradeIn?: TradeInOption;
status?: "SUBMITTED" | "DRAFT";
marketing?: MarketingData;
validate(): string[];
static fromPlain(plain: Record<string, unknown>): SellCarFilterDTO;
toPlain(): Record<string, unknown>;
}
export declare class SellCarOptionsDTO extends PaginationOptions {
sort?: {
field: string;
direction: "asc" | "desc";
};
static fromPlain(plain: Record<string, unknown>): SellCarOptionsDTO;
toPlain(): Record<string, unknown>;
}
export declare class SellCarFetchDTO {
filter: SellCarFilterDTO;
options: SellCarOptionsDTO;
validate(): string[];
static fromPlain(plain: Record<string, unknown>): SellCarFetchDTO;
toPlain(): Record<string, unknown>;
}