Near-expiry markdowns: database operations for operating reviews

Review database operations for operating reviews in Near-expiry markdowns. Check sources, input boundaries, error handling and repeatable test evidence.

What the documents look like

Near-expiry markdown handling tracks the remaining shelf life of store stock. The source material is not a per-item weighing record. It comes from POS stock-age data, store inspections, ERP inventory, and quality inspection records. Operating reviews and exception retrospectives align these sources to the same batch, the same store, and the same period, by day or by shift.

Four process documents sit alongside that data: the near-expiry list, the markdown approval, the damage write-off, and the promotional price tag. Their status fields determine whether a review can treat a markdown as executed or only as requested. The database operations step must keep those status fields traceable and comparable. Connection settings and the vector retrieval backend follow the actual deployment. Configuration values are not inferred from variable names.

Constraints at the database operations step

The same batch can appear in POS, ERP, and inspection records with different states. A review compares the same subject, the same period, and the same field. A contradiction exists only when the values in one field are explicitly mutually exclusive. Retrieval locates relevant documents. It does not carry authorization or entity isolation. A relevance score does not exclude unauthorized records. An empty result can support a downstream design check; it does not show that a rule always returns an empty array. Libraries on different vector models cannot be associated together. The identifier is checked first, and non-matching libraries are excluded.

Hypothetical drill sample. The shift handover note for one store, dated 10 March 2025, reads: "Store A, batch B-0310, leafy vegetables, expiry date 12 March 2025, inspection status: near expiry, markdown request number Z-0310-07, approval field blank." The promotional price tag for the same batch reads: "Store A, batch B-0310, markdown price tag printed, not posted." The draft sentence under review is: "This batch's markdown was approved and executed, so it can be counted in the day's markdown sales report." The judgment needs the approval field and an execution record. In the sample the approval field is blank and the tag is not posted. The sentence is unsupported and remains pending verification.

Configuration and implementation checks

The table lists only settings the official documents describe, or implementation checks tied to this page. The hypothetical trial starting values are for this paper review and are not official defaults.

Configuration itemHypothetical trial starting valueReason and comparison object
MONGODB_URIFilled per actual deploymentCompare against the business data store address; do not infer from the name
MONGODBLOGURINot configuredThe documents state the main store is reused when unset; compare against the main connection
DBMAXLINKHypothetical start 10Documented range 10 to 1000; compare against observed connection counts under own load
SYNC_INDEXHypothetical start trueThe documents state missing indexes are created at startup; compare against index maintenance records
LOGENABLEOTELHypothetical start falseDocumented default false; compare against whether a reporting address is configured
STORAGEDOWNLOADURL_MODEHypothetical start short-proxyDocumented options short-proxy or short-redirect; compare against observed external short links

Three common errors

  1. Treating a printed price tag as an executed markdown. The input is the sample tag text "markdown price tag printed, not posted." The comparison object is the execution status field. The observable result is that no execution record exists, so the draft sentence is unsupported.
  2. Reading a blank approval field as a rejected approval. The input is the sample handover note with "approval field blank." The comparison object is the approval status field. The observable result is that no status is recorded, so the item can only be marked pending verification.
  3. Using a relevance score to exclude unauthorized records. The input is a returned list of related documents. The comparison object is the authorization scope. The observable result is that the score carries no authorization information, so permissions must be checked separately.

How to verify the setup

  1. Take the sample handover note text and the draft sentence. Compare the approval field and the execution record field. The sentence meets the condition only when the approval field states consent and an execution record exists. The current observation is that the sentence is unsupported.
  2. Take the sample promotional price tag text. Compare the posting status field. The markdown execution meets the condition only when the posting status states posted. The current observation is pending verification.
  3. Take one retrieval request across two vector models. Compare the model identifiers on both sides. Association is possible only when the identifiers match. When they differ, exclude that library and record the actual observation. Do not run a cross-model retrieval to compare missed recall.

This page covers only near-expiry markdown handling, operating reviews and exception retrospectives, and database operations. Operational handover must distinguish which materials, actions, and requests are in which authorization state. Retrieval and forms are not authorization or execution.