From 53f318834424f7d281f55c91b0da71f6ad5b96fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Garn=C3=A6s?= Date: Tue, 23 Apr 2024 09:24:08 +0200 Subject: [PATCH 01/13] Use Hermod sprint 13 of design system --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index e9fab83e36..0d4f40d346 100644 --- a/package.json +++ b/package.json @@ -144,7 +144,7 @@ "prop-types": "Since we use former ddb-react components that depend on prop-types we keep this. Should be removed when usage of prop-types is deprecated." }, "dependencies": { - "@danskernesdigitalebibliotek/dpl-design-system": "2024.17.0-273114be2012777935c25d074706ed6187a64e74", + "@danskernesdigitalebibliotek/dpl-design-system": "0.0.0-a5254af2eccd9a9bf4077ee623d29ac580a8a1b5", "@fullcalendar/core": "^6.1.11", "@fullcalendar/daygrid": "^6.1.11", "@fullcalendar/interaction": "^6.1.11", diff --git a/yarn.lock b/yarn.lock index b6adcbb7b6..9073af5544 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1533,10 +1533,10 @@ debug "^3.1.0" lodash.once "^4.1.1" -"@danskernesdigitalebibliotek/dpl-design-system@2024.17.0-273114be2012777935c25d074706ed6187a64e74": - version "2024.17.0-273114be2012777935c25d074706ed6187a64e74" - resolved "https://npm.pkg.github.com/download/@danskernesdigitalebibliotek/dpl-design-system/2024.17.0-273114be2012777935c25d074706ed6187a64e74/68113fd26d9aec5dfdc4196ec86a8a385d9c6eff#68113fd26d9aec5dfdc4196ec86a8a385d9c6eff" - integrity sha512-gaE+WsmZCiqmwPdspqpi8RjkiUJ4WUmzvNHp7t82Q9sm5i3UfIVLNmfixuR/JYe09yngl0mC9HYZR4z0v1xZ9A== +"@danskernesdigitalebibliotek/dpl-design-system@0.0.0-a5254af2eccd9a9bf4077ee623d29ac580a8a1b5": + version "0.0.0-a5254af2eccd9a9bf4077ee623d29ac580a8a1b5" + resolved "https://npm.pkg.github.com/download/@danskernesdigitalebibliotek/dpl-design-system/0.0.0-a5254af2eccd9a9bf4077ee623d29ac580a8a1b5/ae2b169d3af480d7cd1835ccf245799de3f8e6dd#ae2b169d3af480d7cd1835ccf245799de3f8e6dd" + integrity sha512-OLZ4FD3ILxZBRT04Q0U/Q/7UUr+G3O+Tx9hz6t+zZEeusMuDAgVxEpYWZ4e2THj3GjCTO58xPfr7XhKTFYK68A== "@discoveryjs/json-ext@^0.5.0", "@discoveryjs/json-ext@^0.5.3": version "0.5.7" From 8a29e529432570402a60b60269f1d3938b9ee3ab Mon Sep 17 00:00:00 2001 From: Kasper Birch Date: Fri, 19 Apr 2024 12:37:17 +0200 Subject: [PATCH 02/13] Add Repeated opening hour functionality (Form markup) - Convert `initialStartTime` and `initialEndTime` to date objects to facilitate retrieval of `weekDayName` and `DateString` from `startDate` in `EventForm`. Consequently, we've relocated the `extractTime` method into `EventForm` for improved organization. - Introduce `isRepeatedOpeningHour` property to `EventForm` to enable additional fields specific to recurring opening hours - Reposition the `children` elements, now dedicated to the "remove opening hour" functionality, below the submit button to enhance user experience. --- .../opening-hours-editor/DialogFormAdd.tsx | 15 ++- .../opening-hours-editor/DialogFormEdit.tsx | 5 +- src/apps/opening-hours-editor/EventForm.tsx | 97 +++++++++++++++++-- .../OpeningHoursEditor.dev.tsx | 16 +++ .../OpeningHoursEditor.entry.tsx | 3 + src/apps/opening-hours-editor/helper.ts | 12 +++ 6 files changed, 133 insertions(+), 15 deletions(-) diff --git a/src/apps/opening-hours-editor/DialogFormAdd.tsx b/src/apps/opening-hours-editor/DialogFormAdd.tsx index 0d783e71cc..dbda8da1c1 100644 --- a/src/apps/opening-hours-editor/DialogFormAdd.tsx +++ b/src/apps/opening-hours-editor/DialogFormAdd.tsx @@ -3,7 +3,6 @@ import { DateSelectArg } from "@fullcalendar/core"; import { adjustEndDateToStartDayGridMonth, adjustEndDateToStartDayTimeGridWeek, - extractTime, formatDateStr, formatFullCalendarEventToCmsEvent, updateDateTime @@ -32,8 +31,15 @@ const DialogFormAdd: React.FC = ({ const handleSubmit: EventFormOnSubmitType = ( category, startTime, - endTime + endTime, + repeatedEndDate ) => { + if (repeatedEndDate) { + // eslint-disable-next-line no-alert + alert("Repeated event is not supported yet"); + closeDialog(); + return; + } const start = updateDateTime(selectedEventInfo.start, startTime); const startStr = formatDateStr(start); let end = updateDateTime(selectedEventInfo.end, endTime); @@ -71,9 +77,10 @@ const DialogFormAdd: React.FC = ({ return ( ); }; diff --git a/src/apps/opening-hours-editor/DialogFormEdit.tsx b/src/apps/opening-hours-editor/DialogFormEdit.tsx index 56b4903a29..1fb15a5334 100644 --- a/src/apps/opening-hours-editor/DialogFormEdit.tsx +++ b/src/apps/opening-hours-editor/DialogFormEdit.tsx @@ -2,7 +2,6 @@ import React from "react"; import { EventImpl } from "@fullcalendar/core/internal"; import { adjustEndDateBasedOnStartDate, - extractTime, formatFullCalendarEventToCmsEvent, updateDateTime } from "./helper"; @@ -60,8 +59,8 @@ const DialogFormEdit: React.FC = ({ return ( diff --git a/src/apps/opening-hours-editor/EventForm.tsx b/src/apps/opening-hours-editor/EventForm.tsx index c45909092e..844d77a642 100644 --- a/src/apps/opening-hours-editor/EventForm.tsx +++ b/src/apps/opening-hours-editor/EventForm.tsx @@ -4,39 +4,54 @@ import React, { useEffect, useState } from "react"; import { OpeningHoursCategoriesType } from "./types"; import { useText } from "../../core/utils/text"; +import { + extractTime, + getDateString, + getStringForDateInput, + getWeekDayName +} from "./helper"; export type EventFormOnSubmitType = ( category: OpeningHoursCategoriesType, startTime: string, - endTime: string + endTime: string, + repeatedEndDate: string | null ) => void; type EventFormProps = { initialTitle?: string; - initialStartTime: string; - initialEndTime: string; + startDate: Date; + endDate: Date; onSubmit: EventFormOnSubmitType; openingHoursCategories: OpeningHoursCategoriesType[]; children?: React.ReactNode; + isRepeatedOpeningHour?: boolean; }; const EventForm: React.FC = ({ initialTitle, - initialStartTime, - initialEndTime, + startDate, + endDate, onSubmit, openingHoursCategories, - children + children, + isRepeatedOpeningHour }) => { const t = useText(); const initialCategory = initialTitle ? openingHoursCategories.find((category) => category.title === initialTitle) : openingHoursCategories[0]; + const initialStartTime = extractTime(startDate); + const initialEndTime = extractTime(endDate); + const weekDayName = getWeekDayName(startDate); + const [startTime, setStartTime] = useState(initialStartTime); const [endTime, setEndTime] = useState(initialEndTime); const [category, setCategory] = useState(initialCategory); const isSameTime = startTime === endTime; + const [isRepeated, setIsRepeated] = useState(false); + const [repeatedEndDate, setRepeatedEndDate] = useState(null); // Reset the form when the initial values change // This is necessary because EventForm are reused @@ -44,12 +59,14 @@ const EventForm: React.FC = ({ setCategory(initialCategory); setStartTime(initialStartTime); setEndTime(initialEndTime); + setIsRepeated(false); + setRepeatedEndDate(null); }, [initialCategory, initialEndTime, initialStartTime]); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); if (category) { - onSubmit(category, startTime, endTime); + onSubmit(category, startTime, endTime, repeatedEndDate); } }; @@ -112,7 +129,70 @@ const EventForm: React.FC = ({ min={startTime} max="00:00" /> - {children} + {isRepeatedOpeningHour && ( + <> +
+ setIsRepeated(e.target.checked)} + /> + +
+ +
+ + +
+ +
+ + +
+ + + setRepeatedEndDate(e.target.value)} + /> + + )} + {children} ); }; diff --git a/src/apps/opening-hours-editor/OpeningHoursEditor.dev.tsx b/src/apps/opening-hours-editor/OpeningHoursEditor.dev.tsx index 2e9e1cb067..941c4e826f 100644 --- a/src/apps/opening-hours-editor/OpeningHoursEditor.dev.tsx +++ b/src/apps/opening-hours-editor/OpeningHoursEditor.dev.tsx @@ -54,6 +54,22 @@ export default { name: "Opening hours event form submit", defaultValue: "Submit", control: { type: "text" } + }, + openingHoursEventFormRepeatedText: { + name: "Opening hours event form repeated", + defaultValue: "Repeat opening hour from @startDate", + control: { type: "text" } + }, + openingHoursEventFormWeklyText: { + name: "Opening hours event form weekly", + defaultValue: "Weekly", + control: { type: "text" } + }, + + openingHoursEventFormEndDateText: { + name: "Opening hours event to end date", + defaultValue: "End date", + control: { type: "text" } } } } as ComponentMeta; diff --git a/src/apps/opening-hours-editor/OpeningHoursEditor.entry.tsx b/src/apps/opening-hours-editor/OpeningHoursEditor.entry.tsx index 6a82e4a08a..f86a8f1f5f 100644 --- a/src/apps/opening-hours-editor/OpeningHoursEditor.entry.tsx +++ b/src/apps/opening-hours-editor/OpeningHoursEditor.entry.tsx @@ -13,6 +13,9 @@ interface OpeningHoursEditorEntryTextProps { openingHoursEventFormStartTimeText: string; openingHoursEventFormEndTimeText: string; openingHoursEventFormSubmitText: string; + openingHoursEventFormRepeatedText: string; + openingHoursEventFormWeklyText: string; + openingHoursEventFormEndDateText: string; } interface OpeningHoursEditorEntryConfigProps { diff --git a/src/apps/opening-hours-editor/helper.ts b/src/apps/opening-hours-editor/helper.ts index 7637ee6dd0..b6651e329e 100644 --- a/src/apps/opening-hours-editor/helper.ts +++ b/src/apps/opening-hours-editor/helper.ts @@ -112,3 +112,15 @@ export const updateDateTime = (date: Date, timeStr: string) => { const [hours, minutes] = timeStr.split(":").map(Number); return dayjs(date).hour(hours).minute(minutes).toDate(); }; + +export const getWeekDayName = (date: Date) => { + return dayjs(date).format("dddd"); +}; + +export const getDateString = (date: Date) => { + return dayjs(date).format("DD-MM-YYYY"); +}; + +export const getStringForDateInput = (date: Date) => { + return dayjs(date).format("YYYY-MM-DD"); +}; From 0392da23a3beabce221ec3cda906fcb09ccc5c69 Mon Sep 17 00:00:00 2001 From: Kasper Birch Date: Fri, 19 Apr 2024 15:43:01 +0200 Subject: [PATCH 03/13] Add `ConfirmAddRepeatedOpeningHour` This introduces an additional confirmation form for repeated opening hours, displayed in a dialog (modal) --- .../ConfirmAddRepeatedOpeningHour.tsx | 81 +++++ src/apps/opening-hours-editor/EventForm.tsx | 289 ++++++++++-------- .../OpeningHoursEditor.dev.tsx | 31 +- .../OpeningHoursEditor.entry.tsx | 7 +- 4 files changed, 280 insertions(+), 128 deletions(-) create mode 100644 src/apps/opening-hours-editor/ConfirmAddRepeatedOpeningHour.tsx diff --git a/src/apps/opening-hours-editor/ConfirmAddRepeatedOpeningHour.tsx b/src/apps/opening-hours-editor/ConfirmAddRepeatedOpeningHour.tsx new file mode 100644 index 0000000000..64fc5bad80 --- /dev/null +++ b/src/apps/opening-hours-editor/ConfirmAddRepeatedOpeningHour.tsx @@ -0,0 +1,81 @@ +import React from "react"; +import { useText } from "../../core/utils/text"; +import { OpeningHoursCategoriesType } from "./types"; + +type ConfirmAddRepeatedOpeningHourType = { + startDateString: string; + weekDayName: string; + category: OpeningHoursCategoriesType; + startTime: string; + endTime: string; + repeatedEndDate: string; + confirmSubmit: () => void; + closeDialog: () => void; +}; + +const ConfirmAddRepeatedOpeningHour = ({ + startDateString, + weekDayName, + category, + startTime, + endTime, + repeatedEndDate, + confirmSubmit, + closeDialog +}: ConfirmAddRepeatedOpeningHourType) => { + const t = useText(); + return ( +
+

+ {t("openingHoursConfirmAddRepeatedText")} +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
{t("openingHoursEventFormCategoryText")}:{category.title}
{t("openingHoursEventFormStartTimeText")}:{startTime}
{t("openingHoursEventFormEndTimeText")}:{endTime}
{t("openingHoursEventFormStartDateText")}:{startDateString}
{t("openingHoursEventFormEndDateText")}:{repeatedEndDate}
{t("openingHoursEventFormEveryWeekdayText")}:{weekDayName}
+ + +
+ ); +}; + +export default ConfirmAddRepeatedOpeningHour; diff --git a/src/apps/opening-hours-editor/EventForm.tsx b/src/apps/opening-hours-editor/EventForm.tsx index 844d77a642..6c4116f952 100644 --- a/src/apps/opening-hours-editor/EventForm.tsx +++ b/src/apps/opening-hours-editor/EventForm.tsx @@ -10,6 +10,9 @@ import { getStringForDateInput, getWeekDayName } from "./helper"; +import useDialog from "../../components/dialog/useDialog"; +import Dialog from "../../components/dialog/Dialog"; +import ConfirmAddRepeatedOpeningHour from "./ConfirmAddRepeatedOpeningHour"; export type EventFormOnSubmitType = ( category: OpeningHoursCategoriesType, @@ -38,6 +41,9 @@ const EventForm: React.FC = ({ isRepeatedOpeningHour }) => { const t = useText(); + const { dialogContent, openDialogWithContent, closeDialog, dialogRef } = + useDialog(); + const initialCategory = initialTitle ? openingHoursCategories.find((category) => category.title === initialTitle) : openingHoursCategories[0]; @@ -45,6 +51,7 @@ const EventForm: React.FC = ({ const initialStartTime = extractTime(startDate); const initialEndTime = extractTime(endDate); const weekDayName = getWeekDayName(startDate); + const startDateString = getDateString(startDate); const [startTime, setStartTime] = useState(initialStartTime); const [endTime, setEndTime] = useState(initialEndTime); @@ -63,146 +70,180 @@ const EventForm: React.FC = ({ setRepeatedEndDate(null); }, [initialCategory, initialEndTime, initialStartTime]); + // if isRepeated are set back to false, reset repeatedEndDate + useEffect(() => { + if (!isRepeated) { + setRepeatedEndDate(null); + } + }, [isRepeated]); + const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); - if (category) { + if (!category) { + return; + } + + if (repeatedEndDate) { + openDialogWithContent( + + onSubmit(category, startTime, endTime, repeatedEndDate) + } + closeDialog={closeDialog} + /> + ); + } else { onSubmit(category, startTime, endTime, repeatedEndDate); } }; return ( -
- - - - setStartTime(e.target.value)} - /> - - setEndTime(e.target.value)} - min={startTime} - max="00:00" - /> - {isRepeatedOpeningHour && ( - <> -
- setIsRepeated(e.target.checked)} - /> + + + + setStartTime(e.target.value)} + /> + + setEndTime(e.target.value)} + min={startTime} + max="00:00" + /> + {isRepeatedOpeningHour && ( + <> +
+ setIsRepeated(e.target.checked)} + /> + +
+ +
+ + +
+ +
+ + +
+ -
- -
setRepeatedEndDate(e.target.value)} /> - -
+ + )} + + {children} +
-
- - -
- - - setRepeatedEndDate(e.target.value)} - /> - - )} - - {children} - + + {dialogContent} + + ); }; diff --git a/src/apps/opening-hours-editor/OpeningHoursEditor.dev.tsx b/src/apps/opening-hours-editor/OpeningHoursEditor.dev.tsx index 941c4e826f..2c8f62ebcc 100644 --- a/src/apps/opening-hours-editor/OpeningHoursEditor.dev.tsx +++ b/src/apps/opening-hours-editor/OpeningHoursEditor.dev.tsx @@ -35,9 +35,9 @@ export default { defaultValue: new Date("2024-03-25"), control: { type: "date" } }, - openingHoursEventFormTitleText: { - name: "Opening hours event form title", - defaultValue: "Title", + openingHoursEventFormCategoryText: { + name: "Opening hours event form category", + defaultValue: "Opening hour", control: { type: "text" } }, openingHoursEventFormStartTimeText: { @@ -70,6 +70,31 @@ export default { name: "Opening hours event to end date", defaultValue: "End date", control: { type: "text" } + }, + openingHoursEventFormStartDateText: { + name: "Opening hours event form start date", + defaultValue: "Start date", + control: { type: "text" } + }, + openingHoursEventFormEveryWeekdayText: { + name: "Opening hours event form every weekday", + defaultValue: "Every", + control: { type: "text" } + }, + openingHoursConfirmAddRepeatedText: { + name: "Opening hours confirm add repeated", + defaultValue: "Do you want to add this repeated opening hour?", + control: { type: "text" } + }, + openingHoursConfirmAddRepeatedCancelText: { + name: "Opening hours confirm add repeated cancel", + defaultValue: "Cancel", + control: { type: "text" } + }, + openingHoursConfirmAddRepeatedSubmitText: { + name: "Opening hours confirm add repeated submit", + defaultValue: "I'm sure", + control: { type: "text" } } } } as ComponentMeta; diff --git a/src/apps/opening-hours-editor/OpeningHoursEditor.entry.tsx b/src/apps/opening-hours-editor/OpeningHoursEditor.entry.tsx index f86a8f1f5f..17cc5e8230 100644 --- a/src/apps/opening-hours-editor/OpeningHoursEditor.entry.tsx +++ b/src/apps/opening-hours-editor/OpeningHoursEditor.entry.tsx @@ -9,13 +9,18 @@ import { withConfig } from "../../core/utils/config"; interface OpeningHoursEditorEntryTextProps { openingHoursRemoveEventButtonText: string; openingHoursInvalidEventText: string; - openingHoursEventFormTitleText: string; + openingHoursEventFormCategoryText: string; openingHoursEventFormStartTimeText: string; openingHoursEventFormEndTimeText: string; openingHoursEventFormSubmitText: string; openingHoursEventFormRepeatedText: string; openingHoursEventFormWeklyText: string; openingHoursEventFormEndDateText: string; + openingHoursEventFormEveryWeekdayText: string; + openingHoursEventFormStartDateText: string; + openingHoursConfirmAddRepeatedText: string; + openingHoursConfirmAddRepeatedCancelText: string; + openingHoursConfirmAddRepeatedSubmitText: string; } interface OpeningHoursEditorEntryConfigProps { From 28cb4ce227426c3ea1b4d874862124c264a6405c Mon Sep 17 00:00:00 2001 From: Kasper Birch Date: Mon, 22 Apr 2024 14:23:39 +0200 Subject: [PATCH 04/13] Update to latest openAPI spec from DPL-CMS The `target` inside `orval.config.ts` should be set back to develop when https://github.com/danskernesdigitalebibliotek/dpl-cms/pull/1027 is merged. --- orval.config.ts | 2 +- src/core/dpl-cms/dpl-cms.ts | 6 +++--- .../model/dplOpeningHoursCreatePOST200.ts | 2 ++ .../dplOpeningHoursCreatePOST200Repetition.ts | 17 +++++++++++++++++ ...OpeningHoursCreatePOST200RepetitionType.ts | 19 +++++++++++++++++++ ...gHoursCreatePOST200RepetitionWeeklyData.ts | 12 ++++++++++++ .../model/dplOpeningHoursCreatePOSTBody.ts | 2 ++ ...dplOpeningHoursCreatePOSTBodyRepetition.ts | 17 +++++++++++++++++ ...peningHoursCreatePOSTBodyRepetitionType.ts | 19 +++++++++++++++++++ ...HoursCreatePOSTBodyRepetitionWeeklyData.ts | 12 ++++++++++++ .../model/dplOpeningHoursListGET200Item.ts | 2 ++ ...dplOpeningHoursListGET200ItemRepetition.ts | 17 +++++++++++++++++ ...peningHoursListGET200ItemRepetitionType.ts | 19 +++++++++++++++++++ ...HoursListGET200ItemRepetitionWeeklyData.ts | 12 ++++++++++++ .../model/dplOpeningHoursUpdatePATCH200.ts | 2 ++ ...dplOpeningHoursUpdatePATCH200Repetition.ts | 17 +++++++++++++++++ ...peningHoursUpdatePATCH200RepetitionType.ts | 19 +++++++++++++++++++ ...HoursUpdatePATCH200RepetitionWeeklyData.ts | 12 ++++++++++++ .../model/dplOpeningHoursUpdatePATCHBody.ts | 2 ++ ...plOpeningHoursUpdatePATCHBodyRepetition.ts | 17 +++++++++++++++++ ...eningHoursUpdatePATCHBodyRepetitionType.ts | 19 +++++++++++++++++++ ...oursUpdatePATCHBodyRepetitionWeeklyData.ts | 12 ++++++++++++ src/core/dpl-cms/model/eventsGET200Item.ts | 2 ++ .../eventsGET200ItemTicketCategoriesItem.ts | 3 --- ...entsGET200ItemTicketCategoriesItemCount.ts | 15 --------------- src/core/dpl-cms/model/index.ts | 16 +++++++++++++++- 26 files changed, 271 insertions(+), 23 deletions(-) create mode 100644 src/core/dpl-cms/model/dplOpeningHoursCreatePOST200Repetition.ts create mode 100644 src/core/dpl-cms/model/dplOpeningHoursCreatePOST200RepetitionType.ts create mode 100644 src/core/dpl-cms/model/dplOpeningHoursCreatePOST200RepetitionWeeklyData.ts create mode 100644 src/core/dpl-cms/model/dplOpeningHoursCreatePOSTBodyRepetition.ts create mode 100644 src/core/dpl-cms/model/dplOpeningHoursCreatePOSTBodyRepetitionType.ts create mode 100644 src/core/dpl-cms/model/dplOpeningHoursCreatePOSTBodyRepetitionWeeklyData.ts create mode 100644 src/core/dpl-cms/model/dplOpeningHoursListGET200ItemRepetition.ts create mode 100644 src/core/dpl-cms/model/dplOpeningHoursListGET200ItemRepetitionType.ts create mode 100644 src/core/dpl-cms/model/dplOpeningHoursListGET200ItemRepetitionWeeklyData.ts create mode 100644 src/core/dpl-cms/model/dplOpeningHoursUpdatePATCH200Repetition.ts create mode 100644 src/core/dpl-cms/model/dplOpeningHoursUpdatePATCH200RepetitionType.ts create mode 100644 src/core/dpl-cms/model/dplOpeningHoursUpdatePATCH200RepetitionWeeklyData.ts create mode 100644 src/core/dpl-cms/model/dplOpeningHoursUpdatePATCHBodyRepetition.ts create mode 100644 src/core/dpl-cms/model/dplOpeningHoursUpdatePATCHBodyRepetitionType.ts create mode 100644 src/core/dpl-cms/model/dplOpeningHoursUpdatePATCHBodyRepetitionWeeklyData.ts delete mode 100644 src/core/dpl-cms/model/eventsGET200ItemTicketCategoriesItemCount.ts diff --git a/orval.config.ts b/orval.config.ts index b25e6f6426..7c84e1c862 100644 --- a/orval.config.ts +++ b/orval.config.ts @@ -139,7 +139,7 @@ export default defineConfig({ }, input: { target: - "https://raw.githubusercontent.com/danskernesdigitalebibliotek/dpl-cms/opening-hours-api/openapi.json", + "https://raw.githubusercontent.com/danskernesdigitalebibliotek/dpl-cms/opening-hours-repeated/openapi.json", converterOptions: { indent: 2 } diff --git a/src/core/dpl-cms/dpl-cms.ts b/src/core/dpl-cms/dpl-cms.ts index 648981b0ab..1605557402 100644 --- a/src/core/dpl-cms/dpl-cms.ts +++ b/src/core/dpl-cms/dpl-cms.ts @@ -487,7 +487,7 @@ export const eventPATCH = ( params: EventPATCHParams ) => { return fetcher({ - url: `/dpl_event/${uuid}`, + url: `/api/v1/events/${uuid}`, method: "PATCH", headers: { "Content-Type": "application/json" }, data: eventPATCHBody, @@ -560,7 +560,7 @@ export const useEventPATCH = < */ export const eventsGET = (params: EventsGETParams, signal?: AbortSignal) => { return fetcher({ - url: `/dpl_event`, + url: `/api/v1/events`, method: "GET", params, signal @@ -568,7 +568,7 @@ export const eventsGET = (params: EventsGETParams, signal?: AbortSignal) => { }; export const getEventsGETQueryKey = (params: EventsGETParams) => { - return [`/dpl_event`, ...(params ? [params] : [])] as const; + return [`/api/v1/events`, ...(params ? [params] : [])] as const; }; export const getEventsGETQueryOptions = < diff --git a/src/core/dpl-cms/model/dplOpeningHoursCreatePOST200.ts b/src/core/dpl-cms/model/dplOpeningHoursCreatePOST200.ts index ba11ad3a80..99b20ff5fb 100644 --- a/src/core/dpl-cms/model/dplOpeningHoursCreatePOST200.ts +++ b/src/core/dpl-cms/model/dplOpeningHoursCreatePOST200.ts @@ -6,6 +6,7 @@ * OpenAPI spec version: Versioning not supported */ import type { DplOpeningHoursCreatePOST200Category } from "./dplOpeningHoursCreatePOST200Category"; +import type { DplOpeningHoursCreatePOST200Repetition } from "./dplOpeningHoursCreatePOST200Repetition"; export type DplOpeningHoursCreatePOST200 = { /** The id for the branch the instance belongs to */ @@ -17,6 +18,7 @@ export type DplOpeningHoursCreatePOST200 = { end_time: string; /** An serial unique id of the opening hours instance. */ id: number; + repetition: DplOpeningHoursCreatePOST200Repetition; /** When the opening hours start. In format HH:MM */ start_time: string; }; diff --git a/src/core/dpl-cms/model/dplOpeningHoursCreatePOST200Repetition.ts b/src/core/dpl-cms/model/dplOpeningHoursCreatePOST200Repetition.ts new file mode 100644 index 0000000000..5d0220c39b --- /dev/null +++ b/src/core/dpl-cms/model/dplOpeningHoursCreatePOST200Repetition.ts @@ -0,0 +1,17 @@ +/** + * Generated by orval v6.26.0 🍺 + * Do not edit manually. + * DPL CMS - REST API + * The REST API provide by the core REST module. + * OpenAPI spec version: Versioning not supported + */ +import type { DplOpeningHoursCreatePOST200RepetitionType } from "./dplOpeningHoursCreatePOST200RepetitionType"; +import type { DplOpeningHoursCreatePOST200RepetitionWeeklyData } from "./dplOpeningHoursCreatePOST200RepetitionWeeklyData"; + +export type DplOpeningHoursCreatePOST200Repetition = { + /** A serial unique id of the repetition. All instances with the same id belongs to the same repetition. */ + id: number; + /** If/how the instance should be repeated in the future:
- single: The instance should not be repeated
- weekly: The instance should be repeated weekly from the first day of the repetition until the provided end date. The week day of the first instance defines which weekday should be used for the repeated instances. */ + type: DplOpeningHoursCreatePOST200RepetitionType; + weekly_data?: DplOpeningHoursCreatePOST200RepetitionWeeklyData; +}; diff --git a/src/core/dpl-cms/model/dplOpeningHoursCreatePOST200RepetitionType.ts b/src/core/dpl-cms/model/dplOpeningHoursCreatePOST200RepetitionType.ts new file mode 100644 index 0000000000..b12c33c0d1 --- /dev/null +++ b/src/core/dpl-cms/model/dplOpeningHoursCreatePOST200RepetitionType.ts @@ -0,0 +1,19 @@ +/** + * Generated by orval v6.26.0 🍺 + * Do not edit manually. + * DPL CMS - REST API + * The REST API provide by the core REST module. + * OpenAPI spec version: Versioning not supported + */ + +/** + * If/how the instance should be repeated in the future:
- single: The instance should not be repeated
- weekly: The instance should be repeated weekly from the first day of the repetition until the provided end date. The week day of the first instance defines which weekday should be used for the repeated instances. + */ +export type DplOpeningHoursCreatePOST200RepetitionType = + typeof DplOpeningHoursCreatePOST200RepetitionType[keyof typeof DplOpeningHoursCreatePOST200RepetitionType]; + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const DplOpeningHoursCreatePOST200RepetitionType = { + none: "none", + weekly: "weekly" +} as const; diff --git a/src/core/dpl-cms/model/dplOpeningHoursCreatePOST200RepetitionWeeklyData.ts b/src/core/dpl-cms/model/dplOpeningHoursCreatePOST200RepetitionWeeklyData.ts new file mode 100644 index 0000000000..b8e8fecb21 --- /dev/null +++ b/src/core/dpl-cms/model/dplOpeningHoursCreatePOST200RepetitionWeeklyData.ts @@ -0,0 +1,12 @@ +/** + * Generated by orval v6.26.0 🍺 + * Do not edit manually. + * DPL CMS - REST API + * The REST API provide by the core REST module. + * OpenAPI spec version: Versioning not supported + */ + +export type DplOpeningHoursCreatePOST200RepetitionWeeklyData = { + /** The end date of the repetition. If the end date is not on the same week day as the first instance then the preceding occurrence of the weekday will be the last instance.

This field must be provided if type is 'weekly' */ + end_date?: string; +}; diff --git a/src/core/dpl-cms/model/dplOpeningHoursCreatePOSTBody.ts b/src/core/dpl-cms/model/dplOpeningHoursCreatePOSTBody.ts index 580c8c3fcc..d36e3d488a 100644 --- a/src/core/dpl-cms/model/dplOpeningHoursCreatePOSTBody.ts +++ b/src/core/dpl-cms/model/dplOpeningHoursCreatePOSTBody.ts @@ -6,6 +6,7 @@ * OpenAPI spec version: Versioning not supported */ import type { DplOpeningHoursCreatePOSTBodyCategory } from "./dplOpeningHoursCreatePOSTBodyCategory"; +import type { DplOpeningHoursCreatePOSTBodyRepetition } from "./dplOpeningHoursCreatePOSTBodyRepetition"; export type DplOpeningHoursCreatePOSTBody = { /** The id for the branch the instance belongs to */ @@ -17,6 +18,7 @@ export type DplOpeningHoursCreatePOSTBody = { end_time: string; /** An serial unique id of the opening hours instance. */ id?: number; + repetition: DplOpeningHoursCreatePOSTBodyRepetition; /** When the opening hours start. In format HH:MM */ start_time: string; }; diff --git a/src/core/dpl-cms/model/dplOpeningHoursCreatePOSTBodyRepetition.ts b/src/core/dpl-cms/model/dplOpeningHoursCreatePOSTBodyRepetition.ts new file mode 100644 index 0000000000..949de21ab4 --- /dev/null +++ b/src/core/dpl-cms/model/dplOpeningHoursCreatePOSTBodyRepetition.ts @@ -0,0 +1,17 @@ +/** + * Generated by orval v6.26.0 🍺 + * Do not edit manually. + * DPL CMS - REST API + * The REST API provide by the core REST module. + * OpenAPI spec version: Versioning not supported + */ +import type { DplOpeningHoursCreatePOSTBodyRepetitionType } from "./dplOpeningHoursCreatePOSTBodyRepetitionType"; +import type { DplOpeningHoursCreatePOSTBodyRepetitionWeeklyData } from "./dplOpeningHoursCreatePOSTBodyRepetitionWeeklyData"; + +export type DplOpeningHoursCreatePOSTBodyRepetition = { + /** A serial unique id of the repetition. All instances with the same id belongs to the same repetition. */ + id?: number; + /** If/how the instance should be repeated in the future:
- single: The instance should not be repeated
- weekly: The instance should be repeated weekly from the first day of the repetition until the provided end date. The week day of the first instance defines which weekday should be used for the repeated instances. */ + type: DplOpeningHoursCreatePOSTBodyRepetitionType; + weekly_data?: DplOpeningHoursCreatePOSTBodyRepetitionWeeklyData; +}; diff --git a/src/core/dpl-cms/model/dplOpeningHoursCreatePOSTBodyRepetitionType.ts b/src/core/dpl-cms/model/dplOpeningHoursCreatePOSTBodyRepetitionType.ts new file mode 100644 index 0000000000..08cae5159e --- /dev/null +++ b/src/core/dpl-cms/model/dplOpeningHoursCreatePOSTBodyRepetitionType.ts @@ -0,0 +1,19 @@ +/** + * Generated by orval v6.26.0 🍺 + * Do not edit manually. + * DPL CMS - REST API + * The REST API provide by the core REST module. + * OpenAPI spec version: Versioning not supported + */ + +/** + * If/how the instance should be repeated in the future:
- single: The instance should not be repeated
- weekly: The instance should be repeated weekly from the first day of the repetition until the provided end date. The week day of the first instance defines which weekday should be used for the repeated instances. + */ +export type DplOpeningHoursCreatePOSTBodyRepetitionType = + typeof DplOpeningHoursCreatePOSTBodyRepetitionType[keyof typeof DplOpeningHoursCreatePOSTBodyRepetitionType]; + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const DplOpeningHoursCreatePOSTBodyRepetitionType = { + none: "none", + weekly: "weekly" +} as const; diff --git a/src/core/dpl-cms/model/dplOpeningHoursCreatePOSTBodyRepetitionWeeklyData.ts b/src/core/dpl-cms/model/dplOpeningHoursCreatePOSTBodyRepetitionWeeklyData.ts new file mode 100644 index 0000000000..5d1d6c4d90 --- /dev/null +++ b/src/core/dpl-cms/model/dplOpeningHoursCreatePOSTBodyRepetitionWeeklyData.ts @@ -0,0 +1,12 @@ +/** + * Generated by orval v6.26.0 🍺 + * Do not edit manually. + * DPL CMS - REST API + * The REST API provide by the core REST module. + * OpenAPI spec version: Versioning not supported + */ + +export type DplOpeningHoursCreatePOSTBodyRepetitionWeeklyData = { + /** The end date of the repetition. If the end date is not on the same week day as the first instance then the preceding occurrence of the weekday will be the last instance.

This field must be provided if type is 'weekly' */ + end_date?: string; +}; diff --git a/src/core/dpl-cms/model/dplOpeningHoursListGET200Item.ts b/src/core/dpl-cms/model/dplOpeningHoursListGET200Item.ts index 0d5b5fb743..85b6347e54 100644 --- a/src/core/dpl-cms/model/dplOpeningHoursListGET200Item.ts +++ b/src/core/dpl-cms/model/dplOpeningHoursListGET200Item.ts @@ -6,6 +6,7 @@ * OpenAPI spec version: Versioning not supported */ import type { DplOpeningHoursListGET200ItemCategory } from "./dplOpeningHoursListGET200ItemCategory"; +import type { DplOpeningHoursListGET200ItemRepetition } from "./dplOpeningHoursListGET200ItemRepetition"; export type DplOpeningHoursListGET200Item = { /** The id for the branch the instance belongs to */ @@ -17,6 +18,7 @@ export type DplOpeningHoursListGET200Item = { end_time: string; /** An serial unique id of the opening hours instance. */ id: number; + repetition: DplOpeningHoursListGET200ItemRepetition; /** When the opening hours start. In format HH:MM */ start_time: string; }; diff --git a/src/core/dpl-cms/model/dplOpeningHoursListGET200ItemRepetition.ts b/src/core/dpl-cms/model/dplOpeningHoursListGET200ItemRepetition.ts new file mode 100644 index 0000000000..97a493a47d --- /dev/null +++ b/src/core/dpl-cms/model/dplOpeningHoursListGET200ItemRepetition.ts @@ -0,0 +1,17 @@ +/** + * Generated by orval v6.26.0 🍺 + * Do not edit manually. + * DPL CMS - REST API + * The REST API provide by the core REST module. + * OpenAPI spec version: Versioning not supported + */ +import type { DplOpeningHoursListGET200ItemRepetitionType } from "./dplOpeningHoursListGET200ItemRepetitionType"; +import type { DplOpeningHoursListGET200ItemRepetitionWeeklyData } from "./dplOpeningHoursListGET200ItemRepetitionWeeklyData"; + +export type DplOpeningHoursListGET200ItemRepetition = { + /** A serial unique id of the repetition. All instances with the same id belongs to the same repetition. */ + id: number; + /** If/how the instance should be repeated in the future:
- single: The instance should not be repeated
- weekly: The instance should be repeated weekly from the first day of the repetition until the provided end date. The week day of the first instance defines which weekday should be used for the repeated instances. */ + type: DplOpeningHoursListGET200ItemRepetitionType; + weekly_data?: DplOpeningHoursListGET200ItemRepetitionWeeklyData; +}; diff --git a/src/core/dpl-cms/model/dplOpeningHoursListGET200ItemRepetitionType.ts b/src/core/dpl-cms/model/dplOpeningHoursListGET200ItemRepetitionType.ts new file mode 100644 index 0000000000..d9860d1d5c --- /dev/null +++ b/src/core/dpl-cms/model/dplOpeningHoursListGET200ItemRepetitionType.ts @@ -0,0 +1,19 @@ +/** + * Generated by orval v6.26.0 🍺 + * Do not edit manually. + * DPL CMS - REST API + * The REST API provide by the core REST module. + * OpenAPI spec version: Versioning not supported + */ + +/** + * If/how the instance should be repeated in the future:
- single: The instance should not be repeated
- weekly: The instance should be repeated weekly from the first day of the repetition until the provided end date. The week day of the first instance defines which weekday should be used for the repeated instances. + */ +export type DplOpeningHoursListGET200ItemRepetitionType = + typeof DplOpeningHoursListGET200ItemRepetitionType[keyof typeof DplOpeningHoursListGET200ItemRepetitionType]; + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const DplOpeningHoursListGET200ItemRepetitionType = { + none: "none", + weekly: "weekly" +} as const; diff --git a/src/core/dpl-cms/model/dplOpeningHoursListGET200ItemRepetitionWeeklyData.ts b/src/core/dpl-cms/model/dplOpeningHoursListGET200ItemRepetitionWeeklyData.ts new file mode 100644 index 0000000000..8dc61957a4 --- /dev/null +++ b/src/core/dpl-cms/model/dplOpeningHoursListGET200ItemRepetitionWeeklyData.ts @@ -0,0 +1,12 @@ +/** + * Generated by orval v6.26.0 🍺 + * Do not edit manually. + * DPL CMS - REST API + * The REST API provide by the core REST module. + * OpenAPI spec version: Versioning not supported + */ + +export type DplOpeningHoursListGET200ItemRepetitionWeeklyData = { + /** The end date of the repetition. If the end date is not on the same week day as the first instance then the preceding occurrence of the weekday will be the last instance.

This field must be provided if type is 'weekly' */ + end_date?: string; +}; diff --git a/src/core/dpl-cms/model/dplOpeningHoursUpdatePATCH200.ts b/src/core/dpl-cms/model/dplOpeningHoursUpdatePATCH200.ts index 3a14536dcb..4f5d1211fd 100644 --- a/src/core/dpl-cms/model/dplOpeningHoursUpdatePATCH200.ts +++ b/src/core/dpl-cms/model/dplOpeningHoursUpdatePATCH200.ts @@ -6,6 +6,7 @@ * OpenAPI spec version: Versioning not supported */ import type { DplOpeningHoursUpdatePATCH200Category } from "./dplOpeningHoursUpdatePATCH200Category"; +import type { DplOpeningHoursUpdatePATCH200Repetition } from "./dplOpeningHoursUpdatePATCH200Repetition"; export type DplOpeningHoursUpdatePATCH200 = { /** The id for the branch the instance belongs to */ @@ -17,6 +18,7 @@ export type DplOpeningHoursUpdatePATCH200 = { end_time: string; /** An serial unique id of the opening hours instance. */ id: number; + repetition: DplOpeningHoursUpdatePATCH200Repetition; /** When the opening hours start. In format HH:MM */ start_time: string; }; diff --git a/src/core/dpl-cms/model/dplOpeningHoursUpdatePATCH200Repetition.ts b/src/core/dpl-cms/model/dplOpeningHoursUpdatePATCH200Repetition.ts new file mode 100644 index 0000000000..59b8f191b0 --- /dev/null +++ b/src/core/dpl-cms/model/dplOpeningHoursUpdatePATCH200Repetition.ts @@ -0,0 +1,17 @@ +/** + * Generated by orval v6.26.0 🍺 + * Do not edit manually. + * DPL CMS - REST API + * The REST API provide by the core REST module. + * OpenAPI spec version: Versioning not supported + */ +import type { DplOpeningHoursUpdatePATCH200RepetitionType } from "./dplOpeningHoursUpdatePATCH200RepetitionType"; +import type { DplOpeningHoursUpdatePATCH200RepetitionWeeklyData } from "./dplOpeningHoursUpdatePATCH200RepetitionWeeklyData"; + +export type DplOpeningHoursUpdatePATCH200Repetition = { + /** A serial unique id of the repetition. All instances with the same id belongs to the same repetition. */ + id: number; + /** If/how the instance should be repeated in the future:
- single: The instance should not be repeated
- weekly: The instance should be repeated weekly from the first day of the repetition until the provided end date. The week day of the first instance defines which weekday should be used for the repeated instances. */ + type: DplOpeningHoursUpdatePATCH200RepetitionType; + weekly_data?: DplOpeningHoursUpdatePATCH200RepetitionWeeklyData; +}; diff --git a/src/core/dpl-cms/model/dplOpeningHoursUpdatePATCH200RepetitionType.ts b/src/core/dpl-cms/model/dplOpeningHoursUpdatePATCH200RepetitionType.ts new file mode 100644 index 0000000000..e8635cdeb2 --- /dev/null +++ b/src/core/dpl-cms/model/dplOpeningHoursUpdatePATCH200RepetitionType.ts @@ -0,0 +1,19 @@ +/** + * Generated by orval v6.26.0 🍺 + * Do not edit manually. + * DPL CMS - REST API + * The REST API provide by the core REST module. + * OpenAPI spec version: Versioning not supported + */ + +/** + * If/how the instance should be repeated in the future:
- single: The instance should not be repeated
- weekly: The instance should be repeated weekly from the first day of the repetition until the provided end date. The week day of the first instance defines which weekday should be used for the repeated instances. + */ +export type DplOpeningHoursUpdatePATCH200RepetitionType = + typeof DplOpeningHoursUpdatePATCH200RepetitionType[keyof typeof DplOpeningHoursUpdatePATCH200RepetitionType]; + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const DplOpeningHoursUpdatePATCH200RepetitionType = { + none: "none", + weekly: "weekly" +} as const; diff --git a/src/core/dpl-cms/model/dplOpeningHoursUpdatePATCH200RepetitionWeeklyData.ts b/src/core/dpl-cms/model/dplOpeningHoursUpdatePATCH200RepetitionWeeklyData.ts new file mode 100644 index 0000000000..7caa2bad9e --- /dev/null +++ b/src/core/dpl-cms/model/dplOpeningHoursUpdatePATCH200RepetitionWeeklyData.ts @@ -0,0 +1,12 @@ +/** + * Generated by orval v6.26.0 🍺 + * Do not edit manually. + * DPL CMS - REST API + * The REST API provide by the core REST module. + * OpenAPI spec version: Versioning not supported + */ + +export type DplOpeningHoursUpdatePATCH200RepetitionWeeklyData = { + /** The end date of the repetition. If the end date is not on the same week day as the first instance then the preceding occurrence of the weekday will be the last instance.

This field must be provided if type is 'weekly' */ + end_date?: string; +}; diff --git a/src/core/dpl-cms/model/dplOpeningHoursUpdatePATCHBody.ts b/src/core/dpl-cms/model/dplOpeningHoursUpdatePATCHBody.ts index 340f793ea4..ce952cf638 100644 --- a/src/core/dpl-cms/model/dplOpeningHoursUpdatePATCHBody.ts +++ b/src/core/dpl-cms/model/dplOpeningHoursUpdatePATCHBody.ts @@ -6,6 +6,7 @@ * OpenAPI spec version: Versioning not supported */ import type { DplOpeningHoursUpdatePATCHBodyCategory } from "./dplOpeningHoursUpdatePATCHBodyCategory"; +import type { DplOpeningHoursUpdatePATCHBodyRepetition } from "./dplOpeningHoursUpdatePATCHBodyRepetition"; export type DplOpeningHoursUpdatePATCHBody = { /** The id for the branch the instance belongs to */ @@ -17,6 +18,7 @@ export type DplOpeningHoursUpdatePATCHBody = { end_time: string; /** An serial unique id of the opening hours instance. */ id: number; + repetition: DplOpeningHoursUpdatePATCHBodyRepetition; /** When the opening hours start. In format HH:MM */ start_time: string; }; diff --git a/src/core/dpl-cms/model/dplOpeningHoursUpdatePATCHBodyRepetition.ts b/src/core/dpl-cms/model/dplOpeningHoursUpdatePATCHBodyRepetition.ts new file mode 100644 index 0000000000..48b621fd65 --- /dev/null +++ b/src/core/dpl-cms/model/dplOpeningHoursUpdatePATCHBodyRepetition.ts @@ -0,0 +1,17 @@ +/** + * Generated by orval v6.26.0 🍺 + * Do not edit manually. + * DPL CMS - REST API + * The REST API provide by the core REST module. + * OpenAPI spec version: Versioning not supported + */ +import type { DplOpeningHoursUpdatePATCHBodyRepetitionType } from "./dplOpeningHoursUpdatePATCHBodyRepetitionType"; +import type { DplOpeningHoursUpdatePATCHBodyRepetitionWeeklyData } from "./dplOpeningHoursUpdatePATCHBodyRepetitionWeeklyData"; + +export type DplOpeningHoursUpdatePATCHBodyRepetition = { + /** A serial unique id of the repetition. All instances with the same id belongs to the same repetition. */ + id: number; + /** If/how the instance should be repeated in the future:
- single: The instance should not be repeated
- weekly: The instance should be repeated weekly from the first day of the repetition until the provided end date. The week day of the first instance defines which weekday should be used for the repeated instances. */ + type: DplOpeningHoursUpdatePATCHBodyRepetitionType; + weekly_data?: DplOpeningHoursUpdatePATCHBodyRepetitionWeeklyData; +}; diff --git a/src/core/dpl-cms/model/dplOpeningHoursUpdatePATCHBodyRepetitionType.ts b/src/core/dpl-cms/model/dplOpeningHoursUpdatePATCHBodyRepetitionType.ts new file mode 100644 index 0000000000..65beeb7e2b --- /dev/null +++ b/src/core/dpl-cms/model/dplOpeningHoursUpdatePATCHBodyRepetitionType.ts @@ -0,0 +1,19 @@ +/** + * Generated by orval v6.26.0 🍺 + * Do not edit manually. + * DPL CMS - REST API + * The REST API provide by the core REST module. + * OpenAPI spec version: Versioning not supported + */ + +/** + * If/how the instance should be repeated in the future:
- single: The instance should not be repeated
- weekly: The instance should be repeated weekly from the first day of the repetition until the provided end date. The week day of the first instance defines which weekday should be used for the repeated instances. + */ +export type DplOpeningHoursUpdatePATCHBodyRepetitionType = + typeof DplOpeningHoursUpdatePATCHBodyRepetitionType[keyof typeof DplOpeningHoursUpdatePATCHBodyRepetitionType]; + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const DplOpeningHoursUpdatePATCHBodyRepetitionType = { + none: "none", + weekly: "weekly" +} as const; diff --git a/src/core/dpl-cms/model/dplOpeningHoursUpdatePATCHBodyRepetitionWeeklyData.ts b/src/core/dpl-cms/model/dplOpeningHoursUpdatePATCHBodyRepetitionWeeklyData.ts new file mode 100644 index 0000000000..687dbecafb --- /dev/null +++ b/src/core/dpl-cms/model/dplOpeningHoursUpdatePATCHBodyRepetitionWeeklyData.ts @@ -0,0 +1,12 @@ +/** + * Generated by orval v6.26.0 🍺 + * Do not edit manually. + * DPL CMS - REST API + * The REST API provide by the core REST module. + * OpenAPI spec version: Versioning not supported + */ + +export type DplOpeningHoursUpdatePATCHBodyRepetitionWeeklyData = { + /** The end date of the repetition. If the end date is not on the same week day as the first instance then the preceding occurrence of the weekday will be the last instance.

This field must be provided if type is 'weekly' */ + end_date?: string; +}; diff --git a/src/core/dpl-cms/model/eventsGET200Item.ts b/src/core/dpl-cms/model/eventsGET200Item.ts index ad66a897b1..e1d861fd79 100644 --- a/src/core/dpl-cms/model/eventsGET200Item.ts +++ b/src/core/dpl-cms/model/eventsGET200Item.ts @@ -30,6 +30,8 @@ export type EventsGET200Item = { series?: EventsGET200ItemSeries; /** The state of the event. */ state: EventsGET200ItemState; + /** Total number of tickets which can be sold for the event. */ + ticket_capacity?: number; /** Ticket categories used for the event. Not present for events without ticketing. */ ticket_categories?: EventsGET200ItemTicketCategoriesItem[]; /** The event title. */ diff --git a/src/core/dpl-cms/model/eventsGET200ItemTicketCategoriesItem.ts b/src/core/dpl-cms/model/eventsGET200ItemTicketCategoriesItem.ts index a96ff5559c..70faee9881 100644 --- a/src/core/dpl-cms/model/eventsGET200ItemTicketCategoriesItem.ts +++ b/src/core/dpl-cms/model/eventsGET200ItemTicketCategoriesItem.ts @@ -5,12 +5,9 @@ * The REST API provide by the core REST module. * OpenAPI spec version: Versioning not supported */ -import type { EventsGET200ItemTicketCategoriesItemCount } from "./eventsGET200ItemTicketCategoriesItemCount"; import type { EventsGET200ItemTicketCategoriesItemPrice } from "./eventsGET200ItemTicketCategoriesItemPrice"; export type EventsGET200ItemTicketCategoriesItem = { - /** Number of tickets for the event. */ - count?: EventsGET200ItemTicketCategoriesItemCount; /** The price of a ticket in the category */ price: EventsGET200ItemTicketCategoriesItemPrice; /** The name of the ticket category. */ diff --git a/src/core/dpl-cms/model/eventsGET200ItemTicketCategoriesItemCount.ts b/src/core/dpl-cms/model/eventsGET200ItemTicketCategoriesItemCount.ts deleted file mode 100644 index b4adfe3f3e..0000000000 --- a/src/core/dpl-cms/model/eventsGET200ItemTicketCategoriesItemCount.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Generated by orval v6.26.0 🍺 - * Do not edit manually. - * DPL CMS - REST API - * The REST API provide by the core REST module. - * OpenAPI spec version: Versioning not supported - */ - -/** - * Number of tickets for the event. - */ -export type EventsGET200ItemTicketCategoriesItemCount = { - /** Total number of tickets for the event. */ - total?: number; -}; diff --git a/src/core/dpl-cms/model/index.ts b/src/core/dpl-cms/model/index.ts index 9058f7e694..6dba853f46 100644 --- a/src/core/dpl-cms/model/index.ts +++ b/src/core/dpl-cms/model/index.ts @@ -15,20 +15,35 @@ export * from "./campaignMatchPOSTFormat"; export * from "./campaignMatchPOSTParams"; export * from "./dplOpeningHoursCreatePOST200"; export * from "./dplOpeningHoursCreatePOST200Category"; +export * from "./dplOpeningHoursCreatePOST200Repetition"; +export * from "./dplOpeningHoursCreatePOST200RepetitionType"; +export * from "./dplOpeningHoursCreatePOST200RepetitionWeeklyData"; export * from "./dplOpeningHoursCreatePOSTBody"; export * from "./dplOpeningHoursCreatePOSTBodyCategory"; +export * from "./dplOpeningHoursCreatePOSTBodyRepetition"; +export * from "./dplOpeningHoursCreatePOSTBodyRepetitionType"; +export * from "./dplOpeningHoursCreatePOSTBodyRepetitionWeeklyData"; export * from "./dplOpeningHoursCreatePOSTFormat"; export * from "./dplOpeningHoursCreatePOSTParams"; export * from "./dplOpeningHoursDeleteDELETEFormat"; export * from "./dplOpeningHoursDeleteDELETEParams"; export * from "./dplOpeningHoursListGET200Item"; export * from "./dplOpeningHoursListGET200ItemCategory"; +export * from "./dplOpeningHoursListGET200ItemRepetition"; +export * from "./dplOpeningHoursListGET200ItemRepetitionType"; +export * from "./dplOpeningHoursListGET200ItemRepetitionWeeklyData"; export * from "./dplOpeningHoursListGETFormat"; export * from "./dplOpeningHoursListGETParams"; export * from "./dplOpeningHoursUpdatePATCH200"; export * from "./dplOpeningHoursUpdatePATCH200Category"; +export * from "./dplOpeningHoursUpdatePATCH200Repetition"; +export * from "./dplOpeningHoursUpdatePATCH200RepetitionType"; +export * from "./dplOpeningHoursUpdatePATCH200RepetitionWeeklyData"; export * from "./dplOpeningHoursUpdatePATCHBody"; export * from "./dplOpeningHoursUpdatePATCHBodyCategory"; +export * from "./dplOpeningHoursUpdatePATCHBodyRepetition"; +export * from "./dplOpeningHoursUpdatePATCHBodyRepetitionType"; +export * from "./dplOpeningHoursUpdatePATCHBodyRepetitionWeeklyData"; export * from "./dplOpeningHoursUpdatePATCHFormat"; export * from "./dplOpeningHoursUpdatePATCHParams"; export * from "./eventPATCHBody"; @@ -44,7 +59,6 @@ export * from "./eventsGET200ItemImage"; export * from "./eventsGET200ItemSeries"; export * from "./eventsGET200ItemState"; export * from "./eventsGET200ItemTicketCategoriesItem"; -export * from "./eventsGET200ItemTicketCategoriesItemCount"; export * from "./eventsGET200ItemTicketCategoriesItemPrice"; export * from "./eventsGETFormat"; export * from "./eventsGETParams"; From 2062010f4f712767cf0cef51486f11d7ff5f22f9 Mon Sep 17 00:00:00 2001 From: Kasper Birch Date: Thu, 25 Apr 2024 10:44:27 +0200 Subject: [PATCH 05/13] Update `createOpeningHours` and `updateOpeningHours` methods post latest OpenAPI spec adoption from DPL-CMS. Changes include: - Refactoring the opening hour editor for new `repetition` field. - Applying correct Types. - Adding a series-specific logo. - Refreshing WireMock with new opening hours data and adding `opening-hours-data.js` to handle it --- ...-7dfc9127-ba40-4098-9dfb-ed65799e99f0.json | 30 +- .docker/wiremock/cms/opening-hours-data.js | 687 ++++++++++++++++++ .../opening-hours-editor/DialogFormAdd.tsx | 34 +- .../opening-hours-editor/DialogFormEdit.tsx | 20 +- .../OpeningHoursEditor.dev.tsx | 2 +- .../OpeningHoursEditorEventContent.tsx | 15 +- src/apps/opening-hours-editor/helper.ts | 66 +- .../useOpeningHoursEditor.tsx | 9 +- 8 files changed, 807 insertions(+), 56 deletions(-) create mode 100644 .docker/wiremock/cms/opening-hours-data.js diff --git a/.docker/wiremock/cms/mappings/full-calendar-opening-hours-7dfc9127-ba40-4098-9dfb-ed65799e99f0.json b/.docker/wiremock/cms/mappings/full-calendar-opening-hours-7dfc9127-ba40-4098-9dfb-ed65799e99f0.json index 1312ef617f..5450204440 100644 --- a/.docker/wiremock/cms/mappings/full-calendar-opening-hours-7dfc9127-ba40-4098-9dfb-ed65799e99f0.json +++ b/.docker/wiremock/cms/mappings/full-calendar-opening-hours-7dfc9127-ba40-4098-9dfb-ed65799e99f0.json @@ -1,18 +1,18 @@ { - "id" : "7dfc9127-ba40-4098-9dfb-ed65799e99f0", - "name" : "Full Calendar Opening hours", - "request" : { - "url" : "/dpl_opening_hours?branch_id=12", - "method" : "GET" + "id": "7dfc9127-ba40-4098-9dfb-ed65799e99f0", + "name": "Full Calendar Opening hours", + "request": { + "url": "/dpl_opening_hours?branch_id=12", + "method": "GET" }, - "response" : { - "status" : 200, - "body" : "[\n {\n \"id\": 21,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-11\",\n \"start_time\": \"08:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 22,\n \"category\": {\n \"title\": \"Selvbetjening\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-11\",\n \"start_time\": \"13:00\",\n \"end_time\": \"17:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 23,\n \"category\": {\n \"title\": \"Med betjening\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-11\",\n \"start_time\": \"18:00\",\n \"end_time\": \"20:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 24,\n \"category\": {\n \"title\": \"Telefontid\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-12\",\n \"start_time\": \"09:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 25,\n \"category\": {\n \"title\": \"Borgerservice\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-12\",\n \"start_time\": \"12:00\",\n \"end_time\": \"14:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 26,\n \"category\": {\n \"title\": \"Børneetagen\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-12\",\n \"start_time\": \"15:00\",\n \"end_time\": \"18:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 27,\n \"category\": {\n \"title\": \"Makerlab\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-13\",\n \"start_time\": \"08:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 28,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-13\",\n \"start_time\": \"12:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 29,\n \"category\": {\n \"title\": \"Selvbetjening\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-13\",\n \"start_time\": \"17:00\",\n \"end_time\": \"20:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 30,\n \"category\": {\n \"title\": \"Med betjening\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-14\",\n \"start_time\": \"09:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 31,\n \"category\": {\n \"title\": \"Telefontid\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-14\",\n \"start_time\": \"14:00\",\n \"end_time\": \"17:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 32,\n \"category\": {\n \"title\": \"Borgerservice\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-14\",\n \"start_time\": \"18:00\",\n \"end_time\": \"20:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 33,\n \"category\": {\n \"title\": \"Børneetagen\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-15\",\n \"start_time\": \"08:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 34,\n \"category\": {\n \"title\": \"Makerlab\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-15\",\n \"start_time\": \"13:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 35,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-15\",\n \"start_time\": \"17:00\",\n \"end_time\": \"19:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 36,\n \"category\": {\n \"title\": \"Selvbetjening\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-16\",\n \"start_time\": \"09:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 37,\n \"category\": {\n \"title\": \"Med betjening\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-16\",\n \"start_time\": \"12:30\",\n \"end_time\": \"15:30\",\n \"branch_id\": 12\n },\n {\n \"id\": 38,\n \"category\": {\n \"title\": \"Telefontid\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-16\",\n \"start_time\": \"16:00\",\n \"end_time\": \"18:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 39,\n \"category\": {\n \"title\": \"Borgerservice\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-17\",\n \"start_time\": \"10:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 40,\n \"category\": {\n \"title\": \"Børneetagen\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-17\",\n \"start_time\": \"14:00\",\n \"end_time\": \"17:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 41,\n \"category\": {\n \"title\": \"Makerlab\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-17\",\n \"start_time\": \"18:00\",\n \"end_time\": \"20:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 0,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-18\",\n \"start_time\": \"09:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 1,\n \"category\": {\n \"title\": \"Selvbetjening\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-18\",\n \"start_time\": \"13:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 2,\n \"category\": {\n \"title\": \"Med betjening\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-18\",\n \"start_time\": \"17:00\",\n \"end_time\": \"19:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 3,\n \"category\": {\n \"title\": \"Telefontid\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-19\",\n \"start_time\": \"08:00\",\n \"end_time\": \"10:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 4,\n \"category\": {\n \"title\": \"Borgerservice\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-19\",\n \"start_time\": \"11:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 5,\n \"category\": {\n \"title\": \"Børneetagen\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-19\",\n \"start_time\": \"14:00\",\n \"end_time\": \"17:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 6,\n \"category\": {\n \"title\": \"Makerlab\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-20\",\n \"start_time\": \"09:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 7,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-20\",\n \"start_time\": \"13:00\",\n \"end_time\": \"15:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 8,\n \"category\": {\n \"title\": \"Selvbetjening\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-20\",\n \"start_time\": \"16:00\",\n \"end_time\": \"19:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 9,\n \"category\": {\n \"title\": \"Med betjening\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-21\",\n \"start_time\": \"09:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 10,\n \"category\": {\n \"title\": \"Telefontid\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-21\",\n \"start_time\": \"12:00\",\n \"end_time\": \"14:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 11,\n \"category\": {\n \"title\": \"Borgerservice\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-21\",\n \"start_time\": \"15:00\",\n \"end_time\": \"18:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 12,\n \"category\": {\n \"title\": \"Børneetagen\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-22\",\n \"start_time\": \"10:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 13,\n \"category\": {\n \"title\": \"Makerlab\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-22\",\n \"start_time\": \"14:00\",\n \"end_time\": \"17:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 14,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-22\",\n \"start_time\": \"18:00\",\n \"end_time\": \"20:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 15,\n \"category\": {\n \"title\": \"Selvbetjening\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-23\",\n \"start_time\": \"09:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 16,\n \"category\": {\n \"title\": \"Med betjening\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-23\",\n \"start_time\": \"12:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 17,\n \"category\": {\n \"title\": \"Telefontid\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-23\",\n \"start_time\": \"17:00\",\n \"end_time\": \"19:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 18,\n \"category\": {\n \"title\": \"Borgerservice\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-24\",\n \"start_time\": \"10:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 19,\n \"category\": {\n \"title\": \"Børneetagen\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-24\",\n \"start_time\": \"14:00\",\n \"end_time\": \"18:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 20,\n \"category\": {\n \"title\": \"Makerlab\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-24\",\n \"start_time\": \"19:00\",\n \"end_time\": \"21:00\",\n \"branch_id\": 12\n },\n\n {\n \"id\": 42,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-25\",\n \"start_time\": \"08:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 43,\n \"category\": {\n \"title\": \"Selvbetjening\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-25\",\n \"start_time\": \"13:00\",\n \"end_time\": \"17:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 44,\n \"category\": {\n \"title\": \"Med betjening\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-25\",\n \"start_time\": \"18:00\",\n \"end_time\": \"20:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 45,\n \"category\": {\n \"title\": \"Telefontid\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-26\",\n \"start_time\": \"09:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 46,\n \"category\": {\n \"title\": \"Borgerservice\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-26\",\n \"start_time\": \"12:00\",\n \"end_time\": \"14:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 47,\n \"category\": {\n \"title\": \"Børneetagen\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-26\",\n \"start_time\": \"15:00\",\n \"end_time\": \"18:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 48,\n \"category\": {\n \"title\": \"Makerlab\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-27\",\n \"start_time\": \"08:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 49,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-27\",\n \"start_time\": \"12:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 50,\n \"category\": {\n \"title\": \"Selvbetjening\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-27\",\n \"start_time\": \"17:00\",\n \"end_time\": \"20:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 51,\n \"category\": {\n \"title\": \"Med betjening\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-28\",\n \"start_time\": \"09:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 52,\n \"category\": {\n \"title\": \"Telefontid\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-28\",\n \"start_time\": \"14:00\",\n \"end_time\": \"17:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 53,\n \"category\": {\n \"title\": \"Borgerservice\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-28\",\n \"start_time\": \"18:00\",\n \"end_time\": \"20:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 54,\n \"category\": {\n \"title\": \"Børneetagen\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-29\",\n \"start_time\": \"08:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 55,\n \"category\": {\n \"title\": \"Makerlab\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-29\",\n \"start_time\": \"13:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 56,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-29\",\n \"start_time\": \"17:00\",\n \"end_time\": \"19:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 57,\n \"category\": {\n \"title\": \"Selvbetjening\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-30\",\n \"start_time\": \"09:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 58,\n \"category\": {\n \"title\": \"Med betjening\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-30\",\n \"start_time\": \"12:30\",\n \"end_time\": \"15:30\",\n \"branch_id\": 12\n },\n {\n \"id\": 59,\n \"category\": {\n \"title\": \"Telefontid\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-30\",\n \"start_time\": \"16:00\",\n \"end_time\": \"18:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 60,\n \"category\": {\n \"title\": \"Borgerservice\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-31\",\n \"start_time\": \"10:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 61,\n \"category\": {\n \"title\": \"Børneetagen\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-31\",\n \"start_time\": \"14:00\",\n \"end_time\": \"17:00\",\n \"branch_id\": 12\n },\n {\n \"id\": 62,\n \"category\": {\n \"title\": \"Makerlab\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-31\",\n \"start_time\": \"18:00\",\n \"end_time\": \"20:00\",\n \"branch_id\": 12\n }\n]\n", - "headers" : { } + "response": { + "status": 200, + "body": "[\n {\n \"id\": 1,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-11\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 1,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 2,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-18\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 1,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 3,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-25\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 1,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 4,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-01\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 1,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 5,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-08\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 1,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 6,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-12\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 2,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 7,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-19\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 2,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 8,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-26\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 2,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 9,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-02\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 2,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 10,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-09\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 2,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 26,\n \"category\": {\n \"title\": \"Telefon\",\n \"color\": \"green\"\n },\n \"date\": \"2024-03-12\",\n \"start_time\": \"10:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 6,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 27,\n \"category\": {\n \"title\": \"Telefon\",\n \"color\": \"green\"\n },\n \"date\": \"2024-03-19\",\n \"start_time\": \"10:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 6,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 28,\n \"category\": {\n \"title\": \"Telefon\",\n \"color\": \"green\"\n },\n \"date\": \"2024-03-26\",\n \"start_time\": \"10:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 6,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 29,\n \"category\": {\n \"title\": \"Telefon\",\n \"color\": \"green\"\n },\n \"date\": \"2024-04-02\",\n \"start_time\": \"10:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 6,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 30,\n \"category\": {\n \"title\": \"Telefon\",\n \"color\": \"green\"\n },\n \"date\": \"2024-04-09\",\n \"start_time\": \"10:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 6,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 11,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-13\",\n \"start_time\": \"08:00\",\n \"end_time\": \"14:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 3,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 12,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-20\",\n \"start_time\": \"08:00\",\n \"end_time\": \"14:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 3,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 13,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-27\",\n \"start_time\": \"08:00\",\n \"end_time\": \"14:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 3,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 14,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-03\",\n \"start_time\": \"08:00\",\n \"end_time\": \"14:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 3,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 15,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-10\",\n \"start_time\": \"08:00\",\n \"end_time\": \"14:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 3,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 16,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-14\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 4,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 17,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-21\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 4,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 18,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-28\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 4,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 19,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-04\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 4,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 20,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-11\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 4,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 21,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-15\",\n \"start_time\": \"08:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 5,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 22,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-22\",\n \"start_time\": \"08:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 5,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 23,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-29\",\n \"start_time\": \"08:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 5,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 24,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-05\",\n \"start_time\": \"08:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 5,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 25,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-12\",\n \"start_time\": \"08:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 5,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 31,\n \"category\": {\n \"title\": \"SingleOpeningHour1\",\n \"color\": \"lightblue\"\n },\n \"date\": \"2024-03-11\",\n \"start_time\": \"08:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 6,\n \"type\": \"none\"\n }\n },\n {\n \"id\": 32,\n \"category\": {\n \"title\": \"SingleOpeningHour2\",\n \"color\": \"pink\"\n },\n \"date\": \"2024-03-19\",\n \"start_time\": \"08:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 7,\n \"type\": \"none\"\n }\n },\n {\n \"id\": 33,\n \"category\": {\n \"title\": \"SingleOpeningHour3\",\n \"color\": \"limegreen\"\n },\n \"date\": \"2024-03-30\",\n \"start_time\": \"08:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 8,\n \"type\": \"none\"\n }\n },\n {\n \"id\": 34,\n \"category\": {\n \"title\": \"SingleOpeningHour4\",\n \"color\": \"gray\"\n },\n \"date\": \"2024-04-04\",\n \"start_time\": \"08:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 9,\n \"type\": \"none\"\n }\n },\n {\n \"id\": 35,\n \"category\": {\n \"title\": \"SingleOpeningHour5\",\n \"color\": \"darkblue\"\n },\n \"date\": \"2024-04-14\",\n \"start_time\": \"08:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 10,\n \"type\": \"none\"\n }\n }\n]", + "headers": {} }, - "uuid" : "7dfc9127-ba40-4098-9dfb-ed65799e99f0", - "persistent" : true, - "priority" : 5, - "insertionIndex" : 1, - "postServeActions" : [ ] -} \ No newline at end of file + "uuid": "7dfc9127-ba40-4098-9dfb-ed65799e99f0", + "persistent": true, + "priority": 5, + "insertionIndex": 4, + "postServeActions": [] +} diff --git a/.docker/wiremock/cms/opening-hours-data.js b/.docker/wiremock/cms/opening-hours-data.js new file mode 100644 index 0000000000..a60eaf56d9 --- /dev/null +++ b/.docker/wiremock/cms/opening-hours-data.js @@ -0,0 +1,687 @@ +const serieOpenMonday = [ + { + id: 1, + category: { + title: "Åbent", + color: "#4986e7" + }, + date: "2024-03-11", + start_time: "08:00", + end_time: "16:00", + branch_id: 12, + repetition: { + id: 1, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + }, + { + id: 2, + category: { + title: "Åbent", + color: "#4986e7" + }, + date: "2024-03-18", + start_time: "08:00", + end_time: "16:00", + branch_id: 12, + repetition: { + id: 1, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + }, + { + id: 3, + category: { + title: "Åbent", + color: "#4986e7" + }, + date: "2024-03-25", + start_time: "08:00", + end_time: "16:00", + branch_id: 12, + repetition: { + id: 1, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + }, + { + id: 4, + category: { + title: "Åbent", + color: "#4986e7" + }, + date: "2024-04-01", + start_time: "08:00", + end_time: "16:00", + branch_id: 12, + repetition: { + id: 1, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + }, + { + id: 5, + category: { + title: "Åbent", + color: "#4986e7" + }, + date: "2024-04-08", + start_time: "08:00", + end_time: "16:00", + branch_id: 12, + repetition: { + id: 1, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + } +]; + +const serieOpenTuesday = [ + { + id: 6, + category: { + title: "Åbent", + color: "#4986e7" + }, + date: "2024-03-12", + start_time: "08:00", + end_time: "16:00", + branch_id: 12, + repetition: { + id: 2, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + }, + { + id: 7, + category: { + title: "Åbent", + color: "#4986e7" + }, + date: "2024-03-19", + start_time: "08:00", + end_time: "16:00", + branch_id: 12, + repetition: { + id: 2, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + }, + { + id: 8, + category: { + title: "Åbent", + color: "#4986e7" + }, + date: "2024-03-26", + start_time: "08:00", + end_time: "16:00", + branch_id: 12, + repetition: { + id: 2, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + }, + { + id: 9, + category: { + title: "Åbent", + color: "#4986e7" + }, + date: "2024-04-02", + start_time: "08:00", + end_time: "16:00", + branch_id: 12, + repetition: { + id: 2, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + }, + { + id: 10, + category: { + title: "Åbent", + color: "#4986e7" + }, + date: "2024-04-09", + start_time: "08:00", + end_time: "16:00", + branch_id: 12, + repetition: { + id: 2, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + } +]; + +const serieOpenWednesday = [ + { + id: 11, + category: { + title: "Åbent", + color: "#4986e7" + }, + date: "2024-03-13", + start_time: "08:00", + end_time: "14:00", + branch_id: 12, + repetition: { + id: 3, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + }, + { + id: 12, + category: { + title: "Åbent", + color: "#4986e7" + }, + date: "2024-03-20", + start_time: "08:00", + end_time: "14:00", + branch_id: 12, + repetition: { + id: 3, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + }, + { + id: 13, + category: { + title: "Åbent", + color: "#4986e7" + }, + date: "2024-03-27", + start_time: "08:00", + end_time: "14:00", + branch_id: 12, + repetition: { + id: 3, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + }, + { + id: 14, + category: { + title: "Åbent", + color: "#4986e7" + }, + date: "2024-04-03", + start_time: "08:00", + end_time: "14:00", + branch_id: 12, + repetition: { + id: 3, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + }, + { + id: 15, + category: { + title: "Åbent", + color: "#4986e7" + }, + date: "2024-04-10", + start_time: "08:00", + end_time: "14:00", + branch_id: 12, + repetition: { + id: 3, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + } +]; + +const serieOpenThursday = [ + { + id: 16, + category: { + title: "Åbent", + color: "#4986e7" + }, + date: "2024-03-14", + start_time: "08:00", + end_time: "16:00", + branch_id: 12, + repetition: { + id: 4, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + }, + { + id: 17, + category: { + title: "Åbent", + color: "#4986e7" + }, + date: "2024-03-21", + start_time: "08:00", + end_time: "16:00", + branch_id: 12, + repetition: { + id: 4, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + }, + { + id: 18, + category: { + title: "Åbent", + color: "#4986e7" + }, + date: "2024-03-28", + start_time: "08:00", + end_time: "16:00", + branch_id: 12, + repetition: { + id: 4, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + }, + { + id: 19, + category: { + title: "Åbent", + color: "#4986e7" + }, + date: "2024-04-04", + start_time: "08:00", + end_time: "16:00", + branch_id: 12, + repetition: { + id: 4, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + }, + { + id: 20, + category: { + title: "Åbent", + color: "#4986e7" + }, + date: "2024-04-11", + start_time: "08:00", + end_time: "16:00", + branch_id: 12, + repetition: { + id: 4, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + } +]; + +const serieOpenFriday = [ + { + id: 21, + category: { + title: "Åbent", + color: "#4986e7" + }, + date: "2024-03-15", + start_time: "08:00", + end_time: "12:00", + branch_id: 12, + repetition: { + id: 5, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + }, + { + id: 22, + category: { + title: "Åbent", + color: "#4986e7" + }, + date: "2024-03-22", + start_time: "08:00", + end_time: "12:00", + branch_id: 12, + repetition: { + id: 5, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + }, + { + id: 23, + category: { + title: "Åbent", + color: "#4986e7" + }, + date: "2024-03-29", + start_time: "08:00", + end_time: "12:00", + branch_id: 12, + repetition: { + id: 5, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + }, + { + id: 24, + category: { + title: "Åbent", + color: "#4986e7" + }, + date: "2024-04-05", + start_time: "08:00", + end_time: "12:00", + branch_id: 12, + repetition: { + id: 5, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + }, + { + id: 25, + category: { + title: "Åbent", + color: "#4986e7" + }, + date: "2024-04-12", + start_time: "08:00", + end_time: "12:00", + branch_id: 12, + repetition: { + id: 5, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + } +]; + +const seriePhoneTuesday = [ + { + id: 26, + category: { + title: "Telefon", + color: "green" + }, + date: "2024-03-12", + start_time: "10:00", + end_time: "13:00", + branch_id: 12, + repetition: { + id: 6, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + }, + { + id: 27, + category: { + title: "Telefon", + color: "green" + }, + date: "2024-03-19", + start_time: "10:00", + end_time: "13:00", + branch_id: 12, + repetition: { + id: 6, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + }, + { + id: 28, + category: { + title: "Telefon", + color: "green" + }, + date: "2024-03-26", + start_time: "10:00", + end_time: "13:00", + branch_id: 12, + repetition: { + id: 6, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + }, + { + id: 29, + category: { + title: "Telefon", + color: "green" + }, + date: "2024-04-02", + start_time: "10:00", + end_time: "13:00", + branch_id: 12, + repetition: { + id: 6, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + }, + { + id: 30, + category: { + title: "Telefon", + color: "green" + }, + date: "2024-04-09", + start_time: "10:00", + end_time: "13:00", + branch_id: 12, + repetition: { + id: 6, + type: "weekly", + weekly_data: { + end_date: "2024-04-14" + } + } + } +]; + +const singleOpeningHours = [ + { + id: 31, + category: { + title: "SingleOpeningHour1", + color: "lightblue" + }, + date: "2024-03-11", + start_time: "08:00", + end_time: "11:00", + branch_id: 12, + repetition: { + id: 6, + type: "none" + } + }, + { + id: 32, + category: { + title: "SingleOpeningHour2", + color: "pink" + }, + date: "2024-03-19", + start_time: "08:00", + end_time: "11:00", + branch_id: 12, + repetition: { + id: 7, + type: "none" + } + }, + { + id: 33, + category: { + title: "SingleOpeningHour3", + color: "limegreen" + }, + date: "2024-03-30", + start_time: "08:00", + end_time: "11:00", + branch_id: 12, + repetition: { + id: 8, + type: "none" + } + }, + { + id: 34, + category: { + title: "SingleOpeningHour4", + color: "gray" + }, + date: "2024-04-04", + start_time: "08:00", + end_time: "11:00", + branch_id: 12, + repetition: { + id: 9, + type: "none" + } + }, + { + id: 35, + category: { + title: "SingleOpeningHour5", + color: "darkblue" + }, + date: "2024-04-14", + start_time: "08:00", + end_time: "11:00", + branch_id: 12, + repetition: { + id: 10, + type: "none" + } + } +]; + +export const openingHoursPrevWeek1 = [ + serieOpenMonday[0], + serieOpenTuesday[0], + seriePhoneTuesday[0], + serieOpenWednesday[0], + serieOpenThursday[0], + serieOpenFriday[0], + singleOpeningHours[0] +].flat(); + +export const openingHoursPrevWeek2 = [ + serieOpenMonday[1], + serieOpenTuesday[1], + seriePhoneTuesday[1], + serieOpenWednesday[1], + serieOpenThursday[1], + serieOpenFriday[1], + singleOpeningHours[1] +].flat(); + +export const openingHoursNextWeek1 = [ + serieOpenMonday[3], + serieOpenTuesday[3], + seriePhoneTuesday[3], + serieOpenWednesday[3], + serieOpenThursday[3], + serieOpenFriday[3], + singleOpeningHours[3] +].flat(); + +export const openingHoursNextWeek2 = [ + serieOpenMonday[4], + serieOpenTuesday[4], + seriePhoneTuesday[4], + serieOpenWednesday[4], + serieOpenThursday[4], + serieOpenFriday[4], + singleOpeningHours[4] +].flat(); + +const openingHoursAll = [ + serieOpenMonday, + serieOpenTuesday, + seriePhoneTuesday, + serieOpenWednesday, + serieOpenThursday, + serieOpenFriday, + singleOpeningHours +].flat(); + +export default openingHoursAll; diff --git a/src/apps/opening-hours-editor/DialogFormAdd.tsx b/src/apps/opening-hours-editor/DialogFormAdd.tsx index dbda8da1c1..b3bda1cdad 100644 --- a/src/apps/opening-hours-editor/DialogFormAdd.tsx +++ b/src/apps/opening-hours-editor/DialogFormAdd.tsx @@ -4,16 +4,19 @@ import { adjustEndDateToStartDayGridMonth, adjustEndDateToStartDayTimeGridWeek, formatDateStr, - formatFullCalendarEventToCmsEvent, + formatFullCalendarEventToCmsEventAdd, updateDateTime } from "./helper"; import EventForm, { EventFormOnSubmitType } from "./EventForm"; -import { DplOpeningHoursListGET200Item } from "../../core/dpl-cms/model"; +import { + DplOpeningHoursCreatePOSTBody, + DplOpeningHoursCreatePOSTBodyRepetitionType +} from "../../core/dpl-cms/model"; import { OpeningHoursCategoriesType } from "./types"; type DialogFormAddProps = { selectedEventInfo: DateSelectArg; - handleEventAdd: (selectedEventInfo: DplOpeningHoursListGET200Item) => void; + handleEventAdd: (event: DplOpeningHoursCreatePOSTBody) => void; closeDialog: () => void; openingHoursCategories: OpeningHoursCategoriesType[]; }; @@ -34,12 +37,6 @@ const DialogFormAdd: React.FC = ({ endTime, repeatedEndDate ) => { - if (repeatedEndDate) { - // eslint-disable-next-line no-alert - alert("Repeated event is not supported yet"); - closeDialog(); - return; - } const start = updateDateTime(selectedEventInfo.start, startTime); const startStr = formatDateStr(start); let end = updateDateTime(selectedEventInfo.end, endTime); @@ -57,7 +54,7 @@ const DialogFormAdd: React.FC = ({ endStr = adjustedEnd.endStr; } - const newEventInfo = { + const newFullCalenderEvent = { ...selectedEventInfo, start, startStr, @@ -68,9 +65,22 @@ const DialogFormAdd: React.FC = ({ allDay: false }; - calendarApi.addEvent(newEventInfo); + calendarApi.addEvent(newFullCalenderEvent); calendarApi.unselect(); - handleEventAdd(formatFullCalendarEventToCmsEvent(newEventInfo)); + + const cmsEvent = formatFullCalendarEventToCmsEventAdd({ + ...newFullCalenderEvent, + repetition: { + type: repeatedEndDate + ? DplOpeningHoursCreatePOSTBodyRepetitionType.weekly + : DplOpeningHoursCreatePOSTBodyRepetitionType.none, + ...(repeatedEndDate + ? { weekly_data: { end_date: repeatedEndDate } } + : {}) + } + }); + + handleEventAdd(cmsEvent); closeDialog(); }; diff --git a/src/apps/opening-hours-editor/DialogFormEdit.tsx b/src/apps/opening-hours-editor/DialogFormEdit.tsx index 1fb15a5334..4c4d3dc550 100644 --- a/src/apps/opening-hours-editor/DialogFormEdit.tsx +++ b/src/apps/opening-hours-editor/DialogFormEdit.tsx @@ -2,17 +2,17 @@ import React from "react"; import { EventImpl } from "@fullcalendar/core/internal"; import { adjustEndDateBasedOnStartDate, - formatFullCalendarEventToCmsEvent, + formatFullCalendarEventToCmsEventEdit, updateDateTime } from "./helper"; import EventForm, { EventFormOnSubmitType } from "./EventForm"; import { useText } from "../../core/utils/text"; import { OpeningHoursCategoriesType } from "./types"; -import { DplOpeningHoursListGET200Item } from "../../core/dpl-cms/model"; +import { DplOpeningHoursUpdatePATCHBody } from "../../core/dpl-cms/model"; type DialogFormEditProps = { eventInfo: EventImpl; - handleEventEditing: (event: DplOpeningHoursListGET200Item) => void; + handleEventEditing: (event: DplOpeningHoursUpdatePATCHBody) => void; closeDialog: () => void; handleEventRemove: (eventId: string) => void; openingHoursCategories: OpeningHoursCategoriesType[]; @@ -46,13 +46,23 @@ const DialogFormEdit: React.FC = ({ eventInfo.setProp("color", category.color); eventInfo.setDates(startDate, endDate); - handleEventEditing(formatFullCalendarEventToCmsEvent(eventInfo)); + const cmsEvent = { + id: eventInfo.id, + category, + title: eventInfo.title, + backgroundColor: eventInfo.backgroundColor, + startStr: eventInfo.startStr, + endStr: eventInfo.endStr, + repetition: eventInfo.extendedProps.repetition + }; + + handleEventEditing(formatFullCalendarEventToCmsEventEdit(cmsEvent)); closeDialog(); }; if (!eventInfo.start || !eventInfo.end) { // eslint-disable-next-line no-alert - alert("Invalid event"); + alert(t("openingHoursInvalidEventText")); return null; } diff --git a/src/apps/opening-hours-editor/OpeningHoursEditor.dev.tsx b/src/apps/opening-hours-editor/OpeningHoursEditor.dev.tsx index 2c8f62ebcc..229150bf16 100644 --- a/src/apps/opening-hours-editor/OpeningHoursEditor.dev.tsx +++ b/src/apps/opening-hours-editor/OpeningHoursEditor.dev.tsx @@ -21,7 +21,7 @@ export default { openingHoursEditorCategoriesConfig: { name: "Opening hours categories", defaultValue: - '[{"title":"\\u00c5bent","color":"#B3DC6C"},{"title":"Telefontid","color":"#FBE983"}]', + '[{"title":"\\u00c5bent","color":"#B3DC6C"},{"title":"Telefontid","color":"#FBE983"},{"title":"SingleOpeningHour1","color":"lightblue"},{"title":"SingleOpeningHour2","color":"pink"},{"title":"SingleOpeningHour3","color":"limegreen"},{"title":"SingleOpeningHour4","color":"gray"},{"title":"SingleOpeningHour5","color":"darkblue"}]', control: { type: "text" } }, openingHoursBranchIdConfig: { diff --git a/src/apps/opening-hours-editor/OpeningHoursEditorEventContent.tsx b/src/apps/opening-hours-editor/OpeningHoursEditorEventContent.tsx index 695fe209f9..bc8b18485b 100644 --- a/src/apps/opening-hours-editor/OpeningHoursEditorEventContent.tsx +++ b/src/apps/opening-hours-editor/OpeningHoursEditorEventContent.tsx @@ -1,4 +1,5 @@ import React from "react"; +import logo from "@danskernesdigitalebibliotek/dpl-design-system/build/icons/logo/reload_logo_black.svg"; import { EventInput } from "@fullcalendar/core"; import { extractTime } from "./helper"; @@ -10,15 +11,25 @@ const OpeningHoursEditorEventContent: React.FC< OpeningHoursEditorEventContentProps > = ({ eventInput }) => { const { event } = eventInput; + const { repetition } = event.extendedProps; + const isSeries = repetition?.type === "weekly"; + return (
- {event.title}
- {extractTime(event.start)} - {extractTime(event.end)} + {event.title} +
+ {extractTime(event.start)} - {extractTime(event.end)} +
+ {isSeries && ( +
+ +
+ )}
); }; diff --git a/src/apps/opening-hours-editor/helper.ts b/src/apps/opening-hours-editor/helper.ts index b6651e329e..5b1a0feb8c 100644 --- a/src/apps/opening-hours-editor/helper.ts +++ b/src/apps/opening-hours-editor/helper.ts @@ -1,7 +1,10 @@ import dayjs from "dayjs"; import { EventInput } from "@fullcalendar/core"; -import { EventImpl } from "@fullcalendar/core/internal"; -import { DplOpeningHoursListGET200Item } from "../../core/dpl-cms/model"; +import { + DplOpeningHoursListGET200Item, + DplOpeningHoursCreatePOSTBody, + DplOpeningHoursUpdatePATCHBody +} from "../../core/dpl-cms/model"; const formatDateTimeString = (date: string, time: string): string => { return `${date}T${time}:00`; @@ -10,24 +13,50 @@ const formatDateTimeString = (date: string, time: string): string => { export const formatCmsEventsToFullCalendar = ( data: DplOpeningHoursListGET200Item[] ): EventInput[] => { - return data.map(({ category, date, start_time, end_time, id }) => { - return { - id: id.toString(), - title: category.title, - start: formatDateTimeString(date, start_time), - end: formatDateTimeString(date, end_time), - color: category.color - }; - }); + return data.map( + ({ category, date, start_time, end_time, id, repetition }) => { + return { + id: id.toString(), + title: category.title, + start: formatDateTimeString(date, start_time), + end: formatDateTimeString(date, end_time), + color: category.color, + repetition + }; + } + ); }; -export const formatFullCalendarEventToCmsEvent = ( - event: EventInput | EventImpl -): DplOpeningHoursListGET200Item => { - const isEventInput = "color" in event; // Check if it's EventInput type - const color = isEventInput ? event.color : event.backgroundColor; +export const formatFullCalendarEventToCmsEventAdd = ( + event: EventInput & Pick +): DplOpeningHoursCreatePOSTBody => { + if (!event.title || !event.color) { + throw new Error("Invalid event format"); + } + + const startDate = dayjs(event.startStr); + const endDate = dayjs(event.endStr); + + return { + id: Number(event.id), + category: { + title: event.title, + color: event.color + }, + date: startDate.format("YYYY-MM-DD"), + start_time: startDate.format("HH:mm"), + end_time: endDate.format("HH:mm"), + repetition: event.repetition, + // set to id 0 to because the API requires a branch_id. + // This will be overwritten when the event is added or edited in the useOpeningHoursEditor hook + branch_id: 0 + }; +}; - if (!event.title || !color) { +export const formatFullCalendarEventToCmsEventEdit = ( + event: EventInput & Pick +): DplOpeningHoursUpdatePATCHBody => { + if (!event.title || !event.backgroundColor) { throw new Error("Invalid event format"); } @@ -38,11 +67,12 @@ export const formatFullCalendarEventToCmsEvent = ( id: Number(event.id), category: { title: event.title, - color + color: event.backgroundColor }, date: startDate.format("YYYY-MM-DD"), start_time: startDate.format("HH:mm"), end_time: endDate.format("HH:mm"), + repetition: event.repetition, // set to id 0 to because the API requires a branch_id. // This will be overwritten when the event is added or edited in the useOpeningHoursEditor hook branch_id: 0 diff --git a/src/apps/opening-hours-editor/useOpeningHoursEditor.tsx b/src/apps/opening-hours-editor/useOpeningHoursEditor.tsx index 4830ca2882..51279a8341 100644 --- a/src/apps/opening-hours-editor/useOpeningHoursEditor.tsx +++ b/src/apps/opening-hours-editor/useOpeningHoursEditor.tsx @@ -9,7 +9,10 @@ import { useDplOpeningHoursListGET, useDplOpeningHoursUpdatePATCH } from "../../core/dpl-cms/dpl-cms"; -import { DplOpeningHoursListGET200Item } from "../../core/dpl-cms/model"; +import { + DplOpeningHoursCreatePOSTBody, + DplOpeningHoursUpdatePATCHBody +} from "../../core/dpl-cms/model"; import { useConfig } from "../../core/utils/config"; const useOpeningHoursEditor = () => { @@ -46,7 +49,7 @@ const useOpeningHoursEditor = () => { window.location.reload(); }; - const handleEventAdd = (event: DplOpeningHoursListGET200Item) => { + const handleEventAdd = (event: DplOpeningHoursCreatePOSTBody) => { createOpeningHours( { data: { @@ -68,7 +71,7 @@ const useOpeningHoursEditor = () => { ); }; - const handleEventEditing = (event: DplOpeningHoursListGET200Item) => { + const handleEventEditing = (event: DplOpeningHoursUpdatePATCHBody) => { updateOpeningHours( { id: event.id.toString(), From 5b48258ae7d5c6d2267e7356f16af3b3b839ec27 Mon Sep 17 00:00:00 2001 From: Kasper Birch Date: Wed, 24 Apr 2024 12:25:04 +0200 Subject: [PATCH 06/13] Refactor WireMock stubs for clarity Use consistent data across the editor and frontend, and assign more descriptive names to stubs. --- ...-8b0177da-969f-4461-ae54-34151ad21b07.json | 18 - ...-4a24284b-7281-46df-ae95-de1a28578f3f.json | 18 - ...-479e26d6-5197-4d8f-a2dd-fefe64aabc14.json | 18 - ...b0c2a2f9-7b4d-4a6d-8324-13051e946c02.json} | 14 +- ...-f17d80cb-0e88-46f5-910a-07d9b803d2c3.json | 21 + ...-b03cdd7c-c1e0-4e35-b374-f429642e379f.json | 20 + ...b4a3d509-efc1-409b-acfd-4eaad6d6c6e2.json} | 8 +- ...-104eae1e-ae10-4893-aadb-7f19ca988f1a.json | 20 + ...-6c1c831f-bec5-4c57-a4d1-322196701f1b.json | 20 + ...-9e0567ff-57cf-4991-bd32-686e084568a7.json | 18 - .docker/wiremock/cms/opening-hours-data.js | 687 ------------------ .../OpeningHoursEditor.dev.tsx | 2 +- src/apps/opening-hours/OpeningHours.dev.tsx | 4 +- 13 files changed, 96 insertions(+), 772 deletions(-) delete mode 100644 .docker/wiremock/cms/mappings/cms-stub-2-8b0177da-969f-4461-ae54-34151ad21b07.json delete mode 100644 .docker/wiremock/cms/mappings/current-week--4a24284b-7281-46df-ae95-de1a28578f3f.json delete mode 100644 .docker/wiremock/cms/mappings/dummy-479e26d6-5197-4d8f-a2dd-fefe64aabc14.json rename .docker/wiremock/cms/mappings/{full-calendar-opening-hours-7dfc9127-ba40-4098-9dfb-ed65799e99f0.json => opening-hours-all-b0c2a2f9-7b4d-4a6d-8324-13051e946c02.json} (87%) create mode 100644 .docker/wiremock/cms/mappings/opening-hours-create-instance-f17d80cb-0e88-46f5-910a-07d9b803d2c3.json create mode 100644 .docker/wiremock/cms/mappings/opening-hours-current-week-b03cdd7c-c1e0-4e35-b374-f429642e379f.json rename .docker/wiremock/cms/mappings/{delete-event-f52a1b96-38d2-479a-aeaf-65367637d365.json => opening-hours-delete-instance-b4a3d509-efc1-409b-acfd-4eaad6d6c6e2.json} (59%) create mode 100644 .docker/wiremock/cms/mappings/opening-hours-next-week-104eae1e-ae10-4893-aadb-7f19ca988f1a.json create mode 100644 .docker/wiremock/cms/mappings/opening-hours-previous-week-6c1c831f-bec5-4c57-a4d1-322196701f1b.json delete mode 100644 .docker/wiremock/cms/mappings/previous-week-9e0567ff-57cf-4991-bd32-686e084568a7.json delete mode 100644 .docker/wiremock/cms/opening-hours-data.js diff --git a/.docker/wiremock/cms/mappings/cms-stub-2-8b0177da-969f-4461-ae54-34151ad21b07.json b/.docker/wiremock/cms/mappings/cms-stub-2-8b0177da-969f-4461-ae54-34151ad21b07.json deleted file mode 100644 index 8ec657ec70..0000000000 --- a/.docker/wiremock/cms/mappings/cms-stub-2-8b0177da-969f-4461-ae54-34151ad21b07.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "id" : "8b0177da-969f-4461-ae54-34151ad21b07", - "name" : "Next week", - "request" : { - "url" : "/dpl_opening_hours?branch_id=1&from_date=2024-03-25&to_date=2024-03-31", - "method" : "GET" - }, - "response" : { - "status" : 200, - "body" : " [{\n \"id\": 42,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-25\",\n \"start_time\": \"08:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 43,\n \"category\": {\n \"title\": \"Mors hyggehjørne\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-25\",\n \"start_time\": \"13:00\",\n \"end_time\": \"17:00\",\n \"branch_id\": 2\n },\n {\n \"id\": 44,\n \"category\": {\n \"title\": \"Med betjening\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-25\",\n \"start_time\": \"18:00\",\n \"end_time\": \"20:00\",\n \"branch_id\": 3\n },\n {\n \"id\": 45,\n \"category\": {\n \"title\": \"Telefontid\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-26\",\n \"start_time\": \"09:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 46,\n \"category\": {\n \"title\": \"Borgerservice\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-26\",\n \"start_time\": \"12:00\",\n \"end_time\": \"14:00\",\n \"branch_id\": 2\n },\n {\n \"id\": 47,\n \"category\": {\n \"title\": \"Børneetagen\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-26\",\n \"start_time\": \"15:00\",\n \"end_time\": \"18:00\",\n \"branch_id\": 3\n },\n {\n \"id\": 48,\n \"category\": {\n \"title\": \"Makerlab\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-27\",\n \"start_time\": \"08:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 49,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-27\",\n \"start_time\": \"12:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 2\n },\n {\n \"id\": 50,\n \"category\": {\n \"title\": \"Selvbetjening\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-27\",\n \"start_time\": \"17:00\",\n \"end_time\": \"20:00\",\n \"branch_id\": 3\n },\n {\n \"id\": 51,\n \"category\": {\n \"title\": \"Med betjening\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-28\",\n \"start_time\": \"09:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 52,\n \"category\": {\n \"title\": \"Telefontid\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-28\",\n \"start_time\": \"14:00\",\n \"end_time\": \"17:00\",\n \"branch_id\": 2\n },\n {\n \"id\": 53,\n \"category\": {\n \"title\": \"Borgerservice\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-28\",\n \"start_time\": \"18:00\",\n \"end_time\": \"20:00\",\n \"branch_id\": 3\n },\n {\n \"id\": 54,\n \"category\": {\n \"title\": \"Børneetagen\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-29\",\n \"start_time\": \"08:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 55,\n \"category\": {\n \"title\": \"Makerlab\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-29\",\n \"start_time\": \"13:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 2\n },\n {\n \"id\": 56,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-29\",\n \"start_time\": \"17:00\",\n \"end_time\": \"19:00\",\n \"branch_id\": 3\n },\n {\n \"id\": 57,\n \"category\": {\n \"title\": \"Selvbetjening\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-30\",\n \"start_time\": \"09:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 58,\n \"category\": {\n \"title\": \"Med betjening\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-30\",\n \"start_time\": \"12:30\",\n \"end_time\": \"15:30\",\n \"branch_id\": 2\n },\n {\n \"id\": 59,\n \"category\": {\n \"title\": \"Telefontid\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-30\",\n \"start_time\": \"16:00\",\n \"end_time\": \"18:00\",\n \"branch_id\": 3\n },\n {\n \"id\": 60,\n \"category\": {\n \"title\": \"Borgerservice\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-31\",\n \"start_time\": \"10:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 61,\n \"category\": {\n \"title\": \"Børneetagen\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-31\",\n \"start_time\": \"14:00\",\n \"end_time\": \"17:00\",\n \"branch_id\": 2\n },\n {\n \"id\": 62,\n \"category\": {\n \"title\": \"Makerlab\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-31\",\n \"start_time\": \"18:00\",\n \"end_time\": \"20:00\",\n \"branch_id\": 3\n }\n]\n", - "headers" : { } - }, - "uuid" : "8b0177da-969f-4461-ae54-34151ad21b07", - "persistent" : true, - "priority" : 5, - "insertionIndex" : 2, - "postServeActions" : [ ] -} \ No newline at end of file diff --git a/.docker/wiremock/cms/mappings/current-week--4a24284b-7281-46df-ae95-de1a28578f3f.json b/.docker/wiremock/cms/mappings/current-week--4a24284b-7281-46df-ae95-de1a28578f3f.json deleted file mode 100644 index 0e8a7e4759..0000000000 --- a/.docker/wiremock/cms/mappings/current-week--4a24284b-7281-46df-ae95-de1a28578f3f.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "id" : "4a24284b-7281-46df-ae95-de1a28578f3f", - "name" : "Current week ", - "request" : { - "url" : "/dpl_opening_hours?branch_id=1&from_date=2024-03-18&to_date=2024-03-24", - "method" : "GET" - }, - "response" : { - "status" : 200, - "body" : "[ {\n \"id\": 0,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-18\",\n \"start_time\": \"09:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 1,\n \"category\": {\n \"title\": \"Selvbetjening\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-18\",\n \"start_time\": \"13:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 2,\n \"category\": {\n \"title\": \"Med betjening\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-18\",\n \"start_time\": \"17:00\",\n \"end_time\": \"19:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 3,\n \"category\": {\n \"title\": \"Telefontid\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-19\",\n \"start_time\": \"08:00\",\n \"end_time\": \"10:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 4,\n \"category\": {\n \"title\": \"Borgerservice\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-19\",\n \"start_time\": \"11:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 5,\n \"category\": {\n \"title\": \"Børneetagen\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-19\",\n \"start_time\": \"14:00\",\n \"end_time\": \"17:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 6,\n \"category\": {\n \"title\": \"Makerlab\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-20\",\n \"start_time\": \"09:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 7,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-20\",\n \"start_time\": \"13:00\",\n \"end_time\": \"15:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 8,\n \"category\": {\n \"title\": \"Selvbetjening\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-20\",\n \"start_time\": \"16:00\",\n \"end_time\": \"19:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 9,\n \"category\": {\n \"title\": \"Med betjening\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-21\",\n \"start_time\": \"09:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 10,\n \"category\": {\n \"title\": \"Telefontid\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-21\",\n \"start_time\": \"12:00\",\n \"end_time\": \"14:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 11,\n \"category\": {\n \"title\": \"Borgerservice\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-21\",\n \"start_time\": \"15:00\",\n \"end_time\": \"18:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 12,\n \"category\": {\n \"title\": \"Børneetagen\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-22\",\n \"start_time\": \"10:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 1\n },\n\n {\n \"id\": 18,\n \"category\": {\n \"title\": \"Borgerservice\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-24\",\n \"start_time\": \"10:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 19,\n \"category\": {\n \"title\": \"Børneetagen\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-24\",\n \"start_time\": \"14:00\",\n \"end_time\": \"18:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 20,\n \"category\": {\n \"title\": \"Makerlab\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-24\",\n \"start_time\": \"19:00\",\n \"end_time\": \"21:00\",\n \"branch_id\": 1\n }]", - "headers" : { } - }, - "uuid" : "4a24284b-7281-46df-ae95-de1a28578f3f", - "persistent" : true, - "priority" : 5, - "insertionIndex" : 3, - "postServeActions" : [ ] -} \ No newline at end of file diff --git a/.docker/wiremock/cms/mappings/dummy-479e26d6-5197-4d8f-a2dd-fefe64aabc14.json b/.docker/wiremock/cms/mappings/dummy-479e26d6-5197-4d8f-a2dd-fefe64aabc14.json deleted file mode 100644 index 27d8d669f5..0000000000 --- a/.docker/wiremock/cms/mappings/dummy-479e26d6-5197-4d8f-a2dd-fefe64aabc14.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "id" : "479e26d6-5197-4d8f-a2dd-fefe64aabc14", - "name" : "Opening hours", - "request" : { - "url" : "/dpl_opening_hours", - "method" : "GET" - }, - "response" : { - "status" : 200, - "body" : "[\n \n]\n", - "headers" : { } - }, - "uuid" : "479e26d6-5197-4d8f-a2dd-fefe64aabc14", - "persistent" : true, - "priority" : 5, - "insertionIndex" : 0, - "postServeActions" : [ ] -} \ No newline at end of file diff --git a/.docker/wiremock/cms/mappings/full-calendar-opening-hours-7dfc9127-ba40-4098-9dfb-ed65799e99f0.json b/.docker/wiremock/cms/mappings/opening-hours-all-b0c2a2f9-7b4d-4a6d-8324-13051e946c02.json similarity index 87% rename from .docker/wiremock/cms/mappings/full-calendar-opening-hours-7dfc9127-ba40-4098-9dfb-ed65799e99f0.json rename to .docker/wiremock/cms/mappings/opening-hours-all-b0c2a2f9-7b4d-4a6d-8324-13051e946c02.json index 5450204440..508a51d04b 100644 --- a/.docker/wiremock/cms/mappings/full-calendar-opening-hours-7dfc9127-ba40-4098-9dfb-ed65799e99f0.json +++ b/.docker/wiremock/cms/mappings/opening-hours-all-b0c2a2f9-7b4d-4a6d-8324-13051e946c02.json @@ -1,18 +1,20 @@ { - "id": "7dfc9127-ba40-4098-9dfb-ed65799e99f0", - "name": "Full Calendar Opening hours", + "id": "b0c2a2f9-7b4d-4a6d-8324-13051e946c02", + "name": "Opening hours all", "request": { "url": "/dpl_opening_hours?branch_id=12", "method": "GET" }, "response": { "status": 200, - "body": "[\n {\n \"id\": 1,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-11\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 1,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 2,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-18\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 1,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 3,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-25\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 1,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 4,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-01\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 1,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 5,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-08\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 1,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 6,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-12\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 2,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 7,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-19\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 2,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 8,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-26\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 2,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 9,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-02\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 2,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 10,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-09\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 2,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 26,\n \"category\": {\n \"title\": \"Telefon\",\n \"color\": \"green\"\n },\n \"date\": \"2024-03-12\",\n \"start_time\": \"10:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 6,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 27,\n \"category\": {\n \"title\": \"Telefon\",\n \"color\": \"green\"\n },\n \"date\": \"2024-03-19\",\n \"start_time\": \"10:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 6,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 28,\n \"category\": {\n \"title\": \"Telefon\",\n \"color\": \"green\"\n },\n \"date\": \"2024-03-26\",\n \"start_time\": \"10:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 6,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 29,\n \"category\": {\n \"title\": \"Telefon\",\n \"color\": \"green\"\n },\n \"date\": \"2024-04-02\",\n \"start_time\": \"10:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 6,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 30,\n \"category\": {\n \"title\": \"Telefon\",\n \"color\": \"green\"\n },\n \"date\": \"2024-04-09\",\n \"start_time\": \"10:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 6,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 11,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-13\",\n \"start_time\": \"08:00\",\n \"end_time\": \"14:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 3,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 12,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-20\",\n \"start_time\": \"08:00\",\n \"end_time\": \"14:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 3,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 13,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-27\",\n \"start_time\": \"08:00\",\n \"end_time\": \"14:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 3,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 14,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-03\",\n \"start_time\": \"08:00\",\n \"end_time\": \"14:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 3,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 15,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-10\",\n \"start_time\": \"08:00\",\n \"end_time\": \"14:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 3,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 16,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-14\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 4,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 17,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-21\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 4,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 18,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-28\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 4,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 19,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-04\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 4,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 20,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-11\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 4,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 21,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-15\",\n \"start_time\": \"08:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 5,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 22,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-22\",\n \"start_time\": \"08:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 5,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 23,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-29\",\n \"start_time\": \"08:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 5,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 24,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-05\",\n \"start_time\": \"08:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 5,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 25,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-12\",\n \"start_time\": \"08:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 5,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 31,\n \"category\": {\n \"title\": \"SingleOpeningHour1\",\n \"color\": \"lightblue\"\n },\n \"date\": \"2024-03-11\",\n \"start_time\": \"08:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 6,\n \"type\": \"none\"\n }\n },\n {\n \"id\": 32,\n \"category\": {\n \"title\": \"SingleOpeningHour2\",\n \"color\": \"pink\"\n },\n \"date\": \"2024-03-19\",\n \"start_time\": \"08:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 7,\n \"type\": \"none\"\n }\n },\n {\n \"id\": 33,\n \"category\": {\n \"title\": \"SingleOpeningHour3\",\n \"color\": \"limegreen\"\n },\n \"date\": \"2024-03-30\",\n \"start_time\": \"08:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 8,\n \"type\": \"none\"\n }\n },\n {\n \"id\": 34,\n \"category\": {\n \"title\": \"SingleOpeningHour4\",\n \"color\": \"gray\"\n },\n \"date\": \"2024-04-04\",\n \"start_time\": \"08:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 9,\n \"type\": \"none\"\n }\n },\n {\n \"id\": 35,\n \"category\": {\n \"title\": \"SingleOpeningHour5\",\n \"color\": \"darkblue\"\n },\n \"date\": \"2024-04-14\",\n \"start_time\": \"08:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 10,\n \"type\": \"none\"\n }\n }\n]", - "headers": {} + "body": "[\n {\n \"id\": 1,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-11\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 1,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 2,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-18\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 1,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 3,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-25\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 1,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 4,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-01\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 1,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 5,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-08\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 1,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 6,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-12\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 2,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 7,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-19\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 2,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 8,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-26\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 2,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 9,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-02\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 2,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 10,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-09\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 2,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 26,\n \"category\": {\n \"title\": \"Telefon\",\n \"color\": \"green\"\n },\n \"date\": \"2024-03-12\",\n \"start_time\": \"10:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 6,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 27,\n \"category\": {\n \"title\": \"Telefon\",\n \"color\": \"green\"\n },\n \"date\": \"2024-03-19\",\n \"start_time\": \"10:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 6,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 28,\n \"category\": {\n \"title\": \"Telefon\",\n \"color\": \"green\"\n },\n \"date\": \"2024-03-26\",\n \"start_time\": \"10:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 6,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 29,\n \"category\": {\n \"title\": \"Telefon\",\n \"color\": \"green\"\n },\n \"date\": \"2024-04-02\",\n \"start_time\": \"10:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 6,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 30,\n \"category\": {\n \"title\": \"Telefon\",\n \"color\": \"green\"\n },\n \"date\": \"2024-04-09\",\n \"start_time\": \"10:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 6,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 11,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-13\",\n \"start_time\": \"08:00\",\n \"end_time\": \"14:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 3,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 12,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-20\",\n \"start_time\": \"08:00\",\n \"end_time\": \"14:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 3,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 13,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-27\",\n \"start_time\": \"08:00\",\n \"end_time\": \"14:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 3,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 14,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-03\",\n \"start_time\": \"08:00\",\n \"end_time\": \"14:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 3,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 15,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-10\",\n \"start_time\": \"08:00\",\n \"end_time\": \"14:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 3,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 16,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-14\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 4,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 17,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-21\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 4,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 18,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-28\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 4,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 19,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-04\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 4,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 20,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-11\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 4,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 21,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-15\",\n \"start_time\": \"08:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 5,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 22,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-22\",\n \"start_time\": \"08:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 5,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 23,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-29\",\n \"start_time\": \"08:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 5,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 24,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-05\",\n \"start_time\": \"08:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 5,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 25,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-12\",\n \"start_time\": \"08:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 5,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 31,\n \"category\": {\n \"title\": \"Borgerservice\",\n \"color\": \"lightblue\"\n },\n \"date\": \"2024-03-11\",\n \"start_time\": \"10:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 6,\n \"type\": \"none\"\n }\n },\n {\n \"id\": 32,\n \"category\": {\n \"title\": \"Borgerservice\",\n \"color\": \"lightblue\"\n },\n \"date\": \"2024-03-19\",\n \"start_time\": \"12:00\",\n \"end_time\": \"14:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 7,\n \"type\": \"none\"\n }\n },\n {\n \"id\": 33,\n \"category\": {\n \"title\": \"Borgerservice\",\n \"color\": \"lightblue\"\n },\n \"date\": \"2024-03-30\",\n \"start_time\": \"08:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 8,\n \"type\": \"none\"\n }\n },\n {\n \"id\": 34,\n \"category\": {\n \"title\": \"Borgerservice\",\n \"color\": \"lightblue\"\n },\n \"date\": \"2024-04-04\",\n \"start_time\": \"08:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 9,\n \"type\": \"none\"\n }\n },\n {\n \"id\": 35,\n \"category\": {\n \"title\": \"Borgerservice\",\n \"color\": \"lightblue\"\n },\n \"date\": \"2024-04-14\",\n \"start_time\": \"08:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 10,\n \"type\": \"none\"\n }\n }\n]", + "headers": { + "Content-Type": "application/json" + } }, - "uuid": "7dfc9127-ba40-4098-9dfb-ed65799e99f0", + "uuid": "b0c2a2f9-7b4d-4a6d-8324-13051e946c02", "persistent": true, "priority": 5, - "insertionIndex": 4, + "insertionIndex": 5, "postServeActions": [] } diff --git a/.docker/wiremock/cms/mappings/opening-hours-create-instance-f17d80cb-0e88-46f5-910a-07d9b803d2c3.json b/.docker/wiremock/cms/mappings/opening-hours-create-instance-f17d80cb-0e88-46f5-910a-07d9b803d2c3.json new file mode 100644 index 0000000000..24df9ac691 --- /dev/null +++ b/.docker/wiremock/cms/mappings/opening-hours-create-instance-f17d80cb-0e88-46f5-910a-07d9b803d2c3.json @@ -0,0 +1,21 @@ +{ + "id": "f17d80cb-0e88-46f5-910a-07d9b803d2c3", + "name": "Opening hours create instance", + "request": { + "url": "/dpl_opening_hours?_format=json", + "method": "POST" + }, + "response": { + "status": 200, + "body": "[ \n {\n \"id\": {{randomValue length=3 type='NUMERIC'}},\n \"category\": {\n \"title\": \"{{jsonPath request.body '$.category.title'}}\",\n \"color\": \"{{jsonPath request.body '$.category.color'}}\"\n },\n \"date\": \"{{jsonPath request.body '$.date'}}\",\n \"start_time\": \"{{jsonPath request.body '$.start_time'}}\",\n \"end_time\": \"{{jsonPath request.body '$.end_time'}}\",\n \"branch_id\": {{jsonPath request.body '$.branch_id'}},\n \"repetition\": {\n \"id\": {{randomValue length=3 type='NUMERIC'}},\n \"type\": \"{{jsonPath request.body '$.repetition.type'}}\",{{#if (eq (jsonPath request.body '$.repetition.type') 'weekly')}}\"weekly_data\": {{{jsonPath request.body '$.repetition.weekly_data'}}}{{/if}}\n }\n }\n]", + "headers": { + "Content-Type": "application/json" + }, + "transformers": ["response-template"] + }, + "uuid": "f17d80cb-0e88-46f5-910a-07d9b803d2c3", + "persistent": true, + "priority": 5, + "insertionIndex": 1, + "postServeActions": [] +} diff --git a/.docker/wiremock/cms/mappings/opening-hours-current-week-b03cdd7c-c1e0-4e35-b374-f429642e379f.json b/.docker/wiremock/cms/mappings/opening-hours-current-week-b03cdd7c-c1e0-4e35-b374-f429642e379f.json new file mode 100644 index 0000000000..772f2dcfd7 --- /dev/null +++ b/.docker/wiremock/cms/mappings/opening-hours-current-week-b03cdd7c-c1e0-4e35-b374-f429642e379f.json @@ -0,0 +1,20 @@ +{ + "id": "b03cdd7c-c1e0-4e35-b374-f429642e379f", + "name": "Opening hours current week", + "request": { + "url": "/dpl_opening_hours?branch_id=12&from_date=2024-03-25&to_date=2024-03-31", + "method": "GET" + }, + "response": { + "status": 200, + "body": "[\n {\n \"id\": 3,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-25\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 1,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 8,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-26\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 2,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 28,\n \"category\": {\n \"title\": \"Telefon\",\n \"color\": \"green\"\n },\n \"date\": \"2024-03-26\",\n \"start_time\": \"10:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 6,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 13,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-27\",\n \"start_time\": \"08:00\",\n \"end_time\": \"14:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 3,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 18,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-28\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 4,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 23,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-29\",\n \"start_time\": \"08:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 5,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 33,\n \"category\": {\n \"title\": \"Borgerservice\",\n \"color\": \"lightblue\"\n },\n \"date\": \"2024-03-30\",\n \"start_time\": \"08:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 8,\n \"type\": \"none\"\n }\n }\n]", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "b03cdd7c-c1e0-4e35-b374-f429642e379f", + "persistent": true, + "priority": 5, + "insertionIndex": 3, + "postServeActions": [] +} diff --git a/.docker/wiremock/cms/mappings/delete-event-f52a1b96-38d2-479a-aeaf-65367637d365.json b/.docker/wiremock/cms/mappings/opening-hours-delete-instance-b4a3d509-efc1-409b-acfd-4eaad6d6c6e2.json similarity index 59% rename from .docker/wiremock/cms/mappings/delete-event-f52a1b96-38d2-479a-aeaf-65367637d365.json rename to .docker/wiremock/cms/mappings/opening-hours-delete-instance-b4a3d509-efc1-409b-acfd-4eaad6d6c6e2.json index 6a67dab95b..fae0e2ee4f 100644 --- a/.docker/wiremock/cms/mappings/delete-event-f52a1b96-38d2-479a-aeaf-65367637d365.json +++ b/.docker/wiremock/cms/mappings/opening-hours-delete-instance-b4a3d509-efc1-409b-acfd-4eaad6d6c6e2.json @@ -1,6 +1,6 @@ { - "id": "f52a1b96-38d2-479a-aeaf-65367637d365", - "name": "Delete event", + "id": "b4a3d509-efc1-409b-acfd-4eaad6d6c6e2", + "name": "Opening hours delete instance", "request": { "urlPathPattern": "/dpl_opening_hours/[0-9]+", "method": "DELETE" @@ -10,9 +10,9 @@ "body": "", "headers": {} }, - "uuid": "f52a1b96-38d2-479a-aeaf-65367637d365", + "uuid": "b4a3d509-efc1-409b-acfd-4eaad6d6c6e2", "persistent": true, "priority": 5, - "insertionIndex": 1, + "insertionIndex": 5, "postServeActions": [] } diff --git a/.docker/wiremock/cms/mappings/opening-hours-next-week-104eae1e-ae10-4893-aadb-7f19ca988f1a.json b/.docker/wiremock/cms/mappings/opening-hours-next-week-104eae1e-ae10-4893-aadb-7f19ca988f1a.json new file mode 100644 index 0000000000..3396234065 --- /dev/null +++ b/.docker/wiremock/cms/mappings/opening-hours-next-week-104eae1e-ae10-4893-aadb-7f19ca988f1a.json @@ -0,0 +1,20 @@ +{ + "id": "104eae1e-ae10-4893-aadb-7f19ca988f1a", + "name": "Opening hours next week", + "request": { + "url": "/dpl_opening_hours?branch_id=12&from_date=2024-04-01&to_date=2024-04-07", + "method": "GET" + }, + "response": { + "status": 200, + "body": "[\n {\n \"id\": 4,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-01\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 1,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 9,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-02\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 2,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 29,\n \"category\": {\n \"title\": \"Telefon\",\n \"color\": \"green\"\n },\n \"date\": \"2024-04-02\",\n \"start_time\": \"10:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 6,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 14,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-03\",\n \"start_time\": \"08:00\",\n \"end_time\": \"14:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 3,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 19,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-04\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 4,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 24,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-04-05\",\n \"start_time\": \"08:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 5,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 34,\n \"category\": {\n \"title\": \"Borgerservice\",\n \"color\": \"lightblue\"\n },\n \"date\": \"2024-04-04\",\n \"start_time\": \"08:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 9,\n \"type\": \"none\"\n }\n }\n]", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "104eae1e-ae10-4893-aadb-7f19ca988f1a", + "persistent": true, + "priority": 5, + "insertionIndex": 4, + "postServeActions": [] +} diff --git a/.docker/wiremock/cms/mappings/opening-hours-previous-week-6c1c831f-bec5-4c57-a4d1-322196701f1b.json b/.docker/wiremock/cms/mappings/opening-hours-previous-week-6c1c831f-bec5-4c57-a4d1-322196701f1b.json new file mode 100644 index 0000000000..083782e36a --- /dev/null +++ b/.docker/wiremock/cms/mappings/opening-hours-previous-week-6c1c831f-bec5-4c57-a4d1-322196701f1b.json @@ -0,0 +1,20 @@ +{ + "id": "6c1c831f-bec5-4c57-a4d1-322196701f1b", + "name": "Opening hours previous week", + "request": { + "url": "/dpl_opening_hours?branch_id=12&from_date=2024-03-18&to_date=2024-03-24", + "method": "GET" + }, + "response": { + "status": 200, + "body": "[\n {\n \"id\": 2,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-18\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 1,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 7,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-19\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 2,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 27,\n \"category\": {\n \"title\": \"Telefon\",\n \"color\": \"green\"\n },\n \"date\": \"2024-03-19\",\n \"start_time\": \"10:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 6,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 12,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-20\",\n \"start_time\": \"08:00\",\n \"end_time\": \"14:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 3,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 17,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-21\",\n \"start_time\": \"08:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 4,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 22,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#4986e7\"\n },\n \"date\": \"2024-03-22\",\n \"start_time\": \"08:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 5,\n \"type\": \"weekly\",\n \"weekly_data\": {\n \"end_date\": \"2024-04-14\"\n }\n }\n },\n {\n \"id\": 32,\n \"category\": {\n \"title\": \"Borgerservice\",\n \"color\": \"lightblue\"\n },\n \"date\": \"2024-03-19\",\n \"start_time\": \"12:00\",\n \"end_time\": \"14:00\",\n \"branch_id\": 12,\n \"repetition\": {\n \"id\": 7,\n \"type\": \"none\"\n }\n }\n]", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "6c1c831f-bec5-4c57-a4d1-322196701f1b", + "persistent": true, + "priority": 5, + "insertionIndex": 5, + "postServeActions": [] +} diff --git a/.docker/wiremock/cms/mappings/previous-week-9e0567ff-57cf-4991-bd32-686e084568a7.json b/.docker/wiremock/cms/mappings/previous-week-9e0567ff-57cf-4991-bd32-686e084568a7.json deleted file mode 100644 index 1b72e69878..0000000000 --- a/.docker/wiremock/cms/mappings/previous-week-9e0567ff-57cf-4991-bd32-686e084568a7.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "id" : "9e0567ff-57cf-4991-bd32-686e084568a7", - "name" : "Previous week", - "request" : { - "url" : "/dpl_opening_hours?branch_id=1&from_date=2024-03-11&to_date=2024-03-17", - "method" : "GET" - }, - "response" : { - "status" : 200, - "body" : "[{\n \"id\": 21,\n \"category\": {\n \"title\": \"Fars legestue\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-11\",\n \"start_time\": \"08:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 22,\n \"category\": {\n \"title\": \"Selvbetjening\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-11\",\n \"start_time\": \"13:00\",\n \"end_time\": \"17:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 23,\n \"category\": {\n \"title\": \"Med betjening\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-11\",\n \"start_time\": \"18:00\",\n \"end_time\": \"20:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 24,\n \"category\": {\n \"title\": \"Telefontid\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-12\",\n \"start_time\": \"09:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 25,\n \"category\": {\n \"title\": \"Borgerservice\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-12\",\n \"start_time\": \"12:00\",\n \"end_time\": \"14:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 26,\n \"category\": {\n \"title\": \"Børneetagen\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-12\",\n \"start_time\": \"15:00\",\n \"end_time\": \"18:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 27,\n \"category\": {\n \"title\": \"Makerlab\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-13\",\n \"start_time\": \"08:00\",\n \"end_time\": \"11:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 28,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-13\",\n \"start_time\": \"12:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 29,\n \"category\": {\n \"title\": \"Selvbetjening\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-13\",\n \"start_time\": \"17:00\",\n \"end_time\": \"20:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 30,\n \"category\": {\n \"title\": \"Med betjening\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-14\",\n \"start_time\": \"09:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 31,\n \"category\": {\n \"title\": \"Telefontid\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-14\",\n \"start_time\": \"14:00\",\n \"end_time\": \"17:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 32,\n \"category\": {\n \"title\": \"Borgerservice\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-14\",\n \"start_time\": \"18:00\",\n \"end_time\": \"20:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 33,\n \"category\": {\n \"title\": \"Børneetagen\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-15\",\n \"start_time\": \"08:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 34,\n \"category\": {\n \"title\": \"Makerlab\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-15\",\n \"start_time\": \"13:00\",\n \"end_time\": \"16:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 35,\n \"category\": {\n \"title\": \"Åbent\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-15\",\n \"start_time\": \"17:00\",\n \"end_time\": \"19:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 36,\n \"category\": {\n \"title\": \"Selvbetjening\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-16\",\n \"start_time\": \"09:00\",\n \"end_time\": \"12:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 37,\n \"category\": {\n \"title\": \"Med betjening\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-16\",\n \"start_time\": \"12:30\",\n \"end_time\": \"15:30\",\n \"branch_id\": 1\n },\n {\n \"id\": 38,\n \"category\": {\n \"title\": \"Telefontid\",\n \"color\": \"#FF0000\"\n },\n \"date\": \"2024-03-16\",\n \"start_time\": \"16:00\",\n \"end_time\": \"18:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 39,\n \"category\": {\n \"title\": \"Borgerservice\",\n \"color\": \"#008000\"\n },\n \"date\": \"2024-03-17\",\n \"start_time\": \"10:00\",\n \"end_time\": \"13:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 40,\n \"category\": {\n \"title\": \"Børneetagen\",\n \"color\": \"#FFFF00\"\n },\n \"date\": \"2024-03-17\",\n \"start_time\": \"14:00\",\n \"end_time\": \"17:00\",\n \"branch_id\": 1\n },\n {\n \"id\": 41,\n \"category\": {\n \"title\": \"Makerlab\",\n \"color\": \"#0000FF\"\n },\n \"date\": \"2024-03-17\",\n \"start_time\": \"18:00\",\n \"end_time\": \"20:00\",\n \"branch_id\": 1\n }]", - "headers" : { } - }, - "uuid" : "9e0567ff-57cf-4991-bd32-686e084568a7", - "persistent" : true, - "priority" : 5, - "insertionIndex" : 1, - "postServeActions" : [ ] -} \ No newline at end of file diff --git a/.docker/wiremock/cms/opening-hours-data.js b/.docker/wiremock/cms/opening-hours-data.js deleted file mode 100644 index a60eaf56d9..0000000000 --- a/.docker/wiremock/cms/opening-hours-data.js +++ /dev/null @@ -1,687 +0,0 @@ -const serieOpenMonday = [ - { - id: 1, - category: { - title: "Åbent", - color: "#4986e7" - }, - date: "2024-03-11", - start_time: "08:00", - end_time: "16:00", - branch_id: 12, - repetition: { - id: 1, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - }, - { - id: 2, - category: { - title: "Åbent", - color: "#4986e7" - }, - date: "2024-03-18", - start_time: "08:00", - end_time: "16:00", - branch_id: 12, - repetition: { - id: 1, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - }, - { - id: 3, - category: { - title: "Åbent", - color: "#4986e7" - }, - date: "2024-03-25", - start_time: "08:00", - end_time: "16:00", - branch_id: 12, - repetition: { - id: 1, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - }, - { - id: 4, - category: { - title: "Åbent", - color: "#4986e7" - }, - date: "2024-04-01", - start_time: "08:00", - end_time: "16:00", - branch_id: 12, - repetition: { - id: 1, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - }, - { - id: 5, - category: { - title: "Åbent", - color: "#4986e7" - }, - date: "2024-04-08", - start_time: "08:00", - end_time: "16:00", - branch_id: 12, - repetition: { - id: 1, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - } -]; - -const serieOpenTuesday = [ - { - id: 6, - category: { - title: "Åbent", - color: "#4986e7" - }, - date: "2024-03-12", - start_time: "08:00", - end_time: "16:00", - branch_id: 12, - repetition: { - id: 2, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - }, - { - id: 7, - category: { - title: "Åbent", - color: "#4986e7" - }, - date: "2024-03-19", - start_time: "08:00", - end_time: "16:00", - branch_id: 12, - repetition: { - id: 2, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - }, - { - id: 8, - category: { - title: "Åbent", - color: "#4986e7" - }, - date: "2024-03-26", - start_time: "08:00", - end_time: "16:00", - branch_id: 12, - repetition: { - id: 2, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - }, - { - id: 9, - category: { - title: "Åbent", - color: "#4986e7" - }, - date: "2024-04-02", - start_time: "08:00", - end_time: "16:00", - branch_id: 12, - repetition: { - id: 2, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - }, - { - id: 10, - category: { - title: "Åbent", - color: "#4986e7" - }, - date: "2024-04-09", - start_time: "08:00", - end_time: "16:00", - branch_id: 12, - repetition: { - id: 2, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - } -]; - -const serieOpenWednesday = [ - { - id: 11, - category: { - title: "Åbent", - color: "#4986e7" - }, - date: "2024-03-13", - start_time: "08:00", - end_time: "14:00", - branch_id: 12, - repetition: { - id: 3, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - }, - { - id: 12, - category: { - title: "Åbent", - color: "#4986e7" - }, - date: "2024-03-20", - start_time: "08:00", - end_time: "14:00", - branch_id: 12, - repetition: { - id: 3, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - }, - { - id: 13, - category: { - title: "Åbent", - color: "#4986e7" - }, - date: "2024-03-27", - start_time: "08:00", - end_time: "14:00", - branch_id: 12, - repetition: { - id: 3, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - }, - { - id: 14, - category: { - title: "Åbent", - color: "#4986e7" - }, - date: "2024-04-03", - start_time: "08:00", - end_time: "14:00", - branch_id: 12, - repetition: { - id: 3, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - }, - { - id: 15, - category: { - title: "Åbent", - color: "#4986e7" - }, - date: "2024-04-10", - start_time: "08:00", - end_time: "14:00", - branch_id: 12, - repetition: { - id: 3, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - } -]; - -const serieOpenThursday = [ - { - id: 16, - category: { - title: "Åbent", - color: "#4986e7" - }, - date: "2024-03-14", - start_time: "08:00", - end_time: "16:00", - branch_id: 12, - repetition: { - id: 4, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - }, - { - id: 17, - category: { - title: "Åbent", - color: "#4986e7" - }, - date: "2024-03-21", - start_time: "08:00", - end_time: "16:00", - branch_id: 12, - repetition: { - id: 4, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - }, - { - id: 18, - category: { - title: "Åbent", - color: "#4986e7" - }, - date: "2024-03-28", - start_time: "08:00", - end_time: "16:00", - branch_id: 12, - repetition: { - id: 4, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - }, - { - id: 19, - category: { - title: "Åbent", - color: "#4986e7" - }, - date: "2024-04-04", - start_time: "08:00", - end_time: "16:00", - branch_id: 12, - repetition: { - id: 4, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - }, - { - id: 20, - category: { - title: "Åbent", - color: "#4986e7" - }, - date: "2024-04-11", - start_time: "08:00", - end_time: "16:00", - branch_id: 12, - repetition: { - id: 4, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - } -]; - -const serieOpenFriday = [ - { - id: 21, - category: { - title: "Åbent", - color: "#4986e7" - }, - date: "2024-03-15", - start_time: "08:00", - end_time: "12:00", - branch_id: 12, - repetition: { - id: 5, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - }, - { - id: 22, - category: { - title: "Åbent", - color: "#4986e7" - }, - date: "2024-03-22", - start_time: "08:00", - end_time: "12:00", - branch_id: 12, - repetition: { - id: 5, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - }, - { - id: 23, - category: { - title: "Åbent", - color: "#4986e7" - }, - date: "2024-03-29", - start_time: "08:00", - end_time: "12:00", - branch_id: 12, - repetition: { - id: 5, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - }, - { - id: 24, - category: { - title: "Åbent", - color: "#4986e7" - }, - date: "2024-04-05", - start_time: "08:00", - end_time: "12:00", - branch_id: 12, - repetition: { - id: 5, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - }, - { - id: 25, - category: { - title: "Åbent", - color: "#4986e7" - }, - date: "2024-04-12", - start_time: "08:00", - end_time: "12:00", - branch_id: 12, - repetition: { - id: 5, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - } -]; - -const seriePhoneTuesday = [ - { - id: 26, - category: { - title: "Telefon", - color: "green" - }, - date: "2024-03-12", - start_time: "10:00", - end_time: "13:00", - branch_id: 12, - repetition: { - id: 6, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - }, - { - id: 27, - category: { - title: "Telefon", - color: "green" - }, - date: "2024-03-19", - start_time: "10:00", - end_time: "13:00", - branch_id: 12, - repetition: { - id: 6, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - }, - { - id: 28, - category: { - title: "Telefon", - color: "green" - }, - date: "2024-03-26", - start_time: "10:00", - end_time: "13:00", - branch_id: 12, - repetition: { - id: 6, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - }, - { - id: 29, - category: { - title: "Telefon", - color: "green" - }, - date: "2024-04-02", - start_time: "10:00", - end_time: "13:00", - branch_id: 12, - repetition: { - id: 6, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - }, - { - id: 30, - category: { - title: "Telefon", - color: "green" - }, - date: "2024-04-09", - start_time: "10:00", - end_time: "13:00", - branch_id: 12, - repetition: { - id: 6, - type: "weekly", - weekly_data: { - end_date: "2024-04-14" - } - } - } -]; - -const singleOpeningHours = [ - { - id: 31, - category: { - title: "SingleOpeningHour1", - color: "lightblue" - }, - date: "2024-03-11", - start_time: "08:00", - end_time: "11:00", - branch_id: 12, - repetition: { - id: 6, - type: "none" - } - }, - { - id: 32, - category: { - title: "SingleOpeningHour2", - color: "pink" - }, - date: "2024-03-19", - start_time: "08:00", - end_time: "11:00", - branch_id: 12, - repetition: { - id: 7, - type: "none" - } - }, - { - id: 33, - category: { - title: "SingleOpeningHour3", - color: "limegreen" - }, - date: "2024-03-30", - start_time: "08:00", - end_time: "11:00", - branch_id: 12, - repetition: { - id: 8, - type: "none" - } - }, - { - id: 34, - category: { - title: "SingleOpeningHour4", - color: "gray" - }, - date: "2024-04-04", - start_time: "08:00", - end_time: "11:00", - branch_id: 12, - repetition: { - id: 9, - type: "none" - } - }, - { - id: 35, - category: { - title: "SingleOpeningHour5", - color: "darkblue" - }, - date: "2024-04-14", - start_time: "08:00", - end_time: "11:00", - branch_id: 12, - repetition: { - id: 10, - type: "none" - } - } -]; - -export const openingHoursPrevWeek1 = [ - serieOpenMonday[0], - serieOpenTuesday[0], - seriePhoneTuesday[0], - serieOpenWednesday[0], - serieOpenThursday[0], - serieOpenFriday[0], - singleOpeningHours[0] -].flat(); - -export const openingHoursPrevWeek2 = [ - serieOpenMonday[1], - serieOpenTuesday[1], - seriePhoneTuesday[1], - serieOpenWednesday[1], - serieOpenThursday[1], - serieOpenFriday[1], - singleOpeningHours[1] -].flat(); - -export const openingHoursNextWeek1 = [ - serieOpenMonday[3], - serieOpenTuesday[3], - seriePhoneTuesday[3], - serieOpenWednesday[3], - serieOpenThursday[3], - serieOpenFriday[3], - singleOpeningHours[3] -].flat(); - -export const openingHoursNextWeek2 = [ - serieOpenMonday[4], - serieOpenTuesday[4], - seriePhoneTuesday[4], - serieOpenWednesday[4], - serieOpenThursday[4], - serieOpenFriday[4], - singleOpeningHours[4] -].flat(); - -const openingHoursAll = [ - serieOpenMonday, - serieOpenTuesday, - seriePhoneTuesday, - serieOpenWednesday, - serieOpenThursday, - serieOpenFriday, - singleOpeningHours -].flat(); - -export default openingHoursAll; diff --git a/src/apps/opening-hours-editor/OpeningHoursEditor.dev.tsx b/src/apps/opening-hours-editor/OpeningHoursEditor.dev.tsx index 229150bf16..8f31538efa 100644 --- a/src/apps/opening-hours-editor/OpeningHoursEditor.dev.tsx +++ b/src/apps/opening-hours-editor/OpeningHoursEditor.dev.tsx @@ -21,7 +21,7 @@ export default { openingHoursEditorCategoriesConfig: { name: "Opening hours categories", defaultValue: - '[{"title":"\\u00c5bent","color":"#B3DC6C"},{"title":"Telefontid","color":"#FBE983"},{"title":"SingleOpeningHour1","color":"lightblue"},{"title":"SingleOpeningHour2","color":"pink"},{"title":"SingleOpeningHour3","color":"limegreen"},{"title":"SingleOpeningHour4","color":"gray"},{"title":"SingleOpeningHour5","color":"darkblue"}]', + '[{"title":"\\u00c5bent","color":"#B3DC6C"},{"title":"Telefontid","color":"#FBE983"},{"title":"Borgerservice","color":"lightblue"}]', control: { type: "text" } }, openingHoursBranchIdConfig: { diff --git a/src/apps/opening-hours/OpeningHours.dev.tsx b/src/apps/opening-hours/OpeningHours.dev.tsx index 6a56a2f4f9..33a861f3e6 100644 --- a/src/apps/opening-hours/OpeningHours.dev.tsx +++ b/src/apps/opening-hours/OpeningHours.dev.tsx @@ -12,11 +12,11 @@ export default { component: OpeningHours, argTypes: { initialDate: { - defaultValue: new Date("2024-03-21"), + defaultValue: new Date("2024-03-25"), control: { type: "date" } }, branchId: { - defaultValue: 1, + defaultValue: 12, control: { type: "number" } }, showOpeningHoursForWeekText: { From 23e7bf7580f2fa607d463186861cace52366b204 Mon Sep 17 00:00:00 2001 From: Kasper Birch Date: Fri, 26 Apr 2024 10:28:15 +0200 Subject: [PATCH 07/13] Add missing data attributes for Cypress tests --- .../ConfirmAddRepeatedOpeningHour.tsx | 12 ++++++++++-- src/apps/opening-hours-editor/EventForm.tsx | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/apps/opening-hours-editor/ConfirmAddRepeatedOpeningHour.tsx b/src/apps/opening-hours-editor/ConfirmAddRepeatedOpeningHour.tsx index 64fc5bad80..ace984c31b 100644 --- a/src/apps/opening-hours-editor/ConfirmAddRepeatedOpeningHour.tsx +++ b/src/apps/opening-hours-editor/ConfirmAddRepeatedOpeningHour.tsx @@ -25,11 +25,17 @@ const ConfirmAddRepeatedOpeningHour = ({ }: ConfirmAddRepeatedOpeningHourType) => { const t = useText(); return ( -
+

{t("openingHoursConfirmAddRepeatedText")}

- +
@@ -58,6 +64,7 @@ const ConfirmAddRepeatedOpeningHour = ({
{t("openingHoursEventFormCategoryText")}:
-
- - -
- -
- - -
-
{isSeries && (
- + {iconAltText}
)} From 45297fa84ee2a1c2eec021f6224625d4ea3b21ea Mon Sep 17 00:00:00 2001 From: Kasper Birch Date: Thu, 25 Apr 2024 15:50:55 +0200 Subject: [PATCH 12/13] Update `ConfirmAddRepeatedOpeningHour` component to use Date objects and transform the date into the required strings inside. --- .../ConfirmAddRepeatedOpeningHour.tsx | 15 +++++++-------- src/apps/opening-hours-editor/EventForm.tsx | 5 ++--- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/apps/opening-hours-editor/ConfirmAddRepeatedOpeningHour.tsx b/src/apps/opening-hours-editor/ConfirmAddRepeatedOpeningHour.tsx index ace984c31b..089d701a7e 100644 --- a/src/apps/opening-hours-editor/ConfirmAddRepeatedOpeningHour.tsx +++ b/src/apps/opening-hours-editor/ConfirmAddRepeatedOpeningHour.tsx @@ -1,21 +1,20 @@ import React from "react"; import { useText } from "../../core/utils/text"; import { OpeningHoursCategoriesType } from "./types"; +import { getDateString, getWeekDayName } from "./helper"; type ConfirmAddRepeatedOpeningHourType = { - startDateString: string; - weekDayName: string; + startDate: Date; category: OpeningHoursCategoriesType; startTime: string; endTime: string; - repeatedEndDate: string; + repeatedEndDate: Date; confirmSubmit: () => void; closeDialog: () => void; }; const ConfirmAddRepeatedOpeningHour = ({ - startDateString, - weekDayName, + startDate, category, startTime, endTime, @@ -51,15 +50,15 @@ const ConfirmAddRepeatedOpeningHour = ({ {t("openingHoursEventFormStartDateText")}: - {startDateString} + {getDateString(startDate)} {t("openingHoursEventFormEndDateText")}: - {repeatedEndDate} + {getDateString(repeatedEndDate)} {t("openingHoursEventFormEveryWeekdayText")}: - {weekDayName} + {getWeekDayName(startDate)} diff --git a/src/apps/opening-hours-editor/EventForm.tsx b/src/apps/opening-hours-editor/EventForm.tsx index 41f31e63bc..e28ecbaa01 100644 --- a/src/apps/opening-hours-editor/EventForm.tsx +++ b/src/apps/opening-hours-editor/EventForm.tsx @@ -86,12 +86,11 @@ const EventForm: React.FC = ({ if (repeatedEndDate) { openDialogWithContent( onSubmit(category, startTime, endTime, repeatedEndDate) } From 935f1656cecce2b896b313c4104de370244b607c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Garn=C3=A6s?= Date: Tue, 30 Apr 2024 16:14:43 +0200 Subject: [PATCH 13/13] Use release 2024.18.0 of design system --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 02509b5417..aa66511098 100644 --- a/package.json +++ b/package.json @@ -144,7 +144,7 @@ "prop-types": "Since we use former ddb-react components that depend on prop-types we keep this. Should be removed when usage of prop-types is deprecated." }, "dependencies": { - "@danskernesdigitalebibliotek/dpl-design-system": "0.0.0-89ee7ca8efb8b6e59286fb5b6f65e9eaba031e11", + "@danskernesdigitalebibliotek/dpl-design-system": "2024.18.0-d02b9076284ebf6320a0c838eccdc62087aa2ff5", "@fullcalendar/core": "^6.1.11", "@fullcalendar/daygrid": "^6.1.11", "@fullcalendar/interaction": "^6.1.11", diff --git a/yarn.lock b/yarn.lock index 7c61dd6ee8..ba3a628480 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1533,10 +1533,10 @@ debug "^3.1.0" lodash.once "^4.1.1" -"@danskernesdigitalebibliotek/dpl-design-system@0.0.0-89ee7ca8efb8b6e59286fb5b6f65e9eaba031e11": - version "0.0.0-89ee7ca8efb8b6e59286fb5b6f65e9eaba031e11" - resolved "https://npm.pkg.github.com/download/@danskernesdigitalebibliotek/dpl-design-system/0.0.0-89ee7ca8efb8b6e59286fb5b6f65e9eaba031e11/41405f20ce1204da8dce72e61c5ab21a383c9aa1#41405f20ce1204da8dce72e61c5ab21a383c9aa1" - integrity sha512-RkbfccFhSm/0R36iwsBOzXLrox0QaxM+gtYJoykmSqAY2uYmrVrxloF9BpSH+pBT88NBhPnqZf5RDz47z8YoIw== +"@danskernesdigitalebibliotek/dpl-design-system@2024.18.0-d02b9076284ebf6320a0c838eccdc62087aa2ff5": + version "2024.18.0-d02b9076284ebf6320a0c838eccdc62087aa2ff5" + resolved "https://npm.pkg.github.com/download/@danskernesdigitalebibliotek/dpl-design-system/2024.18.0-d02b9076284ebf6320a0c838eccdc62087aa2ff5/f1d5da5b17e3ac3e7763c72b9a7a88d79ba31442#f1d5da5b17e3ac3e7763c72b9a7a88d79ba31442" + integrity sha512-ve+ANGj9pphqRcFDxYanAA+2mv9y91PsvzhlOlvNXjULgwp9wHIz/lvt/Frz5i6zvE47NbX9LmbkQIy/OmzJ7A== "@discoveryjs/json-ext@^0.5.0", "@discoveryjs/json-ext@^0.5.3": version "0.5.7"