Introduce PocketBase workflow support, migration tooling, server APIs and documentation. Adds a set of PocketBase collection JSONs (order_items, order_items_v2, collection_pool, delivery_notes, delivery_note_items, repairs) and a large import manifest for workflow collections; includes docs describing MCP/API layer, migration audit, order-item schema and rollout plans. Adds server-side agent/MCP endpoints and services (api/mcp, api/v1/orders, collection-pool, order-items status, health) plus helper modules (pocketbase-admin, orders-service, order-item-status, agent-auth) and a migration script to create order_items_v2/collection_pool. UI: new pages for collection-pool, delivery-notes, repairs and several updates to orders/quotes pages, sidebar, tooltip and pb helpers/types. Also updates package.json (migration script and related changes) and global styles. Required env vars and suggested migration command are documented (e.g. NEXT_PUBLIC_POCKETBASE_URL, PB_ADMIN_EMAIL, PB_ADMIN_PASSWORD, ORDER_ITEMS_COLLECTION; run npm run pb:migrate:orders-v2).
28 lines
1.9 KiB
JSON
28 lines
1.9 KiB
JSON
{
|
|
"name": "collection_pool",
|
|
"type": "base",
|
|
"system": false,
|
|
"listRule": "@request.auth.id != ''",
|
|
"viewRule": "@request.auth.id != ''",
|
|
"createRule": "@request.auth.id != ''",
|
|
"updateRule": "@request.auth.id != ''",
|
|
"deleteRule": "@request.auth.id != ''",
|
|
"fields": [
|
|
{ "name": "order", "type": "relation", "required": true, "options": { "collectionId": "REPLACE_ORDERS_COLLECTION_ID", "maxSelect": 1, "minSelect": null, "displayFields": [] } },
|
|
{ "name": "order_item", "type": "relation", "required": true, "options": { "collectionId": "REPLACE_ORDER_ITEMS_COLLECTION_ID", "maxSelect": 1, "minSelect": null, "displayFields": [] } },
|
|
{ "name": "supplier", "type": "relation", "required": false, "options": { "collectionId": "REPLACE_SUPPLIERS_COLLECTION_ID", "maxSelect": 1, "minSelect": null, "displayFields": [] } },
|
|
{ "name": "drv_id", "type": "relation", "required": false, "options": { "collectionId": "_pb_users_auth_", "maxSelect": 1, "minSelect": null, "displayFields": ["name", "email"] } },
|
|
|
|
{ "name": "pool_status", "type": "select", "required": true, "options": { "maxSelect": 1, "values": ["queued", "assigned", "in_progress", "completed", "failed"] } },
|
|
{ "name": "priority", "type": "select", "required": false, "options": { "maxSelect": 1, "values": ["low", "normal", "high", "urgent"] } },
|
|
{ "name": "pool_notes", "type": "text", "required": false, "options": { "min": null, "max": 5000, "pattern": "" } },
|
|
|
|
{ "name": "assigned_at", "type": "date", "required": false, "options": { "min": "", "max": "" } },
|
|
{ "name": "completed_at", "type": "date", "required": false, "options": { "min": "", "max": "" } }
|
|
],
|
|
"indexes": [
|
|
"CREATE INDEX idx_collection_pool_status ON collection_pool (pool_status)",
|
|
"CREATE INDEX idx_collection_pool_driver ON collection_pool (drv_id)",
|
|
"CREATE INDEX idx_collection_pool_order_item ON collection_pool (order_item)"
|
|
]
|
|
}
|