Documentation Index
Fetch the complete documentation index at: https://mintlify.com/PloutusLab/krafta-web/llms.txt
Use this file to discover all available pages before exploring further.
The workshop dashboard at /workshop/dashboard is the production control center for allied print shops. Access requires the TALLER or ADMIN role — workshop operators reach it directly after logging in. The dashboard fetches all orders from /api/orders, filters them to show items requiring workshop attention, and provides action buttons to advance each order through the production lifecycle.
Viewing the production queue
The dashboard displays a grid of order cards — each card shows the order number, creation date, current status, shipping destination, and the list of items to be produced. Where a print file (previewUrl) is attached to an order item, a thumbnail is shown and a Descargar Archivo button allows the operator to download the high-resolution print file to begin production.
Key fields visible on each order card:
| Field | Description |
|---|
orderNumber | Human-readable order identifier |
createdAt | Date the order was placed |
status | Current production stage (see lifecycle below) |
shippingCity / shippingState | Delivery destination |
items[].productName | Name of the product to be produced |
items[].quantity | Number of units to produce |
items[].previewUrl | Print-ready design file URL |
Production status lifecycle
Orders that arrive at the workshop queue carry statuses set by the platform and the admin payment verification flow. Workshop operators advance orders through production using the action buttons on each card:
| Status | Meaning | Available action |
|---|
REPORTED | Payment submitted by customer, awaiting admin verification | No operator action — wait for admin to confirm payment |
CONFIRMED | Payment verified; order is ready to enter production | Comenzar Producción → advances to IN_PRODUCTION |
IN_PRODUCTION | Workshop is actively manufacturing the item | Marcar como Listo → advances to READY |
READY | Item is fully produced and ready for pickup or dispatch | Despachar / Entregar → advances to DISPATCHED |
DISPATCHED | Item has been handed to the customer or delivery carrier | No further operator action required |
The status values above (CONFIRMED, IN_PRODUCTION, READY, DISPATCHED) are the order-level statuses used in the workshop dashboard UI and updated via PUT /api/workshop. The Prisma schema additionally defines a ProductionAssignment model with its own AssignmentStatus enum (PENDING_ASSIGNMENT, NOTIFIED, ACCEPTED, IN_PRODUCTION, READY, HANDED_TO_DELIVERY, COMPLETED, REJECTED, CANCELLED) for finer-grained tracking when the full assignment routing flow is active.
Production assignment model
Behind each routed order item, a ProductionAssignment record tracks the workshop relationship and agreed cost. Key fields:
| Field | Description |
|---|
orderItemId | The order item being produced |
workshopId | The workshop responsible for this assignment |
workshopOfferId | The offer selected at routing time |
agreedCost | Production cost frozen at assignment creation time |
currency | Always "USD" |
status | Current stage per AssignmentStatus enum |
agreedCost is locked permanently when the assignment is created. It reflects the WorkshopOffer.cost at the moment of routing and will not change even if the offer is later updated.
Workshop payables
The WorkshopPayable model tracks the amounts Krafta owes the workshop for each completed assignment. Payables are generated according to the workshop’s paymentPolicy and updated as payments are made.
| Field | Description |
|---|
assignmentId | The assignment this payable is associated with |
amount | Total amount owed to the workshop |
policy | Payment policy snapshot (DEPOSITO_TOTAL, DEPOSITO_PARCIAL, PAGO_AL_FINALIZAR, or PAGO_CONTRA_ENTREGA) |
dueDate | When the payment is due |
paidAmount | Amount already paid toward this payable |
reference | Payment reference number |
receiptUrl | Link to the payment receipt |
status | PENDING, PARTIAL, or PAID |
Multiple WorkshopPayable records can exist for a single assignment when the payment policy requires split payments (for example, DEPOSITO_PARCIAL generates two payables: one for the deposit and one for the remainder).
Managing offers and coverage
Workshop operators and admins can update the workshop’s pricing and delivery scope using the workshops API:
- Update workshop details — call
PUT /api/workshops with the workshop id and updated fields to change capacityPerDay, slaDays, paymentPolicy, and contact details.
- Add or update a
WorkshopOffer — set the cost, currency, minQuantity, and reviewRequired flag for a specific ProductVariant to control what the workshop charges and whether orders need manual review.
- Configure coverage — create
WorkshopCoverage records specifying the stateName and optional cityName to define the geographic areas the workshop can serve.
To deactivate a workshop and stop it from receiving new assignments, send DELETE /api/workshops?id=[workshopId]. This sets active: false on the workshop record without deleting any historical assignment or payable data.