feat: zvýraznění dnů v historii obsahujících objednávky
CI / Generate TypeScript types (push) Successful in 12s
CI / Server unit tests (push) Successful in 20s
CI / Build server (push) Successful in 24s
CI / Build client (push) Successful in 36s
CI / Playwright E2E tests (push) Successful in 1m17s
CI / Build and push Docker image (push) Successful in 40s
CI / Notify (push) Successful in 2s

This commit is contained in:
2026-06-05 14:50:33 +02:00
parent fb84bff687
commit f28f127a92
13 changed files with 284 additions and 12 deletions
+18
View File
@@ -28,6 +28,24 @@ function findGroup(data: ClientData, id: string): OrderGroup | undefined {
return data.groups?.find(g => g.id === id);
}
/**
* Vrátí seznam ISO dat (YYYY-MM-DD), pro která existuje alespoň jedna objednávková skupina.
* Slouží ke zvýraznění dnů v date pickeru na stránce objednávání.
*/
export async function getOrderDates(): Promise<string[]> {
const EXTRA_SUFFIX = '_extra';
const keys = await storage.listKeys(EXTRA_SUFFIX);
const dates: string[] = [];
for (const key of keys) {
if (!key.endsWith(EXTRA_SUFFIX)) continue;
const data = await storage.getData<ClientData>(key);
if (data?.groups && data.groups.length > 0) {
dates.push(key.slice(0, -EXTRA_SUFFIX.length));
}
}
return dates.sort();
}
export async function createGroup(creatorLogin: string, name: string, date?: Date): Promise<ClientData> {
const stores = await getStores();
if (!stores.some(s => s.toLowerCase() === name.trim().toLowerCase())) {