Replace entire repo content with shahikitchen-v1-prodcution.zip (v1.1 production)

This commit is contained in:
root
2026-06-25 13:44:21 +00:00
parent 284dcfa120
commit 6cd5aaa048
850 changed files with 15616 additions and 26143 deletions
+45
View File
@@ -0,0 +1,45 @@
export type Branch = 'askim' | 'backaplan';
export interface ValidTableId {
valid: true;
branch: Branch;
tableNumber: string;
tableIdentifier: string;
}
export interface InvalidTableId {
valid: false;
reason: 'missing' | 'format' | 'range';
}
export type ParsedTableId = ValidTableId | InvalidTableId;
const TABLE_ID_PATTERN = /^(backaplan|askim)-([0-9]{3})$/;
const MIN_TABLE = 1;
const MAX_TABLE = 40;
/** Domain rule: parse and validate QR table identifiers. */
export function parseTableId(raw: string | null | undefined): ParsedTableId {
if (!raw) {
return { valid: false, reason: 'missing' };
}
const match = raw.match(TABLE_ID_PATTERN);
if (!match) {
return { valid: false, reason: 'format' };
}
const branch = match[1] as Branch;
const tableNum = parseInt(match[2], 10);
if (tableNum < MIN_TABLE || tableNum > MAX_TABLE) {
return { valid: false, reason: 'range' };
}
return {
valid: true,
branch,
tableNumber: match[2],
tableIdentifier: raw,
};
}