feat(validations): merchant (bar/lavazh) ticket validations end-to-end

In-park merchants discharge customers' parking: a merchant user scans the
ticket on their device (/validate; validation:create + program↔user binding)
and applies their program — comp / first-N-minutes free / amount-off (capped,
typed at scan) / percent. All money stays at the booth: the quote folds live
validations in a canonical order (timeCredit → percent → fixed → comp, net
floors at 0, Σ lines ≡ gross − net), the payment records gross/discount and
CONSUMES the validation ids (an overstay's fresh period never re-applies
them), the receipt prints the gross → lines → net story, and the Z/X-report
carries discountTotalMinor leakage. Every apply/void is a signed, attributed
ledger event (refId = append-only void); program config is /setup/site master
data (Bar/Lavazh checkboxes + right-column panel, tabs when both) whose saves
sign config_change. Migration 0024 + reset-db drift-guard entries; 8 route
integration tests + priceSession fold suite.

See wiki/concepts/validation-discounts.md for the full design record.

Claude-Session: https://claude.ai/code/session_01YYkpEsLmoQPaize5ec3oUm
This commit is contained in:
2026-07-13 19:49:58 +02:00
parent ba7538aeb5
commit 692dff5f89
24 changed files with 1939 additions and 14 deletions
+47
View File
@@ -68,6 +68,7 @@ export const sq = {
logs: "Loget",
backup: "Kopje rezervë",
profile: "Profili",
validate: "Validime",
},
drawer: {
stateTitle: "Arka tani",
@@ -235,6 +236,7 @@ export const sq = {
evtCashOut: "PAGESË",
evtCashReview: "SHQYRTIM",
evtConfigChange: "KONFIG",
evtValidation: "VALIDIM",
decision: { authorize: "autorizuar", deny: "refuzuar" },
evtAnomaly: "ANOMALI",
evtRefused: "REFUZUAR",
@@ -748,6 +750,51 @@ export const sq = {
fieldPhone: "Telefoni",
fieldEmail: "Email",
},
// Merchant validations (bar / lavazh) — the /setup/site panel, the merchant's
// /validate screen, and the booth-modal discount lines. See validation-discounts.md.
val: {
// /setup/site
sectionTitle: "Validime tregtare",
sectionHint: "Shërbime të tjera brenda parkut (bar / lavazh) skanojnë biletën e hyrjes dhe bëjnë zbritje — pagesa dhe fatura bëhen në kabinë.",
enableBar: "Bar",
enableLavazh: "Lavazh",
labelName: "Etiketa në faturë",
labelNamePh: "p.sh. Lavazh — 1 orë falas",
mode: "Lloji i zbritjes",
modeComp: "Parkimi falas plotësisht",
modeTimeCredit: "Minutat e para falas",
modeFixed: "Zbritje shume (shkruhet në skanim)",
modePercent: "Zbritje në përqindje",
minutes: "Minuta falas",
percent: "Përqindja (%)",
maxAmount: "Tavani i zbritjes për validim",
maxPerDay: "Maks. validime në ditë (bosh = pa kufi)",
users: "Përdoruesit që validojnë",
usersHint: "Vetëm përdoruesit e zgjedhur (me lejen validation:create në rolin e tyre) mund të aplikojnë këtë program nga pajisja e tyre.",
noUsers: "Asnjë përdorues në sistem — krijojeni te Përdoruesit.",
saved: "U ruajt.",
// /validate (the merchant screen)
title: "Validim biletash",
scanPrompt: "Skanoni ose shkruani numrin e biletës",
lookup: "Kërko",
entry: "Hyrja:",
notFound: "Nuk u gjet biletë me këtë numër.",
closed: "Bileta është e mbyllur (ka dalë ose është anuluar).",
subscription: "Kjo është hyrje abonenti — nuk validohet.",
amountLabel: "Shuma e zbritjes",
amountHint: "maks. {{max}}",
apply: "Apliko validimin",
applied: "Validimi u aplikua.",
existing: "Validime në këtë biletë",
voided: "anuluar",
used: "përdorur në pagesë",
void: "Anulo",
confirmVoid: "Të anulohet ky validim?",
noPrograms: "Nuk keni asnjë program validimi të lidhur me ju — kontaktoni administratorin.",
// booth pay modal / receipts
gross: "Tarifa",
discount: "Zbritje",
},
users: {
title: "Përdoruesit",
add: "+ Shto përdorues",