Skip to main content

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:
FieldDescription
orderNumberHuman-readable order identifier
createdAtDate the order was placed
statusCurrent production stage (see lifecycle below)
shippingCity / shippingStateDelivery destination
items[].productNameName of the product to be produced
items[].quantityNumber of units to produce
items[].previewUrlPrint-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:
StatusMeaningAvailable action
REPORTEDPayment submitted by customer, awaiting admin verificationNo operator action — wait for admin to confirm payment
CONFIRMEDPayment verified; order is ready to enter productionComenzar Producción → advances to IN_PRODUCTION
IN_PRODUCTIONWorkshop is actively manufacturing the itemMarcar como Listo → advances to READY
READYItem is fully produced and ready for pickup or dispatchDespachar / Entregar → advances to DISPATCHED
DISPATCHEDItem has been handed to the customer or delivery carrierNo 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:
FieldDescription
orderItemIdThe order item being produced
workshopIdThe workshop responsible for this assignment
workshopOfferIdThe offer selected at routing time
agreedCostProduction cost frozen at assignment creation time
currencyAlways "USD"
statusCurrent 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.
FieldDescription
assignmentIdThe assignment this payable is associated with
amountTotal amount owed to the workshop
policyPayment policy snapshot (DEPOSITO_TOTAL, DEPOSITO_PARCIAL, PAGO_AL_FINALIZAR, or PAGO_CONTRA_ENTREGA)
dueDateWhen the payment is due
paidAmountAmount already paid toward this payable
referencePayment reference number
receiptUrlLink to the payment receipt
statusPENDING, 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.

Build docs developers (and LLMs) love