mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 19:30:57 +00:00
add custom contrat templates
This commit is contained in:
@@ -4,7 +4,7 @@ import type {
|
||||
} from "../../modules/contract-templates/entities/contract-template.entity";
|
||||
|
||||
/**
|
||||
* Default article packs for the six contract templates, transcribed from the
|
||||
* Default article packs for the ten 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.
|
||||
@@ -20,6 +20,13 @@ export interface ContractTemplateSeed {
|
||||
articles: Array<Omit<ContractTemplateArticle, "order">>;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
type ContractTemplateBase = Omit<ContractTemplateSeed, "code">;
|
||||
|
||||
const a = (id: string, title: string, body: string): Omit<ContractTemplateArticle, "order"> => ({
|
||||
id,
|
||||
title,
|
||||
@@ -28,8 +35,7 @@ const a = (id: string, title: string, body: string): Omit<ContractTemplateArticl
|
||||
|
||||
/* ────────────────────────────── IMPORT / BULK ────────────────────────────── */
|
||||
|
||||
const IMPORT_BULK: ContractTemplateSeed = {
|
||||
code: "IMPORT_BULK",
|
||||
const IMPORT_BULK_BASE: ContractTemplateBase = {
|
||||
name: "Bulk Import Contract",
|
||||
description:
|
||||
"Import of bulk cargo (e.g. steel billets) from Djibouti (DMP/Nagad) to Galaan Multipurpose Port with customs clearance and optional last-mile delivery.",
|
||||
@@ -158,8 +164,7 @@ The governing law shall be the laws of the Federal Democratic Republic of Ethiop
|
||||
|
||||
/* ────────────────────────────── EXPORT / BULK ────────────────────────────── */
|
||||
|
||||
const EXPORT_BULK: ContractTemplateSeed = {
|
||||
code: "EXPORT_BULK",
|
||||
const EXPORT_BULK_BASE: ContractTemplateBase = {
|
||||
name: "Bulk Export Contract",
|
||||
description:
|
||||
"Export of bulk cargo (e.g. livestock) by railway from Ethiopian loading stations to Nagad railway freight yard, Djibouti.",
|
||||
@@ -294,8 +299,7 @@ The governing law shall be the laws of the Federal Democratic Republic of Ethiop
|
||||
|
||||
/* ──────────────────────────── INTERCITY / BULK ───────────────────────────── */
|
||||
|
||||
const INTERCITY_BULK: ContractTemplateSeed = {
|
||||
code: "INTERCITY_BULK",
|
||||
const INTERCITY_BULK_BASE: ContractTemplateBase = {
|
||||
name: "Bulk Intercity Contract",
|
||||
description:
|
||||
"Domestic (intercity) bulk cargo transportation by railway between Ethiopian freight yards, e.g. Dire Dawa to Sebeta.",
|
||||
@@ -418,8 +422,7 @@ The governing law shall be the laws of the Federal Democratic Republic of Ethiop
|
||||
|
||||
/* ──────────────────────────── IMPORT / CONTAINER ─────────────────────────── */
|
||||
|
||||
const IMPORT_CONTAINER: ContractTemplateSeed = {
|
||||
code: "IMPORT_CONTAINER",
|
||||
const IMPORT_CONTAINER_BASE: ContractTemplateBase = {
|
||||
name: "Container Import Contract",
|
||||
description:
|
||||
"Import container transport by railway from SGTD (Djibouti) to Dire Dawa, Modjo dry port, or Galaan Multipurpose Port, with empty-container return.",
|
||||
@@ -568,8 +571,7 @@ If unresolved, disputes shall be taken to the Federal Court in Addis Ababa.`,
|
||||
|
||||
/* ──────────────────────────── EXPORT / CONTAINER ─────────────────────────── */
|
||||
|
||||
const EXPORT_CONTAINER: ContractTemplateSeed = {
|
||||
code: "EXPORT_CONTAINER",
|
||||
const EXPORT_CONTAINER_BASE: ContractTemplateBase = {
|
||||
name: "Container Export Contract",
|
||||
description:
|
||||
"Export container transport, freight forwarding, and customs clearing from Galaan Multipurpose Port or Modjo dry port to SGTD container freight station (Djibouti).",
|
||||
@@ -717,8 +719,7 @@ The signatories confirm that they are fully authorized to sign and execute this
|
||||
|
||||
/* ─────────────────────────── INTERCITY / CONTAINER ───────────────────────── */
|
||||
|
||||
const INTERCITY_CONTAINER: ContractTemplateSeed = {
|
||||
code: "INTERCITY_CONTAINER",
|
||||
const INTERCITY_CONTAINER_BASE: ContractTemplateBase = {
|
||||
name: "Container Intercity Contract",
|
||||
description:
|
||||
"Domestic (intercity) container transport by railway between Ethiopian terminals — Galaan Multipurpose Port, Modjo dry port, and Dire Dawa — including empty repositioning.",
|
||||
@@ -854,11 +855,67 @@ If unresolved, disputes shall be taken to the Federal Court in Addis Ababa.`,
|
||||
],
|
||||
};
|
||||
|
||||
export const CONTRACT_TEMPLATE_DEFAULTS: ContractTemplateSeed[] = [
|
||||
IMPORT_BULK,
|
||||
EXPORT_BULK,
|
||||
INTERCITY_BULK,
|
||||
IMPORT_CONTAINER,
|
||||
EXPORT_CONTAINER,
|
||||
INTERCITY_CONTAINER,
|
||||
/* ─────────────────────── CUSTOMS / NO-CUSTOMS SPLIT ──────────────────────── */
|
||||
|
||||
/**
|
||||
* Articles appended to the `_CUSTOMS` variant of every base pack. The signed
|
||||
* source documents fold customs duties into the body prose rather than a
|
||||
* dedicated article, so these state the clearing obligations explicitly for the
|
||||
* contracts where EDR clears on the Client's behalf.
|
||||
*/
|
||||
const CUSTOMS_ARTICLES: Array<Omit<ContractTemplateArticle, "order">> = [
|
||||
a(
|
||||
"customs-clearing",
|
||||
"Customs Clearing Services",
|
||||
`The Service Provider shall carry out customs clearing on behalf of the Client for the cargo covered by this Agreement, including declaration, lodgement, and follow-up at the customs stations of Djibouti and Ethiopia as applicable to the agreed corridor.
|
||||
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 Customs Clearing",
|
||||
`Grant the Service Provider a duly signed and stamped power of attorney authorising it to act as the Client's customs agent for the duration of this Agreement.
|
||||
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.
|
||||
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` / `_NO_CUSTOMS` pair for one base pack. */
|
||||
function splitByCustoms(
|
||||
base: ContractTemplateBase,
|
||||
codeStem: string,
|
||||
): ContractTemplateSeed[] {
|
||||
return [
|
||||
{
|
||||
...base,
|
||||
code: `${codeStem}_CUSTOMS` as ContractTemplateCode,
|
||||
name: `${base.name} (with customs clearing)`,
|
||||
description: `${base.description} Customs clearing is performed by the Service Provider.`,
|
||||
articles: [...base.articles, ...CUSTOMS_ARTICLES],
|
||||
},
|
||||
{
|
||||
...base,
|
||||
code: `${codeStem}_NO_CUSTOMS` as ContractTemplateCode,
|
||||
name: `${base.name} (without customs clearing)`,
|
||||
description: `${base.description} Customs clearing is handled by the Client.`,
|
||||
articles: [...base.articles],
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Ten templates: import and export each split by customs clearing, intercity
|
||||
* not split at all — it is a domestic Ethiopian movement that crosses no
|
||||
* border, so there is no customs leg to contract for.
|
||||
*/
|
||||
export const CONTRACT_TEMPLATE_DEFAULTS: ContractTemplateSeed[] = [
|
||||
...splitByCustoms(IMPORT_BULK_BASE, "IMPORT_BULK"),
|
||||
...splitByCustoms(EXPORT_BULK_BASE, "EXPORT_BULK"),
|
||||
{ ...INTERCITY_BULK_BASE, code: "INTERCITY_BULK" },
|
||||
...splitByCustoms(IMPORT_CONTAINER_BASE, "IMPORT_CONTAINER"),
|
||||
...splitByCustoms(EXPORT_CONTAINER_BASE, "EXPORT_CONTAINER"),
|
||||
{ ...INTERCITY_CONTAINER_BASE, code: "INTERCITY_CONTAINER" },
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user