mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 13:05:44 +00:00
feat: enhance train scheduling and contract management features
- Added StationWorkControls to manage loading/unloading phases in TrainScheduleV2DetailPage. - Implemented API endpoints for recording station work and managing wagon detach requests. - Updated contract templates to include Ethiopian customs handling options. - Enhanced shipment forms to collect customs clearing agent details for without-customs bookings. - Introduced NUMBER_OF_WAGONS as a unit of measure for bulk cargo, allowing customers to specify wagon counts. - Improved validation for customs clearing agent information in shipment forms. - Updated various components and services to accommodate new features and ensure data integrity.
This commit is contained in:
@@ -4,7 +4,7 @@ import type {
|
||||
} from "../../modules/contract-templates/entities/contract-template.entity";
|
||||
|
||||
/**
|
||||
* Default article packs for the ten contract templates, transcribed from the
|
||||
* Default article packs for the fourteen contract templates, transcribed from the
|
||||
* signed EDR contract documents (test/contrat_docs). Article bodies use the
|
||||
* dynamic-article text format: one clause per line, "- " prefix for bullets
|
||||
* nested under the previous clause, single-line body = plain paragraph.
|
||||
@@ -23,7 +23,8 @@ export interface ContractTemplateSeed {
|
||||
/**
|
||||
* A base pack keyed by direction/freight only. Each one is transcribed from a
|
||||
* signed EDR contract and is split at the bottom of this file into the
|
||||
* `_CUSTOMS` / `_NO_CUSTOMS` pair the template table actually stores.
|
||||
* `_CUSTOMS` / `_ETHIOPIAN_CUSTOMS` / `_NO_CUSTOMS` trio the template table
|
||||
* actually stores.
|
||||
*/
|
||||
type ContractTemplateBase = Omit<ContractTemplateSeed, "code">;
|
||||
|
||||
@@ -883,7 +884,35 @@ Settle assessed duties and taxes within the period notified by the Service Provi
|
||||
),
|
||||
];
|
||||
|
||||
/** Build the stored `_CUSTOMS` / `_NO_CUSTOMS` pair for one base pack. */
|
||||
/**
|
||||
* Articles appended to the `_ETHIOPIAN_CUSTOMS` variant: the Service Provider
|
||||
* clears the Ethiopian side only, while Djibouti clearing stays with the
|
||||
* Client. Article ids match the full-customs pack so downstream checks treat
|
||||
* both as customs-clearing variants.
|
||||
*/
|
||||
const ETHIOPIAN_CUSTOMS_ARTICLES: Array<Omit<ContractTemplateArticle, "order">> = [
|
||||
a(
|
||||
"customs-clearing",
|
||||
"Ethiopian Customs Clearing Services",
|
||||
`The Service Provider shall carry out customs clearing on behalf of the Client for the cargo covered by this Agreement at the customs stations of Ethiopia only, including declaration, lodgement, and follow-up as applicable to the agreed corridor.
|
||||
Customs clearing at Djibouti is not included in this Agreement and remains the sole responsibility of the Client.
|
||||
The Service Provider shall act only within the authority granted by the Client and shall not amend a declaration without the Client's written instruction.
|
||||
Customs duties, taxes, and any government charges assessed on the cargo remain payable by the Client and are not included in the freight price; the Service Provider shall settle them on the Client's behalf only where the Client has placed the corresponding funds in advance.
|
||||
The Service Provider shall hand over all customs documents obtained in the course of clearing to the Client upon completion of each shipment.`,
|
||||
),
|
||||
a(
|
||||
"customs-client-duties",
|
||||
"Client Obligations for Ethiopian Customs Clearing",
|
||||
`Grant the Service Provider a duly signed and stamped power of attorney authorising it to act as the Client's customs agent in Ethiopia for the duration of this Agreement.
|
||||
Complete customs clearing at Djibouti and deliver the cargo customs-cleared on the Djibouti side, together with the supporting release documents, in time for the scheduled railway loading.
|
||||
Submit every document required for declaration (commercial invoice, packing list, bill of lading or airway bill, permits, certificates of origin, and any authority-specific licence) within one (1) calendar day of the Service Provider's request.
|
||||
Warrant that the declared description, quantity, value, and tariff classification of the cargo are complete and accurate.
|
||||
Bear any penalty, demurrage, storage, or re-inspection cost arising from incorrect, incomplete, or late Client-supplied information or documentation, or from delayed Djibouti-side clearing.
|
||||
Settle assessed duties and taxes within the period notified by the Service Provider, failing which the Service Provider may suspend clearing and the cargo shall remain at the Client's risk and cost.`,
|
||||
),
|
||||
];
|
||||
|
||||
/** Build the stored `_CUSTOMS` / `_ETHIOPIAN_CUSTOMS` / `_NO_CUSTOMS` trio for one base pack. */
|
||||
function splitByCustoms(
|
||||
base: ContractTemplateBase,
|
||||
codeStem: string,
|
||||
@@ -896,6 +925,14 @@ function splitByCustoms(
|
||||
description: `${base.description} Customs clearing is performed by the Service Provider.`,
|
||||
articles: [...base.articles, ...CUSTOMS_ARTICLES],
|
||||
},
|
||||
{
|
||||
...base,
|
||||
code: `${codeStem}_ETHIOPIAN_CUSTOMS` as ContractTemplateCode,
|
||||
name: `${base.name} (Ethiopian customs clearing only)`,
|
||||
description: `${base.description} Only Ethiopian customs clearing is performed by the Service Provider; Djibouti clearing is handled by the Client.`,
|
||||
documentTitle: `${base.documentTitle} (Ethiopian Customs Clearing Only)`,
|
||||
articles: [...base.articles, ...ETHIOPIAN_CUSTOMS_ARTICLES],
|
||||
},
|
||||
{
|
||||
...base,
|
||||
code: `${codeStem}_NO_CUSTOMS` as ContractTemplateCode,
|
||||
@@ -907,7 +944,8 @@ function splitByCustoms(
|
||||
}
|
||||
|
||||
/**
|
||||
* Ten templates: import and export each split by customs clearing, intercity
|
||||
* Fourteen templates: import and export each split by customs clearing option
|
||||
* (full, Ethiopian-only, none), intercity
|
||||
* not split at all — it is a domestic Ethiopian movement that crosses no
|
||||
* border, so there is no customs leg to contract for.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user