HOCO B2B
Team tasksAnis

SRV-17 — Preparation & delivery module

Delivery records per order, picking list, carrier assignment and tracking number, proof of delivery, delivery-fee policy.

FieldDetails
Task codeSRV-17
PhaseP1 — V1 build & integration
Product scopeV1
StatusDone (Mon 19 Oct 2026)
StartMon 19 Oct 2026
DueMon 19 Oct 2026
ResponsibleAnis — Full-stack developer
Co-responsible—
Effort0.5 person-day(s) planned · 3 from scratch · size XS
Area · appServer · server
Depends onSRV-16
UnblocksDSH-06
Milestones—

Summary

Delivery records per order, picking list, carrier assignment and tracking number, proof of delivery, delivery-fee policy.

Description

After confirmation, orders go through preparation and delivery handled by the delivery manager (cahier §3, §4.4, §11; DLV-01…DLV-04, DLV-06). This task implements one Delivery per order with the DeliveryStatus lifecycle (TO_PREPARE, PREPARING, READY, SHIPPED, DELIVERED, FAILED, RETURNED) kept in step with the order statuses through the orders state machine, the picking list, carrier assignment (DeliveryMode OWN_FLEET, CARRIER, PICKUP; Carrier list flagged API-capable or manual) and tracking number, proof of delivery (photo, recipient name, timestamp), failed-delivery handling with reason and retry, and the delivery-fee policy (free threshold, fee per wilaya) consumed by checkout options. Stock deduction at SHIPPED and the delivery note at READY are triggered through the existing hooks. Out of scope: carrier APIs (V2, SRV-34) and the delivery board UI (DSH-06).

Subtasks

#SubtaskOwner
1Delivery creation on VALIDATED and DeliveryStatus transitions synced with OrderStatus PREPARING/READY/SHIPPED/DELIVEREDAnis
2admin.deliveries.pickingList (lines grouped by product, barcodes, quantities, order note) as JSON and printable PDFAnis
3Carrier management admin.carriers.crud (name, mode, API-capable flag, tracking URL template, active)Anis
4admin.deliveries.update: mode, carrier, driver, tracking number, planned date; SHIPPED triggers stock deduction via stock.deductOnAnis
5admin.deliveries.proof: DELIVERY_PROOF photo, recipient name, timestamp → DELIVERED; FAILED with reason and retry or returnAnis
6Delivery-fee policy (free-delivery threshold, fee table per wilaya, pickup free) used by cart.checkoutOptions and snapshotted on the orderAnis
7admin.deliveries.list for the board (status columns, carrier, wilaya, date filters)Anis
8Events delivery.shipped / delivery.delivered / delivery.failed feeding order status notificationsAnis

Deliverables

  • apps/server/src/modules/fulfillment/{deliveries,carriers,fees,picking-list}.{service,router}.ts
  • packages/contracts/src/admin/deliveries.ts
  • Picking list PDF template on the shared PDF base

Acceptance criteria

  • Marking a delivery SHIPPED moves the order to SHIPPED and writes SHIPMENT stock movements once (DLV-02, STK-03)
  • DELIVERED requires a recipient name and either a photo or a documented exception; the reseller is notified (DLV-03)
  • An order above the free-delivery threshold has a zero delivery fee; otherwise the fee of the delivery wilaya applies (DLV-06)
  • The picking list lists every order line with quantity and barcode (DLV-01)
  • Inactive carriers cannot be assigned (DLV-04)

Requirements covered

RequirementTitleRelease
DLV-01Preparation workflow (picking list) up to 'ready'V1
DLV-02Shipping: carrier assignment (own fleet or company), tracking numberV1
DLV-03Delivery confirmation with proof (photo, recipient name)V1
DLV-04Carrier list management (API-capable vs manual)V1
DLV-06Delivery-fee policy (free threshold, per wilaya)V1

Screens

ScreenNameApp
BO-42Delivery boardBO
BO-43CarriersBO

API surface

Endpoint groupOperations
Orders & delivery21

Test measures

  • Unit tests for the fee policy
  • DB tests for delivery/order status synchronisation and single deduction
  • Manual print check of the picking list on A4

KPI

  • Delivered by Mon 19 Oct 2026 within 0.5 person-day(s).
  • Every acceptance criterion above demonstrated before hand-off; linked requirements' acceptance criteria pass.
  • Zero open critical defects, permission gaps or data-integrity regressions at sign-off.

Generated from content/plan/tasks.json by scripts/generate-team-tasks.mjs. Dates are computed by the scheduler (Sunday–Thursday weeks, holidays excluded) — change the plan, not this page.

On this page