import { Attr } from 'ts-framework' import { ProviderResponseDTO } from './provider' import { ProviderProductResponseDTO } from './provider-product' import { UserResponseDTO } from './user' import { VehicleResponseDTO } from './vehicle' export class OperatorFiltersDTO { @Attr({ type: String, optional: true }) providerIds?: string[] @Attr({ type: String, optional: true }) organizationId?: string @Attr({ type: String, optional: true }) productIds?: string[] @Attr({ type: Number, optional: true }) skip?: number @Attr({ type: Number, optional: true }) take?: number @Attr({ type: Boolean, optional: true }) isArchived?: boolean @Attr({ type: String, optional: true }) search?: string @Attr({ type: String, optional: true }) sortBy?: string[] } //TODO give this a better name //It is used to find drivers who are associated with a list of providers export class OperatorsListRequestDTO { @Attr({ type: Boolean }) archived: boolean @Attr({ type: Number, optional: true }) page?: number @Attr({ type: String }) providersIds: string @Attr({ type: String }) organizationId: string @Attr({ type: Number, optional: true }) recordsPerPage?: number } export class PaginatedOperatorsRequestDTO { @Attr({ type: Boolean }) archived: boolean @Attr({ type: Number, optional: true }) page?: number @Attr({ type: Number, optional: true }) recordsPerPage?: number } export class SaveProductsDTO { @Attr({ type: String }) id: string @Attr({ type: String }) productIds: string[] @Attr({ type: String }) organizationId: string } export class OperatorDTO { id: string } export interface OperatorsListResponseDTO { items: OperatorResponseDTO[], total: number } export interface OperatorOrganizationResponseDTO { id: string, name: string } export class OperatorResponseDTO { id: string externalId: string | null isArchived: boolean isRemoved: boolean user: UserResponseDTO vehicle: OperatorVehicleResponseDTO | null products: OperatorProductResponseDTO[] organizations: OperatorOrganizationResponseDTO[] organizationIds: string[] } export class OperatorVehicleResponseDTO { id: string year: string licensePlate: string isActive: boolean isInRide: boolean accommodations: string[] capacities: { id: string amble: number, cot: number, wheelchair: number }[] color: string | null make: string | null model: string | null type: string | null } export class OperatorProductResponseDTO { id: string deactivationDate: Date description: string name: string integrationId: string pricingId: string organizationId: string } export class OperatorProviderResponseDTO { id: string name: string description: string } export class UpdateCurrentOperatorRequestDTO { @Attr({ type: String }) firstName: string @Attr({ type: String }) lastName: string } export class SetVehicleRequestDTO { @Attr({ type: String }) vehicleId: string @Attr({ type: String, optional: true }) operatorId?: string } export class CheckInCheckOutDTO { @Attr({ type: Boolean, optional: true }) isCheckIn: boolean } export class OperatorSessionDTO { @Attr({ type: String }) operatorId: string @Attr({ type: Date }) checkInTime?: Date @Attr({ type: Date }) checkOutTime?: Date @Attr({ type: String }) duration?: string } export class UpdateOperatorSessionDTO { @Attr({ type: String }) id: string @Attr({ type: Date }) checkOutTime: Date @Attr({ type: String }) duration: string } export class SessionHistoryRequestDTO { @Attr({ type: String }) operatorId: string @Attr({ type: Number, optional: true }) page?: number @Attr({ type: Number, optional: true }) recordsPerPage?: number } export class OperatorsSessionHistoryByDateRequestDTO { @Attr({ type: String }) operatorId: string @Attr({ type: Date }) date: Date }