Erlyc
Erlyc
Toggle sidebar
Log in
Log in
Report this showcase item

Tell us what is wrong — spam, offensive content, stolen work…

Shared artifacts

Supermarket and retail chain management application

VS

Volodymyr Savchenko

published 1 hour ago · 1 view

laravel-vue
57 features
Your plan does not include showcase imports.

Large-scale supermarket and retail chain management application for a company operating hundreds of stores, warehouses, online shops, and delivery services across multiple countries

Supermarket and retail chain management application — Screen map
Project anatomy

Built with deepseek/deepseek-v4-pro-0813

38
Entities
40
DB tables
29
Screens
6
Modules
38
Models
46
Relations
6
Roles
18
Requirements
5
Journeys
628
Code files
0 comments
Log in to like, rate, or join the conversation. Log in
Original prompt

Create a large-scale supermarket and retail chain management application for a company operating hundreds of stores, warehouses, online shops, and delivery services across multiple countries, where store employees manage products, shelves, stock, prices, promotions, damaged goods, and daily tasks; warehouse teams control incoming goods, storage, picking, transfers, and replenishment; purchasing teams manage suppliers, orders, delivery schedules, and costs; marketing teams create promotions and loyalty campaigns; customer service handles complaints, refunds, and delivery problems; finance monitors sales, margins, expenses, and payments; regional managers compare store performance; and executives see the overall business. Connect products, brands, categories, suppliers, stores, warehouses, customers, loyalty accounts, purchases, orders, deliveries, promotions, employees, shifts, returns, complaints, and payments so users can easily follow everyday situations such as why milk is out of stock, which supplier caused a delayed delivery, whether a promotion increased sales, which stores waste the most food, or why an online order arrived incomplete. Include dashboards for daily sales, profit, stock levels, popular products, low-stock items, waste, delivery delays, customer satisfaction, employee workload, and store comparisons, with drill-down from company level to a country, region, store, department, product, or transaction. Support purchasing and replenishment workflows, stock transfers between locations, price and promotion approvals, supplier performance, expiry-date monitoring, inventory counts, returns and refunds, customer complaints, loyalty points and rewards, online orders, click-and-collect, home delivery, employee shifts and task assignments, equipment issues, and store opening and closing checklists. Provide automatic alerts for low stock, unusual sales changes, expired products, missed deliveries, pricing mistakes, excessive waste, suspicious transactions, unanswered complaints, and staffing shortages, together with configurable notifications and escalation rules. Add powerful search and filters, barcode and QR scanning, product and shelf photos, document attachments, comments, bulk updates, Excel/CSV imports and exports, scheduled reports, audit history, multilingual and multi-currency support, and detailed permissions so employees see only the stores and functions relevant to them while regional and corporate teams can access broader information. Include integrations with point-of-sale systems, e-commerce platforms, payment providers, warehouse systems, delivery partners, supplier feeds, and accounting systems, plus mobile-friendly screens for employees checking stock, scanning products, receiving deliveries, completing store tasks, handling customer requests, and approving actions while away from a computer.

Discovery boards
Project Brief
What I think you want to build
A concise interpretation of the product intent.
interpretation
critical

A unified retail operations platform connecting stores, warehouses, purchasing, marketing, customer service, finance, and executive reporting across hundreds of locations and multiple countries.

CONCISE-AUTO: This is the most direct reading of the prompt. All listed modules and the scale point to a comprehensive retail management system.

interpretation

An ERP-style system rather than a point solution, given the breadth of modules spanning inventory, purchasing, promotions, finance, HR shifts, and customer service.

CONCISE-AUTO: The scope spans multiple business functions typically found in retail ERP systems. This shapes architecture and data model decisions.

interpretation

A system that partially replaces some existing tools (spreadsheets, legacy warehouse software) while integrating with existing POS and e-commerce platforms rather than rebuilding them from scratch.

User explicitly edited this element to clarify partial replacement: spreadsheets and legacy warehouse tools are replaced, POS and e-commerce are integrated.

Likely target users
Proposed end-user groups.
interpretation

Store employees: shop floor staff using mobile devices for stock checks, price lookups, task completion, and barcode scanning. Current workaround: walking to a back-office PC or calling a manager.

CONCISE-AUTO: The prompt explicitly describes store employees managing products, shelves, stock, prices, promotions, damaged goods, and daily tasks with mobile-friendly screens.

interpretation

Warehouse teams: receiving, putaway, picking, transfers, and replenishment staff using desktop terminals or rugged handheld devices with barcode scanners. Current workaround: paper pick lists and manual inventory counts.

CONCISE-AUTO: Warehouse operations are explicitly listed with specific workflows. Desktop terminals with scanners are the typical warehouse setup.

interpretation

Regional managers and executives: read-only dashboard users who compare store performance and drill down from company to transaction level. Current workaround: waiting for weekly reports from analysts.

CONCISE-AUTO: The prompt describes comparing store performance and seeing overall business with drill-down from company to transaction level.

interpretation

Customer service agents: need a unified view of orders, deliveries, complaints, refunds, and loyalty accounts to resolve issues quickly. Current workaround: switching between multiple systems to piece together a customer's history.

CONCISE-AUTO: The prompt lists customer service handling complaints, refunds, and delivery problems, implying a need for cross-entity visibility.

interpretation

Purchasing and marketing teams: back-office users managing suppliers, orders, promotions, and loyalty campaigns. Current workaround: spreadsheets and email chains with suppliers.

CONCISE-AUTO: The prompt lists purchasing teams managing suppliers, orders, delivery schedules, and costs, and marketing teams creating promotions and loyalty campaigns.

Problems worth solving
Likely pains, inefficiencies, or opportunities.
interpretation

Users cannot easily trace everyday situations like why milk is out of stock or which supplier caused a delayed delivery because data is siloed across systems.

CONCISE-AUTO: The prompt explicitly lists traceability scenarios as a core requirement. This is the stated problem.

interpretation

The underlying job-to-be-done is operational visibility: giving every role the right information at the right time to make decisions without calling other departments.

CONCISE-AUTO: The traceability examples all point to reducing cross-departmental friction and enabling self-service answers.

interpretation

Improving stock availability is the primary business driver. Waste reduction and executive visibility are important secondary outcomes that follow from better stock data.

User answered the primary business driver blocker: stock availability is the core operational pain, with waste reduction and executive visibility as secondary outcomes.

risk

Multi-country operations create complexity around currency, language, tax, and regulatory compliance that the user may not have fully considered.

User explicitly accepted this risk and confirmed multi-country tax, labor, and data residency requirements must be addressed in the architecture. This is a known risk, not a blocker.

Desired outcomes
What the application should enable.
interpretation

After the app exists, a store manager can identify why a product is out of stock within seconds by tracing from shelf to supplier delivery.

CONCISE-AUTO: This is the observable end-state implied by the traceability requirement.

interpretation

After the app exists, executives can see daily sales, margins, and waste across all countries and drill down to a single transaction without requesting a report.

CONCISE-AUTO: The drill-down requirement implies self-service analytics at all levels.

interpretation

After the app exists, warehouse and store teams can complete stock transfers and replenishment without manual phone calls or paper forms.

CONCISE-AUTO: The workflow requirements for transfers and replenishment imply digitizing currently manual processes.

interpretation

After the app exists, customer service agents can resolve a complaint about an incomplete online order by viewing the order, delivery, and warehouse picking history in one screen.

CONCISE-AUTO: The prompt's traceability examples include 'why an online order arrived incomplete', implying a unified view for customer service.

Usage context
When and how users likely use the app.
interpretation

Store employees will use the app primarily on mobile devices (phones or handheld scanners) while standing or walking on the shop floor.

CONCISE-AUTO: The prompt explicitly requests mobile-friendly screens for stock checking, scanning, and task completion.

interpretation

Warehouse and back-office users will primarily use desktop workstations with barcode scanners and label printers.

CONCISE-AUTO: Warehouse receiving, picking, and inventory counts typically happen at fixed stations or with rugged handheld devices.

interpretation

The app will be used across multiple time zones, requiring timezone-aware timestamps and scheduling.

CONCISE-AUTO: Multi-country operations imply multiple time zones. Shifts, deliveries, and reports must handle this correctly.

interpretation

The system will support 1,000-5,000 concurrent users across all roles, requiring solid architecture and performance targets but not extreme scale.

User answered the concurrent users blocker: 1,000-5,000 concurrent users is a realistic range for hundreds of stores plus warehouses and back-office teams.

interpretation

The system will operate across 4-10 countries, requiring multi-language, multi-currency, and regulatory compliance features.

User answered the countries blocker: 4-10 countries is the most common scale for a 'multiple countries' retail chain.

Scope boundaries
What the product likely should not be.
constraint

This is not a point-of-sale system — POS is an integration target, not a feature to build.

CONCISE-AUTO: The prompt lists POS systems as integrations, not as something to build. Building a POS would be a massive scope expansion.

constraint

This is not an e-commerce platform — online shops are integration targets, not features to build.

CONCISE-AUTO: The prompt lists e-commerce platforms as integrations. Building a storefront would duplicate existing tools.

constraint

This is not an accounting system — finance monitoring and payment tracking are in scope, but general ledger, tax filing, and payroll are out of scope.

CONCISE-AUTO: The prompt mentions accounting systems as integrations. Building full accounting would be redundant and risky.

Blind spots and risks
Areas DTC believes require attention.
risk
critical

Technical risk: integrating with hundreds of heterogeneous POS, e-commerce, and warehouse systems across multiple countries will be the largest engineering challenge.

CONCISE-AUTO: Integration complexity is the most common failure point for retail ERP projects. Each country may have different systems.

risk

User adoption risk: store employees may resist a new system if it is slower than their current workflow or requires too many taps on mobile.

CONCISE-AUTO: Retail staff have high turnover and low tolerance for friction. A slow mobile UI will be abandoned.

risk
critical

Scope risk: the breadth of modules (inventory, purchasing, promotions, finance, HR, customer service) could lead to a shallow implementation of everything and deep implementation of nothing.

CONCISE-AUTO: This is a classic ERP scope explosion risk. Prioritization and phased delivery are essential.

risk

Regulatory risk: multi-country operations involve GDPR, local labor laws, food safety regulations, and tax compliance that vary by jurisdiction.

CONCISE-AUTO: The prompt mentions multi-country but not regulatory compliance. User explicitly accepted this risk and confirmed it must be addressed in the architecture.

High-impact decisions
Choices that change product direction.
decision
critical

Architecture: single-tenant with hierarchical organization (company → country → region → store) vs multi-tenant SaaS architecture.

CONCISE-AUTO: The prompt describes one company operating many locations, not a SaaS serving multiple companies. Single-tenant simplifies data model and permissions.

decision

Product catalog: shared global catalog with country-specific pricing and promotions as overlays vs fully independent country catalogs.

CONCISE-AUTO: A shared catalog reduces duplication but requires careful handling of local products, barcodes, and regulatory labels.

decision

Phasing: inventory and purchasing first, followed by warehouse workflows, then dashboards and reporting, with customer service and marketing modules in later phases. This prioritizes the data backbone that all traceability scenarios depend on.

User explicitly edited this element to define the phasing: inventory and purchasing first, then warehouse workflows, then dashboards and reporting, with customer service and marketing later.

decision

Integration strategy: hybrid approach — use an iPaaS middleware for standard integrations (POS, e-commerce, payment providers, accounting) and build custom connectors only for unique or legacy systems that lack standard APIs.

User explicitly edited this element to define the integration strategy: hybrid approach with iPaaS for standard integrations and custom connectors for legacy systems.

decision

Data synchronization: hybrid — near-real-time for operational data (stock levels, orders, deliveries, complaints) and batch for analytics and reporting. This balances accuracy for daily operations with cost and complexity.

User explicitly edited this element to define the sync strategy: hybrid with near-real-time for operational data and batch for analytics.

Needs & Data
Core domain objects
What entities exist in the product world.
interpretation
critical

Product: id, sku, gtin/barcode, name, description, brand_id, category_id, parent_product_id (nullable, for variants), is_global (bool), country_code (nullable for local products), unit_of_measure, created_at, updated_at, deleted_at. Relationships: belongs to Brand, Category, and optionally parent Product; has many Price records, InventoryLevel records, PromotionProduct links.

CONCISE-AUTO: Product is the central entity. The parent_product_id field implements the confirmed variant model (dec_data_005). The is_global flag and nullable country_code implement the shared catalog with local overlays decision.

interpretation
critical

Store: id, name, address, country_code, region_id, timezone, opening_hours, status, phone_primary, phone_emergency, email_orders, email_manager. Warehouse: id, name, address, country_code, region_id, capacity, status. Both link to Organization hierarchy (company → country → region → location).

CONCISE-AUTO: Stores and warehouses are distinct location types with different operational attributes but share the hierarchical organization model from dec_001. The typed contact fields implement the confirmed contact modeling decision (dec_data_008).

interpretation

Supplier: id, name, contact_info, payment_terms, lead_time_days, reliability_score (derived), status. PurchaseOrder: id, supplier_id, warehouse_id (destination), order_date, expected_delivery_date, actual_delivery_date, status (draft/sent/confirmed/partial/received/cancelled), total_cost. PurchaseOrderLine: id, purchase_order_id, product_id, quantity_ordered, quantity_received, unit_cost.

CONCISE-AUTO: Supplier and PurchaseOrder are essential for the purchasing workflow and the 'which supplier caused a delayed delivery' traceability scenario.

interpretation
critical

StockMovement: id, product_id, batch_id (nullable, required for perishable products), location_id (store or warehouse), movement_type (receipt/transfer_out/transfer_in/sale/return/damage/count_adjustment/expiry), quantity_change (+/-), reference_type, reference_id (links to PurchaseOrder, StockTransfer, Sale, etc.), created_at, created_by. This is the ledger that answers 'why' questions.

CONCISE-AUTO: The ledger-style stock movement model is the core of inventory traceability. The batch_id field implements the confirmed full batch tracking decision (dec_data_007) and the dedicated Batch entity (dec_data_010). Every stock change is recorded with a reference to its cause.

interpretation

InventoryLevel: id, product_id, batch_id (nullable), location_id, quantity_on_hand, quantity_reserved, quantity_available (derived), reorder_point, max_stock, last_counted_at. This is the fast-read current state, rebuilt from StockMovement ledger.

CONCISE-AUTO: Separating current state (InventoryLevel) from history (StockMovement) gives fast reads for dashboards while preserving audit trail. The batch_id field enables per-batch inventory tracking via the dedicated Batch entity.

interpretation

StockTransfer: id, from_location_id, to_location_id, status (draft/in_transit/received/cancelled), created_at, shipped_at, received_at. StockTransferLine: id, stock_transfer_id, product_id, batch_id (nullable), quantity_sent, quantity_received. Links to StockMovement records for both outbound and inbound.

CONCISE-AUTO: Stock transfers between locations are explicitly required and connect to the stock movement ledger for full traceability. Batch tracking extends to transfers for perishable products.

interpretation

Customer: id, first_name, last_name, email, phone, address, country_code, consent_gdpr (bool), consent_marketing (bool), created_at, updated_at, deleted_at. LoyaltyAccount: id, customer_id, points_balance, tier, joined_at. Order: id, customer_id, loyalty_account_id (nullable), store_id (for click-and-collect) or delivery_address, order_date, status, total_amount, currency.

CONCISE-AUTO: Customer, LoyaltyAccount, and Order are separate entities per the prompt. GDPR consent fields are included per claim_data_009.

interpretation

Employee: id, first_name, last_name, email, phone, role_id, status, hire_date. EmployeeLocation: id, employee_id, location_id, location_type (store/warehouse/region/country), is_primary. Shift: id, employee_id, location_id, start_time, end_time, role_during_shift. Task: id, location_id, assigned_to (employee_id), title, description, due_at, status, priority.

CONCISE-AUTO: Employee-to-location assignment is the foundation for store-level permission scoping. Shifts and tasks are explicitly required.

interpretation

Price: id, product_id, country_code (nullable for global), currency, amount_base, amount_local, exchange_rate_snapshot, effective_from, effective_to (nullable), status (draft/approved/active/expired), approved_by, approved_at. Promotion: id, name, description, country_code (nullable), start_date, end_date, discount_type (percentage/fixed/bogo), discount_value, status. PromotionProduct: id, promotion_id, product_id.

CONCISE-AUTO: Effective-dated pricing with approval workflow implements the price versioning decision and the price/promotion approval requirement. The amount_base and amount_local fields with exchange_rate_snapshot implement the confirmed multi-currency decision (dec_data_006).

interpretation

Complaint: id, customer_id, order_id (nullable), type (product_quality/delivery_delay/wrong_item/missing_item/other), description, status (open/investigating/resolved/closed), priority, assigned_to, created_at, resolved_at. Return: id, order_id, customer_id, reason, status (requested/approved/received/refunded/rejected), refund_amount, created_at. Payment: id, order_id, amount, currency, method, status, transaction_reference, created_at.

CONCISE-AUTO: Customer service workflows require Complaint, Return, and Payment entities. These link to Order for the unified customer service view.

interpretation

Batch: id, product_id, batch_number, expiry_date, received_date, supplier_id (nullable), status (active/expired/quarantined/depleted). Each batch is linked to StockMovement records and InventoryLevel records for per-batch tracking.

CONCISE-AUTO: The confirmed dedicated Batch entity decision (dec_data_010) requires a first-class Batch entity with its own table. This enables precise expiry monitoring and waste tracking per batch without denormalizing batch data across StockMovement and InventoryLevel.

User-provided inputs
Data the future app may ask from its users.
interpretation

Product creation form: sku (text, required, unique per country), gtin/barcode (text, optional, validated for check digit), name (text, required), description (text, optional), brand (dropdown, required), category (dropdown, required), unit_of_measure (dropdown: each/kg/liter/pack, required), parent_product_id (dropdown, optional, for variant creation), is_global (checkbox, default true), country_code (dropdown, required if not global).

CONCISE-AUTO: These are the minimum fields to create a product in the shared catalog model. The parent_product_id field implements the confirmed variant model. Barcode validation catches data entry errors early.

interpretation

Stock count entry: product (barcode scan or search), batch (dropdown, required for perishable products), location (auto-filled from user context), counted_quantity (number, required, non-negative), count_date (date, default today), notes (text, optional). System compares counted vs expected and flags discrepancies above tolerance.

CONCISE-AUTO: Inventory counts are explicitly required. The batch field implements the confirmed full batch tracking decision. Barcode scanning is the primary input method for store employees on mobile.

interpretation

Purchase order creation: supplier (dropdown, required), destination warehouse (dropdown, required), expected_delivery_date (date, required), line items (product + quantity + unit_cost, at least one required), notes (text, optional).

CONCISE-AUTO: Purchase order creation is a core purchasing workflow. The form captures the minimum to place an order with a supplier.

interpretation

