Migrace z pořadových indexů na unikátní klíče

This commit is contained in:
2025-01-09 22:05:20 +01:00
parent 774cb4f9d2
commit 02de6691a8
7 changed files with 104 additions and 100 deletions

View File

@@ -1,20 +1,20 @@
import { FeatureRequest, PizzaOrder } from "./Types";
import { FeatureRequest, LocationKey, PizzaOrder } from "./Types";
export type ILocationKey = {
locationKey: LocationKey,
}
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

@@ -12,10 +12,11 @@ export type FoodChoices = {
note?: string,
}
// TODO okomentovat / rozdělit
export type Choices = {
[location: string]: {
[location in LocationKey]?: {
[login: string]: FoodChoices
},
}
}
/** Velikost konkrétní pizzy */
@@ -119,6 +120,9 @@ export enum Locations {
ROZHODUJI = 'Rozhoduji se',
}
// TODO totéž
export type LocationKey = keyof typeof Locations;
export enum UdalostEnum {
ZAHAJENA_PIZZA = "Zahájen pizza day",
OBJEDNANA_PIZZA = "Objednána pizza",