From 0f11d9518f9c299a2e1f1ca82be2910c1c2a34b2 Mon Sep 17 00:00:00 2001 From: Nathnael Date: Tue, 18 Aug 2026 08:45:38 +0000 Subject: [PATCH] feat(backoffice): flag customers whose registration was typed, not fetched MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two kinds of customer reach approval with a registration nobody checked: a co-operative union or farm, which holds no trade licence, and a foreign investor, whose licence comes from the Investment Commission rather than the trade registry. Both were reviewed on screens that read exactly like an eTrade-verified company's, with only a small Registration field naming the difference. They now carry an orange "Manual entry" badge in the customers list and beside the company name, and their overview opens with an alert saying the name, registration and address below are the customer's own statement — pointing the reviewer at the paper that stands in for the licence (the co-operative certificate, or the investment licence) before approving. Approval itself is not blocked. --- .../src/components/customers/badges.tsx | 30 +++++++++++++++++++ .../src/components/customers/index.ts | 1 + .../pages/customers/CustomerDetailPage.tsx | 28 ++++++++++++++++- .../src/pages/customers/CustomersPage.tsx | 5 ++++ .../backoffice/src/types/customer.ts | 7 +++++ 5 files changed, 70 insertions(+), 1 deletion(-) diff --git a/apps/edr-freight-web/backoffice/src/components/customers/badges.tsx b/apps/edr-freight-web/backoffice/src/components/customers/badges.tsx index 90dea5adb..22d3e66cf 100644 --- a/apps/edr-freight-web/backoffice/src/components/customers/badges.tsx +++ b/apps/edr-freight-web/backoffice/src/components/customers/badges.tsx @@ -114,6 +114,36 @@ export function CompanyNationalityBadge({ ); } +/** + * The company's registration was typed, not fetched from eTrade — nothing in it + * has been checked against a licence. Loud on purpose: it is the one thing a + * reviewer must not miss about this customer. Two kinds of company land here + * for different reasons, and the badge names which. + */ +export function ManualRegistrationBadge({ + cooperative, + investorLicence, +}: { + cooperative?: boolean | null; + investorLicence?: boolean | null; +}) { + if (!cooperative && !investorLicence) return null; + return ( + + {cooperative + ? "Manual entry · co-operative" + : "Manual entry · investment licence"} + + ); +} + /** * Profile chips for a company row: one chip per role (Importer / Exporter / …) * carrying its reference code, colored by the profile's status (green active, diff --git a/apps/edr-freight-web/backoffice/src/components/customers/index.ts b/apps/edr-freight-web/backoffice/src/components/customers/index.ts index 6f869173c..864a89ae6 100644 --- a/apps/edr-freight-web/backoffice/src/components/customers/index.ts +++ b/apps/edr-freight-web/backoffice/src/components/customers/index.ts @@ -4,6 +4,7 @@ export { CompanyStatusBadge, CompanyTypeBadge, InvoiceStatusBadge, + ManualRegistrationBadge, PaymentStatusBadge, ProfileApprovalActions, ProfileChips, diff --git a/apps/edr-freight-web/backoffice/src/pages/customers/CustomerDetailPage.tsx b/apps/edr-freight-web/backoffice/src/pages/customers/CustomerDetailPage.tsx index 40185f990..a81f07c8b 100644 --- a/apps/edr-freight-web/backoffice/src/pages/customers/CustomerDetailPage.tsx +++ b/apps/edr-freight-web/backoffice/src/pages/customers/CustomerDetailPage.tsx @@ -50,6 +50,7 @@ import { CompanyTimeline, CompanyTypeBadge, InvoiceStatusBadge, + ManualRegistrationBadge, PaymentStatusBadge, PersonCard, ProfileApprovalActions, @@ -744,6 +745,10 @@ export default function CustomerDetailPage() { ) : ( )} + } @@ -792,6 +797,25 @@ export default function CustomerDetailPage() { )} + {/* Nothing below came from eTrade for these customers. A + co-operative holds no trade licence at all; a foreign investor's + comes from the Investment Commission, not the trade registry. + Either way every registration field was typed, and the reviewer + is the only check there is. */} + {(company.cooperative || company.investorLicence) && ( + } + title="Registration entered by hand — not verified against eTrade" + > + {company.cooperative + ? "This company onboarded as a co-operative union or farm, which holds no trade licence, so eTrade had no record to look its TIN up in. The company name, registration and address below are the customer's own statement. Check them against the Co-operative Registration Certificate on the Documents tab before approving." + : "This company onboarded on a foreign investment licence, so we could not look its TIN up on eTrade. The company name, registration and address below are the customer's own statement. Check them against the Investment Licence on the Documents tab before approving."} + + )} + diff --git a/apps/edr-freight-web/backoffice/src/pages/customers/CustomersPage.tsx b/apps/edr-freight-web/backoffice/src/pages/customers/CustomersPage.tsx index 91bb72fdc..3825f0165 100644 --- a/apps/edr-freight-web/backoffice/src/pages/customers/CustomersPage.tsx +++ b/apps/edr-freight-web/backoffice/src/pages/customers/CustomersPage.tsx @@ -28,6 +28,7 @@ import { useNavigate } from "react-router-dom"; import { CompanyNationalityBadge, CompanyStatusBadge, + ManualRegistrationBadge, ProfileChips, formatDate, } from "@/components/customers"; @@ -142,6 +143,10 @@ export default function CustomersPage() { {c.name} + TIN {c.tin} diff --git a/apps/edr-freight-web/backoffice/src/types/customer.ts b/apps/edr-freight-web/backoffice/src/types/customer.ts index 7fa7d792a..8c95e7342 100644 --- a/apps/edr-freight-web/backoffice/src/types/customer.ts +++ b/apps/edr-freight-web/backoffice/src/types/customer.ts @@ -234,6 +234,13 @@ export interface Company { * manager to check the owner against, and it holds no freight-forwarder role. */ cooperative?: boolean; + /** + * A foreign investor on an Ethiopian Investment Commission licence: eTrade + * holds no record for its TIN, so every registration field below was typed by + * the customer and verified by nobody. The reviewer is the check — compare + * them against the investment licence on the Documents tab. + */ + investorLicence?: boolean; address?: string | null; phone?: string | null; email?: string | null;