
📦 Processing Shoper order 23142...
📦 Fetching order-products for order 23142 with filters: {"order_id":"23142"}
✅ Received 1 products for order 23142
✅ Fetched 1 products for order 23142
❌ Error saving order 23142 to commerce: error: null value in column "source" of relation "order_items" violates not-null constraint
    at /home/runner/workspace/node_modules/pg/lib/client.js:545:17
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async saveOrderToCommerce (/home/runner/workspace/server/postgres.ts:687:7)
    at async syncShoperOrders (/home/runner/workspace/server/routes.ts:331:24)
    at async <anonymous> (/home/runner/workspace/server/routes.ts:652:22) {
  length: 499,
  severity: 'ERROR',
  code: '23502',
  detail: 'Failing row contains (155, c6007c96-856e-4c14-aad1-c58f1180cf29, null, null, 157, 811, 5905806203158, null, 1, null, PLN, null, null, null, 2025-10-06 18:27:41.671195, Szafka na buty z wieszakiem 60x30WP60 N1D1 BIAŁY, 555.00, 555.00, PL, ONLINE, f, {"id": "27002", "tax": "23%", "code": "5905806203158", "name": "...).',
  hint: undefined,
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: 'commerce',
  table: 'order_items',
  column: 'source',
  dataType: undefined,
  constraint: undefined,
  file: 'execMain.c',
  line: '2021',
  routine: 'ExecConstraints'
}
❌ Failed to process Shoper order 23142: error: null value in column "source" of relation "order_items" violates not-null constraint
    at /home/runner/workspace/node_modules/pg/lib/client.js:545:17
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async saveOrderToCommerce (/home/runner/workspace/server/postgres.ts:687:7)
    at async syncShoperOrders (/home/runner/workspace/server/routes.ts:331:24)
    at async <anonymous> (/home/runner/workspace/server/routes.ts:652:22) {
  length: 499,
  severity: 'ERROR',
  code: '23502',
  detail: 'Failing row contains (155, c6007c96-856e-4c14-aad1-c58f1180cf29, null, null, 157, 811, 5905806203158, null, 1, null, PLN, null, null, null, 2025-10-06 18:27:41.671195, Szafka na buty z wieszakiem 60x30WP60 N1D1 BIAŁY, 555.00, 555.00, PL, ONLINE, f, {"id": "27002", "tax": "23%", "code": "5905806203158", "name": "...).',
  hint: undefined,
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: 'commerce',
  table: 'order_items',
  column: 'source',
  dataType: undefined,
  constraint: undefined,
  file: 'execMain.c',
  line: '2021',
  routine: 'ExecConstraints'
}