feat(bookings): Implement data-driven service type selection and configuration

This commit is contained in:
ghost2023
2026-06-13 12:26:06 +03:00
parent 44aef8c1b3
commit 3e2e07bb5f
4 changed files with 264 additions and 243 deletions

View File

@@ -5,16 +5,16 @@ export * from "./dropdown_settings";
export * from "./overview";
export enum TradeDirection {
IMPORT = 'IMPORT',
EXPORT = 'EXPORT',
BOTH = 'BOTH',
IMPORT = "IMPORT",
EXPORT = "EXPORT",
BOTH = "BOTH",
}
export enum PriorityType {
USD_PAYER = 'USD_PAYER',
RAIL_AND_FORWARDING = 'RAIL_AND_FORWARDING',
GOVERNMENT_ACCOUNT = 'GOVERNMENT_ACCOUNT',
HIGH_VOLUME_SHIPMENT = 'HIGH_VOLUME_SHIPMENT',
USD_PAYER = "USD_PAYER",
RAIL_AND_FORWARDING = "RAIL_AND_FORWARDING",
GOVERNMENT_ACCOUNT = "GOVERNMENT_ACCOUNT",
HIGH_VOLUME_SHIPMENT = "HIGH_VOLUME_SHIPMENT",
}
/** Bonus applied to government bookings so they outrank commercial priority. */
@@ -26,19 +26,19 @@ export interface GovernmentBookingFields {
}
export enum ExceededAction {
WARNING_ONLY = 'WARNING_ONLY',
HARD_BLOCK = 'HARD_BLOCK',
WARNING_ONLY = "WARNING_ONLY",
HARD_BLOCK = "HARD_BLOCK",
}
export enum CalculationMethod {
PER_TON = 'PER_TON',
FLAT_FEE = 'FLAT_FEE',
PERCENTAGE = 'PERCENTAGE',
PER_TON = "PER_TON",
FLAT_FEE = "FLAT_FEE",
PERCENTAGE = "PERCENTAGE",
}
export enum FreightType {
Container = 'CONTAINER',
Bulk = 'BULK',
Container = "CONTAINER",
Bulk = "BULK",
}
export enum BookingStatus {
@@ -390,6 +390,18 @@ export interface BookingReferenceService {
id: string;
name: string;
code: string;
serviceName: string;
description?: string | null | undefined;
canBeBookedAlone: boolean;
includesFirstMile: boolean;
includesLastMile: boolean;
includesCustoms: boolean;
priorityBonusPoints: number;
isActive: boolean;
displayOrder: number;
createdAt: string;
updatedAt: string;
deletedAt?: string | null | undefined;
}
export interface BookingReferenceShippingLine {
@@ -462,31 +474,34 @@ export interface CreateBookingContainerDto {
}
export interface CreateBookingDto {
reference?: string;
companyId?: string;
trainId?: string;
trainScheduleId?: string;
freightShapeValidation?: boolean | undefined;
reference?: string | undefined;
isGovernment?: boolean | undefined;
governmentInstitution?: string | undefined;
companyId?: string | undefined;
trainId?: string | undefined;
trainScheduleId?: string | undefined;
scheduledDate: string;
contractType: "NEW" | "RENEWAL";
previousContractId?: string;
contractType: string;
previousContractId?: string | undefined;
serviceTypeId: string;
firstMilePickupAddress?: string;
lastMileDeliveryAddress?: string;
equipmentReturn: "WITH_RETURN" | "WITHOUT_RETURN" | "NA";
firstMilePickupAddress?: string | undefined;
lastMileDeliveryAddress?: string | undefined;
equipmentReturn: string;
originYardId: string;
destinationYardId: string;
tradeDirection: "IMPORT" | "EXPORT" | "DOMESTIC";
freightType: FreightType;
cargoTypeId?: string;
cargoFreeText?: string;
shippingLineId?: string;
tradeDirection: string;
freightType: string;
cargoTypeId?: string | undefined;
cargoFreeText?: string | undefined;
shippingLineId?: string | undefined;
cargoTotalWeightVgm: number;
isHazardous?: boolean;
paymentCurrency: "ETB" | "USD";
pnrCode?: string;
startDate?: string;
endDate?: string;
financialTerms?: string;
isHazardous?: boolean | undefined;
paymentCurrency: string;
pnrCode?: string | undefined;
startDate?: string | undefined;
endDate?: string | undefined;
financialTerms?: string | undefined;
containers?: CreateBookingContainerDto[];
allowConsolidation?: boolean;
}