STARTING POINT: Pro creates supply_orders. Somehow supply_orders got cleared. SELECT COUNT(*) FROM supply_order WHERE is_cleared IS TRUE and shipment_id IS NULL AND is_cancelled IS NOT TRUE; ------------------------------------------------------------------------------------------------------------------------------------ /supply-orders/ready-to-ship 1. RECEIVER generates SHIPMENT for all pending supply_orders, one shipment per patient per address. /ready-to-ship Date | Patient | Item | Address | Action [Generate Shipment] /shipment-underway Date | Patient | Item | Address | Shipment /all #TODO /shipments 2. PRINTER prints the PICK-LIST for each shipment, moving it from status CREATED to PRINTED. :: Pick lists now are presumed to exist in reality. :: Make sure duplicate pick lists are not created! :: TODO: defend against duplicate pick lists being printed and dispatched by scanner stopping it from going to fulfiller, or even fulfiller stopping it from going to dispatcher. /ready-to-print (SELECT * FROM shipment WHERE status = 'CREATED'); TODO @Josh (! Add endpoint update multi shipments statuses) __ shipments selected [Generate PDF for Selected Shipments, Move status to 'PRINTED'] _________________________________________________________________________ [_] (v) | Patient | Items | Address /printed-and-waiting-for-picker ___ shipments selected [Print Again] _________________________________________________________________________ [_] (v) | Patient | Items | Address | Printed At | Actions [Print Again] /being-processed (v) | Patient | Items | Address | Status /all #TODO /shipments/view/{shipment} ----------------------------------------- ... show direct columns on shipment (date, status, etc.) ... show the supply_orders in the shipment ... allow mutation of shipment status. !!! you can even mark a shipment as 'CREATED' here and it would kick back up to '/ready-to-print' !!! you can even remove supply_orders from shipments, therefore kicking THEM back up to /supply-orders/ready-to-ship [Print Pick-List & Move Status to 'PRINTED'] <- I can click this button anytime I want. ----------------------------------------- 3. PICKER is given this pick-list... moves status to BEING_PICKED, Picker then picks it all out, marks it as PICKED, gives it to a scanner. 4. SCANNER then associates which LOT#, IMEI#, etc. went out associated to that supply_order. marks it as READY_FOR_FULFILLMENT. 5. FULFILLER boxes it up and prints associated postage and mark the carriers / tracking numbers. marks it as READY_FOR_DISPATCH. 6. DISPATCHER gets it to the carrier. marks it as DISPATCHED. ====================================================================================================================================