mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 11:21:18 +00:00
fix: an issue
This commit is contained in:
18
apps/edr-freight-web/portal/src/utils/documentSettingCode.ts
Normal file
18
apps/edr-freight-web/portal/src/utils/documentSettingCode.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* The company document set a company resolves to — one of three, never a
|
||||
* combination: a co-operative union or farm uploads its own papers INSTEAD of
|
||||
* its nationality's (it holds no business licence), and is always Ethiopian.
|
||||
*
|
||||
* Mirrors `CompaniesService.documentSettingCodeFor` on the API; prefer the
|
||||
* server-resolved `documentSettingCode` from onboarding requirements where one
|
||||
* is available, and use this where only the company is at hand.
|
||||
*/
|
||||
export function documentSettingCode(
|
||||
nationality: string | null | undefined,
|
||||
cooperative?: boolean | null,
|
||||
): string {
|
||||
if (cooperative) return "company_onboarding_documents_cooperative";
|
||||
return nationality === "foreign"
|
||||
? "company_onboarding_documents_foreign"
|
||||
: "company_onboarding_documents_ethiopian";
|
||||
}
|
||||
Reference in New Issue
Block a user