mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 15:18:11 +00:00
merge conflict fix
This commit is contained in:
79
packages/types/src/freight/etrade.ts
Normal file
79
packages/types/src/freight/etrade.ts
Normal file
@@ -0,0 +1,79 @@
|
||||
export interface ETradeAddressInfo {
|
||||
Region: string;
|
||||
Zone: string;
|
||||
Woreda: string;
|
||||
Kebele: string;
|
||||
HouseNo: string;
|
||||
MobilePhone: string;
|
||||
RegularPhone: string;
|
||||
}
|
||||
|
||||
export interface ETradeAssociateInfo {
|
||||
Position: string | null;
|
||||
ManagerName: string;
|
||||
ManagerNameEng: string;
|
||||
Photo: string | null;
|
||||
MobilePhone: string | null;
|
||||
RegularPhone: string | null;
|
||||
}
|
||||
|
||||
export interface ETradeBusinessInfo {
|
||||
MainGuid: string;
|
||||
OwnerTIN: string;
|
||||
DateRegistered: string;
|
||||
TradeName: string;
|
||||
LicenceNumber: string;
|
||||
Status: number;
|
||||
StatusDescription: string;
|
||||
Capital: number;
|
||||
AssociateShortInfos: ETradeAssociateInfo[];
|
||||
AddressInfo: ETradeAddressInfo;
|
||||
RenewedTo: string;
|
||||
RenewedToDateString: string;
|
||||
RenewalDate: string;
|
||||
RenewedFrom: string;
|
||||
CancellationDate: string | null;
|
||||
}
|
||||
|
||||
export interface ETradeCompanyInfo {
|
||||
Tin: string;
|
||||
LegalCondtion: string;
|
||||
RegNo: string;
|
||||
RegDate: string;
|
||||
BusinessName: string;
|
||||
BusinessNameAmh: string;
|
||||
PaidUpCapital: number;
|
||||
AssociateShortInfos: ETradeAssociateInfo[];
|
||||
Businesses: Array<{
|
||||
MainGuid: string;
|
||||
OwnerTIN: string;
|
||||
DateRegistered: string;
|
||||
TradeNameAmh: string;
|
||||
TradesName: string;
|
||||
LicenceNumber: string;
|
||||
RenewalDate: string;
|
||||
RenewedFrom: string;
|
||||
RenewedTo: string;
|
||||
BusinessLicensingGroupMain: string | null;
|
||||
SubGroups: string | null;
|
||||
}>;
|
||||
}
|
||||
|
||||
export interface CompanyRegistrationData {
|
||||
licenceNumber: string;
|
||||
statusDescription: string;
|
||||
dateRegistered: string;
|
||||
renewedFrom: string;
|
||||
renewalDate: string;
|
||||
renewedTo: string;
|
||||
region: string;
|
||||
zone: string;
|
||||
woreda: string;
|
||||
kebele: string;
|
||||
houseNo: string;
|
||||
mobilePhone: string;
|
||||
regularPhone: string;
|
||||
managerName: string;
|
||||
managerEmail?: string;
|
||||
managerPhone: string;
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import type { BaseEntity } from "../common";
|
||||
export * from "./dropdown_settings";
|
||||
export * from "./file_upload_settings";
|
||||
export * from "./overview";
|
||||
export * from "./etrade";
|
||||
|
||||
export enum TradeDirection {
|
||||
IMPORT = "IMPORT",
|
||||
@@ -41,6 +42,26 @@ export enum FreightType {
|
||||
Bulk = "BULK",
|
||||
}
|
||||
|
||||
/**
|
||||
* Distinguishes a normal one-time booking from a general contract — an umbrella
|
||||
* commitment that is signed and paid once, then drawn down by many orders over
|
||||
* its period. Stored on the booking row.
|
||||
*/
|
||||
export enum BookingType {
|
||||
OneTime = "ONE_TIME",
|
||||
GeneralContract = "GENERAL_CONTRACT",
|
||||
}
|
||||
|
||||
/**
|
||||
* How a cargo type's quantity is measured. Bulk cargo is weighed in tons,
|
||||
* break-bulk is counted per item. Containerised freight is always counted by
|
||||
* container and carries no unit-of-measure.
|
||||
*/
|
||||
export enum CargoUnitOfMeasure {
|
||||
PerTon = "PER_TON",
|
||||
PerItem = "PER_ITEM",
|
||||
}
|
||||
|
||||
export enum BookingStatus {
|
||||
Draft = "DRAFT",
|
||||
Submitted = "SUBMITTED",
|
||||
@@ -67,6 +88,10 @@ export enum BookingStatus {
|
||||
Cancelled = "CANCELLED",
|
||||
PendingConsolidation = "PENDING_CONSOLIDATION",
|
||||
Consolidated = "CONSOLIDATED",
|
||||
/** General contract: paid umbrella contract that is accepting drawdown orders. */
|
||||
ContractActive = "CONTRACT_ACTIVE",
|
||||
/** General contract: closed because its quantity was exhausted (or period elapsed). */
|
||||
ContractClosed = "CONTRACT_CLOSED",
|
||||
}
|
||||
|
||||
export enum ConsignmentStatus {
|
||||
@@ -330,6 +355,11 @@ export interface IBooking extends BaseEntity {
|
||||
customerId: string;
|
||||
trainId?: string | null;
|
||||
status: BookingStatus;
|
||||
/** ONE_TIME for normal bookings; GENERAL_CONTRACT for umbrella contracts. */
|
||||
bookingType?: BookingType;
|
||||
/** General contracts only: when ordering closes (null until active / for one-time). */
|
||||
expiresAt?: string | null;
|
||||
/** Null for general contracts at creation — the date is chosen per order. */
|
||||
scheduledDate: string;
|
||||
totalAmount: number;
|
||||
paymentStatus: PaymentStatus;
|
||||
@@ -475,6 +505,8 @@ export interface BookingReferenceCargoTypeChild {
|
||||
name: string;
|
||||
code: string;
|
||||
show_free_text_box: boolean;
|
||||
/** How this cargo is measured (PER_TON / PER_ITEM); null when unset. */
|
||||
unit_of_measure?: CargoUnitOfMeasure | null;
|
||||
}
|
||||
|
||||
export interface BookingReferenceCargoTypeGroup {
|
||||
@@ -555,7 +587,10 @@ export interface CreateBookingDto {
|
||||
companyId?: string | undefined;
|
||||
trainId?: string | undefined;
|
||||
trainScheduleId?: string | undefined;
|
||||
scheduledDate: string;
|
||||
/** Optional for general contracts — they pick the date per order, not at creation. */
|
||||
scheduledDate?: string | undefined;
|
||||
/** Defaults to ONE_TIME. GENERAL_CONTRACT creates an umbrella contract. */
|
||||
bookingType?: BookingType | undefined;
|
||||
contractType: string;
|
||||
previousContractId?: string | undefined;
|
||||
serviceTypeId: string;
|
||||
@@ -579,3 +614,73 @@ export interface CreateBookingDto {
|
||||
containers?: CreateBookingContainerDto[];
|
||||
allowConsolidation?: boolean;
|
||||
}
|
||||
|
||||
// ── General Contracts & Booking Orders ──────────────────────────────────────────
|
||||
|
||||
/**
|
||||
* A line of contracted quantity. For CONTAINER contracts there is one line per
|
||||
* container type (each its own drawdown pool); for BULK/BREAK_BULK a single line
|
||||
* with a null containerTypeId carries the total tons/items.
|
||||
*/
|
||||
export interface ContractQuantityLine {
|
||||
containerTypeId: string | null;
|
||||
containerTypeName?: string | null;
|
||||
/** PER_TON / PER_ITEM for bulk-style lines; null for container lines. */
|
||||
unitOfMeasure?: CargoUnitOfMeasure | null;
|
||||
/** Total contracted units on this line (containers, tons, or items). */
|
||||
contractedQuantity: number;
|
||||
/** Units already drawn down by non-cancelled orders. */
|
||||
orderedQuantity: number;
|
||||
/** contractedQuantity − orderedQuantity. */
|
||||
remainingQuantity: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Customer-facing view of a general contract (a Booking with
|
||||
* bookingType = GENERAL_CONTRACT) and its remaining drawdown pool.
|
||||
*/
|
||||
export interface IGeneralContract extends IBooking {
|
||||
bookingType: BookingType;
|
||||
/** When the contract becomes ACTIVE; when ordering closes. Null until active. */
|
||||
expiresAt?: string | null;
|
||||
/** Per-line contracted / ordered / remaining quantities. */
|
||||
quantityLines: ContractQuantityLine[];
|
||||
}
|
||||
|
||||
export interface CreateBookingOrderLineDto {
|
||||
/** Null for bulk/break-bulk; the container type id for container contracts. */
|
||||
containerTypeId?: string | null;
|
||||
quantity: number;
|
||||
}
|
||||
|
||||
export interface CreateBookingOrderDto {
|
||||
/** The general contract (booking) this order draws down from. */
|
||||
contractBookingId: string;
|
||||
/** The shipment day the customer wants for this order. */
|
||||
scheduledDate: string;
|
||||
lines: CreateBookingOrderLineDto[];
|
||||
}
|
||||
|
||||
export interface IBookingOrderLine {
|
||||
id: string;
|
||||
containerTypeId?: string | null;
|
||||
containerTypeName?: string | null;
|
||||
quantity: number;
|
||||
}
|
||||
|
||||
export interface IBookingOrder {
|
||||
id: string;
|
||||
reference: string;
|
||||
contractBookingId: string;
|
||||
/** The child shipment booking spawned for this order (enters scheduling). */
|
||||
bookingId?: string | null;
|
||||
bookingReference?: string | null;
|
||||
companyId?: string | null;
|
||||
scheduledDate: string;
|
||||
status: BookingStatus;
|
||||
schedulingStatus: SchedulingStatus;
|
||||
trainScheduleId?: string | null;
|
||||
lines: IBookingOrderLine[];
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user