Use Cases & User Stories¶
Comprehensive use case catalog for CostEngine (MfgIQ).
Summary Table¶
| ID | Use Case Name | Category | Priority | Complexity | User Role |
|---|---|---|---|---|---|
| UC-001 | Complete RFQ-to-Quote Flow | Core Workflow | P0 - Critical | High | Estimator |
| UC-002 | Rush Quote (High Priority) | Core Workflow | P0 - Critical | Medium | Estimator |
| UC-101 | Import Standard Costing Template | Excel Import | P0 - Critical | Medium | Estimator |
| UC-102 | Import with Errors | Excel Import | P1 - Important | Medium | Estimator |
| UC-103 | Import Legacy Excel (Non-Standard) | Excel Import | P1 - Important | High | Estimator |
| UC-104 | Similar Part Geometry Search | Excel Import | P1 - Important | High | Estimator |
| UC-201 | Calculate Material Cost | Cost Calculation | P0 - Critical | Low | System |
| UC-202 | Calculate Multi-Operation Cost | Cost Calculation | P0 - Critical | Medium | System |
| UC-203 | Apply Cascading Scrap | Cost Calculation | P0 - Critical | Medium | System |
| UC-301 | Drill Down on Cost Line | Explainability | P0 - Critical | Medium | Estimator |
| UC-302 | Compare Two Versions | Explainability | P1 - Important | Medium | Estimator |
| UC-303 | Benchmark against History | Explainability | P1 - Important | Medium | Estimator |
| UC-304 | Low-Margin Approval Workflow | Explainability | P0 - Critical | Medium | Manager |
| UC-401 | Customer Requests Quantity Change | Versioning | P1 - Important | Low | Estimator |
| UC-402 | Material Price Increase | Versioning | P1 - Important | Medium | Admin |
| UC-501 | Generate Standard Quote | Output | P0 - Critical | Medium | Estimator |
| UC-502 | Quote for Tender Submission | Output | P1 - Important | Low | Estimator |
| UC-601 | Missing Critical Data | UI & Data Integrity | P1 - Important | Low | System |
| UC-602 | Unrealistic Values | UI & Data Integrity | P1 - Important | Medium | System |
| UC-603 | UI Validation Patterns | UX/UI Hygiene | P1 - Important | Low | UI Layer |
| UC-701 | Sync with Tally ERP | Integration | P2 - Future | High | Admin |
| UC-702 | Email Integration | Integration | P2 - Future | Low | Estimator |
| UC-801 | Incremental Excel Sync | Data Pipeline | P0 - Critical | High | System |
| UC-802 | Automated Rate Lock | Data Pipeline | P1 - Important | Medium | System |
| UC-901 | Database Failover Recovery | System Ops | P1 - Important | High | DevOps |
| UC-902 | Audit Trail Forensic Search | System Ops | P1 - Important | Medium | Admin |
| UC-903 | Containerized Deployment (Docker) | Technical Ops | P1 - Important | Medium | DevOps |
| UC-904 | Centralized Observability & Logging | Technical Ops | P1 - Important | Low | Admin |
| UC-905 | MLOps Pipeline (Phase 3) | Intelligence | P2 - Future | High | System |
Total Use Cases: 30 covering all MVP & Intelligence functionality
Core Workflow Use Cases¶
UC-001: Complete RFQ-to-Quote Flow¶
Priority: P0 - Critical
Complexity: High
Actor: Estimator
Precondition: Customer sent RFQ via email with part drawings and quantity
Main Success Scenario:
| Step | Action | Expected Result |
|---|---|---|
| 1 | Estimator uploads Excel costing template with RFQ details | File uploaded successfully |
| 2 | System extracts material specs, BOM, and routing | Data parsed and displayed |
| 3 | System calculates costs automatically | All cost components calculated |
| 4 | Estimator reviews cost breakdown | Cost details visible with explainability |
| 5 | Estimator overrides cycle time based on shop floor expertise | Override accepted, impact shown |
| 6 | System recalculates and shows impact | Updated costs displayed |
| 7 | Estimator generates quote with 3 margin scenarios | Quote previewed |
| 8 | System creates PDF and Excel quote pack | Files generated |
| 9 | Estimator sends quote to customer | Quote sent |
| 10 | System saves version 1.0 | Version saved with timestamp |
Alternative Flows:
| Flow ID | Condition | Action |
|---|---|---|
| 3a | Missing material rate | System prompts for manual entry |
| 4a | Cost seems too high | Estimator investigates assumptions |
| 6a | Override rejected | Estimator must provide reason |
Postcondition: Quote sent to customer, version saved in system
Performance Target: 15-20 minutes (vs 2-4 hours manually)
Acceptance Criteria: - Complete flow in < 20 minutes - All 6 cost components calculated - At least 1 override applied successfully - PDF + Excel quote generated
UC-002: Rush Quote (High Priority)¶
Priority: P0 - Critical
Complexity: Medium
Actor: Estimator
Business Context: Customer needs quote in 1 hour for urgent project
Flow:
| Step | Action | Time Target |
|---|---|---|
| 1 | Estimator uses existing similar part as template | 5 min |
| 2 | Adjusts quantity and critical dimensions | 10 min |
| 3 | Accepts default assumptions (no deep validation) | 5 min |
| 4 | Generates Base margin scenario only | 5 min |
| 5 | Sends quote within 30 minutes | 5 min |
Key Requirements:
| Requirement | Supported | Notes |
|---|---|---|
| Fast template duplication | Yes | Copy from existing quote |
| Quick overrides without full validation | Yes | Skip validation checks |
| Single margin scenario option | Yes | Base margin only |
Excel Import Use Cases¶
UC-101: Import Standard Costing Template¶
Priority: P0 - Critical
Complexity: Medium
Actor: Estimator
Precondition: Estimator has filled Excel template with part data
Flow:
| Step | Action | System Response |
|---|---|---|
| 1 | Click "Upload Costing Sheet" | File dialog opens |
| 2 | Select Excel file from computer | File uploading... |
| 3 | System validates file structure | Validation in progress |
| 4 | System extracts and displays data | Shows Part number, drawing number, Material grade and specs, Operations list with times, Tooling requirements |
| 5 | System highlights any missing fields | Warning indicators shown |
| 6 | Estimator confirms import | Processing... |
| 7 | System creates quote draft | Quote draft created |
Success Criteria:
| Criterion | Target | Measurement |
|---|---|---|
| Data field mapping | 100% | All fields mapped correctly |
| Missing field warnings | All | Warnings shown for empty fields |
| Import time | < 10 sec | From upload to draft creation |
UC-102: Import with Errors¶
Priority: P1 - Important
Complexity: Medium
Actor: Estimator
Flow:
| Step | Action | Error Detected |
|---|---|---|
| 1 | Upload Excel file | Processing... |
| 2 | System detects errors | Unknown material grade "XYZ123" |
| 2a | Missing cycle time for Operation 3 | |
| 2b | Negative scrap percentage | |
| 3 | System shows error report with line numbers | Error details with cell references |
| 4 | Estimator fixes issues in Excel | File updated |
| 5 | Re-uploads corrected file | Validation passed |
| 6 | Import succeeds | Quote draft created |
Error Handling:
| Feature | Supported | Details |
|---|---|---|
| Clear error messages with cell references | Yes | Shows exact Excel cell |
| Partial import option (skip errored rows) | Yes | Import valid data only |
| Downloadable error log | Yes | CSV export of errors |
UC-103: Import Legacy Excel (Non-Standard Format)¶
Priority: P1 - Important
Complexity: High
Actor: Estimator
Scenario: Factory has been using Excel for 10 years, custom format
Flow:
| Step | Action | Result |
|---|---|---|
| 1 | Upload custom Excel | Attempt auto-detection |
| 2 | System attempts auto-detection | Fails - format unknown |
| 3 | Estimator selects "Manual Field Mapping" mode | Mapping UI opens |
| 4 | System shows Excel preview | First 10 rows displayed |
| 5 | Estimator maps fields | "Item Code" → Part Number "Material Type" → Material Grade "Time per Piece (min)" → Cycle Time |
| 6 | System saves mapping template | Template saved |
| 7 | Future uploads use saved mapping | Auto-applied |
Key Feature: Excel-first onboarding (differentiation!)
UC-104: Similar Part Geometry Search¶
Priority: P1 - Important
Complexity: High
Actor: Estimator
Scenario: User uploads a part with a new Part Number (e.g., "AX-505"), but the factory has made a similar "Shaft" before.
Flow: 1. Upload: Estimator uploads part details. 2. Geometric Hashing: System analyzes critical dimensions (Diameter, Length, Material). 3. Similarity Detect: System identifies Part #AX-102 as a 90% geometric match. 4. Context Suggestion: Sidebar shows: "Found similar part AX-102. Usual quote: ₹1,100. Should I import its Routing logic?" 5. Selection: Estimator accepts suggeston to save 15 minutes of data entry.
Cost Calculation Use Cases¶
UC-201: Calculate Material Cost¶
Priority: P0 - Critical
Complexity: Low
Actor: System (automated)
Trigger: Material data imported
Calculation Steps:
| Step | Action | Value | Source |
|---|---|---|---|
| 1 | Get material grade | SAE4140 | Excel import |
| 2 | Look up current RM rate | ₹99.5/kg | Material Master (updated 2026-01-20) |
| 3 | Get gross weight | 2.304 kg | Excel (per drawing) |
| 4 | Get net weight | 2.0 kg | Excel (finished part) |
| 5 | Calculate yield | 86.8% | 2.0 / 2.304 |
| 6 | Apply formula | ₹263.95 | (2.304 × 99.5) / 0.868 |
| 7 | Save to cost breakdown with assumption tags | Saved | With full traceability |
Explainability Output:
Material Cost: ₹263.95
├─ Material: SAE4140 (from Excel)
├─ RM Rate: ₹99.5/kg (current market rate, last updated 2026-01-20)
├─ Gross Weight: 2.304 kg (per drawing)
├─ Net Weight: 2.0 kg (finished part)
├─ Yield: 86.8% (calculated)
└─ Formula: (2.304 × 99.5) / 0.868
Formula: $$ \text{Material Cost} = \frac{\text{Gross Weight} \times \text{RM Rate}}{\text{Yield}} $$
UC-202: Calculate Multi-Operation Cost¶
Priority: P0 - Critical
Complexity: Medium
Actor: System
Input: Routing with 5 operations
Calculation Breakdown:
| Operation | Setup Cost | Cycle Cost | Tool Cost | Total | Calculation |
|---|---|---|---|---|---|
| Op 1: Cutting | ₹0.07 | ₹14.40 | ₹0.00 | ₹14.47 | Setup: 0.30h @ ₹120/h ÷ 500pcs Cycle: 0.12h @ ₹120/h |
| Op 2: Turning | ₹0.05 | ₹72.00 | ₹0.00 | ₹72.05 | Setup: 0.20h @ ₹120/h ÷ 500pcs Cycle: 0.60h @ ₹120/h |
| Op 3: Threading | ₹0.08 | ₹137.20 | ₹2.00 | ₹139.28 | Setup: 0.30h @ ₹140/h ÷ 500pcs Cycle: 0.98h @ ₹140/h Tool: ₹2.00/pc |
| Op 4: Heat Treat | ₹0.04 | ₹8.00 | ₹0.00 | ₹8.04 | Setup: 0.10h @ ₹100/h ÷ 500pcs Cycle: 0.08h @ ₹100/h |
| Op 5: Coating | ₹0.06 | ₹4.55 | ₹0.00 | ₹4.61 | Setup: 0.15h @ ₹80/h ÷ 500pcs Cycle: 0.06h @ ₹80/h |
| Total | ₹0.30 | ₹236.15 | ₹2.00 | ₹238.45 |
Key Feature: Operations-first model (differentiation!)
UC-203: Apply Cascading Scrap¶
Priority: P0 - Critical
Complexity: Medium
Actor: System
Scenario: Need 1000 finished pieces, scrap at each stage
Cascading Calculation:
| Stage | Scrap % | Required Qty | Calculation |
|---|---|---|---|
| Final Output | - | 1000 pcs | Target quantity |
| Material Stage | 5% | 1053 pcs | 1000 / 0.95 |
| Operation 1 | 3% | 1085 pcs | 1053 / 0.97 |
| Operation 2 | 2% | 1107 pcs | 1085 / 0.98 |
| Raw Material Start | - | 1107 pcs | +10.7% total |
Cost Impact:
| Component | Impact | Notes |
|---|---|---|
| Material cost | +10.7% | Purchase 1107 instead of 1000 |
| Tracked in explainability | Yes | Full scrap traceability |
Explainability Use Cases¶
UC-301: Drill Down on Cost Line¶
Priority: P0 - Critical
Complexity: Medium
Actor: Estimator
Scenario: Customer questions why material cost is ₹264
Flow:
| Step | Action | Display |
|---|---|---|
| 1 | Estimator clicks on "Material Cost: ₹263.95" | Cost line highlighted |
| 2 | System shows popup | Material Cost Breakdown Source Data: ✓ Material Grade: SAE4140 (from Excel cell B7) ✓ Gross Weight: 2.304 kg (from Excel cell D13) ✓ RM Rate: ₹99.5/kg (from Material Master) Calculation: (Gross Weight × RM Rate) / Yield % = (2.304 × 99.5) / 0.868 = ₹263.95 Assumptions: • Yield: 86.8% (calculated from gross/net) • RM Rate: Current market rate (updated 2026-01-20) • No scrap surcharge applied [Override RM Rate] [Override Yield %] |
| 3 | Estimator screenshots this for customer | Screenshot taken |
| 4 | Customer satisfied with transparency | Accepted |
Key Feature: Explainable + defensible (differentiation!)
UC-302: Compare Two Versions¶
Priority: P1 - Important
Complexity: Medium
Actor: Estimator
Scenario: Customer asks "Why did quote go up from v1.0 to v1.1?"
Flow:
| Step | Action | Result |
|---|---|---|
| 1 | Open quote, select "Compare Versions" | Version selector shown |
| 2 | Choose v1.0 vs v1.1 | Loading comparison... |
| 3 | System shows diff | Detailed changes displayed |
| 4 | Estimator forwards comparison to customer with context | Email sent |
Diff Display:
| Cost Component | v1.0 | v1.1 | Change | Reason |
|---|---|---|---|---|
| Material Cost | ₹229.22 | ₹263.95 | +₹34.73 (+15.1%) | RM Rate: ₹89.5/kg → ₹99.5/kg "RM price increase from supplier" |
| Op 3: Threading | ₹125.00 | ₹139.28 | +₹14.28 (+11.4%) | Cycle: 0.85h → 0.98h "Revised time after trial run" |
| Total Impact | +₹49.01 (+9.3%) |
UC-303: Benchmark against History¶
Priority: P1 - Important
Complexity: Medium
Actor: Estimator
Scenario: Estimator identifies a new "Cost to Quote" of ₹950, but remembers charging ₹1,100 previously.
Main Success Scenario:
| Step | Action | System Response |
|---|---|---|
| 1 | Estimator begins costing for Part #AX-102 | System identifies historical quotes for the same or similar part number. |
| 2 | System displays "History Sidebar" | Shows: "Last Quoted: ₹1,100 (v2.0, 2025-11-15)". |
| 3 | Estimator completes the 950 estimate | System calculates variance: -₹150 (-13.6%). |
| 4 | System highlights "Significant Variance Detected" | UI shows a comparison bar: [Historical: 1,100] vs [Current: 950]. |
| 5 | Estimator clicks "Analyze Variance" | System pulls price-buildup from both versions to highlight delta (e.g., "Steel Rate was ₹110, now ₹98"). |
| 6 | Estimator confirms the new price as defensible | Variance note saved to audit log. |
Key Feature: Prevents "Price Drift" by surfacing historical context during active estimation.
UC-304: Low-Margin Approval Workflow¶
Priority: P0 - Critical
Complexity: Medium
Actor: Manager
Scenario: Estimator sets price to ₹950 (8% margin), which is below the "Aggressive" floor of 15%.
Flow: 1. Floor Check: System flags the 8% margin as "High Risk". 2. Restriction: "Publish Quote" button is disabled. 3. Request: Estimator clicks "Request Approval" and adds note: "Matching competitor price for strategic entry." 4. Notification: Sales Manager receives an app/email alert. 5. Action: Manager reviews the cost buildup (UC-301) and historical benchmark (UC-303). 6. Decision: Click "Approve". 7. Resolution: Quote button enabled; timestamped approval added to audit log (UC-902).
Versioning Use Cases¶
UC-401: Customer Requests Quantity Change¶
Priority: P1 - Important
Complexity: Low
Actor: Estimator
Flow:
| Step | Action | Result |
|---|---|---|
| 1 | Customer emails: "Please requote for 2000 pcs instead of 500" | Request received |
| 2 | Estimator opens quote v1.0 | Quote loaded |
| 3 | Clicks "Create New Version" | Version dialog opens |
| 4 | Changes quantity: 500 → 2000 | Recalculating... |
| 5 | System recalculates | Setup costs amortized over 2000 pcs (lower per-piece) Total cost per piece drops from ₹529 to ₹487 |
| 6 | Estimator adds note: "Qty change: 500 → 2000 pcs" | Note saved |
| 7 | Saves as v2.0 | Version created |
| 8 | Generates new quote | Quote ready |
Key Insight: Batch economics automatically calculated
UC-402: Material Price Increase¶
Priority: P1 - Important
Complexity: Medium
Actor: Admin
Scenario: Steel prices increased 12% across the board
Flow:
| Step | Action | Impact |
|---|---|---|
| 1 | Admin updates Material Master: SAE4140: ₹89.5/kg → ₹99.5/kg Effective date: 2026-01-24 |
Rate updated |
| 2 | System flags 47 open quotes using SAE4140 | Affected quotes identified |
| 3 | Admin selects "Bulk Update Affected Quotes" | Batch process started |
| 4 | For each quote: Create new version (v1.1, v1.2, etc.) Recalculate with new rate Add note: "RM price update (12% increase)" |
47 versions created |
| 5 | Estimators review and approve changes | Changes reviewed |
| 6 | Updated quotes sent to customers | Quotes sent |
Governance: Price changes auditable, traceable to source
Output Use Cases¶
UC-501: Generate Standard Quote¶
Priority: P0 - Critical
Complexity: Medium
Actor: Estimator
Output Requirements: - Professional PDF for customer - Detailed Excel for internal review
PDF Quote Structure:
| Section | Content |
|---|---|
| Header | Company Logo, Quote #Q-2026-0042, Date: 2026-01-24, Valid Until: 2026-02-24 |
| Customer Info | Customer: ABC Manufacturing Part: Receiver Housing (Drawing #RH-2024-05) |
| Pricing Scenarios | Base (25%): 1000 pcs @ ₹661.50 = ₹661,500 Aggressive (15%): 1000 pcs @ ₹608.00 = ₹608,000 Safe (35%): 1000 pcs @ ₹714.50 = ₹714,500 |
| Terms | Payment Terms: Net 30 Delivery: 6-8 weeks ARO Tooling: Included in piece price |
| Technical Specs | Material: SAE4140 Steel, 21mm diameter Processes: Cut, Turn, Thread, Heat Treat, Coat Quality: As per drawing specifications |
Excel Breakdown Structure:
| Sheet | Content |
|---|---|
| Sheet 1: Summary | Same as PDF |
| Sheet 2: Detailed Cost Breakdown | Material costs Each operation with time/rate Tooling costs Overheads Scrap factors |
| Sheet 3: Assumptions & Notes | Manual overrides with justifications Critical assumptions Customer-specific notes |
UC-502: Quote for Tender Submission¶
Priority: P1 - Important
Complexity: Low
Actor: Estimator
Scenario: Government tender requires specific format
Flow:
| Step | Action | Output |
|---|---|---|
| 1 | Generate standard quote | PDF + Excel created |
| 2 | Export cost data to tender template (Excel) | Data exported |
| 3 | Fill required fields | GST breakdown Make in India certification Delivery schedule |
| 4 | Upload to tender portal | Submitted |
| 5 | Keep CostEngine version for future reference | Version saved |
Feature: Export to custom templates
Edge Cases & Error Handling¶
UC-601: Missing Critical Data¶
Priority: P1 - Important
Complexity: Low
Actor: System
Scenario: Excel uploaded without material grade
Flow:
| Step | System Action | User Action | UI/UX Feedback |
|---|---|---|---|
| 1 | System detects missing material grade | - | Red Highlight on field B7 in the Excel preview table. |
| 2 | Halts import, shows error | - | Toast Notification: "Incomplete Data". A modal slides in showing the missing field. |
| 3 | - | Estimator enters "SAE4140" | Field turns from Red to White with a checkmark ✅. |
| 4 | Import resumes | Click "Continue" | Background processing indicator shown. |
UC-602: Unrealistic Values¶
Priority: P1 - Important
Complexity: Medium
Actor: System
Scenario: Typo in Excel: Cycle time = 100 hours (should be 1.0)
Flow:
| Step | System Action | Detection | UI/UX Feedback |
|---|---|---|---|
| 1 | System calculates operation cost = ₹12,000 | Calculation complete | Total cost bar turns Orange (Suspicious value). |
| 2 | Validation rule triggers | Cycle > 24 hrs | Inline Warning Icon ⚠️ next to the Turning Cycle row. |
| 3 | Warning shown | Popup triggered | Tooltip: "Value is 10x higher than peer parts." |
| 4 | Estimator clicks "Fix" | Value updated | Value turns Green briefly to confirm change. |
| 5 | System recalculates | Cost: ₹120/piece | Dashboard totals update in real-time with smooth animation. |
Safety: Catch data entry errors before bad quotes
UC-603: System-Wide UI Validation Patterns¶
Priority: P1 - Important
Category: UX/UI Hygiene
Standard system behaviors for input and feedback:
| Scenario | UI Pattern | Behavior |
|---|---|---|
| Mandatory Field | Asterisk (*) | Field label includes a red asterisk. Submit is disabled until filled. |
| Logic Conflict | Error Bar | If Net Weight > Gross Weight, show a persistent red header: "Physical Inconsistency Detected." |
| Manual Override | Yellow Highlight | Any cell carrying a manual override must have a yellow background to distinguish from calculated values. |
| Unsaved Changes | Form Guard | Prompt "Unsaved Changes" if the user attempts to navigate away during an edit. |
| Calculation Delay | Skeleton Load | Show shimmering placeholder states if background calculations take > 200ms. |
Integration Use Cases¶
UC-701: Sync with Tally ERP¶
Priority: P2 - Future
Complexity: High
Actor: Admin (scheduled job)
Flow:
| Time | Action | Result |
|---|---|---|
| 2:00 AM | Nightly job runs | Job started |
| 2:01 AM | System queries CostEngine for won quotes | 12 won quotes found |
| 2:02 AM | For each won quote: Create customer order in Tally Transfer BOM and quantities Set pricing from quote |
Orders created |
| 2:05 AM | System logs sync status | Log updated |
| 8:00 AM | Morning report shows 12 quotes synced | Report available |
Integration Point: REST API to Tally
UC-702: Email Integration¶
Priority: P2 - Future
Complexity: Low
Actor: Estimator
Flow:
| Step | Action | Pre-filled Data |
|---|---|---|
| 1 | Generate quote PDF | PDF created |
| 2 | Click "Email Quote" | Email compose opens |
| 3 | System pre-fills | To: customer email (from RFQ) Subject: "Quote #Q-2026-0042 for Receiver Housing" Body: Professional template Attachment: PDF + Excel |
| 4 | Estimator reviews and sends | Email sent |
| 5 | System tracks | "Quote sent on 2026-01-24 10:30 AM" |
Technical Use Cases (Pipeline & Ops)¶
UC-801: Incremental Excel Sync¶
Actor: Background Job (Temporal/Node.js)
Ensures that large Excel files don't bog down the UI and that only changed data creates new database versions.
- Checksum Generation: System hashes the incoming Excel file/sheet.
- Comparison: Compares with the hash of the last
v-current. - Diff Engine: If hashes differ, identifies which specific rows (Operations) or clusters (Material) have changed.
- Async Load: UI shows "Importing in progress (75%)" while the background worker processes the diff.
- Completion: User receives a toast: "Sync complete. 2 Operations updated, Material cost unchanged."
UC-802: Automated Rate Lock¶
Actor: System
Ensures that once a quote is "Published", changing a global Raw Material rate doesn't break historical data.
- Publish Trigger: Estimator marks quote as "Final".
- Snapshot: System copies the current global Material Rate and MHR into the
quote_itemrecord. - Decoupling: The quote now references its internal snapshot, not the global Master.
- Verification: Admin updates Steel Rate. Quote remains at the old rate unless the estimator explicitly chooses to "Upgrade Version".
UC-901: Database Failover Recovery¶
Actor: DevOps / Infrastructure
Standard Operating Procedure (SOP) for when the primary database becomes unresponsive.
- Detection: Monitoring system triggers an alert (Avg Latency > 2s).
- Traffic Halt: Load balancer returns 503 "Maintenance Underway".
- Failover: Promote Read Replica to Primary status.
- Verification: Run
SELECT count(*) FROM quotesto ensure zero data loss from the last 1-hour window (matching RPO). - Recovery: Restore traffic and notify Admin of the failover event.
UC-902: Audit Trail Forensic Search¶
Actor: Admin
Tracking down "who changed what" when a customer disputes a quote from 6 months ago.
- Search Params: Admin enters
part_number = "Y"and date range. - Log Retrieval: System pulls all
audit_logswheretarget_idmatches the part. - Timeline View: Displays a chronological list of:
- [Jan 10]: User A changed MHR from 200 to 220.
- [Jan 12]: User B overrode Steel Rate to 65.00 with reason "Special Supplier offer".
- Export: Admin exports this as a PDF "Traceability Report" to show the customer why the price changed mid-project.
UC-903: Containerized Deployment (Docker)¶
Actor: DevOps
Ensures the application runs identically in local dev, staging, and production environments.
- Containerization: Packaging of the FastAPI backend, Next.js frontend, and Celery workers into industry-standard Docker images.
- Orchestration: Use of
docker-composefor local testing and Cloudflare/Cloud Run for production. - Reproducibility: Ability to spin up a fresh testing environment in < 5 minutes for trial-run simulations.
UC-904: Centralized Observability & Logging¶
Actor: Admin / Developer
Consolidating logs from the API, Database, and Background workers into a single pane of glass.
- Unified Logging: Implementation of structured (JSON) logging across all microservices.
- Alerting: Integration with Sentry/ELK for high-severity error alerting.
- Telemetry: Tracking system health metrics (API latency, worker queue depth) to prevent downtime.
UC-905: MLOps Pipeline (Phase 3)¶
Actor: System / Data Science
Lifecycle management for the AI agents and Price Prediction models.
- Model Training: Automated retraining of RM rate forecasting models as new market data arrives.
- Version Control: Tracking which version of an LLM or Embedding model produced a specific agentic suggestion.
- Evaluation: Continuous monitoring of Agentic "Helpfulness" vs. Human overrides.
Use Case Testing Matrix¶
| Use Case | Manual Test | Automated Test | User Acceptance | Priority |
|---|---|---|---|---|
| UC-001 | Required | E2E test | 5 real RFQs | P0 |
| UC-002 | Required | Integration | 3 rush scenarios | P0 |
| UC-101 | Required | Unit test | 3 templates | P0 |
| UC-102 | Required | Unit test | Error scenarios | P1 |
| UC-103 | Required | Manual | Legacy formats | P1 |
| UC-201 | Spot check | Unit test | N/A | P0 |
| UC-202 | Spot check | Unit test | Multi-op routing | P0 |
| UC-203 | Spot check | Unit test | Scrap scenarios | P0 |
| UC-301 | Required | Manual | Customer demo | P0 |
| UC-302 | Required | Integration | Version test | P1 |
| UC-401 | Required | Integration | Qty changes | P1 |
| UC-402 | Required | Integration | Bulk updates | P1 |
| UC-501 | Required | Output test | Quote review | P0 |
| UC-502 | Required | Manual | Tender format | P1 |
| UC-601 | Required | Unit test | Missing data | P1 |
| UC-602 | Required | Unit test | Validation | P1 |
| UC-701 | Manual | Integration | ERP sync | P2 |
| UC-702 | Required | Integration | Email send | P2 |
| UC-801 | Required | Pipeline test | Sync logic | P0 |
| UC-802 | Required | Unit test | Snapshot lock | P1 |
| UC-901 | Manual | Chaos Test | Failover SOP | P1 |
| UC-902 | Required | Manual | Forensic search | P1 |
| UC-903 | Required | Unit Test | Docker Build | P1 |
| UC-904 | Required | Integration | Sentry Logs | P1 |
| UC-905 | Manual | Sandbox | Model Version | P2 |
Related Documentation¶
- Detailed Use Case Estimates → - Granular effort estimates for implementation
- Modular Blocks → - Architecture building blocks
- Core Workflows → - Detailed process flows
- MVP Scope → - Feature specifications