Delivery receiving: purchase_order (dropdown or scan), line items with received_quantity (number, default ordered quantity, editable), batch_number (text, required for perishable products), expiry_date (date, required for perishable products), condition (dropdown: good/damaged/expired, default good), received_at (timestamp, default now), notes (text, optional).

CONCISE-AUTO: Receiving is where delivery discrepancies are captured. The batch_number and expiry_date fields implement the confirmed full batch tracking decision. The condition field feeds the damaged goods workflow.

interpretation

Price change request: product (search/scan), country (dropdown, default user's country), new_price_local (decimal, required, > 0), currency (dropdown, default country currency), new_price_base (decimal, auto-calculated from exchange rate, editable), effective_from (date, required), effective_to (date, optional), reason (text, required for approval workflow).

CONCISE-AUTO: Price changes require approval per the prompt. The dual price fields implement the confirmed multi-currency decision (dec_data_006). The reason field supports the approval workflow.

interpretation

Customer registration: first_name (text, required), last_name (text, required), email (email, required, unique), phone (text, optional, validated format), address (text, required for delivery), country (dropdown, required), consent_gdpr (checkbox, required), consent_marketing (checkbox, optional).

CONCISE-AUTO: GDPR consent is mandatory for customer data collection. Email uniqueness prevents duplicate customer records.

interpretation

Employee assignment: employee (dropdown), location (dropdown, store or warehouse), role (dropdown, from role list), is_primary (checkbox, default false). Shift creation: employee (dropdown), location (auto-filled), start_time (datetime, required), end_time (datetime, required, > start_time), role_during_shift (dropdown).

CONCISE-AUTO: Employee-to-location assignment is the foundation for permission scoping. Shift creation captures scheduling data.

interpretation

Complaint filing: customer (search by email/phone/loyalty id), order_id (optional, search), type (dropdown: product_quality/delivery_delay/wrong_item/missing_item/other), description (text, required), priority (dropdown: low/medium/high/critical, default medium).

CONCISE-AUTO: Customer service agents need to file complaints quickly. The type dropdown enables routing and reporting.

System-derived data
Data calculated or inferred by the app.
recommendation

InventoryLevel.quantity_available = quantity_on_hand - quantity_reserved. Recalculated on every stock movement and reservation change.

CONCISE-AUTO: Available quantity is the number that matters for replenishment and order fulfillment. Deriving it prevents inconsistent manual updates.

recommendation

Supplier.reliability_score = weighted average of on-time delivery rate (60%), quantity accuracy rate (30%), and quality acceptance rate (10%) over the last 90 days. Updated nightly.

CONCISE-AUTO: The 'which supplier caused a delayed delivery' scenario implies supplier performance tracking. A composite score gives a single comparable metric.

recommendation

Product.current_price = the active Price record with the latest effective_from date where effective_to is null or in the future. Product.margin = current_price - latest_unit_cost (from most recent PurchaseOrderLine). Margin is calculated in base currency for cross-country comparison.

CONCISE-AUTO: Current price and margin are derived from versioned price and cost data. Deriving them ensures consistency across reports. Base currency margin enables cross-country comparison per the confirmed multi-currency decision.

recommendation

Stockout risk score per product per location = f(current stock level, average daily sales velocity, lead time from supplier, open purchase orders). Score 0-100 where >70 means high risk of stockout within lead time.

CONCISE-AUTO: The primary business driver is stock availability. A stockout risk score enables proactive replenishment alerts.

recommendation

LoyaltyAccount.tier = derived from points earned in trailing 12 months: Bronze (0-999), Silver (1000-4999), Gold (5000-14999), Platinum (15000+). Recalculated nightly.

CONCISE-AUTO: Loyalty tiers are typically derived from point accumulation over a rolling window. Deriving prevents manual tier assignment errors.

recommendation

Store.performance_rank = percentile rank of store within its region based on composite score of sales growth, margin, waste rate, and customer satisfaction. Updated weekly.

CONCISE-AUTO: Regional managers need to compare store performance. A percentile rank gives context beyond raw numbers.

recommendation

Product.expiry_risk = derived from batch expiry dates and current stock levels. Products with batches expiring within 7 days and stock > 0 are flagged as expiry_risk = high. Batches expiring within 30 days are flagged as expiry_risk = medium.

CONCISE-AUTO: Expiry-date monitoring is explicitly required. The confirmed dedicated Batch entity (dec_data_010) enables precise per-batch expiry risk calculation.

Business rules and decision logic
Validations, calculations, scoring, gates.
constraint
critical

StockMovement.quantity_change must never result in InventoryLevel.quantity_on_hand < 0. Any movement that would cause negative stock is rejected with an error.

CONCISE-AUTO: Negative inventory is a data integrity violation that corrupts all downstream calculations. This is a hard constraint.

constraint

Price.effective_from must be >= today for new price records. Price.effective_to must be > Price.effective_from. No two active Price records for the same product and country can have overlapping effective date ranges.

CONCISE-AUTO: Overlapping price records create ambiguity about which price applies. This constraint prevents data corruption.

constraint

PurchaseOrderLine.quantity_received must be <= PurchaseOrderLine.quantity_ordered. Receiving more than ordered requires a new purchase order or an explicit override with manager approval.

CONCISE-AUTO: Over-receiving without approval can hide supplier errors and inflate inventory. This rule enforces purchase order discipline.

constraint

Order.total_amount = SUM(OrderLine.subtotal) - discount + tax + shipping. OrderLine.subtotal = quantity * unit_price. All amounts stored in both order currency and base currency with exchange rate snapshot at order time.

CONCISE-AUTO: Order totals must be calculated consistently. The dual currency storage implements the confirmed multi-currency decision (dec_data_006). Storing the exchange rate snapshot prevents historical amounts from changing when rates fluctuate.

constraint

Employee can only be assigned to locations within their country. Regional managers can view all stores in their region but cannot edit data outside their region. Corporate users have full access.

CONCISE-AUTO: This implements the permission scoping requirement. Country-level assignment is a natural boundary for multi-country operations.

constraint
critical

Customer PII can only be accessed by users with customer_service or admin role. Customer.consent_gdpr must be true before any marketing communication. Customer data deletion requests must be fulfilled within 30 days (GDPR).

CONCISE-AUTO: GDPR compliance requires access controls and consent enforcement. The 30-day deletion window is a GDPR requirement.

constraint

Payment records are immutable once status = 'completed'. Corrections require a reversing Payment record with negative amount and a reference to the original payment.

CONCISE-AUTO: Immutable financial records are a standard accounting pattern. Reversing entries preserve audit trail.

constraint

StockTransfer.status transitions: draft → in_transit → received. A transfer cannot be marked received unless all StockTransferLine.quantity_sent > 0. Received quantity can be less than sent (damage in transit) but never more.

CONCISE-AUTO: Transfer status transitions enforce workflow integrity. Allowing received < sent handles in-transit damage.

constraint

Batch.expiry_date must be > Batch.received_date. Batches with expiry_date in the past are automatically marked as expired. Expired batches cannot be sold or transferred; they can only be moved to waste or returned to supplier.

CONCISE-AUTO: The confirmed dedicated Batch entity (dec_data_010) requires rules to enforce expiry integrity and prevent sale of expired products.

Knowledge and data dependencies
External data, expert knowledge, integrations.
constraint
critical

POS integration must provide: sales transactions (product, quantity, price, timestamp, store), payment details, and customer loyalty id if captured. This is the primary source of sales data.

CONCISE-AUTO: POS is an integration target, not a feature to build. Sales data flows from POS into the system for inventory deduction and reporting.

constraint

E-commerce integration must provide: online orders (customer, items, quantities, delivery address, order status), and inventory levels if the e-commerce platform manages its own stock.

CONCISE-AUTO: Online orders are a separate channel that must feed into the unified order and inventory data model.

constraint

Accounting system integration must receive: sales summaries, payment records, and expense data. The accounting system is the system of record for general ledger, not this app.

CONCISE-AUTO: Finance monitoring is in scope but full accounting is not. The app sends financial data to the accounting system.

constraint

Supplier feeds must provide: product catalogs (sku, barcode, description, unit cost), availability, and lead times. Supplier data quality varies significantly and requires validation on import.

CONCISE-AUTO: Supplier feeds are a key data source for purchasing. Data quality varies, so import validation is essential.

constraint

Delivery partner integrations must provide: tracking numbers, delivery status updates, and proof of delivery. This data links to Order for the 'why did an online order arrive incomplete' traceability scenario.

CONCISE-AUTO: Delivery tracking is essential for customer service and the traceability scenarios involving deliveries.

constraint

Warehouse management system (WMS) integration must provide: receiving confirmations, picking status, and stock counts. If the WMS is the system of record for warehouse operations, this app syncs with it rather than replacing it.

CONCISE-AUTO: The prompt mentions warehouse systems as integrations. Some warehouse operations may remain in the WMS with this app providing visibility.

constraint

Historical sales data import: last 12 months of sales transactions from POS and e-commerce systems. Import must include product, quantity, price, timestamp, store, and currency. Exchange rates for historical transactions must be sourced from a reliable rate provider.

CONCISE-AUTO: The confirmed historical data import decision (dec_data_009) requires a defined import scope. Exchange rate sourcing is critical for accurate historical base currency conversion.

constraint

Exchange rate provider integration: automated daily feed from ECB or Open Exchange Rates. The feed must provide daily rates for all currencies in use. Manual override by finance team is supported for exceptional cases (e.g., provider outage, unusual market conditions).

CONCISE-AUTO: The confirmed hybrid exchange rate sourcing decision (dec_data_011) requires a rate provider integration. The manual override capability ensures business continuity when the automated feed fails or produces anomalous rates.

Data risks
Where data may be missing, unreliable, or sensitive.
risk
critical

Privacy risk: Customer PII (names, addresses, phone numbers, email) is subject to GDPR. A data breach or unauthorized access could result in significant fines (up to 4% of global revenue).

CONCISE-AUTO: GDPR compliance is mandatory for multi-country retail. This is a critical risk that requires encryption, access controls, and audit logging.

risk

Data quality risk: Barcode/GTIN data will have duplicates, missing values, and conflicts across suppliers. If not handled, product lookups will fail or return wrong products.

CONCISE-AUTO: Real-world retail data is messy. The conflict-tolerant barcode model (dec_data_003) addresses this, but residual risk remains.

risk

Missing data fallback: Supplier delivery confirmations may arrive hours or days after physical receipt. The system must handle 'received but not confirmed' state without blocking downstream workflows.

CONCISE-AUTO: Real-world receiving is asynchronous. The system must allow provisional receiving with later confirmation.

risk

User error scenario: Store employee enters wrong quantity during stock count (e.g., types 100 instead of 10). This creates a stock discrepancy that propagates to replenishment and reporting.

CONCISE-AUTO: Manual data entry is error-prone. The system needs validation (e.g., flag counts that deviate >50% from expected) and correction workflows.

risk

Integration failure risk: If POS or e-commerce integration fails, sales data stops flowing. Inventory levels become stale, and dashboards show incorrect data without clear indication of staleness.

CONCISE-AUTO: The system depends on external data sources. Integration failures must be detected and surfaced, not silently ignored.

risk

Financial data integrity risk: If payment or sales data is corrupted or lost, financial reports become unreliable. The immutability rule (claim_data_010) protects against accidental edits but requires careful implementation.

CONCISE-AUTO: Financial data is high-stakes. Immutability prevents accidental corruption but requires a robust backup and recovery strategy.

risk

Batch tracking complexity risk: Full batch tracking with a dedicated Batch entity adds batch_id to every stock movement, inventory level, and transfer. This increases data volume and query complexity. If not implemented carefully, performance degrades at scale.

CONCISE-AUTO: The confirmed dedicated Batch entity decision (dec_data_010) is necessary but adds complexity. This risk must be managed through proper indexing and query optimization, as noted by the user.

risk

Exchange rate data quality risk: Historical exchange rate snapshots may be inaccurate or missing for some currencies. This affects cross-country reporting accuracy and margin calculations.

CONCISE-AUTO: The confirmed multi-currency decision (dec_data_006) depends on reliable exchange rate data. Missing or incorrect rates corrupt cross-country comparisons.

risk

Exchange rate provider outage risk: The automated daily feed from ECB or Open Exchange Rates may fail due to provider outage, API changes, or rate limits. The manual override capability mitigates this but requires finance team availability and clear escalation procedures.

CONCISE-AUTO: The confirmed hybrid exchange rate sourcing decision (dec_data_011) introduces a dependency on external rate providers. The manual override is the fallback, but it requires operational readiness.

Open data decisions
High-impact data questions still open.
decision
critical

Product variant modeling: Separate Product records with parent_product_id. Each variant has its own barcode, inventory level, and price.

User accepted this option: each variant needs its own barcode, inventory level, and price, which JSON attributes cannot support cleanly. A separate Variant table adds unnecessary indirection for this scale.

decision
critical

Multi-currency pricing: Store both base and local currency amounts with exchange rate snapshots at transaction time.

User accepted this option: local currency for store operations and customer-facing prices; base currency for cross-country reporting and executive dashboards. Exchange rate snapshot preserves historical accuracy.

decision
critical

Batch/lot tracking: Full batch tracking with expiry dates per batch for perishable products.

User accepted this option: the prompt explicitly requires expiry-date monitoring and waste tracking. Product-level expiry is insufficient for real retail operations where different batches of the same product arrive with different expiry dates.

decision

Store contact modeling: Multiple typed contact fields (phone_primary, phone_emergency, email_orders, email_manager).

User accepted this option: structured, queryable data for routing (e.g., delivery issues go to email_orders, emergencies to phone_emergency) without the schema ambiguity of a JSON blob.

decision

Historical data import: Import last 12 months of sales data for baseline analytics.

User accepted this option: sufficient baseline for stockout predictions, promotion analysis, and initial dashboards without excessive migration effort. 24+ months adds cost with diminishing returns for a new system launch.

decision

Batch entity structure: Dedicated Batch entity with its own table, linked to StockMovement and InventoryLevel records for per-batch tracking.

User accepted this option: it enables batch-level expiry queries, waste tracking, and per-batch inventory without denormalizing batch data across StockMovement and InventoryLevel. The join cost is manageable with proper indexing and is already reflected in el_data_risk_007.

decision

Exchange rate sourcing: Hybrid approach — automated daily feed from a rate provider (ECB or Open Exchange Rates) with manual override capability by the finance team.

User accepted this option: it minimizes manual effort while preserving control for exceptional cases and is consistent with the exchange rate snapshot model already accepted.

Solution Shape
Recommended product concept
A concise product thesis.
interpretation
critical

A unified retail operations command center that gives every role — from shop floor to executive suite — one traceable source of truth for stock, orders, suppliers, and performance across hundreds of locations and multiple countries. The core differentiator is traceability: any user can answer 'why' questions (why is milk out of stock, why is this delivery late, why is this store wasting more) in seconds without calling another department.

CONCISE-AUTO: This thesis synthesizes the confirmed product intent (claim_001), the traceability problem (claim_008), and the operational visibility job-to-be-done (claim_009). User explicitly accepted this element and confirmed the traceability-first command center framing.

Main user journey
Recommended end-user flow.
recommendation
critical

Primary journey — Stock issue resolution: (1) Store employee scans a product or sees a low-stock alert on their mobile device. (2) They open the product's stock status screen showing current quantity, recent movements, and open purchase orders. (3) They tap 'Trace' to see a summary trace: root cause highlighted with one-line explanation. (4) They tap to progressively expand into full movement history, related orders, and supplier details. (5) The employee taps 'Replenish' to trigger a suggested purchase order or stock transfer. (6) The system pre-fills the order with recommended quantity based on sales velocity and lead time. (7) The employee confirms and submits; the order routes to purchasing or warehouse. (8) The employee sees a confirmation with expected arrival date and can share it with their manager.

CONCISE-AUTO: This journey directly serves the confirmed primary driver (claim_010) and the traceability outcome (claim_012). Updated to reflect the confirmed summary-trace-with-progressive-disclosure pattern.

recommendation

Secondary journey — Purchase order to shelf: (1) Purchasing manager creates a purchase order from a replenishment suggestion or manually. (2) The order routes to the supplier with expected delivery date. (3) Warehouse team receives the delivery, scanning items and recording batch numbers and expiry dates for perishables. (4) The system updates inventory levels and flags any discrepancies (short shipment, damaged goods). (5) Stock is put away and available for store replenishment. (6) Store team requests a transfer or receives an auto-generated replenishment suggestion. (7) Warehouse picks and ships the transfer. (8) Store receives and confirms; shelf is restocked.

CONCISE-AUTO: This journey covers the confirmed purchasing and warehouse workflows (dec_003) and the receiving process with batch tracking (claim_data_013). It is the operational backbone that feeds the primary journey.

Capability groups
Feature clusters.
recommendation
critical

Group 1 — Inventory & Replenishment: product catalog management (global + local, variants, barcodes), stock level tracking (ledger-based, batch-aware), stock counts, low-stock alerts, replenishment suggestions, stock transfers between locations, expiry monitoring, waste tracking, damaged goods handling.

CONCISE-AUTO: This group serves the confirmed primary driver (stock availability) and includes every inventory feature from the prompt and data model. It is the core of the product.

recommendation

Group 2 — Purchasing & Supplier Management: supplier directory with performance scores, purchase order creation and approval workflow, delivery schedule tracking, receiving and discrepancy handling, cost tracking, supplier feed integrations, purchase order versioning.

CONCISE-AUTO: This group serves the confirmed purchasing phasing (dec_003) and the supplier traceability scenario (claim_008). Supplier reliability scoring is already in the data model.

recommendation

Group 3 — Warehouse Operations: receiving, putaway, picking, stock transfers, replenishment execution, inventory counts, barcode scanning workflows, label printing, WMS integration.

CONCISE-AUTO: This group serves the confirmed warehouse workflows (claim_005, dec_003) and the desktop-first usage context (claim_016).

recommendation

Group 4 — Customer & Order Resolution: unified customer view, order tracking (online, click-and-collect, home delivery), complaint management, returns and refunds, loyalty account management, delivery partner integration.

CONCISE-AUTO: This group serves the confirmed customer service role (claim_007) and the incomplete order traceability scenario. It is phased later (dec_003) but fully specified.

recommendation

Group 5 — Performance & Analytics: executive dashboards (sales, profit, stock, waste, delivery, satisfaction, workload), drill-down from company to transaction, store comparisons, scheduled reports, KPI alerts, promotion effectiveness analysis.

CONCISE-AUTO: This group serves the confirmed executive visibility outcome (claim_013) and the drill-down requirement. It depends on the operational data backbone from Groups 1-3.

recommendation

Group 6 — Platform & Governance: role-based access control with store/country scoping, audit logging, GDPR controls (consent, erasure, data residency), multi-language and multi-currency support, timezone handling, notifications and escalation rules, import/export, API and webhook infrastructure, integration management (iPaaS + custom connectors).

CONCISE-AUTO: This group is the foundation that makes all other groups safe and compliant. It includes the confirmed regulatory requirements (claim_024, claim_data_009) and the confirmed integration strategy (dec_004).

Optional phase-1 cut
Recommended phase-1 cut, ONLY when the user wants a staged rollout. Leave empty otherwise — the full validated spec is what gets built.
recommendation

Phase 1 (MVP): Inventory & Replenishment (Group 1) + Purchasing & Supplier Management (Group 2) + Warehouse Operations (Group 3) + core dashboards from Performance & Analytics (daily sales, stock levels, low-stock alerts) + essential Platform & Governance (RBAC, audit logging, multi-language, multi-currency, timezone, notifications). Customer & Order Resolution (Group 4) and advanced analytics are later phases.

CONCISE-AUTO: This directly reflects the confirmed phasing (dec_003): inventory and purchasing first, then warehouse, then dashboards. Customer service and marketing are explicitly later. Platform & Governance essentials must ship with phase 1 because they are prerequisites for multi-country compliance.

constraint
critical

MVP depth targets from el_sol_017 are carried into the spec map as phase-1 scope boundaries: depth-first on Inventory & Replenishment and Purchasing. Later-phase groups (Customer & Order Resolution, Marketing) get explicit 'deferred' markers in the spec map with no phase-1 elaboration.

User's refinement request explicitly requires carrying MVP depth targets into the spec map to prevent later-phase groups from silently expanding phase 1. This constraint operationalizes that requirement.

Later extensions
Features valuable after MVP.
recommendation

Customer & Order Resolution (Group 4): complaint management, returns and refunds, loyalty account management, unified customer service view. These are confirmed as later phases (dec_003), not excluded.

CONCISE-AUTO: The user explicitly placed customer service later in the phasing. This is a wanted feature deferred, not a scope cut.

recommendation

Marketing & Promotions: promotion creation and approval workflow, loyalty campaign management, promotion effectiveness analysis. These are confirmed as later phases (dec_003).

CONCISE-AUTO: Marketing is explicitly in the later phase per dec_003. Promotion effectiveness analysis depends on having sufficient sales history from the operational modules.

recommendation

Advanced analytics: predictive stockout forecasting, promotion lift analysis, supplier performance trend analysis, waste pattern detection. These require sufficient historical data from the operational modules.

CONCISE-AUTO: The data model already includes stockout risk scoring and supplier reliability scoring, but advanced predictive analytics need more data volume and are naturally later.

Explicitly excluded scope
Things to not build now.
constraint

Not building: point-of-sale system (POS is an integration target), e-commerce storefront (online shops are integration targets), accounting general ledger and tax filing (accounting system is an integration target), payroll (out of scope).

CONCISE-AUTO: These exclusions are confirmed by claim_018, claim_019, claim_020. They must remain visible to prevent scope creep during spec development.

constraint

Not building: employee scheduling optimization (shift planning is in scope for assignment and tracking, but automated scheduling optimization is out of scope), equipment maintenance management (equipment issues are tracked as tasks, but full CMMS is out of scope).

CONCISE-AUTO: The prompt mentions shifts and equipment issues, but these are task-tracking features, not full HR or maintenance systems. This boundary prevents scope creep.

Trade-offs and tensions
Conflicts requiring resolution.
tradeoff

Ledger completeness vs mobile query speed: full traceability requires recording every stock movement, but store staff need sub-second lookups. Recommended position: materialized InventoryLevel read model with async rebuild from the StockMovement ledger, plus targeted caching for hot product queries. Accept eventual consistency of seconds for read models.

CONCISE-AUTO: This is the classic CQRS tradeoff. The data model already includes both StockMovement (ledger) and InventoryLevel (fast read), so the resolution is architectural, not a data model change.

tradeoff
critical

Breadth vs depth: six capability groups risk shallow implementation. Recommended position: depth-first on Inventory & Replenishment and Purchasing (the confirmed primary driver), with explicit depth targets per group defined in the spec map. Accept that later-phase groups (Customer & Order Resolution, Marketing) will be thinner initially.

CONCISE-AUTO: This operationalizes the confirmed scope risk (claim_023) with the confirmed phasing (dec_003). Depth-first on the primary driver is the standard mitigation.

tradeoff

Real-time vs batch data freshness: near-real-time for operational data (stock, orders, deliveries) vs batch for analytics. Recommended position: define explicit freshness SLAs per entity — stock levels and order status within 60 seconds, dashboards within 15 minutes, scheduled reports daily. This prevents ambiguity about what 'near-real-time' means.

CONCISE-AUTO: The hybrid sync decision (claim_029) is confirmed but the boundary is underspecified. Explicit freshness SLAs make the tradeoff concrete and testable.

tradeoff

Global consistency vs local autonomy: shared product catalog with country overlays (dec_002) vs local teams wanting independent control. Recommended position: shared catalog for product identity and core attributes, country-level autonomy for pricing, promotions, and supplier selection. Escalation path for catalog conflicts via a data steward role.

CONCISE-AUTO: This tradeoff is inherent in the confirmed shared catalog decision. The resolution balances global reporting consistency with local market responsiveness.

Design principles
UX/product principles inferred.
recommendation

Traceability-first: every screen that shows stock, orders, deliveries, or performance must answer at least one 'why' question with a visible trace path. Show a summary trace by default, with progressive drill-down to full movement history and root-cause detail. Users should never have to leave the app to understand root cause.

User explicitly edited this element to clarify summary-trace-with-progressive-disclosure as the standard pattern. This operationalizes the confirmed traceability differentiator (claim_008, claim_012) as a UX requirement.

recommendation
critical

Summary-trace-with-progressive-disclosure is the standard traceability UX pattern across all operational screens: concise root-cause summary by default, one tap to expand into full movement history, related orders, and supplier details. This keeps store-floor interactions fast while preserving deep traceability for analysts and managers.

User explicitly answered the traceability UX blocker confirming 'both: summary trace with progressive drill-down'. This is now a confirmed UX standard, not a recommendation.

recommendation

Device-context-first: mobile-first for store floor tasks (scanning, stock checks, task completion, approvals), desktop-first for warehouse and back-office (receiving, purchasing, analytics). No feature ships without a defined primary device context and a responsive fallback.

CONCISE-AUTO: This principle is grounded in confirmed usage contexts (claim_015, claim_016). It prevents the common failure of designing desktop-first and shrinking to mobile.

recommendation

Role-appropriate visibility: every screen, list, and field declares its authorization surface explicitly. Users see only what their role and location scope allow, and the UI communicates scope boundaries (e.g., 'You are viewing Store 123 only').

CONCISE-AUTO: The confirmed permission model (claim_006, business rule about employee scoping) requires authorization to be a first-class UX concern, not a backend-only concern.

recommendation

Action-oriented: every screen should end with a possible action, not just information. Stock status ends with 'Replenish' or 'Transfer'. Delivery status ends with 'Confirm' or 'Flag discrepancy'. Dashboard ends with 'Drill down' or 'Export'.

CONCISE-AUTO: This principle serves the confirmed job-to-be-done (claim_009: making decisions without calling other departments). Information without action perpetuates the phone-call problem.

recommendation

Offline-tolerant: store floor and warehouse tasks (stock counts, receiving, transfers) must work with intermittent connectivity, with local queueing and sync when connection returns. This is critical for warehouse environments and rural stores.

CONCISE-AUTO: This principle addresses a gap not explicitly in the confirmed claims but implied by the mobile usage context (claim_015) and real-world retail environments. User explicitly accepted this as table-stakes, not scope creep.

Spec Map
Product overview
A concise statement of what the product is, who it serves, and what differentiates it.
interpretation
critical

The product is a unified retail operations command center that gives every role — from shop floor to executive suite — one traceable source of truth for stock, orders, suppliers, and performance across hundreds of locations and multiple countries. The core differentiator is traceability: any user can answer 'why' questions (why is milk out of stock, why is this delivery late, why is this store wasting more) in seconds without calling another department.

CONCISE-AUTO: This is the confirmed product concept from the solution_shape board. It is the foundation for every downstream spec decision.

interpretation

The product is an ERP-style system spanning inventory, purchasing, warehouse operations, performance analytics, and platform governance, with customer service and marketing deferred to later phases.

CONCISE-AUTO: claim_002 confirms ERP-style breadth. dec_003 confirms phasing. This element establishes the scope boundary for the spec map.

interpretation

The primary business driver is improving stock availability. Waste reduction and executive visibility are important secondary outcomes that follow from better stock data.

CONCISE-AUTO: claim_010 is user-confirmed. This driver shapes prioritization of functional requirements and acceptance criteria.

interpretation

The system partially replaces existing tools (spreadsheets, legacy warehouse software) while integrating with existing POS and e-commerce platforms rather than rebuilding them from scratch.

CONCISE-AUTO: claim_003 is user-confirmed. This establishes the integration-first posture and prevents scope creep into building POS or e-commerce.

decision

The spec map covers the full product (all phases), not just phase 1. Phase-1 depth targets are enforced via deferred markers on later-phase sections, but the spec map itself is the complete specification.

CONCISE-AUTO: The objective is a complete specification. The MVP framing lives in its own section. This decision clarifies that the spec map is not MVP-only.

risk
critical

Scope risk: the breadth of modules (inventory, purchasing, warehouse, analytics, governance) could lead to shallow implementation. Mitigation: depth-first on Inventory & Replenishment and Purchasing, with explicit depth targets per group.

CONCISE-AUTO: claim_023 is a confirmed critical risk. The spec map must carry the mitigation strategy from dec_sol_007.

tradeoff
critical

Tradeoff: breadth vs depth. Six capability groups risk shallow implementation. Resolution: depth-first on Inventory & Replenishment and Purchasing (the confirmed primary driver), with later-phase groups (Customer & Order Resolution, Marketing) explicitly deferred.

CONCISE-AUTO: claim_sol_005 is a confirmed critical tradeoff. The spec map must reflect the resolution from dec_sol_007.

User roles
The authoritative role set from the operating model, with responsibilities and device context.
interpretation
critical

Store Employee: shop floor staff using mobile devices for stock checks, price lookups, task completion, barcode scanning, and initiating replenishment. Primary device: mobile (phone or handheld scanner).

CONCISE-AUTO: claim_004 and claim_015 confirm mobile-first for store floor. The operating model confirms Store Employee drives Detect & Alert and Trace Root Cause.

interpretation
critical

Warehouse Team: receiving, putaway, picking, transfers, and replenishment staff using desktop terminals or rugged handheld devices with barcode scanners. Primary device: desktop workstation or rugged handheld.

CONCISE-AUTO: claim_005 and claim_016 confirm desktop-first for warehouse. The operating model confirms Warehouse Team drives Receive & Put Away.

interpretation
critical

Purchasing Manager: back-office user managing suppliers, purchase orders, delivery schedules, and costs. Approves exceptions and large orders in the replenishment workflow. Primary device: desktop.

CONCISE-AUTO: claim_006 confirms back-office desktop use. The operating model confirms Purchasing Manager approves exceptions in Replenish & Approve.

interpretation
critical

Regional Manager: read-only dashboard user who compares store performance and escalates cross-store transfer exceptions. Primary device: desktop or tablet.

CONCISE-AUTO: claim_006 confirms read-only dashboard use. claim_om_004 confirms read-only plus escalation.

interpretation
critical

Platform Automation: non-human lane that builds and serves traces, auto-approves routine replenishment within thresholds, generates alerts, and drives Monitor & Report.

CONCISE-AUTO: claim_om_001 and claim_om_003 confirm Platform Automation's role. This is a system actor, not a human user.

interpretation
critical

Governance & Audit: non-human lane that records audit logs, enforces GDPR controls, and provides traceability for compliance.

CONCISE-AUTO: claim_om_005 confirms Governance & Audit as a named lane. This is a system actor, not a human user.

decision

Customer Service Agent, Marketing Manager, Finance Manager, and Executive roles from the project brief are deferred to later phases. They are not elaborated in the spec map's phase-1 sections but are acknowledged as future roles.

CONCISE-AUTO: claim_sol_011 confirms customer service and marketing are later phases. The operating model does not include these roles, so they are deferred.

risk

User adoption risk: store employees may resist a new system if it is slower than their current workflow or requires too many taps on mobile. Mitigation: mobile-first design with summary-trace-by-default and offline tolerance.

CONCISE-AUTO: claim_022 is a confirmed high risk. The design principles from claim_sol_014 and claim_sol_013 directly mitigate this.

Primary workflows
The end-to-end operating chain mapped to the operating model stages.
interpretation
critical

Detect & Alert stage: Platform Automation monitors stock levels, sales velocity, and delivery schedules. When a product falls below reorder point or a delivery is late, the system generates an alert. Store Employee sees the alert on their mobile device.

CONCISE-AUTO: The operating model confirms Detect & Alert as the first stage. claim_010 confirms stock availability as the primary driver.

interpretation
critical

Trace Root Cause stage: Store Employee initiates the investigation. Platform Automation builds and serves the trace. The employee sees a summary trace with root cause highlighted, then progressively drills down into movement history, related orders, and supplier details.

CONCISE-AUTO: claim_om_001 confirms collaborative trace. claim_sol_014 confirms summary-trace-with-progressive-disclosure.

interpretation
critical

Replenish & Approve stage: Store Employee triggers a replenishment suggestion. Platform Automation auto-approves routine replenishment within thresholds. Purchasing Manager approves exceptions, large orders, and new supplier routes. The system pre-fills the order with recommended quantity based on sales velocity and lead time.

CONCISE-AUTO: claim_om_003 confirms hybrid approval. claim_sol_002 confirms the replenishment flow.

interpretation
critical

Receive & Put Away stage: Warehouse Team receives the delivery, scanning items and recording batch numbers and expiry dates for perishables. The system updates inventory levels and flags discrepancies (short shipment, damaged goods). Stock is put away and available for store replenishment.

CONCISE-AUTO: The operating model confirms Receive & Put Away as a Warehouse Team stage. claim_data_013 confirms batch tracking.

interpretation
critical

Monitor & Report stage: Platform Automation and Regional Manager continuously monitor KPIs (daily sales, stock levels, waste, delivery delays). Regional Manager escalates cross-store transfer exceptions to Purchasing or Warehouse. This is a separate continuous stage, not a sub-step of receiving.

CONCISE-AUTO: claim_om_002 confirms Monitor & Report as a separate stage. claim_om_004 confirms Regional Manager escalation.

interpretation
critical

Primary end-to-end journey — Stock issue resolution: (1) Store Employee sees a low-stock alert. (2) Opens product stock status. (3) Taps 'Trace' to see summary trace. (4) Drills down to root cause. (5) Taps 'Replenish'. (6) System pre-fills order. (7) Employee confirms and submits. (8) Order routes to Purchasing Manager or auto-approves. (9) Warehouse receives and put away. (10) Stock available for store.

CONCISE-AUTO: claim_sol_002 is the confirmed primary journey. This element maps it to the operating model stages.

interpretation

Secondary journey — Purchase order to shelf: (1) Purchasing Manager creates PO from replenishment suggestion or manually. (2) PO routes to supplier. (3) Warehouse receives delivery, scanning items and recording batches. (4) System updates inventory and flags discrepancies. (5) Stock put away. (6) Store requests transfer or receives auto-suggestion. (7) Warehouse picks and ships. (8) Store receives and confirms. (9) Shelf restocked.

CONCISE-AUTO: This is the confirmed secondary journey from the solution_shape board. It maps to the operating model stages.

risk

Risk: supplier delivery confirmations may arrive hours or days after physical receipt. The system must handle 'received but not confirmed' state without blocking downstream workflows. The PurchaseOrder status enum must include a 'received_unconfirmed' state to support this scenario.

CONCISE-AUTO: claim_data_008 is a confirmed data quality risk. User explicitly commented requesting the 'received_unconfirmed' state be added to the PurchaseOrder status enum during technical design.

Functional requirements
Testable, traceable requirements with IDs.
recommendation
critical

FR-001: The system shall allow a store employee to scan a product barcode and view current stock level, recent stock movements, and open purchase orders for that product at their location within 3 seconds.

CONCISE-AUTO: claim_008 confirms traceability as the core problem. claim_015 confirms mobile scanning. This requirement is testable and traceable.

recommendation
critical

FR-002: The system shall display a summary trace for any product, order, or delivery, showing root cause with a one-line explanation, with one-tap progressive drill-down to full movement history, related orders, and supplier details.

CONCISE-AUTO: claim_sol_014 is the confirmed traceability UX standard. This requirement operationalizes it.

recommendation
critical

FR-003: The system shall auto-approve replenishment orders within configured thresholds (e.g., quantity < X, cost < Y) and route exceptions to a Purchasing Manager for approval. Thresholds are tenant-level configuration, not hard-coded constants.

CONCISE-AUTO: claim_om_003 confirms hybrid approval. User confirmed the thresholds as configurable defaults.

recommendation
critical

FR-004: The system shall require batch number and expiry date for all perishable products during receiving, and shall prevent sale or transfer of expired batches.

CONCISE-AUTO: claim_data_013 confirms full batch tracking. This requirement enforces batch capture and expiry rules.

recommendation
critical

FR-005: The system shall record every stock change as a StockMovement with type, quantity, source, destination, batch (if applicable), reference, and timestamp. No stock change shall occur without a corresponding StockMovement record.

CONCISE-AUTO: claim_data_003 confirms ledger-style stock movements. This requirement enforces the ledger.

recommendation

FR-006: The system shall support effective-dated price records with start/end dates, allowing historical price lookup and future price scheduling. No two active price records for the same product and country shall have overlapping effective date ranges.

CONCISE-AUTO: claim_data_004 confirms price versioning. This requirement enforces effective-dated pricing.

recommendation
critical

FR-007: The system shall store both base currency and local currency amounts for all financial transactions, with exchange rate snapshots at transaction time.

CONCISE-AUTO: claim_data_012 confirms multi-currency pricing. This requirement enforces dual-currency storage.

recommendation
critical

FR-008: The system shall support offline tolerance for store-floor and warehouse mobile tasks (stock counts, receiving, transfers) with local queueing and sync when connection returns.

CONCISE-AUTO: claim_sol_013 confirms offline tolerance as table-stakes. This requirement operationalizes it.

recommendation
critical

FR-009: The system shall support GDPR controls including consent tracking, erasure capability, and data residency controls for customer PII.

CONCISE-AUTO: claim_data_009 confirms GDPR compliance as mandatory. This requirement enforces GDPR controls.

recommendation

FR-010: The system shall make financial data (sales, margins, payments) immutable once posted, with corrections applied as reversing entries rather than in-place edits.

CONCISE-AUTO: claim_data_010 confirms immutable financial records. This requirement enforces immutability.

decision

FR-011: The system shall support bulk operations (bulk updates, Excel/CSV imports and exports) for product catalog, price changes, and stock counts. Decision: bulk operations are in scope for phase 1.

CONCISE-AUTO: The original prompt explicitly lists bulk updates and Excel/CSV imports/exports. This is a phase-1 capability for inventory and purchasing.

risk

Risk: barcode/GTIN data will have duplicates, missing values, and conflicts across suppliers. The system must handle barcode conflicts gracefully with store context and supplier data for resolution.

CONCISE-AUTO: claim_data_007 is a confirmed data quality risk. FR requirements must accommodate conflict-tolerant barcode resolution.

Screen / page inventory
Every screen needed for the phase-1 journeys, with purpose and key elements.
recommendation
critical

Screen: Mobile Dashboard (Store Employee). Purpose: landing screen with today's alerts, low-stock items, and pending tasks. Key elements: alert list, low-stock widget, task list, barcode scan button.

CONCISE-AUTO: The primary journey starts with an alert on mobile. This screen is the entry point for store employees.

recommendation
critical

Screen: Product Stock Status (Store Employee, mobile). Purpose: show current quantity, recent movements, open POs, and summary trace for a scanned or searched product. Key elements: barcode scan, quantity on hand, quantity available, batch list, summary trace card, 'Trace' button, 'Replenish' button, 'Transfer' button.

CONCISE-AUTO: claim_sol_014 confirms summary-trace-with-progressive-disclosure. This screen is the core traceability surface.

recommendation
critical

Screen: Trace Detail (Store Employee, mobile). Purpose: progressive drill-down into full movement history, related orders, and supplier details. Key elements: movement timeline, order links, supplier info, root cause explanation, corrective action buttons.

CONCISE-AUTO: claim_sol_014 confirms progressive drill-down. This screen is the expanded trace view.

recommendation
critical

Screen: Replenishment Suggestion (Store Employee, mobile). Purpose: show suggested order with pre-filled quantity based on sales velocity and lead time. Key elements: product, suggested quantity, supplier, expected delivery date, 'Confirm' button, 'Edit' button.

CONCISE-AUTO: claim_om_003 confirms auto-approval for routine replenishment. This screen is where the employee confirms the suggestion.

recommendation
critical

Screen: Purchase Order Approval (Purchasing Manager, desktop). Purpose: review and approve exception replenishment orders. Key elements: order details, supplier, cost, reason for exception, 'Approve' button, 'Reject' button, 'Edit' button.

CONCISE-AUTO: claim_om_003 confirms Purchasing Manager approves exceptions. This screen is the approval surface.

recommendation
critical

Screen: Delivery Receiving (Warehouse Team, desktop or rugged handheld). Purpose: scan items, record batch numbers and expiry dates, flag discrepancies. Key elements: PO lookup, line item list, barcode scan, batch number input, expiry date input, condition dropdown, discrepancy flag, 'Confirm Receipt' button.

CONCISE-AUTO: claim_data_013 confirms batch tracking. This screen is where batch data is captured.

recommendation

Screen: Stock Count (Store Employee or Warehouse Team, mobile or handheld). Purpose: enter counted quantities and flag discrepancies. Key elements: product scan, counted quantity input, expected quantity, discrepancy flag, notes, 'Submit Count' button.

CONCISE-AUTO: claim_data_003 confirms ledger-style movements. Stock counts generate count_adjustment movements.

recommendation

Screen: Executive Dashboard (Regional Manager, desktop). Purpose: compare store performance with drill-down from company to transaction. Key elements: KPI cards (daily sales, profit, stock levels, waste, delivery delays), store comparison table, drill-down charts, export button.

CONCISE-AUTO: claim_013 confirms executive drill-down. This screen is the analytics surface.

recommendation

Screen: Product Catalog Management (Purchasing Manager, desktop). Purpose: create, edit, and manage products, variants, barcodes, and categories. Key elements: product list with filters, product form, variant management, barcode validation, bulk import/export.

CONCISE-AUTO: claim_data_001 confirms Product as a core entity. This screen is the catalog management surface.

recommendation

Screen: Supplier Management (Purchasing Manager, desktop). Purpose: manage supplier directory, performance scores, and delivery schedules. Key elements: supplier list, supplier detail with reliability score, PO history, delivery schedule.

CONCISE-AUTO: claim_data_001 confirms Supplier as a core entity. This screen is the supplier management surface.

decision

Screen: Stock Transfer Management (Warehouse Team, desktop). Purpose: create and track stock transfers between locations. Key elements: transfer list, transfer form with from/to locations, line items with batch selection, status tracking.

CONCISE-AUTO: claim_data_001 confirms StockTransfer as a core entity. This screen is the transfer management surface.

risk

Risk: mobile screens must be optimized for speed and low tap count. Every mobile screen must be usable in under 5 seconds for common tasks (stock check, scan, replenish confirm).

CONCISE-AUTO: claim_022 confirms user adoption risk. This risk element sets a performance target for mobile screens.

Data model
Every entity and field, complete from the needs_data board.
interpretation
critical

Product: id, sku, gtin/barcode, name, description, brand_id, category_id, parent_product_id (nullable, for variants), is_global (bool), country_code (nullable for local products), unit_of_measure, created_at, updated_at, deleted_at. Relationships: belongs to Brand, Category, and optionally parent Product; has many Price records, InventoryLevel records, PromotionProduct links.

CONCISE-AUTO: This is the confirmed Product entity from the needs_data board. It is the backbone of the catalog.

interpretation
critical

Store: id, name, address, country_code, region_id, timezone, opening_hours, status, phone_primary, phone_emergency, email_orders, email_manager. Warehouse: id, name, address, country_code, region_id, capacity, status. Both link to Organization hierarchy (company → country → region → location).

CONCISE-AUTO: This is the confirmed Store and Warehouse entity from the needs_data board.

interpretation
critical

Supplier: id, name, contact_info, payment_terms, lead_time_days, reliability_score (derived), status. PurchaseOrder: id, supplier_id, warehouse_id (destination), order_date, expected_delivery_date, actual_delivery_date, status (draft/sent/confirmed/partial/received/received_unconfirmed/cancelled), total_cost. PurchaseOrderLine: id, purchase_order_id, product_id, quantity_ordered, quantity_received, unit_cost.

CONCISE-AUTO: This is the confirmed Supplier and PurchaseOrder entity from the needs_data board. User explicitly requested the 'received_unconfirmed' state be added to the PurchaseOrder status enum.

interpretation
critical

StockMovement: id, product_id, batch_id (nullable, required for perishable products), location_id (store or warehouse), movement_type (receipt/transfer_out/transfer_in/sale/return/damage/count_adjustment/expiry), quantity_change (+/-), reference_type, reference_id (links to PurchaseOrder, StockTransfer, Sale, etc.), created_at, created_by. This is the ledger that answers 'why' questions.

CONCISE-AUTO: This is the confirmed StockMovement entity from the needs_data board. It is the ledger backbone.

interpretation
critical

InventoryLevel: id, product_id, batch_id (nullable), location_id, quantity_on_hand, quantity_reserved, quantity_available (derived), reorder_point, max_stock, last_counted_at. This is the fast-read current state, rebuilt from StockMovement ledger.

CONCISE-AUTO: This is the confirmed InventoryLevel entity from the needs_data board. It is the materialized read model.

interpretation
critical

StockTransfer: id, from_location_id, to_location_id, status (draft/in_transit/received/cancelled), created_at, shipped_at, received_at. StockTransferLine: id, stock_transfer_id, product_id, batch_id (nullable), quantity_sent, quantity_received. Links to StockMovement records for both outbound and inbound.

CONCISE-AUTO: This is the confirmed StockTransfer entity from the needs_data board.

interpretation

Customer: id, first_name, last_name, email, phone, address, country_code, consent_gdpr (bool), consent_marketing (bool), created_at, updated_at, deleted_at. LoyaltyAccount: id, customer_id, points_balance, tier, joined_at. Order: id, customer_id, loyalty_account_id (nullable), store_id (for click-and-collect) or delivery_address, order_date, status, total_amount, currency.

CONCISE-AUTO: This is the confirmed Customer, LoyaltyAccount, and Order entity from the needs_data board. Deferred to later phases but included in the data model for completeness.

interpretation

Employee: id, first_name, last_name, email, phone, role_id, status, hire_date. EmployeeLocation: id, employee_id, location_id, location_type (store/warehouse/region/country), is_primary. Shift: id, employee_id, location_id, start_time, end_time, role_during_shift. Task: id, location_id, assigned_to (employee_id), title, description, due_at, status, priority.

CONCISE-AUTO: This is the confirmed Employee, EmployeeLocation, Shift, and Task entity from the needs_data board.

interpretation

Price: id, product_id, country_code (nullable for global), currency, amount_base, amount_local, exchange_rate_snapshot, effective_from, effective_to (nullable), status (draft/approved/active/expired), approved_by, approved_at. Promotion: id, name, description, country_code (nullable), start_date, end_date, discount_type (percentage/fixed/bogo), discount_value, status. PromotionProduct: id, promotion_id, product_id.

CONCISE-AUTO: This is the confirmed Price and Promotion entity from the needs_data board. Promotion is deferred to later phases but included for completeness.

interpretation
critical

Batch: id, product_id, batch_number, expiry_date, received_date, supplier_id (nullable), status (active/expired/quarantined/depleted). Each batch is linked to StockMovement records and InventoryLevel records for per-batch tracking.

CONCISE-AUTO: This is the confirmed Batch entity from the needs_data board. It is a dedicated first-class entity.

interpretation

Complaint: id, customer_id, order_id (nullable), type (product_quality/delivery_delay/wrong_item/missing_item/other), description, status (open/investigating/resolved/closed), priority, assigned_to, created_at, resolved_at. Return: id, order_id, customer_id, reason, status (requested/approved/received/refunded/rejected), refund_amount, created_at. Payment: id, order_id, amount, currency, method, status, transaction_reference, created_at.

CONCISE-AUTO: This is the confirmed Complaint, Return, and Payment entity from the needs_data board. Deferred to later phases but included for completeness.

decision

Indexing strategy: foreign-key columns (product_id, location_id, supplier_id, batch_id, purchase_order_id, stock_transfer_id) and frequently-filtered columns (status, movement_type, effective_from, effective_to, expiry_date) are indexed by default.

CONCISE-AUTO: The standard patterns require indexing foreign-key and frequently-filtered columns. This is a default data model decision.

decision

Soft delete: user-facing entities (Product, Customer, Supplier, Employee) use soft delete with deleted_at timestamp. Compliance erasure (GDPR) is handled separately via hard delete with audit trail.

CONCISE-AUTO: The standard patterns require soft delete for user-facing entities. GDPR erasure is the exception.

risk

Risk: barcode conflicts across suppliers. The data model must support conflict-tolerant barcode resolution with store context and supplier data. Barcodes are not globally unique.

CONCISE-AUTO: claim_data_007 is a confirmed data quality risk. The data model must accommodate non-unique barcodes.

Business rules
Validations, calculations, and state transitions.
interpretation
critical

BR-001: StockMovement.quantity_change must never result in InventoryLevel.quantity_on_hand < 0. Any movement that would cause negative stock is rejected with an error.

CONCISE-AUTO: This is a confirmed business rule from the needs_data board. It protects inventory integrity.

interpretation

BR-002: Price.effective_from must be >= today for new price records. Price.effective_to must be > Price.effective_from. No two active Price records for the same product and country can have overlapping effective date ranges.

CONCISE-AUTO: This is a confirmed business rule from the needs_data board. It enforces price versioning integrity.

interpretation

BR-003: PurchaseOrderLine.quantity_received must be <= PurchaseOrderLine.quantity_ordered. Receiving more than ordered requires a new purchase order or an explicit override with manager approval.

CONCISE-AUTO: This is a confirmed business rule from the needs_data board. It prevents over-receiving.

interpretation
critical

BR-004: Batch.expiry_date must be > Batch.received_date. Batches with expiry_date in the past are automatically marked as expired. Expired batches cannot be sold or transferred; they can only be moved to waste or returned to supplier.

CONCISE-AUTO: This is a confirmed business rule from the needs_data board. It enforces expiry handling.

interpretation

BR-005: StockTransfer.status transitions: draft → in_transit → received. A transfer cannot be marked received unless all StockTransferLine.quantity_sent > 0. Received quantity can be less than sent (damage in transit) but never more.

CONCISE-AUTO: This is a confirmed business rule from the needs_data board. It enforces transfer state transitions.

interpretation

BR-006: Payment records are immutable once status = 'completed'. Corrections require a reversing Payment record with negative amount and a reference to the original payment.

CONCISE-AUTO: This is a confirmed business rule from the needs_data board. It enforces financial immutability.

interpretation
critical

BR-007: Customer PII can only be accessed by users with customer_service or admin role. Customer.consent_gdpr must be true before any marketing communication. Customer data deletion requests must be fulfilled within 30 days (GDPR).

CONCISE-AUTO: This is a confirmed business rule from the needs_data board. It enforces GDPR compliance.

interpretation

BR-008: Employee can only be assigned to locations within their country. Regional managers can view all stores in their region but cannot edit data outside their region. Corporate users have full access.

CONCISE-AUTO: This is a confirmed business rule from the needs_data board. It enforces location scoping.

decision

BR-009: Replenishment auto-approval thresholds: orders with total cost below a configurable threshold (default: 5,000 base currency) and quantity below a configurable threshold (default: 100 units) are auto-approved. All other orders require Purchasing Manager approval. Thresholds are tenant-level configuration, not hard-coded constants.

CONCISE-AUTO: claim_om_003 confirms hybrid approval. User confirmed the thresholds as configurable defaults.

interpretation

BR-010: PurchaseOrder status transitions must include received_unconfirmed as a valid state. A PO enters received_unconfirmed when physical receipt is recorded but supplier confirmation has not yet arrived. Downstream workflows (putaway, transfer, replenishment) must not be blocked by this state.

CONCISE-AUTO: User explicitly requested this state. This business rule formalizes the transition and ensures downstream workflows are not blocked.

Permissions / access model
What each role can do, with location scoping.
interpretation
critical

Store Employee: can view and edit stock levels, stock counts, and replenishment suggestions for their assigned store. Can initiate replenishment and stock transfers. Cannot approve exception orders or view other stores' data.

CONCISE-AUTO: claim_004 and claim_om_001 confirm Store Employee drives Detect & Alert and Trace Root Cause. claim_data_006 confirms store-level scoping.

interpretation
critical

Warehouse Team: can view and edit receiving, putaway, picking, and transfer data for their assigned warehouse. Can confirm deliveries and record batch data. Cannot approve purchase orders or view store-level data outside their warehouse scope.

CONCISE-AUTO: claim_005 confirms Warehouse Team drives Receive & Put Away. claim_data_006 confirms location scoping.

interpretation
critical

Purchasing Manager: can view and edit supplier data, purchase orders, and delivery schedules. Can approve exception replenishment orders. Can view all stores and warehouses in their country for purchasing decisions.

CONCISE-AUTO: claim_om_003 confirms Purchasing Manager approves exceptions. claim_data_006 confirms country-level scoping.

interpretation
critical

Regional Manager: read-only access to dashboards and reports for their region. Can escalate cross-store transfer exceptions to Purchasing or Warehouse. Cannot edit operational data.

CONCISE-AUTO: claim_om_004 confirms read-only plus escalation. claim_data_006 confirms region-level scoping.

interpretation

Platform Automation: system-level permissions to read all operational data for alert generation, trace building, and auto-approval. Cannot initiate user-facing actions without a trigger.

CONCISE-AUTO: claim_om_001 and claim_om_003 confirm Platform Automation's role. This is a system actor with defined permissions.

interpretation

Governance & Audit: system-level permissions to record audit logs, enforce GDPR controls, and provide traceability for compliance. Cannot modify operational data.

CONCISE-AUTO: claim_om_005 confirms Governance & Audit as a named lane. This is a system actor with defined permissions.

decision
critical

RBAC model: role-based access control with location scoping. Each user is assigned a role and one or more locations (store, warehouse, region, country). Permissions are role + location scope combined.

CONCISE-AUTO: claim_data_006 confirms role-based access with store-level scoping. This decision formalizes the RBAC model.

decision

Field-level security: customer PII fields (email, phone, address) are masked for roles without customer_service or admin permission. Financial fields (margin, cost) are masked for Store Employee and Warehouse Team.

CONCISE-AUTO: The standard patterns require field-level authorization. claim_data_009 confirms GDPR controls for PII.

risk
critical

Risk: unauthorized access to customer PII could result in GDPR fines. Mitigation: field-level security, audit logging of PII access, and role-based access control.

CONCISE-AUTO: claim_data_009 is a confirmed critical risk. This element flags the mitigation strategy.

Integrations
External systems and data flows.
interpretation
critical

POS integration: provides sales transactions (product, quantity, price, timestamp, store), payment details, and customer loyalty id if captured. This is the primary source of sales data. Integration via iPaaS middleware.

CONCISE-AUTO: claim_028 confirms hybrid integration strategy. The needs_data board confirms POS as the primary sales data source.

interpretation

E-commerce integration: provides online orders (customer, items, quantities, delivery address, order status), and inventory levels if the e-commerce platform manages its own stock. Integration via iPaaS middleware.

CONCISE-AUTO: claim_028 confirms hybrid integration strategy. The needs_data board confirms e-commerce as an integration target.

interpretation

Accounting system integration: receives sales summaries, payment records, and expense data. The accounting system is the system of record for general ledger, not this app. Integration via iPaaS middleware.

CONCISE-AUTO: claim_028 confirms hybrid integration strategy. claim_020 confirms accounting is an integration target.

interpretation

Supplier feeds: provide product catalogs (sku, barcode, description, unit cost), availability, and lead times. Supplier data quality varies significantly and requires validation on import. Integration via iPaaS or custom connectors.

CONCISE-AUTO: claim_028 confirms hybrid integration strategy. The needs_data board confirms supplier feeds as a data dependency.

interpretation

Delivery partner integrations: provide tracking numbers, delivery status updates, and proof of delivery. This data links to Order for the 'why did an online order arrive incomplete' traceability scenario. Integration via iPaaS middleware.

CONCISE-AUTO: claim_028 confirms hybrid integration strategy. The needs_data board confirms delivery partner integration.

interpretation

Warehouse management system (WMS) integration: provides receiving confirmations, picking status, and stock counts. If the WMS is the system of record for warehouse operations, this app syncs with it rather than replacing it. Integration via iPaaS or custom connectors.

CONCISE-AUTO: claim_028 confirms hybrid integration strategy. The needs_data board confirms WMS integration.

interpretation

Exchange rate provider integration: automated daily feed from ECB or Open Exchange Rates. The feed must provide daily rates for all currencies in use. Manual override by finance team is supported for exceptional cases.

CONCISE-AUTO: claim_data_017 confirms hybrid exchange rate sourcing. This is a confirmed integration.

risk
critical

Risk: integrating with hundreds of heterogeneous POS, e-commerce, and warehouse systems across multiple countries will be the largest engineering challenge. Mitigation: hybrid iPaaS + custom connectors, phased rollout by country.

CONCISE-AUTO: claim_021 is a confirmed critical risk. This element flags the mitigation strategy.

decision

Integration error handling: all integrations must have consistent error responses, retry with exponential backoff, and dead-letter queues for failed messages. Integration failures must surface as alerts in the system.

CONCISE-AUTO: The standard patterns require consistent error handling and rate limiting for public endpoints. Integration failures must not silently drop data.

Non-functional requirements
Performance, reliability, security, and compliance targets.
recommendation
critical

NFR-001: The system shall support 1,000-5,000 concurrent users across all roles with p95 latency < 500ms for API responses and p99 latency < 2s for dashboard queries. These latency targets are tenant-level configuration, not hard-coded constants.

CONCISE-AUTO: claim_030 confirms 1,000-5,000 concurrent users. User confirmed the latency targets as configurable defaults.

recommendation
critical

NFR-002: Data freshness SLAs: stock levels and order status within 60 seconds, dashboards within 15 minutes, scheduled reports daily. These SLAs define the boundary between near-real-time operational data and batch analytics. These SLAs are tenant-level configuration, not hard-coded constants.

CONCISE-AUTO: claim_029 confirms hybrid sync. User confirmed the freshness SLAs as configurable defaults.

recommendation

NFR-003: The system shall store all timestamps in UTC and display them in the user's local timezone. Shift scheduling and delivery schedules must be timezone-aware.

CONCISE-AUTO: claim_017 confirms multi-timezone usage. This NFR enforces timezone-aware storage and display.

recommendation

NFR-004: The system shall support multi-language UI (at minimum: English, plus the primary languages of the 4-10 operating countries) and multi-currency display with locale-specific number and date formats. The exact language list is a launch-configuration item, not a spec blocker.

CONCISE-AUTO: claim_031 confirms 4-10 countries. User confirmed English plus primary languages as the correct default.

recommendation
critical

NFR-005: The system shall comply with GDPR: consent tracking, erasure capability within 30 days, data residency controls, and audit logging of PII access.

CONCISE-AUTO: claim_data_009 confirms GDPR compliance as mandatory. This NFR enforces GDPR controls.

recommendation
critical

NFR-006: The system shall support offline tolerance for store-floor and warehouse mobile tasks with local queueing and sync when connection returns. Offline data must not be lost on app restart.

CONCISE-AUTO: claim_sol_013 confirms offline tolerance as table-stakes. This NFR enforces offline support.

recommendation

NFR-007: The system shall maintain an audit log of all data changes, including who made the change, when, and what changed. Audit logs must be immutable and retained for at least 7 years for financial data. The retention period is tenant-level configuration, not a hard-coded constant.

CONCISE-AUTO: claim_data_010 confirms immutable financial records. User confirmed the 7-year retention as a configurable default.

recommendation

NFR-008: The system shall support the operating model KPIs: daily sales, profit, stock levels, popular products, low-stock items, waste, delivery delays, customer satisfaction, employee workload, and store comparisons. Each KPI must be drillable from company level to country, region, store, department, product, or transaction.

CONCISE-AUTO: claim_spec_009 confirms the operating model KPIs. claim_013 confirms drill-down capability.

risk

Risk: multi-country regulatory compliance (GDPR, local labor laws, food safety regulations, tax compliance) varies by jurisdiction. Mitigation: country-specific compliance configuration, legal review per country before launch.

CONCISE-AUTO: claim_024 is a confirmed high risk. This element flags the mitigation strategy.

tradeoff

Tradeoff: ledger completeness vs mobile query speed. Resolution: materialized InventoryLevel read model with async rebuild from the StockMovement ledger, plus targeted caching for hot product queries. Accept eventual consistency of seconds for read models.

CONCISE-AUTO: claim_sol_004 is a confirmed tradeoff. The resolution from the solution_shape board must be carried into the spec map.

Acceptance criteria
Observable given/when/then statements.
recommendation
critical

AC-001: Given a store employee scans a product barcode on their mobile device, when the product is out of stock, then the system displays a summary trace showing root cause (e.g., 'Supplier delivery delayed by 3 days') within 3 seconds, with one-tap access to full movement history.

CONCISE-AUTO: claim_012 confirms the traceability outcome. This acceptance criterion is observable and testable.

recommendation

AC-002: Given an executive opens the dashboard, when they select a country, region, or store, then the system displays daily sales, margins, and waste KPIs for that scope within 2 seconds, with drill-down to a single transaction.

CONCISE-AUTO: claim_013 confirms the executive drill-down outcome. This acceptance criterion is observable and testable.

recommendation

AC-003: Given a warehouse team member receives a delivery, when they scan items and record batch numbers and expiry dates, then the system updates inventory levels immediately and flags any discrepancies (short shipment, damaged goods) within 5 seconds.

CONCISE-AUTO: claim_014 confirms the warehouse outcome. This acceptance criterion is observable and testable.

recommendation
critical

AC-004: Given a store employee triggers a replenishment suggestion, when the order total is below the auto-approval threshold, then the system auto-approves the order and routes it to the supplier without Purchasing Manager intervention. When the order total exceeds the threshold, then the system routes it to a Purchasing Manager for approval.

CONCISE-AUTO: claim_om_003 confirms hybrid approval. This acceptance criterion tests the auto-approval behavior.

recommendation
critical

AC-005: Given a batch has an expiry date in the past, when any user attempts to sell or transfer that batch, then the system rejects the action with an error message and marks the batch as expired.

CONCISE-AUTO: claim_data_013 confirms batch tracking. This acceptance criterion tests expiry enforcement.

recommendation
critical

AC-006: Given a store employee is in an area with no connectivity, when they perform a stock count or receiving task, then the system queues the data locally and syncs when connection returns, without data loss.

CONCISE-AUTO: claim_sol_013 confirms offline tolerance. This acceptance criterion tests offline behavior.

recommendation
critical

AC-007: Given a customer requests data erasure under GDPR, when the request is processed, then the system deletes or anonymizes all customer PII within 30 days and records the erasure in the audit log.

CONCISE-AUTO: claim_data_009 confirms GDPR compliance. This acceptance criterion tests erasure capability.

recommendation

AC-008: Given a regional manager opens the store comparison dashboard, when they select two or more stores, then the system displays side-by-side KPIs (sales, margin, waste, delivery delays) with the ability to drill down to transaction level for each store.

CONCISE-AUTO: claim_spec_009 confirms store comparisons as a KPI. This acceptance criterion tests the comparison feature.

risk

Risk: barcode conflicts may cause wrong product resolution. Acceptance criterion: given a barcode that maps to multiple products, when a user scans it, then the system displays a disambiguation list with store context and supplier data for selection.

CONCISE-AUTO: claim_data_007 is a confirmed data quality risk. This acceptance criterion tests conflict resolution.

Out of scope
Explicitly excluded capabilities to prevent reintroduction.
interpretation

Out of scope: point-of-sale system (POS is an integration target), e-commerce storefront (online shops are integration targets), accounting general ledger and tax filing (accounting system is an integration target), payroll (out of scope).

CONCISE-AUTO: claim_sol_010 is confirmed excluded scope. This element mirrors it to prevent reintroduction.

interpretation

Out of scope: employee scheduling optimization (shift planning is in scope for assignment and tracking, but automated scheduling optimization is out of scope), equipment maintenance management (equipment issues are tracked as tasks, but full CMMS is out of scope).

CONCISE-AUTO: This is confirmed excluded scope from the solution_shape board. It prevents scope creep into HR optimization or CMMS.

interpretation

Deferred (not out of scope, but later phases): Customer & Order Resolution (complaint management, returns and refunds, loyalty account management, unified customer service view) and Marketing & Promotions (promotion creation and approval workflow, loyalty campaign management, promotion effectiveness analysis).

CONCISE-AUTO: claim_sol_011 confirms these are later phases, not excluded. This element distinguishes deferred from out-of-scope.

decision

Out of scope: SMS notifications, push notifications, passwordless authentication, onboarding flows, and theming are not in the selected feature tags and are not elaborated in this spec map.

CONCISE-AUTO: The SCOPE HINTS explicitly list these as out of scope by default. This element prevents silent addition.

risk
critical

Risk: scope creep into deferred modules (Customer & Order Resolution, Marketing) during phase 1. Mitigation: explicit deferred markers in the spec map, with no phase-1 elaboration for deferred sections.

CONCISE-AUTO: claim_023 is a confirmed critical risk. This element flags the scope creep mitigation.

Remaining assumptions
Unconfirmed claims being relied on.
hypothesis

Assumption: the auto-approval thresholds (default: 5,000 base currency, 100 units) are reasonable defaults. The user has accepted these as configurable defaults rather than hard-coded values.

CONCISE-AUTO: claim_om_003 confirms hybrid approval. User explicitly accepted the thresholds as configurable defaults.

hypothesis

Assumption: the data freshness SLAs (stock levels within 60 seconds, dashboards within 15 minutes) are acceptable. The user has accepted these as configurable defaults rather than hard-coded values.

CONCISE-AUTO: claim_029 confirms hybrid sync. User explicitly accepted the freshness SLAs as configurable defaults.

hypothesis

Assumption: the latency targets (p95 < 500ms, p99 < 2s) are appropriate for the confirmed 1,000-5,000 concurrent users. The user has accepted these as configurable defaults rather than hard-coded values.

CONCISE-AUTO: claim_030 confirms concurrent users. User explicitly accepted the latency targets as configurable defaults.

hypothesis

Assumption: the audit log retention period of 7 years for financial data is sufficient. The user has accepted this as a configurable default rather than a hard-coded value.

CONCISE-AUTO: claim_data_010 confirms immutable financial records. User explicitly accepted the 7-year retention as a configurable default.

hypothesis

Assumption: the primary languages for multi-language UI are English plus the primary languages of the 4-10 operating countries. The user has accepted this as a configurable default rather than a hard-coded value.

CONCISE-AUTO: claim_031 confirms 4-10 countries. User explicitly accepted English plus primary languages as the correct default.

risk

Risk: the specific regulatory requirements per country (GDPR, local labor laws, food safety regulations, tax compliance) are not fully enumerated. The spec map assumes GDPR as the baseline but does not cover country-specific regulations in detail.

CONCISE-AUTO: claim_024 confirms regulatory risk but not the specific requirements per country. This is a known gap that must be addressed before launch.

decision
critical

Configurable defaults decision: all five open assumptions (auto-approval thresholds, freshness SLAs, latency targets, audit retention, languages) are accepted as configurable defaults rather than hard-coded values. Implementation should treat thresholds, SLAs, latency targets, retention, and languages as tenant-level configuration, not constants.

CONCISE-AUTO: The user explicitly accepted all five assumptions as configurable defaults. This decision formalizes the configuration approach.

Workflow / Roles
Sandbox
Swimlane workflow
Sandbox
Specification

Supermarket and retail chain management application — Specification

Product overview

A unified retail operations command center that gives every role — from shop floor to executive suite — one traceable source of truth for stock, orders, suppliers, and performance across hundreds of locations and multiple countries. The core differentiator is traceability: any user can answer 'why' questions (why is milk out of stock, why is this delivery late, why is this store wasting more) in seconds without calling another department.

Problem statement

Users cannot easily trace everyday situations like why milk is out of stock or which supplier caused a delayed delivery because data is siloed across systems. The underlying job-to-be-done is operational visibility: giving every role the right information at the right time to make decisions without calling other departments. Improving stock availability is the primary business driver; waste reduction and executive visibility are important secondary outcomes.

Target users & roles

  • Store Employee — Shop floor staff using mobile devices for stock checks, price lookups, task completion, barcode scanning, and initiating replenishment.
  • Warehouse Team — Receiving, putaway, picking, transfers, and replenishment staff using desktop terminals or rugged handheld devices with barcode scanners.
  • Purchasing Manager — Back-office user managing suppliers, purchase orders, delivery schedules, and costs. Approves exceptions and large orders.
  • Regional Manager — Read-only dashboard user who compares store performance and escalates cross-store transfer exceptions.
  • Platform Automation — Non-human system actor that builds and serves traces, auto-approves routine replenishment, generates alerts, and drives monitoring.
  • Governance & Audit — Non-human system actor that records audit logs, enforces GDPR controls, and provides traceability for compliance.

User journeys

Stock Issue Resolution (Primary)

  1. Store Employee sees a low-stock alert on their mobile device or scans a product showing a problem.
  2. Employee opens the product's stock status screen showing current quantity, recent movements, and open purchase orders.
  3. Employee taps 'Trace' to see a summary trace with root cause highlighted in a one-line explanation.
  4. Employee progressively drills down into full movement history, related orders, and supplier details.
  5. Employee taps 'Replenish' to trigger a suggested purchase order or stock transfer.
  6. System pre-fills the order with recommended quantity based on sales velocity and lead time.
  7. Employee confirms and submits; the order auto-approves if within thresholds or routes to Purchasing Manager for exception approval.
  8. Warehouse Team receives the delivery, records batch numbers and expiry dates, and puts stock away.
  9. Stock becomes available for the store, and the employee sees confirmation with expected arrival date.

Purchase Order to Shelf (Secondary)

  1. Purchasing Manager creates a purchase order from a replenishment suggestion or manually.
  2. The order routes to the supplier with expected delivery date.
  3. Warehouse Team receives the delivery, scanning items and recording batch numbers and expiry dates for perishables.
  4. System updates inventory levels and flags any discrepancies (short shipment, damaged goods).
  5. Stock is put away and available for store replenishment.
  6. Store team requests a transfer or receives an auto-generated replenishment suggestion.
  7. Warehouse picks and ships the transfer.
  8. Store receives and confirms; shelf is restocked.

Functional requirements

FR-001: Barcode Scan Stock Lookup

The system shall allow a store employee to scan a product barcode and view current stock level, recent stock movements, and open purchase orders for that product at their location within 3 seconds. This serves the traceability problem (claim_008) and mobile scanning context (claim_015).

Acceptance criteria:

  • Given a store employee scans a product barcode on their mobile device, when the product exists in the catalog, then the system displays current stock level, recent movements, and open purchase orders within 3 seconds.

FR-002: Summary Trace with Progressive Drill-Down

The system shall display a summary trace for any product, order, or delivery, showing root cause with a one-line explanation, with one-tap progressive drill-down to full movement history, related orders, and supplier details. This operationalizes the confirmed traceability UX standard (claim_sol_014).

Acceptance criteria:

  • Given a store employee opens a product's stock status, when the product is out of stock, then the system displays a summary trace showing root cause (e.g., 'Supplier delivery delayed by 3 days') with one-tap access to full movement history.

FR-003: Hybrid Replenishment Approval

The system shall auto-approve replenishment orders within configured thresholds (quantity and cost) and route exceptions to a Purchasing Manager for approval. Thresholds are tenant-level configuration, not hard-coded constants. This implements the confirmed hybrid approval decision (claim_om_003).

Acceptance criteria:

  • Given a store employee triggers a replenishment suggestion, when the order total is below the auto-approval threshold, then the system auto-approves the order and routes it to the supplier without Purchasing Manager intervention.
  • Given a store employee triggers a replenishment suggestion, when the order total exceeds the threshold, then the system routes it to a Purchasing Manager for approval.

FR-004: Batch and Expiry Capture

The system shall require batch number and expiry date for all perishable products during receiving, and shall prevent sale or transfer of expired batches. This enforces the confirmed full batch tracking decision (claim_data_013).

Acceptance criteria:

  • Given a warehouse team member receives a delivery of perishable products, when they scan items, then the system requires batch number and expiry date before confirming receipt.
  • Given a batch has an expiry date in the past, when any user attempts to sell or transfer that batch, then the system rejects the action with an error message and marks the batch as expired.

FR-005: Ledger-Style Stock Movements

The system shall record every stock change as a StockMovement with type, quantity, source, destination, batch (if applicable), reference, and timestamp. No stock change shall occur without a corresponding StockMovement record. This enforces the confirmed ledger model (claim_data_003).

Acceptance criteria:

  • Given any stock change occurs (receipt, transfer, sale, return, damage, count adjustment, expiry), when the change is processed, then a StockMovement record is created with type, quantity, source, destination, batch, reference, and timestamp.

FR-006: Effective-Dated Price Records

The system shall support effective-dated price records with start/end dates, allowing historical price lookup and future price scheduling. No two active price records for the same product and country shall have overlapping effective date ranges. This enforces the confirmed price versioning decision (claim_data_004).

Acceptance criteria:

  • Given a purchasing manager creates a new price record, when the effective date range overlaps an existing active price for the same product and country, then the system rejects the new record with an error.

FR-007: Multi-Currency Storage

The system shall store both base currency and local currency amounts for all financial transactions, with exchange rate snapshots at transaction time. This enforces the confirmed multi-currency decision (claim_data_012).

Acceptance criteria:

  • Given a financial transaction occurs in a local currency, when the transaction is recorded, then the system stores both local currency amount and base currency amount with an exchange rate snapshot.

FR-008: Offline Tolerance for Mobile Tasks

The system shall support offline tolerance for store-floor and warehouse mobile tasks (stock counts, receiving, transfers) with local queueing and sync when connection returns. This operationalizes the confirmed offline tolerance principle (claim_sol_013).

Acceptance criteria:

  • Given a store employee is in an area with no connectivity, when they perform a stock count or receiving task, then the system queues the data locally and syncs when connection returns, without data loss.

FR-009: GDPR Controls

The system shall support GDPR controls including consent tracking, erasure capability, and data residency controls for customer PII. This enforces the confirmed GDPR compliance requirement (claim_data_009).

Acceptance criteria:

  • Given a customer requests data erasure under GDPR, when the request is processed, then the system deletes or anonymizes all customer PII within 30 days and records the erasure in the audit log.

FR-010: Immutable Financial Records

The system shall make financial data (sales, margins, payments) immutable once posted, with corrections applied as reversing entries rather than in-place edits. This enforces the confirmed financial immutability rule (claim_data_010).

Acceptance criteria:

  • Given a payment record has status 'completed', when any user attempts to edit the record in place, then the system rejects the edit and requires a reversing entry.

FR-011: Bulk Operations and Import/Export

The system shall support bulk operations (bulk updates, Excel/CSV imports and exports) for product catalog, price changes, and stock counts. This is a phase-1 capability for inventory and purchasing per the original prompt.

Acceptance criteria:

  • Given a purchasing manager uploads a CSV file with product catalog data, when the import is processed, then the system validates each row and reports success or error per row.

FR-012: Multi-Language and Locale Support

The system shall support multi-language UI (at minimum: English plus the primary languages of the 4-10 operating countries) and multi-currency display with locale-specific number and date formats. This enforces the confirmed multi-country requirement (claim_031).

Acceptance criteria:

  • Given a user selects their preferred language, when they navigate the UI, then all labels and messages display in the selected language.

FR-013: Timezone-Aware Timestamps

The system shall store all timestamps in UTC and display them in the user's local timezone. Shift scheduling and delivery schedules must be timezone-aware. This enforces the confirmed multi-timezone requirement (claim_017).

Acceptance criteria:

  • Given a user in a different timezone views a timestamp, when the timestamp is displayed, then it appears in the user's local timezone.

FR-014: Audit Logging

The system shall maintain an audit log of all data changes, including who made the change, when, and what changed. Audit logs must be immutable and retained for at least 7 years for financial data. This enforces the confirmed audit requirement (claim_data_010).

Acceptance criteria:

  • Given any data change occurs, when the change is committed, then an audit log entry is created with user, timestamp, and change details.

FR-015: Role-Based Access Control with Location Scoping

The system shall enforce role-based access control with location scoping. Each user is assigned a role and one or more locations (store, warehouse, region, country). Permissions are role + location scope combined. This enforces the confirmed permission model (claim_data_006).

Acceptance criteria:

  • Given a store employee attempts to view another store's data, when the request is processed, then the system denies access and shows a scope boundary message.

FR-016: KPI Dashboards with Drill-Down

The system shall support the operating model KPIs: daily sales, profit, stock levels, popular products, low-stock items, waste, delivery delays, customer satisfaction, employee workload, and store comparisons. Each KPI must be drillable from company level to country, region, store, department, product, or transaction. This enforces the confirmed KPI set (claim_spec_009).

Acceptance criteria:

  • Given a regional manager opens the store comparison dashboard, when they select two or more stores, then the system displays side-by-side KPIs with drill-down to transaction level for each store.

FR-017: Barcode Conflict Resolution

The system shall handle barcode conflicts gracefully with store context and supplier data for resolution. Barcodes are not globally unique. This addresses the confirmed barcode data quality risk (claim_data_007).

Acceptance criteria:

  • Given a barcode that maps to multiple products, when a user scans it, then the system displays a disambiguation list with store context and supplier data for selection.

FR-018: Received Unconfirmed State

The system shall support a 'received_unconfirmed' state in the PurchaseOrder status enum to handle asynchronous supplier confirmations without blocking downstream workflows. This implements the user's explicit request (claim_data_008b).

Acceptance criteria:

  • Given a warehouse team records physical receipt of a delivery, when supplier confirmation has not yet arrived, then the PurchaseOrder enters 'received_unconfirmed' state and downstream workflows (putaway, transfer, replenishment) are not blocked.

Screen / page inventory

  • Mobile Dashboard (Store Employee) — Landing screen with today's alerts, low-stock items, and pending tasks.
    • Elements: Alert list, Low-stock widget, Task list, Barcode scan button
  • Product Stock Status (Store Employee, mobile) — Show current quantity, recent movements, open POs, and summary trace for a scanned or searched product.
    • Elements: Barcode scan, Quantity on hand, Quantity available, Batch list, Summary trace card, Trace button, Replenish button, Transfer button
  • Trace Detail (Store Employee, mobile) — Progressive drill-down into full movement history, related orders, and supplier details.
    • Elements: Movement timeline, Order links, Supplier info, Root cause explanation, Corrective action buttons
  • Replenishment Suggestion (Store Employee, mobile) — Show suggested order with pre-filled quantity based on sales velocity and lead time.
    • Elements: Product, Suggested quantity, Supplier, Expected delivery date, Confirm button, Edit button
  • Purchase Order Approval (Purchasing Manager, desktop) — Review and approve exception replenishment orders.
    • Elements: Order details, Supplier, Cost, Reason for exception, Approve button, Reject button, Edit button
  • Delivery Receiving (Warehouse Team, desktop or rugged handheld) — Scan items, record batch numbers and expiry dates, flag discrepancies.
    • Elements: PO lookup, Line item list, Barcode scan, Batch number input, Expiry date input, Condition dropdown, Discrepancy flag, Confirm Receipt button
  • Stock Count (Store Employee or Warehouse Team, mobile or handheld) — Enter counted quantities and flag discrepancies.
    • Elements: Product scan, Counted quantity input, Expected quantity, Discrepancy flag, Notes, Submit Count button
  • Executive Dashboard (Regional Manager, desktop) — Compare store performance with drill-down from company to transaction.
    • Elements: KPI cards (daily sales, profit, stock levels, waste, delivery delays), Store comparison table, Drill-down charts, Export button
  • Product Catalog Management (Purchasing Manager, desktop) — Create, edit, and manage products, variants, barcodes, and categories.
    • Elements: Product list with filters, Product form, Variant management, Barcode validation, Bulk import/export
  • Supplier Management (Purchasing Manager, desktop) — Manage supplier directory, performance scores, and delivery schedules.
    • Elements: Supplier list, Supplier detail with reliability score, PO history, Delivery schedule
  • Stock Transfer Management (Warehouse Team, desktop) — Create and track stock transfers between locations.
    • Elements: Transfer list, Transfer form with from/to locations, Line items with batch selection, Status tracking

Data model

Product

Field Type Notes
id uuid Primary key
sku string Unique per country, required
gtin_barcode string Optional, validated for check digit, not globally unique
name string Required
description string Optional
brand_id foreign_key->Brand Required
category_id foreign_key->Category Required
parent_product_id foreign_key->Product Nullable, for variants
is_global boolean Default true
country_code string Nullable for local products
unit_of_measure enum(each,kg,liter,pack) Required
created_at datetime UTC
updated_at datetime UTC
deleted_at datetime Soft delete, nullable

Store

Field Type Notes
id uuid Primary key
name string Required
address string Required
country_code string Required
region_id foreign_key->Region Required
timezone string IANA timezone identifier
opening_hours string Structured opening hours
status enum(active,inactive) Required
phone_primary string Typed contact field
phone_emergency string Typed contact field
email_orders string Typed contact field
email_manager string Typed contact field
created_at datetime UTC
updated_at datetime UTC
deleted_at datetime Soft delete, nullable

Warehouse

Field Type Notes
id uuid Primary key
name string Required
address string Required
country_code string Required
region_id foreign_key->Region Required
capacity integer Optional
status enum(active,inactive) Required
created_at datetime UTC
updated_at datetime UTC
deleted_at datetime Soft delete, nullable

Supplier

Field Type Notes
id uuid Primary key
name string Required
contact_info string Required
payment_terms string Optional
lead_time_days integer Required
reliability_score decimal Derived, updated nightly
status enum(active,inactive) Required
created_at datetime UTC
updated_at datetime UTC
deleted_at datetime Soft delete, nullable

PurchaseOrder

Field Type Notes
id uuid Primary key
supplier_id foreign_key->Supplier Required, indexed
warehouse_id foreign_key->Warehouse Destination, required, indexed
order_date datetime Required
expected_delivery_date datetime Required
actual_delivery_date datetime Nullable
status enum(draft,sent,confirmed,partial,received,received_unconfirmed,cancelled) Required, indexed. 'received_unconfirmed' handles asynchronous supplier confirmations.
total_cost decimal Derived from lines
created_at datetime UTC
updated_at datetime UTC

PurchaseOrderLine

Field Type Notes
id uuid Primary key
purchase_order_id foreign_key->PurchaseOrder Required, indexed
product_id foreign_key->Product Required, indexed
quantity_ordered integer Required, > 0
quantity_received integer Default 0, <= quantity_ordered
unit_cost decimal Required, > 0

StockMovement

Field Type Notes
id uuid Primary key
product_id foreign_key->Product Required, indexed
batch_id foreign_key->Batch Nullable, required for perishable products, indexed
location_id uuid Store or warehouse, required, indexed
movement_type enum(receipt,transfer_out,transfer_in,sale,return,damage,count_adjustment,expiry) Required, indexed
quantity_change integer Positive or negative, required
reference_type string Links to PurchaseOrder, StockTransfer, Sale, etc.
reference_id uuid Links to PurchaseOrder, StockTransfer, Sale, etc.
created_at datetime UTC, required
created_by foreign_key->Employee Required

InventoryLevel

Field Type Notes
id uuid Primary key
product_id foreign_key->Product Required, indexed
batch_id foreign_key->Batch Nullable, indexed
location_id uuid Store or warehouse, required, indexed
quantity_on_hand integer Required, >= 0
quantity_reserved integer Default 0
quantity_available integer Derived: quantity_on_hand - quantity_reserved
reorder_point integer Optional
max_stock integer Optional
last_counted_at datetime Nullable

StockTransfer

Field Type Notes
id uuid Primary key
from_location_id uuid Store or warehouse, required
to_location_id uuid Store or warehouse, required
status enum(draft,in_transit,received,cancelled) Required, indexed
created_at datetime UTC
shipped_at datetime Nullable
received_at datetime Nullable

StockTransferLine

Field Type Notes
id uuid Primary key
stock_transfer_id foreign_key->StockTransfer Required, indexed
product_id foreign_key->Product Required, indexed
batch_id foreign_key->Batch Nullable, indexed
quantity_sent integer Required, > 0
quantity_received integer Default 0, <= quantity_sent

Batch

Field Type Notes
id uuid Primary key
product_id foreign_key->Product Required, indexed
batch_number string Required
expiry_date datetime Required, > received_date
received_date datetime Required
supplier_id foreign_key->Supplier Nullable
status enum(active,expired,quarantined,depleted) Required, indexed

Customer

Field Type Notes
id uuid Primary key
first_name string Required
last_name string Required
email string Required, unique
phone string Optional, validated format
address string Required for delivery
country_code string Required
consent_gdpr boolean Required
consent_marketing boolean Optional
created_at datetime UTC
updated_at datetime UTC
deleted_at datetime Soft delete, nullable

LoyaltyAccount

Field Type Notes
id uuid Primary key
customer_id foreign_key->Customer Required, indexed
points_balance integer Default 0
tier enum(bronze,silver,gold,platinum) Derived from points earned in trailing 12 months
joined_at datetime Required

Order

Field Type Notes
id uuid Primary key
customer_id foreign_key->Customer Required, indexed
loyalty_account_id foreign_key->LoyaltyAccount Nullable
store_id foreign_key->Store For click-and-collect, nullable
delivery_address string For home delivery, nullable
order_date datetime Required
status string Required
total_amount decimal Required
currency string Required, ISO 4217

Employee

Field Type Notes
id uuid Primary key
first_name string Required
last_name string Required
email string Required, unique
phone string Optional
role_id foreign_key->Role Required
status enum(active,inactive) Required
hire_date datetime Required

EmployeeLocation

Field Type Notes
id uuid Primary key
employee_id foreign_key->Employee Required, indexed
location_id uuid Store or warehouse, required
location_type enum(store,warehouse,region,country) Required
is_primary boolean Default false

Shift

Field Type Notes
id uuid Primary key
employee_id foreign_key->Employee Required, indexed
location_id uuid Store or warehouse, required
start_time datetime Required
end_time datetime Required, > start_time
role_during_shift foreign_key->Role Required

Task

Field Type Notes
id uuid Primary key
location_id uuid Store or warehouse, required
assigned_to foreign_key->Employee Required
title string Required
description string Optional
due_at datetime Required
status enum(open,in_progress,completed,cancelled) Required
priority enum(low,medium,high,critical) Required

Price

Field Type Notes
id uuid Primary key
product_id foreign_key->Product Required, indexed
country_code string Nullable for global
currency string Required, ISO 4217
amount_base decimal Required
amount_local decimal Required
exchange_rate_snapshot decimal Required
effective_from datetime Required
effective_to datetime Nullable
status enum(draft,approved,active,expired) Required
approved_by foreign_key->Employee Nullable
approved_at datetime Nullable

Promotion

Field Type Notes
id uuid Primary key
name string Required
description string Optional
country_code string Nullable
start_date datetime Required
end_date datetime Required
discount_type enum(percentage,fixed,bogo) Required
discount_value decimal Required
status enum(draft,approved,active,expired) Required

PromotionProduct

Field Type Notes
id uuid Primary key
promotion_id foreign_key->Promotion Required, indexed
product_id foreign_key->Product Required, indexed

Complaint

Field Type Notes
id uuid Primary key
customer_id foreign_key->Customer Required, indexed
order_id foreign_key->Order Nullable
type enum(product_quality,delivery_delay,wrong_item,missing_item,other) Required
description string Required
status enum(open,investigating,resolved,closed) Required
priority enum(low,medium,high,critical) Required
assigned_to foreign_key->Employee Nullable
created_at datetime Required
resolved_at datetime Nullable

Return

Field Type Notes
id uuid Primary key
order_id foreign_key->Order Required, indexed
customer_id foreign_key->Customer Required, indexed
reason string Required
status enum(requested,approved,received,refunded,rejected) Required
refund_amount decimal Required
created_at datetime Required

Payment

Field Type Notes
id uuid Primary key
order_id foreign_key->Order Required, indexed
amount decimal Required
currency string Required, ISO 4217
method string Required
status enum(pending,completed,failed,reversed) Required
transaction_reference string Required
created_at datetime Required

Brand

Field Type Notes
id uuid Primary key
name string Required, unique

Category

Field Type Notes
id uuid Primary key
name string Required, unique
parent_category_id foreign_key->Category Nullable, for hierarchical categories

Region

Field Type Notes
id uuid Primary key
name string Required
country_code string Required

Role

Field Type Notes
id uuid Primary key
name string Required, unique
description string Optional

AuditLog

Field Type Notes
id uuid Primary key
entity_type string Required
entity_id uuid Required
action enum(create,update,delete,read) Required
changed_by foreign_key->Employee Required
changed_at datetime Required, UTC
before_data json Snapshot before change
after_data json Snapshot after change

ExchangeRate

Field Type Notes
id uuid Primary key
from_currency string Required, ISO 4217
to_currency string Required, ISO 4217
rate decimal Required
effective_date datetime Required
source enum(ecb,open_exchange_rates,manual) Required

Business rules

  • BR-001: StockMovement.quantity_change must never result in InventoryLevel.quantity_on_hand < 0. Any movement that would cause negative stock is rejected with an error.
  • BR-002: Price.effective_from must be >= today for new price records. Price.effective_to must be > Price.effective_from. No two active Price records for the same product and country can have overlapping effective date ranges.
  • BR-003: PurchaseOrderLine.quantity_received must be <= PurchaseOrderLine.quantity_ordered. Receiving more than ordered requires a new purchase order or an explicit override with manager approval.
  • BR-004: Batch.expiry_date must be > Batch.received_date. Batches with expiry_date in the past are automatically marked as expired. Expired batches cannot be sold or transferred; they can only be moved to waste or returned to supplier.
  • BR-005: StockTransfer.status transitions: draft → in_transit → received. A transfer cannot be marked received unless all StockTransferLine.quantity_sent > 0. Received quantity can be less than sent (damage in transit) but never more.
  • BR-006: Payment records are immutable once status = 'completed'. Corrections require a reversing Payment record with negative amount and a reference to the original payment.
  • BR-007: Customer PII can only be accessed by users with customer_service or admin role. Customer.consent_gdpr must be true before any marketing communication. Customer data deletion requests must be fulfilled within 30 days (GDPR).
  • BR-008: Employee can only be assigned to locations within their country. Regional managers can view all stores in their region but cannot edit data outside their region. Corporate users have full access.
  • BR-009: Replenishment auto-approval thresholds: orders with total cost below a configurable threshold (default: 5,000 base currency) and quantity below a configurable threshold (default: 100 units) are auto-approved. All other orders require Purchasing Manager approval. Thresholds are tenant-level configuration, not hard-coded constants.
  • BR-010: PurchaseOrder status transitions must include received_unconfirmed as a valid state. A PO enters received_unconfirmed when physical receipt is recorded but supplier confirmation has not yet arrived. Downstream workflows (putaway, transfer, replenishment) must not be blocked by this state.

Permissions

Role Capabilities
Store Employee read: product, inventory_level, stock_movement, purchase_order (own store); create: stock_count, replenishment_suggestion, stock_transfer_request; update: stock_level (own store); delete: none
Warehouse Team read: product, inventory_level, stock_movement, purchase_order, stock_transfer (own warehouse); create: delivery_receipt, stock_transfer, stock_count; update: inventory_level (own warehouse), stock_transfer (own warehouse); delete: none
Purchasing Manager read: product, supplier, purchase_order, price, inventory_level (own country); create: purchase_order, price_change_request, supplier; update: purchase_order, price, supplier (own country); approve: purchase_order_exception, price_change; delete: none
Regional Manager read: dashboard, kpi, store_comparison, stock_movement, purchase_order (own region); escalate: cross_store_transfer_exception; create: none; update: none; delete: none
Platform Automation read: all operational data; create: alert, stock_movement (system-generated), trace; approve: routine_replenishment (within thresholds); update: inventory_level (system-generated); delete: none
Governance & Audit read: audit_log, all data (for compliance); create: audit_log_entry; enforce: gdpr_controls, rbac; update: none; delete: none

Integrations

  • POS integration: provides sales transactions (product, quantity, price, timestamp, store), payment details, and customer loyalty id if captured. Primary source of sales data. Integration via iPaaS middleware.
  • E-commerce integration: provides online orders (customer, items, quantities, delivery address, order status), and inventory levels if the e-commerce platform manages its own stock. Integration via iPaaS middleware.
  • Accounting system integration: receives sales summaries, payment records, and expense data. The accounting system is the system of record for general ledger, not this app. Integration via iPaaS middleware.
  • Supplier feeds: provide product catalogs (sku, barcode, description, unit cost), availability, and lead times. Supplier data quality varies significantly and requires validation on import. Integration via iPaaS or custom connectors.
  • Delivery partner integrations: provide tracking numbers, delivery status updates, and proof of delivery. This data links to Order for the 'why did an online order arrive incomplete' traceability scenario. Integration via iPaaS middleware.
  • Warehouse management system (WMS) integration: provides receiving confirmations, picking status, and stock counts. If the WMS is the system of record for warehouse operations, this app syncs with it rather than replacing it. Integration via iPaaS or custom connectors.
  • Exchange rate provider integration: automated daily feed from ECB or Open Exchange Rates. The feed must provide daily rates for all currencies in use. Manual override by finance team is supported for exceptional cases.

Non-functional requirements

  • NFR-001: The system shall support 1,000-5,000 concurrent users across all roles with p95 latency < 500ms for API responses and p99 latency < 2s for dashboard queries. These latency targets are tenant-level configuration, not hard-coded constants.
  • NFR-002: Data freshness SLAs: stock levels and order status within 60 seconds, dashboards within 15 minutes, scheduled reports daily. These SLAs are tenant-level configuration, not hard-coded constants.
  • NFR-003: The system shall store all timestamps in UTC and display them in the user's local timezone. Shift scheduling and delivery schedules must be timezone-aware.
  • NFR-004: The system shall support multi-language UI (at minimum: English, plus the primary languages of the 4-10 operating countries) and multi-currency display with locale-specific number and date formats.
  • NFR-005: The system shall comply with GDPR: consent tracking, erasure capability within 30 days, data residency controls, and audit logging of PII access.
  • NFR-006: The system shall support offline tolerance for store-floor and warehouse mobile tasks with local queueing and sync when connection returns. Offline data must not be lost on app restart.
  • NFR-007: The system shall maintain an audit log of all data changes, including who made the change, when, and what changed. Audit logs must be immutable and retained for at least 7 years for financial data. The retention period is tenant-level configuration, not a hard-coded constant.
  • NFR-008: The system shall support the operating model KPIs: daily sales, profit, stock levels, popular products, low-stock items, waste, delivery delays, customer satisfaction, employee workload, and store comparisons. Each KPI must be drillable from company level to country, region, store, department, product, or transaction.

Edge cases

  • User imports CSV with 50,000 rows: the system must process the import asynchronously, report per-row errors, and not block the UI. Rows with validation errors are rejected with specific error messages.
  • Barcode scan returns multiple products: the system displays a disambiguation list with store context and supplier data for selection.
  • Supplier delivery confirmation arrives hours after physical receipt: the PurchaseOrder enters 'received_unconfirmed' state, and downstream workflows (putaway, transfer, replenishment) are not blocked.
  • Store employee enters wrong quantity during stock count (e.g., types 100 instead of 10): the system flags counts that deviate >50% from expected and requires confirmation before applying the adjustment.
  • POS or e-commerce integration fails: the system detects the failure, surfaces an alert, and marks affected data as stale rather than silently showing incorrect data.
  • Exchange rate provider outage: the system uses the last known rate and alerts the finance team to manually override if necessary.
  • Batch expires while in transit: the receiving warehouse must be able to mark the batch as expired upon receipt and route it to waste or return to supplier.

Out of scope

  • Point-of-sale system (POS is an integration target)
  • E-commerce storefront (online shops are integration targets)
  • Accounting general ledger and tax filing (accounting system is an integration target)
  • Payroll (out of scope)
  • Employee scheduling optimization (shift planning is in scope for assignment and tracking, but automated scheduling optimization is out of scope)
  • Equipment maintenance management (equipment issues are tracked as tasks, but full CMMS is out of scope)
  • SMS notifications, push notifications, passwordless authentication, onboarding flows, and theming (not in selected feature tags)
  • Deferred (not out of scope, but later phases): Customer & Order Resolution (complaint management, returns and refunds, loyalty account management, unified customer service view) and Marketing & Promotions (promotion creation and approval workflow, loyalty campaign management, promotion effectiveness analysis)

Assumptions & open items

Assumed:

  • Auto-approval thresholds default to 5,000 base currency and 100 units. These are configurable defaults, not hard-coded values.
  • Data freshness SLAs default to stock levels within 60 seconds, dashboards within 15 minutes, scheduled reports daily. These are configurable defaults.
  • Latency targets default to p95 < 500ms and p99 < 2s. These are configurable defaults.
  • Audit log retention period defaults to 7 years for financial data. This is a configurable default.
  • Primary languages for multi-language UI are English plus the primary languages of the 4-10 operating countries. The exact language list is a launch-configuration item.
  • The specific regulatory requirements per country (GDPR, local labor laws, food safety regulations, tax compliance) are not fully enumerated. The spec assumes GDPR as the baseline but does not cover country-specific regulations in detail.

Coverage notes

  • Functional requirements: 18 (with acceptance criteria: 18)
  • Open assumptions: 6 (unresolved/conflicted: 0)
  • Entities in data model: 30
  • Screens: 11, Roles: 6, Journeys: 2
Screen map
Sandbox
User journeys
Supermarket and retail chain management application — User Journeys
Expanded narratives for the primary, secondary, and implied operational journeys across the retail command center.
1 Stock Issue Resolution (Primary) Store Employee critical many times a day

Maria, a shop floor employee who handles ~30 stock checks and replenishment requests per shift on her mobile device.

Goal: Resolve a low-stock or out-of-stock situation by tracing the root cause and triggering replenishment without calling another department.

Trigger: A low-stock alert appears on the mobile dashboard or a barcode scan shows a stock problem.

Preconditions:
  • Store Employee is authenticated and scoped to their store location.
  • The product exists in the catalog with current inventory data.
  1. 1 Store Employee Opens the Mobile Dashboard and sees a low-stock alert for milk. → Alert list shows the low-stock item with quantity below reorder point. Mobile Dashboard
  2. 2 Store Employee Taps the alert to open the product's stock status. → Current quantity, recent movements, and open purchase orders are displayed. Product Stock Status
  3. 3 Store Employee Taps 'Trace' to view the summary trace. → Root cause is highlighted in a one-line explanation, e.g., 'Supplier delivery delayed by 3 days'. Trace Detail
  4. 4 Store Employee Drills down into full movement history, related orders, and supplier details. → Complete movement timeline and supplier reliability score are visible. Trace Detail
  5. 5 Store Employee Taps 'Replenish' to trigger a suggested order. → Suggested order is pre-filled with recommended quantity based on sales velocity and lead time. Replenishment Suggestion
  6. 6 Store Employee Confirms and submits the replenishment order. → Order is submitted and auto-approved because it is within configured thresholds. Replenishment Suggestion
  7. 7 System Routes the approved order to the supplier and records a StockMovement. → PurchaseOrder is created with expected delivery date; stock movement ledger is updated.
  8. 8 Warehouse Team Receives the delivery, scans items, and records batch numbers and expiry dates. → Inventory levels are updated and stock becomes available for the store. Delivery Receiving
  9. 9 Store Employee Sees confirmation with expected arrival date on the mobile dashboard. → Stock issue is resolved and the employee can answer 'why' questions in seconds. Mobile Dashboard
Alternate path: Barcode scan entry at step 1
  1. Store Employee Scans a product barcode from the Mobile Dashboard. → Product Stock Status opens directly for the scanned product.
  2. Store Employee Continues with trace and replenishment as in the main path. → Journey proceeds from step 2 of the main path.
Alternate path: Stock transfer instead of purchase order at step 5
  1. Store Employee Taps 'Transfer' instead of 'Replenish' on the Product Stock Status screen. → A stock transfer request is initiated from another location.
  2. Warehouse Team Creates and ships the transfer from the source location. → StockTransfer status changes to in_transit.
Error path: Exception approval required at step 6
  1. System Detects the order exceeds auto-approval thresholds. → Order is routed to a Purchasing Manager for exception approval.
  2. Purchasing Manager Reviews and approves the exception order. → Order is approved and routed to the supplier.
  3. Store Employee Receives notification of approval and expected delivery date. → Journey resumes with delivery receiving.
After the main path:
  • A PurchaseOrder or StockTransfer is created and routed.
  • The stock issue is traceable from alert to resolution.
  • Inventory levels are updated after receiving.
FR-001 FR-002 FR-003 FR-004 FR-005 FR-008 FR-015 FR-017 FR-018 Mobile Dashboard Product Stock Status Trace Detail Replenishment Suggestion Delivery Receiving Purchase Order Approval Create Stock Transfer
2 Purchase Order to Shelf (Secondary) Purchasing Manager high weekly

Elena, a back-office purchasing manager who creates ~20 purchase orders per week and approves exceptions across her country.

Goal: Create a purchase order, receive it into the warehouse, and move stock to the store shelf with full traceability.

Trigger: A replenishment suggestion appears or a manual order is needed.

Preconditions:
  • Purchasing Manager is authenticated and scoped to their country.
  • Supplier and product data exist in the catalog.
  1. 1 Purchasing Manager Creates a purchase order from a replenishment suggestion or manually. → PurchaseOrder is created with supplier, line items, and expected delivery date. Create Purchase Order
  2. 2 System Routes the order to the supplier. → Supplier receives the order with expected delivery date.
  3. 3 Warehouse Team Receives the delivery, scanning items and recording batch numbers and expiry dates for perishables. → Inventory levels are updated and discrepancies are flagged. Delivery Receiving
  4. 4 System Updates inventory levels and records StockMovement entries. → Stock is available for store replenishment.
  5. 5 Warehouse Team Puts stock away in the warehouse. → Stock is located and ready for transfer. Putaway
  6. 6 Store Employee Requests a transfer or receives an auto-generated replenishment suggestion. → Transfer request is created for the store. Product Stock Status
  7. 7 Warehouse Team Picks and ships the transfer. → StockTransfer status changes to in_transit. Create Stock Transfer
  8. 8 Store Employee Receives and confirms the transfer; shelf is restocked. → Stock is available for sale and the journey completes. Product Stock Status
Alternate path: Manual order without replenishment suggestion at step 1
  1. Purchasing Manager Opens the Purchase Order List and selects 'Create' manually. → Create Purchase Order screen opens with empty form.
  2. Purchasing Manager Fills in supplier, products, and quantities manually. → Order is created and routed to supplier.
Error path: Short shipment or damaged goods at step 3
  1. Warehouse Team Flags discrepancy during receiving (short shipment or damaged goods). → Discrepancy is recorded and PurchaseOrder enters received_unconfirmed state.
  2. System Notifies Purchasing Manager of the discrepancy. → Purchasing Manager is alerted to resolve with supplier.
  3. Purchasing Manager Reviews the discrepancy and contacts the supplier. → Supplier confirms or corrects the shipment; downstream workflows are not blocked.
After the main path:
  • PurchaseOrder is received and inventory levels are updated.
  • StockTransfer is completed and shelf is restocked.
  • All stock movements are recorded in the ledger.
FR-003 FR-004 FR-005 FR-007 FR-011 FR-015 FR-018 Create Purchase Order Delivery Receiving Putaway Product Stock Status Create Stock Transfer Purchase Order List Purchase Order Detail
3 Stock Count & Adjustment Store Employee high weekly

Jonas, a store employee who performs weekly stock counts and flags discrepancies for adjustment.

Goal: Complete a stock count, flag discrepancies, and apply adjustments with full traceability.

Trigger: A scheduled stock count task appears on the mobile dashboard.

Preconditions:
  • Store Employee is authenticated and scoped to their store.
  • Stock count task is assigned to the employee.
  1. 1 Store Employee Opens the Mobile Dashboard and sees the stock count task. → Task list shows the stock count with due date. Mobile Dashboard
  2. 2 Store Employee Opens the Stock Count screen and scans a product. → Expected quantity is displayed for the scanned product. Stock Count
  3. 3 Store Employee Enters the counted quantity. → Counted quantity is recorded and compared to expected. Stock Count
  4. 4 System Flags counts that deviate more than 50% from expected. → Employee is prompted to confirm the deviation before applying. Stock Count
  5. 5 Store Employee Confirms the count and submits. → Stock adjustment is applied and a StockMovement record is created. Stock Count
  6. 6 System Updates the Movement Ledger with the adjustment. → Inventory levels are corrected and the adjustment is traceable. Movement Ledger
Error path: Offline count submission at step 5
  1. Store Employee Attempts to submit the count while offline. → System queues the count locally and shows a pending sync indicator.
  2. System Syncs the queued count when connection returns. → Count is applied and ledger is updated without data loss.
After the main path:
  • Inventory levels are corrected.
  • StockMovement records are created for all adjustments.
  • Discrepancies are flagged and traceable.
FR-005 FR-008 FR-014 FR-015 Mobile Dashboard Stock Count Movement Ledger
4 Executive Performance Review Regional Manager high weekly

Sofia, a regional manager who reviews store performance weekly and escalates cross-store transfer exceptions.

Goal: Compare store performance across her region and drill down to identify root causes of underperformance.

Trigger: Weekly performance review or an alert about a store's declining KPIs.

Preconditions:
  • Regional Manager is authenticated and scoped to their region.
  • KPI data is fresh within the configured SLA.
  1. 1 Regional Manager Opens the Executive Dashboard. → KPI cards show daily sales, profit, stock levels, waste, and delivery delays for the region. Executive Dashboard
  2. 2 Regional Manager Selects two or more stores for comparison. → Side-by-side KPI comparison is displayed. Store Comparison
  3. 3 Regional Manager Drills down into a store with high waste. → Waste is broken down by product and department. KPI Drill-Down
  4. 4 Regional Manager Drills further into a specific product's movement history. → Root cause of waste is identified (e.g., over-ordering or expiry). Trace Detail
  5. 5 Regional Manager Exports the comparison report for the leadership team. → CSV/Excel report is generated and downloaded. Export Center
Alternate path: Escalate cross-store transfer exception at step 3
  1. Regional Manager Identifies a cross-store transfer exception in the comparison. → Exception is flagged for escalation.
  2. Regional Manager Escalates the exception to the relevant store or warehouse. → Escalation is recorded and routed to the responsible team.
After the main path:
  • Performance insights are documented and exported.
  • Escalations are recorded and traceable.
  • Regional Manager can answer 'why' questions about store performance.
FR-002 FR-015 FR-016 Executive Dashboard Store Comparison KPI Drill-Down Trace Detail Export Center
5 Supplier and Catalog Management Purchasing Manager normal monthly

Elena, the same purchasing manager who maintains the supplier directory and product catalog with bulk imports.

Goal: Maintain accurate supplier and product catalog data, including prices and barcodes, with validation and bulk operations.

Trigger: A new supplier onboarding or a bulk catalog update is required.

Preconditions:
  • Purchasing Manager is authenticated and scoped to their country.
  • Supplier or product data is available for import or manual entry.
  1. 1 Purchasing Manager Opens the Supplier List to review the current directory. → Supplier directory with reliability scores is displayed. Supplier List
  2. 2 Purchasing Manager Opens a supplier detail to review performance and PO history. → Reliability score, PO history, and delivery schedule are visible. Supplier Detail
  3. 3 Purchasing Manager Opens the Product Catalog to manage products and barcodes. → Product list with filters is displayed. Product Catalog
  4. 4 Purchasing Manager Uploads a CSV file with new product data. → System validates each row and reports per-row success or error. Product Catalog
  5. 5 Purchasing Manager Reviews validation errors and corrects them. → Invalid rows are corrected and re-imported. Product Form
  6. 6 Purchasing Manager Creates or updates a price record for a product. → Effective-dated price record is created with no overlapping ranges. Price Edit
Alternate path: Manual product creation at step 3
  1. Purchasing Manager Opens the Product Form to create a new product manually. → Product is created with SKU, barcode, and category.
  2. Purchasing Manager Validates barcode uniqueness with store context. → Barcode conflict is resolved or flagged for disambiguation.
Error path: Overlapping price records at step 6
  1. Purchasing Manager Attempts to create a price record with overlapping effective dates. → System rejects the new record with an error.
  2. Purchasing Manager Adjusts the effective date range to avoid overlap. → Price record is created successfully.
After the main path:
  • Supplier and product catalog data is accurate and validated.
  • Price records are effective-dated with no overlaps.
  • Bulk imports are processed with per-row error reporting.
FR-006 FR-011 FR-015 FR-017 Supplier List Supplier Detail Product Catalog Product Form Price Edit
Coverage
Roles covered: Store Employee, Warehouse Team, Purchasing Manager, Regional Manager
Roles missing: Platform Automation, Governance & Audit
FRs covered: FR-001, FR-002, FR-003, FR-004, FR-005, FR-006, FR-007, FR-008, FR-011, FR-014, FR-015, FR-016, FR-017, FR-018
FRs uncovered: FR-009, FR-010, FR-012, FR-013
  • Platform Automation and Governance & Audit roles have no starring journey; they are system actors but their automated traces, alerts, and audit enforcement are implied rather than narrated.
  • GDPR erasure and consent tracking (FR-009) has no journey; a customer data deletion request scenario is missing.
  • Immutable financial records (FR-010) has no journey; a payment correction via reversing entry scenario is missing.
  • Multi-language and locale switching (FR-012) and timezone-aware display (FR-013) are cross-cutting and not exercised in any journey.
  • The 'received_unconfirmed' state (FR-018) is referenced but a dedicated journey showing asynchronous supplier confirmation is not fully narrated.
How to read
  • Journeys j1 and j2 expand the spec's two compact user journeys; j3-j5 add implied journeys for stock counting, executive review, and catalog management.
  • Screen names are copied verbatim from the screen map; steps with no defined screen are marked null and are findings for the design team.
  • Roles Platform Automation and Governance & Audit are system actors and appear as step actors but do not star any journey; consider adding an automation or audit journey in a future round.
  • Cross-cutting FRs (FR-009, FR-010, FR-012, FR-013) are not exercised by any journey; they may be covered by system-level tests rather than user journeys.
Entities diagram
Sandbox
DB schema
Sandbox
Data models
Sandbox
Entities & DB (text)

Entity-relationship model for a unified retail operations command center. It covers product catalog, inventory ledger, purchasing, warehouse transfers, supplier management, customer orders, employee location scoping, pricing, promotions, and compliance. The model includes base User + UserProfile entities and the domain entities required by the specification, with relationships reflecting traceability from stock movements to purchase orders and suppliers.

Entities (38)
User

Authentication identity for application access. Represents a login account, linked to an Employee profile for operational context.

  • email string
    unique

    Unique email address used for login.

  • password_hash string

    Hashed password for authentication.

  • is_active boolean

    Whether the user account is enabled.

  • last_login_at datetime
    nullable

    Timestamp of the last successful login.

UserProfile

Extended profile information for a User account.

  • first_name string

    User's first name.

  • last_name string

    User's last name.

  • avatar_url string
    nullable

    URL to the user's avatar image.

  • bio text
    nullable

    Short biography or description.

  • timezone string
    nullable

    IANA timezone identifier for the user.

Employee

Represents a staff member within the retail organization. Links a User account to operational roles and locations.

  • first_name string

    Employee's first name.

  • last_name string

    Employee's last name.

  • email string
    unique

    Unique work email address.

  • phone string
    nullable

    Contact phone number.

  • status string

    Employment status.

  • hire_date datetime

    Date the employee was hired.

Role

Defines a set of permissions and capabilities within the system.

  • name string
    unique

    Unique role name (e.g., Store Employee, Purchasing Manager).

  • description string
    nullable

    Optional description of the role's purpose.

Permission

A granular capability or action that can be granted to a role.

  • name string
    unique

    Unique permission identifier (e.g., 'create:purchase_order').

  • description string
    nullable

    Human-readable description of the permission.

EmployeeLocation

Associates an employee with a location (store, warehouse, region, or country) for access scoping.

  • location_type string

    Type of location scope.

  • is_primary boolean

    Whether this is the employee's primary location.

Region

A geographical grouping of stores and warehouses within a country.

  • name string

    Name of the region.

  • country_code string

    ISO country code for the region.

Store

A physical retail location where products are sold.

  • name string

    Name of the store.

  • address string

    Physical address of the store.

  • country_code string

    ISO country code.

  • timezone string

    IANA timezone identifier for the store.

  • opening_hours string
    nullable

    Structured opening hours.

  • status string

    Operational status.

  • phone_primary string
    nullable

    Primary contact phone number.

  • phone_emergency string
    nullable

    Emergency contact phone number.

  • email_orders string
    nullable

    Email for order-related communications.

  • email_manager string
    nullable

    Email for the store manager.

Warehouse

A distribution center or storage facility that supplies stores.

  • name string

    Name of the warehouse.

  • address string

    Physical address of the warehouse.

  • country_code string

    ISO country code.

  • capacity integer
    nullable

    Storage capacity in units.

  • status string

    Operational status.

Brand

A product brand or manufacturer.

  • name string
    unique

    Unique brand name.

Category

A hierarchical classification for products.

  • name string
    unique

    Unique category name.

Product

An item sold or managed in the retail chain. Can be a global product or a local variant.

  • sku string

    Stock Keeping Unit, unique per country.

  • gtin_barcode string
    nullable

    Global Trade Item Number barcode, not globally unique.

  • name string

    Product name.

  • description text
    nullable

    Product description.

  • is_global boolean

    Whether the product is available globally.

  • country_code string
    nullable

    ISO country code for local products.

  • unit_of_measure string

    Unit of measure for the product.

Supplier

A company that provides products to the retail chain.

  • name string

    Supplier name.

  • contact_info string

    Contact information for the supplier.

  • payment_terms string
    nullable

    Agreed payment terms.

  • lead_time_days integer

    Typical lead time in days.

  • reliability_score decimal
    nullable

    Derived reliability score, updated nightly.

  • status string

    Supplier status.

PurchaseOrder

An order placed with a supplier for products to be delivered to a warehouse.

  • order_date datetime

    Date the order was placed.

  • expected_delivery_date datetime

    Expected delivery date.

  • actual_delivery_date datetime
    nullable

    Actual delivery date.

  • status string

    Current status of the purchase order.

  • total_cost decimal
    nullable

    Total cost derived from order lines.

PurchaseOrderLine

A line item within a purchase order, specifying a product and quantity.

  • quantity_ordered integer

    Quantity ordered.

  • quantity_received integer

    Quantity actually received.

  • unit_cost decimal

    Cost per unit.

Batch

A specific batch of a product, typically with an expiry date for perishables.

  • batch_number string

    Unique batch number.

  • expiry_date datetime

    Expiry date for the batch.

  • received_date datetime

    Date the batch was received.

  • status string

    Current status of the batch.

InventoryLevel

Current stock level for a product (and optionally batch) at a specific location.

  • quantity_on_hand integer

    Physical quantity available.

  • quantity_reserved integer

    Quantity reserved for orders or transfers.

  • quantity_available integer
    nullable

    Derived: quantity_on_hand minus quantity_reserved.

  • reorder_point integer
    nullable

    Threshold for triggering replenishment.

  • max_stock integer
    nullable

    Maximum stock level.

  • last_counted_at datetime
    nullable

    Timestamp of the last physical count.

StockMovement

An immutable ledger entry recording any change in stock quantity.

  • movement_type string

    Type of stock movement.

  • quantity_change integer

    Positive or negative quantity change.

  • reference_type string
    nullable

    Type of the related entity (e.g., PurchaseOrder, StockTransfer).

  • reference_id string
    nullable

    ID of the related entity.

StockTransfer

A transfer of stock between two locations (stores or warehouses).

  • status string

    Current status of the transfer.

  • shipped_at datetime
    nullable

    Timestamp when the transfer was shipped.

  • received_at datetime
    nullable

    Timestamp when the transfer was received.

StockTransferLine

A line item within a stock transfer, specifying product, batch, and quantities.

  • quantity_sent integer

    Quantity sent.

  • quantity_received integer

    Quantity received.

Price

An effective-dated price record for a product in a specific country and currency.

  • country_code string
    nullable

    ISO country code, nullable for global prices.

  • currency string

    ISO 4217 currency code.

  • amount_base decimal

    Price in base currency.

  • amount_local decimal

    Price in local currency.

  • exchange_rate_snapshot decimal

    Exchange rate used at transaction time.

  • effective_from datetime

    Start date for price validity.

  • effective_to datetime
    nullable

    End date for price validity.

  • status string

    Price record status.

  • approved_at datetime
    nullable

    Timestamp when the price was approved.

Promotion

A marketing promotion applicable to products.

  • name string

    Promotion name.

  • description text
    nullable

    Promotion description.

  • country_code string
    nullable

    ISO country code, nullable for global promotions.

  • start_date datetime

    Promotion start date.

  • end_date datetime

    Promotion end date.

  • discount_type string

    Type of discount.

  • discount_value decimal

    Value of the discount.

  • status string

    Promotion status.

PromotionProduct

Junction entity linking promotions to products.

Customer

An end customer who purchases products.

  • first_name string

    Customer's first name.

  • last_name string

    Customer's last name.

  • email string
    unique

    Unique email address.

  • phone string
    nullable

    Phone number.

  • address string

    Delivery address.

  • country_code string

    ISO country code.

  • consent_gdpr boolean

    GDPR consent flag.

  • consent_marketing boolean
    nullable

    Marketing consent flag.

LoyaltyAccount

A loyalty program account for a customer.

  • points_balance integer

    Current points balance.

  • tier string

    Loyalty tier.

  • joined_at datetime

    Date the customer joined the loyalty program.

Order

A customer order, either for home delivery or click-and-collect.

  • delivery_address string
    nullable

    Delivery address for home delivery.

  • order_date datetime

    Date the order was placed.

  • status string

    Order status.

  • total_amount decimal

    Total order amount.

  • currency string

    ISO 4217 currency code.

Payment

A payment transaction for an order.

  • amount decimal

    Payment amount.

  • currency string

    ISO 4217 currency code.

  • method string

    Payment method.

  • status string

    Payment status.

  • transaction_reference string

    External transaction reference.

Complaint

A customer complaint related to an order or product.

  • type string

    Type of complaint.

  • description text

    Complaint description.

  • status string

    Complaint status.

  • priority string

    Complaint priority.

  • resolved_at datetime
    nullable

    Timestamp when the complaint was resolved.

Return

A customer return of products from an order.

  • reason string

    Reason for the return.

  • status string

    Return status.

  • refund_amount decimal

    Amount to be refunded.

Shift

A scheduled work shift for an employee at a location.

  • start_time datetime

    Shift start time.

  • end_time datetime

    Shift end time.

Task

A task assigned to an employee at a location.

  • title string

    Task title.

  • description text
    nullable

    Task description.

  • due_at datetime

    Due date for the task.

  • status string

    Task status.

  • priority string

    Task priority.

AuditLog

Immutable record of data changes for compliance and traceability.

  • entity_type string

    Type of the changed entity.

  • entity_id string

    ID of the changed entity.

  • action string

    Action performed.

  • changed_at datetime

    Timestamp of the change.

  • before_data json
    nullable

    Snapshot of data before the change.

  • after_data json
    nullable

    Snapshot of data after the change.

ExchangeRate

A snapshot of an exchange rate between two currencies.

  • from_currency string

    Source currency code.

  • to_currency string

    Target currency code.

  • rate decimal

    Exchange rate value.

  • effective_date datetime

    Date the rate is effective.

  • source string

    Source of the rate.

Notification

An in-app notification for a user.

  • title string

    Notification title.

  • body text
    nullable

    Notification body text.

  • is_read boolean

    Whether the notification has been read.

  • deep_link string
    nullable

    Deep link to the related entity.

SavedView

A user-defined filter preset for lists and dashboards.

  • name string

    Name of the saved view.

  • filter_config json

    JSON configuration of filters and columns.

  • is_default boolean

    Whether this is the default view for the user.

Attachment

A file uploaded and associated with an entity.

  • file_name string

    Original file name.

  • file_path string

    Storage path.

  • mime_type string

    MIME type of the file.

  • size_bytes integer

    File size in bytes.

  • entity_type string

    Polymorphic entity type.

  • entity_id string

    Polymorphic entity ID.

Webhook

Auto-added from feature tags.

  • url string
    nullable
  • event_types_json json
    nullable
  • secret string
    nullable
  • last_sent_at datetime
    nullable
  • enabled boolean
    nullable
FeatureFlag

Auto-added from feature tags.

  • key string
    unique
  • enabled boolean
  • rolled_out_to_json json
    nullable
  • description text
    nullable
Relationships (46)
From Type To Description
user
one-to-one
user_profile Each User has one UserProfile.
user
one-to-one
employee Each User is linked to one Employee record.
role
one-to-many
employee Each Employee has one Role.
role
many-to-many
permission A Role can have many Permissions, and a Permission can belong to many Roles.
employee
one-to-many
employee_location An Employee can be assigned to many locations.
region
one-to-many
store A Region has many Stores.
region
one-to-many
warehouse A Region has many Warehouses.
brand
one-to-many
product A Brand has many Products.
category
one-to-many
product A Category has many Products.
category
one-to-many
category A Category can have a parent Category for hierarchy.
product
one-to-many
product A Product can be a variant of a parent Product.
supplier
one-to-many
purchase_order A Supplier has many PurchaseOrders.
warehouse
one-to-many
purchase_order A Warehouse receives many PurchaseOrders.
purchase_order
one-to-many
purchase_order_line A PurchaseOrder has many PurchaseOrderLines.
product
one-to-many
purchase_order_line A Product appears in many PurchaseOrderLines.
product
one-to-many
batch A Product has many Batches.
supplier
one-to-many
batch A Supplier provides many Batches.
product
one-to-many
inventory_level A Product has many InventoryLevels.
batch
one-to-many
inventory_level A Batch has many InventoryLevels.
product
one-to-many
stock_movement A Product has many StockMovements.
batch
one-to-many
stock_movement A Batch has many StockMovements.
employee
one-to-many
stock_movement An Employee creates many StockMovements.
stock_transfer
one-to-many
stock_transfer_line A StockTransfer has many StockTransferLines.
product
one-to-many
stock_transfer_line A Product appears in many StockTransferLines.
batch
one-to-many
stock_transfer_line A Batch appears in many StockTransferLines.
product
one-to-many
price A Product has many Prices.
employee
one-to-many
price An Employee approves many Prices.
promotion
many-to-many
product A Promotion can include many Products, and a Product can be in many Promotions.
customer
one-to-many
order A Customer has many Orders.
customer
one-to-one
loyalty_account A Customer has one LoyaltyAccount.
loyalty_account
one-to-many
order A LoyaltyAccount can be linked to many Orders.
store
one-to-many
order A Store can have many Orders (click-and-collect).
order
one-to-many
payment An Order has many Payments.
customer
one-to-many
complaint A Customer can have many Complaints.
order
one-to-many
complaint An Order can have many Complaints.
employee
one-to-many
complaint An Employee can be assigned many Complaints.
order
one-to-many
return An Order can have many Returns.
customer
one-to-many
return A Customer can have many Returns.
employee
one-to-many
shift An Employee has many Shifts.
role
one-to-many
shift A Role can be assigned to many Shifts.
employee
one-to-many
task An Employee is assigned many Tasks.
employee
one-to-many
audit_log An Employee creates many AuditLog entries.
user
one-to-many
notification A User can have many Notifications.
user
one-to-many
saved_view A User can have many SavedViews.
promotion
one-to-many
promotion_product Derived from spec data_model: data_model[PromotionProduct].promotion_id.
product
one-to-many
promotion_product Derived from spec data_model: data_model[PromotionProduct].product_id.
Database tables (40)
users
  • id bigInteger
    unique
  • email string
    unique
  • password_hash string
  • is_active boolean
  • last_login_at datetime
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
user_profiles
  • id bigInteger
    unique
  • first_name string
  • last_name string
  • avatar_url string
    nullable
  • bio text
    nullable
  • timezone string
    nullable
  • profile_id bigInteger
    unique
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
employees
  • id bigInteger
    unique
  • first_name string
  • last_name string
  • email string
    unique
  • phone string
    nullable
  • status string
  • hire_date datetime
  • region_id bigInteger
    unique
  • role_id bigInteger
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
roles
  • id bigInteger
    unique
  • name string
    unique
  • description string
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
permissions
  • id bigInteger
    unique
  • name string
    unique
  • description string
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
employee_locations
  • id bigInteger
    unique
  • location_type string
  • is_primary boolean
  • employee_id bigInteger
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
regions
  • id bigInteger
    unique
  • name string
  • country_code string
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
stores
  • id bigInteger
    unique
  • name string
  • address string
  • country_code string
  • timezone string
  • opening_hours string
    nullable
  • status string
  • phone_primary string
    nullable
  • phone_emergency string
    nullable
  • email_orders string
    nullable
  • email_manager string
    nullable
  • region_id bigInteger
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
warehouses
  • id bigInteger
    unique
  • name string
  • address string
  • country_code string
  • capacity integer
    nullable
  • status string
  • region_id bigInteger
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
brands
  • id bigInteger
    unique
  • name string
    unique
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
categories
  • id bigInteger
    unique
  • name string
    unique
  • parent_category_id bigInteger
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
products
  • id bigInteger
    unique
  • sku string
  • gtin_barcode string
    nullable
  • name string
  • description text
    nullable
  • is_global boolean
  • country_code string
    nullable
  • unit_of_measure string
  • brand_id bigInteger
    nullable
  • category_id bigInteger
    nullable
  • parent_product_id bigInteger
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
suppliers
  • id bigInteger
    unique
  • name string
  • contact_info string
  • payment_terms string
    nullable
  • lead_time_days integer
  • reliability_score decimal
    nullable
  • status string
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
purchase_orders
  • id bigInteger
    unique
  • order_date datetime
  • expected_delivery_date datetime
  • actual_delivery_date datetime
    nullable
  • status string
  • total_cost decimal
    nullable
  • supplier_id bigInteger
    nullable
  • warehouse_id bigInteger
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
purchase_order_lines
  • id bigInteger
    unique
  • quantity_ordered integer
  • quantity_received integer
  • unit_cost decimal
  • purchase_order_id bigInteger
    nullable
  • product_id bigInteger
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
batches
  • id bigInteger
    unique
  • batch_number string
  • expiry_date datetime
  • received_date datetime
  • status string
  • product_id bigInteger
    nullable
  • supplier_id bigInteger
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
inventory_levels
  • id bigInteger
    unique
  • quantity_on_hand integer
  • quantity_reserved integer
  • quantity_available integer
    nullable
  • reorder_point integer
    nullable
  • max_stock integer
    nullable
  • last_counted_at datetime
    nullable
  • product_id bigInteger
    nullable
  • batch_id bigInteger
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
stock_movements
  • id bigInteger
    unique
  • movement_type string
  • quantity_change integer
  • reference_type string
    nullable
  • reference_id string
    nullable
  • product_id bigInteger
    nullable
  • batch_id bigInteger
    nullable
  • created_by_id bigInteger
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
stock_transfers
  • id bigInteger
    unique
  • status string
  • shipped_at datetime
    nullable
  • received_at datetime
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
stock_transfer_lines
  • id bigInteger
    unique
  • quantity_sent integer
  • quantity_received integer
  • stock_transfer_id bigInteger
    nullable
  • product_id bigInteger
    nullable
  • batch_id bigInteger
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
prices
  • id bigInteger
    unique
  • country_code string
    nullable
  • currency string
  • amount_base decimal
  • amount_local decimal
  • exchange_rate_snapshot decimal
  • effective_from datetime
  • effective_to datetime
    nullable
  • status string
  • approved_at datetime
    nullable
  • product_id bigInteger
    nullable
  • approved_by_id bigInteger
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
promotions
  • id bigInteger
    unique
  • name string
  • description text
    nullable
  • country_code string
    nullable
  • start_date datetime
  • end_date datetime
  • discount_type string
  • discount_value decimal
  • status string
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
promotion_products
  • id bigInteger
    unique
  • promotion_id bigInteger
    nullable
  • product_id bigInteger
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
customers
  • id bigInteger
    unique
  • first_name string
  • last_name string
  • email string
    unique
  • phone string
    nullable
  • address string
  • country_code string
  • consent_gdpr boolean
  • consent_marketing boolean
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
loyalty_accounts
  • id bigInteger
    unique
  • points_balance integer
  • tier string
  • joined_at datetime
  • customer_id bigInteger
    unique
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
orders
  • id bigInteger
    unique
  • delivery_address string
    nullable
  • order_date datetime
  • status string
  • total_amount decimal
  • currency string
  • customer_id bigInteger
    nullable
  • loyalty_account_id bigInteger
    nullable
  • store_id bigInteger
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
payments
  • id bigInteger
    unique
  • amount decimal
  • currency string
  • method string
  • status string
  • transaction_reference string
  • order_id bigInteger
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
complaints
  • id bigInteger
    unique
  • type string
  • description text
  • status string
  • priority string
  • resolved_at datetime
    nullable
  • customer_id bigInteger
    nullable
  • order_id bigInteger
    nullable
  • assigned_to_id bigInteger
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
returns
  • id bigInteger
    unique
  • reason string
  • status string
  • refund_amount decimal
  • order_id bigInteger
    nullable
  • customer_id bigInteger
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
shifts
  • id bigInteger
    unique
  • start_time datetime
  • end_time datetime
  • employee_id bigInteger
    nullable
  • role_during_shift_id bigInteger
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
tasks
  • id bigInteger
    unique
  • title string
  • description text
    nullable
  • due_at datetime
  • status string
  • priority string
  • assigned_to_id bigInteger
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
audit_logs
  • id bigInteger
    unique
  • entity_type string
  • entity_id string
  • action string
  • changed_at datetime
  • before_data json
    nullable
  • after_data json
    nullable
  • changed_by_id bigInteger
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
exchange_rates
  • id bigInteger
    unique
  • from_currency string
  • to_currency string
  • rate decimal
  • effective_date datetime
  • source string
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
notifications
  • id bigInteger
    unique
  • title string
  • body text
    nullable
  • is_read boolean
  • deep_link string
    nullable
  • user_id bigInteger
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
saved_views
  • id bigInteger
    unique
  • name string
  • filter_config json
  • is_default boolean
  • user_id bigInteger
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
attachments
  • id bigInteger
    unique
  • file_name string
  • file_path string
  • mime_type string
  • size_bytes integer
  • entity_type string
  • entity_id string
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
webhooks
  • id bigInteger
    unique
  • url string
    nullable
  • event_types_json json
    nullable
  • secret string
    nullable
  • last_sent_at datetime
    nullable
  • enabled boolean
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
feature_flags
  • id bigInteger
    unique
  • key string
    unique
  • enabled boolean
  • rolled_out_to_json json
    nullable
  • description text
    nullable
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
permission_role
  • id bigInteger
    unique
  • role_id bigInteger
  • permission_id bigInteger
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
product_promotion
  • id bigInteger
    unique
  • promotion_id bigInteger
  • product_id bigInteger
  • created_at timestamp
    nullable
  • updated_at timestamp
    nullable
Generated code