UNPKG

@alba-cars/common-modules

Version:

A package containing DTOs, validation classes and common modules and interfaces for Alba Cars

85 lines (84 loc) 2.79 kB
import { BaseGetDTO, TypedFilter, TypedOptions } from "../../../../global"; import { LeadDTO } from "../../../lead/data/dto/lead_dto"; import { Vehicle } from "../../../models"; import { MarketingData } from "../../../../core"; export declare enum DepositStatus { PENDING = "pending", COMPLETED = "completed", FAILED = "failed" } export declare enum PaymentOption { CASH = "cash", BANK_TYPE_A = "bank-a", BANK_TYPE_B = "bank-b" } export declare class DepositDTO { id: string; stripePaymentIntentId: string; amount: number; currency: string; status: DepositStatus; isRefundable: boolean; paymentOption: PaymentOption; isRefunded: boolean; lead?: LeadDTO; vehicle: Vehicle; isDeleted?: boolean; createdAt?: Date; updatedAt?: Date; validate(): string[]; static fromPlain(plain: Record<string, unknown>): DepositDTO; toPlain(): Record<string, unknown>; } export declare class DepositCreateDTO { stripePaymentIntentId: string; amount: number; paymentOption: PaymentOption; currency: string; status: DepositStatus; isRefundable?: boolean; isRefunded?: boolean; leadId?: string; userId?: string; vehicleId: string; marketing?: MarketingData; validate(): string[]; static fromPlain(plain: Record<string, unknown>): DepositCreateDTO; toPlain(): Record<string, unknown>; } export declare class DepositUpdateDTO { status?: DepositStatus; isRefundable?: boolean; isRefunded?: boolean; paymentOption?: PaymentOption; isDeleted?: boolean; validate(): string[]; static fromPlain(plain: Record<string, unknown>): DepositUpdateDTO; toPlain(): Record<string, unknown>; } export declare class DepositFilter extends TypedFilter { id?: string | string[]; stripePaymentIntentId?: string | string[]; amount?: number | number[]; currency?: string | string[]; status?: DepositStatus | DepositStatus[]; isRefundable?: boolean; isRefunded?: boolean; leadId?: string | string[]; userId?: string | string[]; vehicleId?: string | string[]; isDeleted?: boolean; search?: string; fromDate?: Date; toDate?: Date; } export declare class DepositOptions extends TypedOptions<DepositDTO> { static fromPlain(plain: Record<string, unknown>): DepositOptions; toPlain(): Record<string, unknown>; } export declare class DepositGetDTO extends BaseGetDTO<DepositDTO, DepositFilter> { filters?: DepositFilter; options?: DepositOptions; static fromPlain<T extends BaseGetDTO<DepositDTO, DepositFilter>>(this: new () => T, plain: Record<string, unknown>): T; toPlain(): Record<string, unknown>; }