Magic bullshit

This commit is contained in:
2025-01-09 00:35:47 +01:00
parent fd9aa547e2
commit bc039a361d
7 changed files with 115 additions and 95 deletions

View File

@@ -1,20 +1,20 @@
import { FeatureRequest, PizzaOrder } from "./Types";
import { FeatureRequest, Locations, PizzaOrder } from "./Types";
export type ILocationKey = {
locationKey: keyof typeof Locations,
}
export type IDayIndex = {
dayIndex?: number,
}
export type AddChoiceRequest = IDayIndex & {
locationIndex: number,
export type AddChoiceRequest = IDayIndex & ILocationKey & {
foodIndex?: number,
}
export type RemoveChoicesRequest = IDayIndex & {
locationIndex: number,
}
export type RemoveChoicesRequest = IDayIndex & ILocationKey;
export type RemoveChoiceRequest = IDayIndex & {
locationIndex: number,
export type RemoveChoiceRequest = IDayIndex & ILocationKey & {
foodIndex: number,
}

View File

@@ -13,9 +13,9 @@ export type FoodChoices = {
}
export type Choices = {
[location: string]: {
[location in keyof typeof Locations]?: {
[login: string]: FoodChoices
},
}
}
/** Velikost konkrétní pizzy */
@@ -88,7 +88,7 @@ export type DayData = {
}
/** Veškerá data pro zobrazení na klientovi. */
export type ClientData extends DayData = {
export type ClientData = DayData & {
todayWeekIndex?: number, // index dnešního dne v týdnu (0-6)
}