{"record":{"id":"d03a6440250c0bf1","repo":"koala73/worldmonitor","slug":"import-row-is-required","errorCode":null,"errorMessage":"import row is required","messagePattern":"import row is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"shared/company-monitoring-contract.ts","lineNumber":284,"sourceCode":"    locations: normalizeList(\n      input.locations,\n      'locations',\n      COMPANY_MONITORING_LIMITS.maxLocations,\n      (value, index) => assertPlainText(value, `locations[${index}]`, COMPANY_MONITORING_LIMITS.maxLocationBytes),\n    ),\n  };\n\n  const customerReference = normalizeOptionalText(\n    input.customerReference,\n    'customerReference',\n    COMPANY_MONITORING_LIMITS.maxCustomerReferenceBytes,\n  );\n  if (customerReference !== undefined) normalized.customerReference = customerReference;\n  return normalized;\n}\n\nexport function normalizeCompanyImportRow(input: CompanyImportRowInput): NormalizedCompanyImportRow {\n  if (!input || typeof input !== 'object') throw new Error('import row is required');\n  const clientImportId = assertPlainText(\n    input.clientImportId,\n    'clientImportId',\n    COMPANY_MONITORING_LIMITS.maxClientImportIdBytes,\n  );\n  if (!Number.isSafeInteger(input.ordinal) || input.ordinal < 0 || input.ordinal >= COMPANY_MONITORING_LIMITS.maxImportRows) {\n    throw new Error('ordinal must be between 0 and 99');\n  }\n\n  const normalized: NormalizedCompanyImportRow = {\n    contractVersion: COMPANY_MONITORING_IMPORT_VERSION,\n    clientImportId,\n    ordinal: input.ordinal,\n    ...normalizeMonitoredCompanyInput(input),\n  };\n\n  if (utf8Bytes(JSON.stringify(normalized)) > COMPANY_MONITORING_LIMITS.maxImportRowBytes) {\n    throw new Error(`row exceeds ${COMPANY_MONITORING_LIMITS.maxImportRowBytes} bytes`);","sourceCodeStart":266,"sourceCodeEnd":302,"githubUrl":"https://github.com/koala73/worldmonitor/blob/eeab0a219fce0f02a00603b532dbae9041b934ac/shared/company-monitoring-contract.ts#L266-L302","documentation":"Contract validation error from normalizeCompanyImportRow: the CSV/import row is null, undefined, or not an object. It is the top-level shape guard before clientImportId, ordinal, and company fields are validated.","triggerScenarios":"Thrown at shared/company-monitoring-contract.ts:284 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Send each import row as a JSON object containing clientImportId, ordinal, and the company fields"],"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-14T00:17:10.932Z"}