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.

Allied print shops join the Krafta network as production partners under the TALLER role. Once onboarded, a workshop receives order assignments, processes each item according to its configured offers and SLA, and hands finished orders to delivery. Krafta currently operates with workshops based in the state of Lara, Venezuela, and the network can be expanded by an admin at any time.

Workshop data model

A Workshop record holds the core identity and operational parameters of a print shop:
FieldTypeDescription
nameStringDisplay name of the workshop
contactNameStringPrimary contact person
phoneStringContact phone number
emailStringContact email address
cityBaseStringCity where the workshop is physically located
stateBaseStringVenezuelan state of the workshop
capacityPerDayIntMaximum number of units the workshop can produce per day
slaDaysIntCommitted turnaround time in business days
paymentPolicyPaymentPolicyWhen Krafta pays the workshop (see below)
activeBooleanWhether the workshop can receive new assignments

Payment policies

The paymentPolicy field controls when Krafta settles the agreed cost with the workshop:
ValueMeaning
DEPOSITO_TOTALFull payment before production begins
DEPOSITO_PARCIALPartial upfront payment, remainder on completion
PAGO_AL_FINALIZARFull payment after production is complete
PAGO_CONTRA_ENTREGAPayment when the order is handed to delivery

Linking users to a workshop

The WorkshopUser model creates a one-to-one link between a User with the TALLER role and a Workshop record:
model WorkshopUser {
  id         String   @id @default(uuid())
  userId     String   @unique
  workshopId String
  user       User     @relation(fields: [userId], references: [id], onDelete: Cascade)
  workshop   Workshop @relation(fields: [workshopId], references: [id], onDelete: Cascade)
}
A single workshop can have multiple WorkshopUser entries, but each User can only belong to one workshop.

Workshop offers

A WorkshopOffer defines what a workshop charges to produce a specific ProductVariant:
FieldDescription
workshopIdThe workshop providing this offer
variantIdThe product variant this offer applies to
costProduction cost charged by the workshop
currencyCurrency for the cost, defaults to "USD"
minQuantityMinimum order quantity for this offer to apply
reviewRequiredIf true, orders using this offer require manual quote review before confirmation
activeWhether this offer is currently available for routing
When reviewRequired is true on a WorkshopOffer, an assigned order is not automatically confirmed — it enters a manual review step where the admin or workshop operator must approve the final cost before production begins.

Workshop coverage

WorkshopCoverage records define the geographic areas a workshop can deliver to:
model WorkshopCoverage {
  id         String   @id @default(uuid())
  workshopId String
  stateName  String
  cityName   String?   // Optional: restricts coverage to a specific city
  workshop   Workshop @relation(fields: [workshopId], references: [id], onDelete: Cascade)
}
A coverage entry with only stateName covers the entire state. Adding a cityName restricts it to that specific city within the state.

Seeded workshops

Two workshops are included in the default seed data and are available immediately after setup: Taller Creativo Barquisimeto (id: "main-workshop-lara")
  • cityBase: Barquisimeto, stateBase: Lara
  • capacityPerDay: 50 units/day
  • slaDays: 3 business days
  • paymentPolicy: PAGO_AL_FINALIZAR
Taller Cabudare Premium (id: "taller-cabudare")
  • cityBase: Cabudare, stateBase: Lara
  • capacityPerDay: 30 units/day
  • slaDays: 2 business days
  • paymentPolicy: DEPOSITO_TOTAL
Both workshops are set to active: true and are immediately selectable as print providers in the creator dashboard publish wizard and in the admin routing panel.

Onboarding a new workshop

New workshops are created by an admin using POST /api/workshops. The endpoint requires the ADMIN role.
POST /api/workshops
Content-Type: application/json

{
  "name": "Taller Ejemplo Valera",
  "contactName": "María González",
  "phone": "04241234567",
  "email": "maria@tallerejemplo.com",
  "cityBase": "Valera",
  "stateBase": "Trujillo",
  "capacityPerDay": 20,
  "slaDays": 4,
  "paymentPolicy": "DEPOSITO_PARCIAL"
}
After the workshop record is created, the admin assigns a TALLER user by creating a WorkshopUser entry. The workshop operator can then log in and access the dashboard at /workshop/dashboard to begin receiving and processing production assignments.

Build docs developers (and LLMs) love