feat(auth): per-user UI language preference (sq default, en)

Add users.language ('sq'|'en', default 'sq'; migration 0003). Returned from
/api/auth/login and /api/auth/me (read from the DB, not the JWT — so changing it
needs no re-login). New PUT /api/auth/language for self-service. Loaded on login
and restored from any booth. Printed tickets stay Albanian (customer-facing).
This commit is contained in:
2026-06-18 11:47:30 +02:00
parent 062feeae2f
commit 445bca0bf6
5 changed files with 855 additions and 3 deletions
+6
View File
@@ -22,6 +22,12 @@ export const users = sqliteTable("users", {
role: text("role", {
enum: ["admin", "operator", "cashier", "readonly"],
}).notNull(),
// Preferred UI language for this user (operator-facing). Loaded on login and
// restored from any booth. Albanian is the default. Printed tickets are NOT
// governed by this — they're always Albanian (customer-facing). See i18n.md.
language: text("language", { enum: ["sq", "en"] })
.notNull()
.default("sq"),
createdAt: text("created_at")
.notNull()
.default(sql`(current_timestamp)`),