feat(etrade): take the selected licence's trade name as the company name

A TIN routinely trades under a name that is not its registered one, and
holds several licences with different trade names — of 58 TINs checked
against eTrade, 8 had at least one licence whose trade name differs from
the registered `BusinessName`, one of them across three licences.

`extractRegistrationData` now resolves `companyName` from the selected
licence's `TradeName`, falling back to `BusinessName` (16 of 309 licences
carry a blank trade name, so the fallback is load-bearing).

EIMS is pinned back to `BusinessName` for the seller's `LegalName`: an
invoice is a MoR tax filing and must carry the legal entity, not the
trade name. It is the only other caller.
This commit is contained in:
Nathnael
2026-08-27 09:28:52 +00:00
parent 4abb2af880
commit 1f5e6296b1
4 changed files with 45 additions and 9 deletions

View File

@@ -76,9 +76,14 @@ export interface ETradeBusinessOption {
export interface CompanyRegistrationData {
/**
* The registered organization name — `ETradeCompanyInfo.BusinessName`, falling
* back to the licence's `TradeName`. Never the manager/owner's personal name;
* that is {@link managerName}.
* The selected licence's trade name — `ETradeBusinessInfo.TradeName`, falling
* back to the registered organization name (`ETradeCompanyInfo.BusinessName`)
* when eTrade leaves the licence's trade name blank. Never the manager/owner's
* personal name; that is {@link managerName}.
*
* NOT the legal entity name: a TIN often trades under a different name, and
* some hold several licences with different trade names. Anything that needs
* the registered name (tax/EIMS) must read `BusinessName` directly.
*/
companyName: string;
licenceNumber: string;