Migrace z pořadových indexů na unikátní klíče
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user