NewWork mode: your Claude Code or Codex on work calls, answering from your project's codeSkip to content
Middle0 views

Design a platform for processing equipment repair requests, including diagnostics, spare parts, and warranties.

Practice

Asked at

AI answer

Architecture

Key components: request intake and management, diagnostics, parts catalog and inventory, repairs/technician assignments, warranty, and notifications. The API serves customers and employees; services exchange events through a broker. The database stores service requests and their states, while diagnostic files and photos are stored in object storage.

Model and lifecycle

A service request contains the customer, device and serial number, symptoms, attachments, status, history, and assignees. Example states: created → diagnostics → awaiting approval → awaiting parts → repair → inspection → ready/closed. Transitions are explicitly defined, with checks and auditing. A diagnostic report stores its version, author, test results, and cost estimate; changing the estimate after approval requires the customer's approval again.

Parts and warranty

Reserve parts atomically so concurrent requests cannot claim the same stock. Track available stock, reservations, and actual consumption separately; when a reservation is canceled, return the part to inventory. For parts in short supply, track supplier orders and expected delivery dates. Warranty verification considers the model, serial number, purchase date, terms, and history of previous repairs; save the result and the rules used in the service request.

Reliability and controls

Send status-change notifications asynchronously and idempotently. Integrate external services—suppliers, payment systems, or CRM—through adapters, timeouts, and retries; do not block a service request when a dependency is temporarily unavailable. Role-based access separates customers, technicians, inventory staff, and administrators. Audit changes, protect personal data, and back up data. Track diagnostic and repair times, repeat repair rates, parts shortages, and overdue requests.