import { Attr } from 'ts-framework' import { MobilityResponseDTO } from './mobility' import { ProviderPricingResponseDTO } from './provider-pricing' import { CreateProviderProductPricingDTO, ProviderProductPricingDTO } from './provider-product-pricing' import { ServiceResponseDTO } from './service' import { ServiceProviderProductResponseDTO } from './service-provider-product' import { VehicleResponseDTO } from './vehicle' export class CalculateProductPricingRequestDTO { @Attr({ type: Number }) pickupLatitude: number @Attr({ type: Number }) pickupLongitude: number @Attr({ type: Number }) dropoffLatitude: number @Attr({ type: Number }) dropoffLongitude: number @Attr({ type: String }) productId: string @Attr({ type: Number }) riderCount: number } export class CreateProviderProductDTO { @Attr({ type: String }) name: string @Attr({ type: String,optional: true }) internalName?: string @Attr({ type: String }) description: string @Attr({ type: String, optional: true }) externalUrl?: string @Attr({ type: String }) organizationId: string @Attr({ type: String }) pricingId: string @Attr({ type: String }) integrationId: string @Attr({ type: String }) serviceLevelId: string } export class CreateProviderProductWithPricingDTO { @Attr({ type: String }) name: string @Attr({ type: String,optional: true }) internalName?: string @Attr({ type: String }) description: string @Attr({ type: String, optional: true }) externalUrl?: string @Attr({ type: String }) organizationId: string @Attr({ type: String }) integrationId: string @Attr({ type: String }) serviceLevelId: string @Attr({ type: CreateProviderProductPricingDTO }) pricing: CreateProviderProductPricingDTO } export class ProviderProductOneMobilityDTO { @Attr({ type: String }) id: string @Attr({ type: String }) mobilityId: string } export class ProviderProductManyMobilitiesDTO { @Attr({ type: String }) id: string @Attr({ type: String }) mobilityIds: string[] } export class ProviderProductDeactivationDTO { @Attr({ type: String }) id: string @Attr({ type: Date }) deactivationDate: Date } export class UpdateProviderProductDTO { @Attr({ type: String }) id: string @Attr({ type: String, optional: true }) name?: string @Attr({ type: String,optional: true }) internalName?: string @Attr({ type: String, optional: true }) description?: string @Attr({ type: String, optional: true }) externalUrl?: string @Attr({ type: String, optional: true }) providerId?: string @Attr({ type: String, optional: true }) organizationId?: string @Attr({ type: String, optional: true }) pricingId?: string @Attr({ type: String, optional: true }) integrationId?: string @Attr({ type: String, optional: true }) serviceLevelId?: string } export class UpdateProviderProductWithPricingDTO { @Attr({ type: String }) id: string @Attr({ type: String, optional: true }) name?: string @Attr({ type: String,optional: true }) internalName?: string @Attr({ type: String, optional: true }) externalUrl?: string @Attr({ type: String, optional: true }) description?: string @Attr({ type: String, optional: true }) organizationId?: string @Attr({ type: String, optional: true }) integrationId?: string @Attr({ type: String, optional: true }) serviceLevelId?: string @Attr({ type: ProviderProductPricingDTO, optional: true }) pricing: ProviderProductPricingDTO } export class GetManyWithOrganizationIdDTO { @Attr({ type: String }) organizationId: string @Attr({ type: Boolean }) active: boolean @Attr({ type: Number, optional: true }) skip?: number @Attr({ type: Number, optional: true }) take?: number @Attr({ type: Boolean, optional: true }) withPricing?: number } export class ProviderProductResponseDTO { id: string deactivationDate: Date description: string externalUrl?: string name: string internalName?: string integrationId: string pricingId?: string pricing?: ProviderPricingResponseDTO mobilities?: MobilityResponseDTO[] serviceProviderProducts?: ServiceProviderProductResponseDTO[] organizationId: string providerProductService?: ServiceResponseDTO[] providerServiceLevel?: {id: string, name: string} vehicles?: VehicleResponseDTO[] } export class ProviderProductPricingResponseDTO { id: string cost: number fare: number constructor(model: ProviderProductPricingResponseDTO) { this.id = model.id this.cost = model.cost this.fare = model.fare } static of(model: ProviderProductPricingResponseDTO): ProviderProductPricingResponseDTO { return new ProviderProductPricingResponseDTO(model) } }