Replace entire repo content with kottgard-production-v1.1.zip (for shahikitchen-prod repo)

This commit is contained in:
root
2026-06-29 15:04:08 +00:00
parent 6cd5aaa048
commit 57cc67d2d3
850 changed files with 26149 additions and 15588 deletions
-45
View File
@@ -1,45 +0,0 @@
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,
};
}