spec.md 3.1 KB

ADDED Requirements

Requirement: Plan order identity and numbering

The system SHALL generate a unique plan order number per plan header using the prefix SXDDH, a date component in YYYYMMDD form, and a daily sequence padded to six digits (example shape: SXDDH20260101000001).

Scenario: New plan gets next sequence for the day

  • WHEN a user creates a new plan on calendar date 2026-01-01 and prior plans already consumed sequence 1 for that date
  • THEN the system assigns SXDDH20260101000002 (or the next free sequence) atomically without collision

Requirement: Plan lifecycle steps and roles

The system SHALL support the seven-step business flow described in project requirements: contract-initiated plan → compliance gate → transport dispatch → weighbridge linkage for inbound/outbound → driver scan return → specialist B verification → optional specialist C freight confirmation → archive.

Scenario: Optional freight step skipped when no freight

  • WHEN the plan is created with the option indicating no transport fee
  • THEN after specialist B completes verification the system SHALL transition directly to archivable state without requiring specialist C freight confirmation

Requirement: Plan header and line fields

The system SHALL persist plan attributes including: plan date, plan order number, document category, follow-up status, completion status, supplier name, destination company, material code/name, product spec, package spec, unit, inbound qty/estimate/price/amount, outbound estimate/qty/price/amount, weight difference (negative allowed), delivery method, transport id, plate number, transport company, transport unit, transport fee, total freight, attachments, sales contract reference, follower, remarks, audit fields (creator/modifier/timestamps), and notification text.

Scenario: Inbound amount derived

  • WHEN inbound quantity and inbound price are set
  • THEN the system SHALL store inbound amount equal to inbound quantity multiplied by inbound price

Requirement: Enumerations

The system SHALL support document categories: 直销单、入库单、出库单、云栋单. Follow-up statuses: 待采购、等客户通知、待安排、计划取消、待发货、已发货、待入库、已入库、待出库、已出库. Completion status: 是、否. Delivery methods: 山峡自提、一票制、客户自提.

Scenario: Invalid enum rejected on write

  • WHEN a client submits a follow-up status not in the defined set
  • THEN the system SHALL reject the write with a validation error

Requirement: Notification template

The system SHALL be able to render a notification message containing at least: plan number, enterprise name, pickup unit, arrival time, product name, arrival tonnage bracketed, and remarks placeholder, consistent with the standard template in requirements.

Scenario: Template populated from plan

  • WHEN a user requests notification text for a saved plan with known tonnage
  • THEN the returned text SHALL include the plan number and tonnage in the prescribed format