From e8d43ba213dee10bf48454bf12d9b7fa8690caca Mon Sep 17 00:00:00 2001 From: Sanny Nguyen Hung Date: Mon, 30 Oct 2023 10:28:40 +0100 Subject: [PATCH] Change kostenlos to YesNoAnswer Co-authored-by: Frederike Ramin Co-authored-by: Pram Gurusinga Co-authored-by: Hannes Schaletzky --- app/models/flows/fluggastrechte/config.json | 2 +- app/models/flows/fluggastrechte/context.ts | 2 +- app/models/flows/fluggastrechte/guards.ts | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/models/flows/fluggastrechte/config.json b/app/models/flows/fluggastrechte/config.json index e7a9f4690..8c544e3e1 100644 --- a/app/models/flows/fluggastrechte/config.json +++ b/app/models/flows/fluggastrechte/config.json @@ -180,7 +180,7 @@ "SUBMIT": [ { "target": "ergebnis/kostenlos-abbruch", - "cond": "kostenlosYesOther" + "cond": "kostenlosYes" }, { "target": "rabatt" diff --git a/app/models/flows/fluggastrechte/context.ts b/app/models/flows/fluggastrechte/context.ts index 5c566eec9..f72076fc0 100644 --- a/app/models/flows/fluggastrechte/context.ts +++ b/app/models/flows/fluggastrechte/context.ts @@ -19,7 +19,7 @@ export const fluggastrechteVorabcheckContext = { entschaedigung: YesNoAnswer, gericht: YesNoAnswer, anwalt: YesNoAnswer, - kostenlos: z.enum(["yesBonus", "yesOther", "no"], customRequiredErrorMessage), + kostenlos: YesNoAnswer, rabatt: YesNoAnswer, buchung: YesNoAnswer, } as const; diff --git a/app/models/flows/fluggastrechte/guards.ts b/app/models/flows/fluggastrechte/guards.ts index f628f49f4..ca4ad8b34 100644 --- a/app/models/flows/fluggastrechte/guards.ts +++ b/app/models/flows/fluggastrechte/guards.ts @@ -34,8 +34,7 @@ export const guards = { ...yesNoGuards("entschaedigung"), ...yesNoGuards("gericht"), ...yesNoGuards("anwalt"), - kostenlosYesOther: (context: FluggastrechtVorabcheckContext) => - context.kostenlos === "yesOther", + ...yesNoGuards("kostenlos"), ...yesNoGuards("rabatt"), ...yesNoGuards("buchung"), };