mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 15:25:45 +00:00
feat: implement shipping line bookings management
- Add ShippingLineBookingsPage for listing and managing shipping line bookings. - Create ShippingLineDocumentsModal for document uploads related to bookings. - Introduce ShippingLineInitiateModal for initiating new shipping line bookings. - Implement booking document state management with booking-doc-state utility. - Add shipping line bookings service for API interactions. - Update index to export new components and services. - Enhance types for freight to include shipping line credits.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { BaseEntity } from '@edr/api-common';
|
||||
import { Column, Entity, Index, JoinColumn, ManyToOne } from 'typeorm';
|
||||
import { ShippingLineCompany } from '../../shipping-lines/entities/shipping-line-company.entity';
|
||||
import { CargoType } from './cargo-type.entity';
|
||||
import { ContainerType } from './container-type.entity';
|
||||
import { Yard } from './yard.entity';
|
||||
@@ -108,6 +109,7 @@ export type RateTrigger = typeof RATE_TRIGGERS[number];
|
||||
@Index(['trigger'])
|
||||
@Index(['originYardId'])
|
||||
@Index(['destinationYardId'])
|
||||
@Index(['shippingLineCompanyId'])
|
||||
export class Rate extends BaseEntity {
|
||||
@Column({ name: 'rate_type', type: 'varchar', length: 50 })
|
||||
rateType!: RateType;
|
||||
@@ -155,6 +157,23 @@ export class Rate extends BaseEntity {
|
||||
@JoinColumn({ name: 'destination_yard_id' })
|
||||
destinationYard?: Yard | null;
|
||||
|
||||
/**
|
||||
* The shipping line this rate belongs to, or NULL for the standard rate every
|
||||
* customer pays. A booking owned by a shipping line prices exclusively off
|
||||
* that line's rates — the standard rate is NOT a fallback, so a missing line
|
||||
* rate hard-blocks the booking rather than quietly billing the customer price.
|
||||
*
|
||||
* Points at `shipping_line_companies` (the portal account that books capacity),
|
||||
* not `shipping_lines` (carrier reference data behind the SHIPPING_LINE
|
||||
* trigger). The two are unrelated despite the similar names.
|
||||
*/
|
||||
@Column({ name: 'shipping_line_company_id', type: 'uuid', nullable: true })
|
||||
shippingLineCompanyId?: string | null;
|
||||
|
||||
@ManyToOne(() => ShippingLineCompany, { nullable: true, eager: false })
|
||||
@JoinColumn({ name: 'shipping_line_company_id' })
|
||||
shippingLineCompany?: ShippingLineCompany | null;
|
||||
|
||||
@Column({ name: 'currency', type: 'varchar', length: 5 })
|
||||
currency!: string;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user