35 lines
1.2 KiB
Markdown
35 lines
1.2 KiB
Markdown
# Price set version tables
|
|
|
|
## Wizard (2 steps)
|
|
|
|
1. Basic info + view bound customers (read-only)
|
|
2. Edit product prices (library pull on next)
|
|
|
|
- No manual effective_time input.
|
|
- Draft version: status=0, effective_time null until activate.
|
|
- Activate: sets effective_time=now; previous version expires. Does not change package header status.
|
|
- Copy as new version: `POST /price/set/version/copy/{psvId}` inserts new draft `prc_price_set_version` and copies `prc_price_set_detail` (+ surcharge snapshots) from source psv_id.
|
|
- Audit submit/approve/reject removed from UI save path.
|
|
|
|
## Graph
|
|
|
|
```
|
|
prc_price_set
|
|
-> prc_price_set_version draft / active / expired
|
|
-> prc_price_set_detail product prices (psv_id)
|
|
-> prc_price_set_version_surcharge
|
|
```
|
|
|
|
## Status
|
|
|
|
Version: 0 draft, 1 active, 2 expired. Active when effective_time <= now and (expire_time null or > now).
|
|
|
|
## SQL
|
|
|
|
1. `price_set_version.sql`
|
|
2. `price_set_version_eff_nullable.sql` (allow null `prc_price_set.effective_date` and `prc_price_set_version.effective_time` for drafts)
|
|
|
|
## Billing
|
|
|
|
Match by price_set_id; multi-version quote should filter active psv_id by bill time.
|