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.

Krafta operates a network of allied printing workshops (talleres) in Venezuela. The workshops admin at /admin/workshops provides a CRUD interface for the Workshop model — the entities that actually produce orders once payment is confirmed. Each workshop record holds its contact details, operational capacity, service-level agreement (SLA), payment policy, and geographic base. When the database is unavailable, the API falls back to a local public/workshops.json file seeded with two default workshops.

Workshop model fields

FieldTypeDescription
nameStringPublic-facing workshop name
contactNameStringPrimary contact person
phoneStringContact phone number (Venezuelan format: 0414...)
emailStringContact email address
cityBaseStringCity where the workshop operates
stateBaseStringVenezuelan state
capacityPerDayIntMaximum units the workshop can produce per day
slaDaysIntStandard production lead time in business days
paymentPolicyPaymentPolicyHow Krafta pays the workshop (see below)
activeBooleanWhether the workshop appears in assignment dropdowns

Payment policy options

Enum valueLabelDescription
DEPOSITO_TOTALDepósito TotalFull payment transferred before production begins
DEPOSITO_PARCIALDepósito Parcial50 % upfront, 50 % on completion
PAGO_AL_FINALIZARPago al FinalizarFull payment after the order is ready
PAGO_CONTRA_ENTREGAPago Contra EntregaPayment on physical delivery of the goods

Create a workshop

POST /api/workshops — request body

{
  "name": "Lara Impresiones C.A.",
  "contactName": "Carlos Rojas",
  "phone": "04141234567",
  "email": "contacto@laraimp.com",
  "cityBase": "Barquisimeto",
  "stateBase": "Lara",
  "capacityPerDay": 40,
  "slaDays": 3,
  "paymentPolicy": "PAGO_AL_FINALIZAR"
}
name
string
required
Workshop display name.
contactName
string
required
Full name of the primary point of contact.
phone
string
required
Venezuelan mobile number. Used to generate WhatsApp dispatch links in the orders panel.
email
string
required
Contact email. Used to generate production order email links.
cityBase
string
Base city. Defaults to "Barquisimeto" if omitted.
stateBase
string
Venezuelan state. Defaults to "Lara" if omitted.
capacityPerDay
integer
Maximum daily production units. Defaults to 10 if omitted.
slaDays
integer
Production lead time in business days. Defaults to 3 if omitted.
paymentPolicy
string
One of the PaymentPolicy enum values. Defaults to "PAGO_AL_FINALIZAR".

Default seeded workshops

When no workshops exist in the database, the API serves these two defaults from the local fallback file:
WorkshopCityStateCapacitySLAPolicy
Taller Creativo BarquisimetoBarquisimetoLara50/day3 daysPAGO_AL_FINALIZAR
Taller Cabudare PremiumCabudareLara30/day2 daysDEPOSITO_TOTAL

WorkshopOffer — variant pricing

A WorkshopOffer links a specific workshop to a specific ProductVariant with a production cost. This is how per-product pricing is configured for each workshop.
FieldDescription
workshopIdThe workshop providing the offer
variantIdThe product variant this price applies to
costProduction cost in USD charged by the workshop
currencyCurrency code, default "USD"
minQuantityMinimum order quantity for this price to apply
reviewRequiredIf true, the price is subject to manual review before confirmation
activeWhether this offer is currently available for assignment

WorkshopCoverage — geographic routing

WorkshopCoverage records define which Venezuelan states and cities a workshop can serve. The delivery routing logic uses these records alongside FulfillmentRule to match an order’s shippingState to the appropriate origin city and delivery method. FulfillmentRule maps a destination state to an originCity (default: "Barquisimeto"), a preferredMethod, and an optional backupMethod using the DeliveryMethod enum (PICKUP, LOCAL_DELIVERY, NATIONAL_SHIPPING).

Production assignment

When an order reaches CONFIRMED status and an admin assigns a workshop in the orders panel, a ProductionAssignment record is created:
FieldDescription
orderItemIdThe specific order item being assigned
workshopIdThe assigned workshop
workshopOfferIdThe WorkshopOffer that determined pricing
agreedCostProduction cost frozen at the moment of assignment — not affected by future offer price changes
statusStarts as PENDING_ASSIGNMENT and advances through NOTIFIED → ACCEPTED → IN_PRODUCTION → READY → HANDED_TO_DELIVERY → COMPLETED

WorkshopPayable lifecycle

Each ProductionAssignment generates one or more WorkshopPayable records representing what Krafta owes the workshop:
StatusMeaning
PENDINGPayment not yet sent
PARTIALPartial amount paid (applicable under DEPOSITO_PARCIAL policy)
PAIDFull amount settled
Each payable record tracks amount, policy, dueDate, paidAmount, and an optional reference and receiptUrl for the outgoing transfer.

Build docs developers (and LLMs) love