At a Glance
Owner: Product Admin / Procurement Lead · Table:tb_pricelist_template· Used by: vendor-pricelist (RFQ rounds spawn from a template) · The shape of a pricelist round — currency, validity, reminders, escalation.


A pricelist template is the shape of a pricelist round: which currency the quote is in, how many days the resulting pricelist stays valid, what reminder schedule chases vendors before the deadline, and after how many days an unfilled response escalates. The buyer picks the template when starting a new RFQ round; actual vendor responses live on the tb_pricelist child table.
Templates speed up recurring procurement cycles — instead of re-configuring every RFQ, the buyer reuses (for example) the "Quarterly Beverage RFQ" template with all its notification settings already in place.
Maintained by Product Admin or the procurement lead. Read by the RFQ creation flow and the reminder background job.
| Task | Where | Notes |
|---|---|---|
| Create a template | Master Data → Pricelist Templates → New | Pick currency, validity, reminders |
| Activate for new rounds | Set status = active |
Selectable in the new-RFQ picker |
| Edit reminder schedule | Template edit → reminder days | Array of days-before-deadline (e.g. [14,7,3,1]) |
| Retire a template | Set status = inactive |
Removed from pickers; historical RFQs still readable |
| Clone for a variant | Use UI clone action | Avoids re-entering currency/validity/reminders |
| Change vendor instructions | Template edit → vendor instructions text | Renders to vendor when RFQ is sent |
| Symptom | Cause | Action |
|---|---|---|
| "Name already exists" | Duplicate among non-deleted templates | Pick different name (app-enforced) |
| Cannot delete | Template has issued RFQ rounds | Flip status = inactive instead |
| Reminder days rejected | Not sorted descending or contains non-positive integers | Fix the array (e.g. [14,7,3,1]) |
| "Currency not active" | tb_currency.is_active = false |
Activate currency under master-data/currency |
| Validity negative | validity_period < 0 |
Use a non-negative integer |
draft → active → inactive. draft is editable; active is selectable; inactive removes from pickers but stays readable on history.Source: tenant schema.
tb_pricelist_template| Field | Prisma Type | Nullable | Description |
|---|---|---|---|
id |
String @db.Uuid |
No | Primary key. |
name |
String @db.VarChar |
No | Template name. |
status |
enum_pricelist_template_status |
No | draft (default), active, inactive. |
description |
String? @db.VarChar |
Yes | Free text. |
note |
String? @db.VarChar |
Yes | Internal note. |
vendor_instructions |
String? @db.Text |
Yes | Rendered to vendor on RFQ send. |
currency_id |
String? @db.Uuid |
Yes | FK to tb_currency. |
currency_code |
String? @db.VarChar |
Yes | Denormalised display copy. |
validity_period |
Int? |
Yes | Days the resulting pricelist stays valid after issuance. |
send_reminders |
Boolean? |
Yes | Master switch (default true). |
reminder_days |
Json? @db.JsonB |
Yes | Array of days-before-deadline (e.g. [14, 7, 3, 1]). |
escalation_after_days |
Int? @db.Integer |
Yes | Days after deadline to escalate (default 0). |
info, dimension, doc_version |
— | Mixed | Standard metadata. |
| Audit columns | — | Yes | created_*, updated_*, deleted_*. |
Constraints: Primary key on id. FK on currency_id onDelete: NoAction. Reverse relations to tb_pricelist_template_detail and tb_request_for_pricing.
enum_pricelist_template_status: draft, active, inactive.
name unique among non-deleted (application-enforced; no explicit @@unique).inactive instead.validity_period >= 0; escalation_after_days >= 0; reminder_days sorted descending with positive integers; currency_id must reference an active currency.draft editable; active selectable for new RFQs; inactive removes from pickers, keeps readable.currency_id resolution.../carmen-turborepo-backend-v2/packages/prisma-shared-schema-tenant/prisma/schema.prisma — tb_pricelist_template (lines ~3869-3911), enum_pricelist_template_status (lines ~3863-3867).../carmen-inventory-frontend/app/(root)/(protected)/vendor-management/price-list-template/.