feat: add currency for articles (#834)

Co-authored-by: Jakob Wennberg <jakob.wennberg@gmail.com>
This commit is contained in:
Alexander Reinthal
2026-07-16 16:00:05 +02:00
committed by GitHub
co-authored by Jakob Wennberg
parent 2a1ec5ec2f
commit edef48471c
11 changed files with 193 additions and 6 deletions
+5
View File
@@ -529,6 +529,11 @@ export const CreateArticleSchema = z.object({
unit: z.string().min(1).max(32).optional(),
price_excl_vat: nonNegativeAmount,
vat_rate: vatRatePercent.optional(),
// Default price currency; omitted = SEK. Pre-fills a new invoice's currency.
// Constrained to the same CurrencySchema enum invoices use, which mirrors the
// seeded currencies reference table: an unknown code is a clean 400 here
// instead of a raw FK violation (23503) surfacing at insert time.
currency: CurrencySchema.optional(),
// Optional BAS class-3 revenue-account override. Null/omitted = derive from
// the invoice's VAT treatment (current behaviour).
revenue_account: revenueAccount.nullable().optional(),