{"record":{"id":"a7e85715b230b24f","repo":"koala73/worldmonitor","slug":"domicilecountry-must-be-us-or-gb","errorCode":null,"errorMessage":"domicileCountry must be US or GB","messagePattern":"domicileCountry must be US or GB","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"shared/company-monitoring-contract.ts","lineNumber":246,"sourceCode":"  xHandles: string[];\n  locations: string[];\n  customerReference?: string;\n}\n\nexport interface NormalizedCompanyImportRow extends NormalizedMonitoredCompanyInput {\n  contractVersion: typeof COMPANY_MONITORING_IMPORT_VERSION;\n  clientImportId: string;\n  ordinal: number;\n}\n\nexport function normalizeMonitoredCompanyInput(input: MonitoredCompanyInput): NormalizedMonitoredCompanyInput {\n  if (!input || typeof input !== 'object') throw new Error('company input is required');\n  const domicileInput = String(input.domicileCountry ?? '').trim().toUpperCase();\n  const domicileCountry = Object.prototype.hasOwnProperty.call(DOMICILE_COUNTRY_BY_INPUT, domicileInput)\n    ? DOMICILE_COUNTRY_BY_INPUT[domicileInput as keyof typeof DOMICILE_COUNTRY_BY_INPUT]\n    : undefined;\n  if (!domicileCountry) {\n    throw new Error('domicileCountry must be US or GB');\n  }\n\n  const normalized: NormalizedMonitoredCompanyInput = {\n    name: assertPlainText(input.name, 'name', COMPANY_MONITORING_LIMITS.maxNameBytes),\n    domicileCountry,\n    aliases: normalizeList(\n      input.aliases,\n      'aliases',\n      COMPANY_MONITORING_LIMITS.maxAliases,\n      (value, index) => assertPlainText(value, `aliases[${index}]`, COMPANY_MONITORING_LIMITS.maxAliasBytes),\n    ),\n    domains: normalizeList(input.domains, 'domains', COMPANY_MONITORING_LIMITS.maxDomains, normalizeDomain),\n    identifiers: normalizeList(\n      input.identifiers,\n      'identifiers',\n      COMPANY_MONITORING_LIMITS.maxIdentifiers,\n      (value, index) => assertPlainText(value, `identifiers[${index}]`, COMPANY_MONITORING_LIMITS.maxIdentifierBytes),\n    ),","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/koala73/worldmonitor/blob/eeab0a219fce0f02a00603b532dbae9041b934ac/shared/company-monitoring-contract.ts#L228-L264","documentation":"Contract validation error from normalizeMonitoredCompanyInput: after uppercasing and trimming, domicileCountry is not one of the supported values. Monitoring is currently restricted to US and GB domiciles; the own-property lookup also rejects inherited junk values.","triggerScenarios":"Thrown at shared/company-monitoring-contract.ts:246 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Send domicileCountry as 'US' or 'GB' (any casing is normalized)","Wait for domicile support expansion if you need another country"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"eeab0a219fce0f02a00603b532dbae9041b934ac","analyzedAt":"2026-08-21T16:51:25.751Z","contentChangedAt":"2026-08-21T16:51:25.751Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}