One record for every purchase order, and everything attached to it.
Fashion Operations Intelligence
Purchase orders, supplier documents, letters of credit and correspondence connected in a single operational model.
- Category
- Enterprise platform
- Industry
- Fashion
- Work type
- Apps, AI, Integrations
- Stack
- Next.js, NestJS, PostgreSQL, Microsoft Graph, Document AI

01Context
A fashion sourcing operation working with several overseas suppliers per season. Each purchase order generates proformas, packing lists, letter-of-credit paperwork and a long tail of email, handled by a small team across buying, logistics and finance.
The business problem
Purchase orders, proformas, letters of credit and supplier email all describe the same activity in different formats. Without explicit relationships, the team rebuilds the state of an order by hand, from inboxes and spreadsheets.
What we built
A relationship-centred platform: orders linked to suppliers, styles, documents and financial milestones. Incoming mail and attachments are classified and filed against the order they belong to, with AI suggestions held for review.
02System architecture
Systems, flows and the boundaries between them.
- Service
- System of record
- External system
- Gate
- Asynchronous
- 1Microsoft 365 mail to Ingestion workerChange notification, then delta query
- 2Supplier documents to Ingestion workerUpload API
- 3Bank LC advices to Ingestion workerForwarded advice or upload
- 4Ingestion worker to Original filesOriginal stored with content hash
- 5Ingestion worker to Document AIQueued analysis job · async
- 6Document AI to Record matcherTyped fields, schema-validated
- 7Record matcher to Suggestion queueSuggested link and line-level diff
- 8Suggestion queue to Order graphConfirmed write with audit entry
- 9Order graph to Operations consoleTyped API, scoped by role
Components: Microsoft 365 mail (External system, Graph notifications); Supplier documents (External system, proforma · packing list); Bank LC advices (External system, PDF by email or upload); Ingestion worker (Service, dedupe · hash · store); Original files (System of record, object storage); Document AI (Service, classify · extract); Record matcher (Service, PO ref · supplier); Suggestion queue (Approval or permission gate, person confirms); Order graph (System of record, PostgreSQL · NestJS); Operations console (Service, Next.js · role views).
Major capabilities
- Order graph
- Orders, styles, suppliers, documents and payment milestones as linked records with their own history.
- Mailbox ingestion
- Shared mailboxes read through Microsoft Graph; attachments stored once, with a content hash.
- Document classification
- Proformas, packing lists and LC documents typed and their fields extracted against a schema.
- Discrepancy detection
- Extracted quantities and values compared line by line with the purchase order.
- LC milestone tracking
- Opening, shipment, presentation and payment tracked per order, with what blocks each step.
03Engineering approach
The decisions that shaped the system.
We modelled the domain before drawing a screen. Once order, supplier, document and milestone had explicit relationships, every interface became a view over the same graph, and automation had something precise to write to.
- 01
Model the relationships before the screens.
Order, supplier, document and milestone are first-class records. Screens are views; the graph is the product.
- 02
AI classifies and suggests. A person confirms.
A wrong link on a letter of credit has a financial cost, so model output becomes a suggestion with its evidence, never a silent write.
- 03
Every document keeps its original.
Extracted fields sit beside the source file and its hash, so any value can be traced back to the page it came from.
04Workflow
A packing list arrives
From an inbound email to a held LC presentation. The system prepares the decision; a buyer makes it.
- External
mail.receivedSupplier email with two attachments reaches the shipping mailbox.
- System
document.storedAttachments stored as originals; duplicate of an earlier send detected and skipped.
- System
document.classifiedClassified as packing list, fields extracted and validated against the schema.
- System
order.matchedMatched to PO-27-0418 by order reference and supplier.
- System
lines.comparedLine 2 shows 216 units against 180 ordered.
- System
suggestion.createdSuggested: hold LC document presentation, notify supplier.
- Person
suggestion.confirmedBuyer confirms the hold. Order milestone updated, supplier email drafted for review.
05Integration complexity
What each connection has to survive.
| System | Interface | What makes it hard |
|---|---|---|
| Microsoft 365 | Graph change notifications, delta queries | Subscriptions expire and must be renewed; notifications can arrive late or twice. |
| Supplier documents | Email attachments and uploads | No shared format: the same field appears in different places on every supplier's template. |
| Banking paperwork | PDF advices and drafts | LC terms are strict; a mismatch between documents can delay payment. |
06Challenges solved
Problems we had to design around.
- 01
The same shipment described by four documents that disagree.
Line-level comparison against the purchase order, with differences raised as reviewable suggestions.
- 02
Supplier templates vary and change without notice.
Schema-validated extraction per document type; failures route to review instead of guessing.
- 03
Order history lived in individual inboxes.
Shared mailbox ingestion with every message filed against the order it concerns.
07Outcomes
The team navigates one record per order, with source documents, LC milestones and correspondence beside every decision, instead of reconstructing it.
Outcomes are described at capability level. Client figures stay with the client.
- The state of an order is read from one record rather than reassembled from inboxes.
- Quantity and value discrepancies are raised when the document arrives, before LC presentation.
- Every automated suggestion carries its evidence and the name of the person who confirmed it.
Relevant services
Bring us the process everyone works around.
The spreadsheet that runs the business, the inbox nobody can leave, the integration that breaks quietly. Tell us where operations slow down and we will show you how we would engineer it.
What happens next
- 01A conversation with the engineers who would build it.
- 02A short written view of the problem and how we would approach it.
- 03A scoped proposal, if working together makes sense.