WFDASHDRIVER-APP/e2e/check_stub.mjs
SJCoetz 85662380a2 feat: add order item photo uploads and fix PB bugs
- fix driver_locations schema mismatch: use `relation` instead of `driver` per live PB schema
- remove invalid `ready_for_collection` filter that caused silent 400 errors
- add order_item_attachments support for driver pickup photos with proper error handling:
  * replace legacy collection_photo field with new collection for multiple per-item files
  * upload photos after updating item status to avoid stranding assigned items
  * show warning toast if upload fails instead of success confirmation
  * update toast messages to reflect photo upload status
- add pre-build schema check script to catch invalid PB field references pre-deploy
- add corresponding npm scripts and prebuild hook for the schema check
- add e2e test scripts for collection and upload flows
- update type definitions and pocketbase SDK helpers for new schema and functionality
2026-07-08 01:35:26 +02:00

10 lines
514 B
JavaScript

import PocketBase from 'pocketbase';
const pb = new PocketBase('https://pocketbase-gnqc88suy8fqk6wyryjjdpvl.169.239.180.130.sslip.io');
const auth = await pb.collection('users').authWithPassword('david.els1@outlook.com', '1234567890');
const me = auth.record.id;
const stuck = await pb.collection('order_items').getFullList({
filter: `item_status = "collected" && drv_id = "${me}"`,
});
for (const i of stuck) {
console.log(i.id, '|', JSON.stringify(i.description), '|', i.drv_collected_at, '|', i.updated);
}