container
Warehouse Database
PostgreSQL database that stores picking jobs and their status.
Databasepostgres@16Residency: eu-west-1Retention: 1yAccess Mode: readWrite
What is this?
The Warehouse Database stores the picking and packing jobs for the warehouse. The Warehouse ServiceWarehouse ServiceServicev1.0.0Orchestrates picking and packing in the warehouse. It reacts to completed orders, creates picking jobs, and signals when...Publishesorder-ready-for-shippingSubscribesorder-completedOwnerfulfilment-platformMapRepoView docs creates jobs and the Picking WorkerPicking WorkerServicev1.0.0
Works through picking jobs on the warehouse floor and signals when an order has been picked and packed.
Publishesorder-packedOwnerfulfilment-platformMapRepoView docs updates them as orders are picked.
What does it store?
- Picking Jobs — one row per order being fulfilled: order, status and timestamps.
- Picking Job Items — the items to pick for each job.
Schema
-- Warehouse Database — picking and packing jobs
CREATE TABLE picking_jobs ( job_id UUID PRIMARY KEY DEFAULT gen_random_uuid(), order_id UUID NOT NULL, status TEXT NOT NULL DEFAULT 'CREATED' CHECK (status IN ('CREATED', 'PICKING', 'PACKED')), created_at TIMESTAMPTZ NOT NULL DEFAULT now(), updated_at TIMESTAMPTZ NOT NULL DEFAULT now());
CREATE TABLE picking_job_items ( job_id UUID NOT NULL REFERENCES picking_jobs (job_id) ON DELETE CASCADE, product_id UUID NOT NULL, quantity INTEGER NOT NULL CHECK (quantity > 0), picked BOOLEAN NOT NULL DEFAULT false, PRIMARY KEY (job_id, product_id));
CREATE INDEX idx_picking_jobs_order ON picking_jobs (order_id);CREATE INDEX idx_picking_jobs_status ON picking_jobs (status);