From 1809d83cfdcbf052e0dfd3ca90e0a3eec4d52fdc Mon Sep 17 00:00:00 2001 From: Sergey Krylov Date: Mon, 26 Jun 2023 08:17:38 +0300 Subject: [PATCH] add maintenance page --- src/api/routes/breadcrumbs/controller.ts | 10 +++++ src/api/routes/faq/controller.ts | 23 +++++++++++ src/api/routes/text/controller.ts | 50 ++++++++++++++++++++++++ src/constants/index.ts | 5 ++- 4 files changed, 86 insertions(+), 2 deletions(-) diff --git a/src/api/routes/breadcrumbs/controller.ts b/src/api/routes/breadcrumbs/controller.ts index f959145..fb24ae0 100644 --- a/src/api/routes/breadcrumbs/controller.ts +++ b/src/api/routes/breadcrumbs/controller.ts @@ -63,6 +63,12 @@ const themedCombosPageBreadcrumbs: BreadcrumbsType[] = [ { href: PAGE_LINK.THEMED_COMBOS, label: PAGE_LINK_LABEL[PAGE_LINK.THEMED_COMBOS] }, ]; +const maintenancePageBreadcrumbs: BreadcrumbsType[] = [ + { href: PAGE_LINK.HOME, label: PAGE_LINK_LABEL[PAGE_LINK.HOME] }, + { label: PAGE_LINK_LABEL[PAGE_LINK.SERVICES] }, + { href: PAGE_LINK.MAINTENANCE, label: PAGE_LINK_LABEL[PAGE_LINK.MAINTENANCE] }, +]; + const pricePageBreadcrumbs: BreadcrumbsType[] = [ { href: PAGE_LINK.HOME, label: PAGE_LINK_LABEL[PAGE_LINK.HOME] }, { href: PAGE_LINK.PRICE, label: PAGE_LINK_LABEL[PAGE_LINK.PRICE] }, @@ -117,6 +123,10 @@ export const getBreadcrumbs = (req: Request, res: Response) => { return res.status(200).json(themedCombosPageBreadcrumbs); } + case PAGE_LINK.MAINTENANCE: { + return res.status(200).json(maintenancePageBreadcrumbs); + } + default: return res.status(404); } diff --git a/src/api/routes/faq/controller.ts b/src/api/routes/faq/controller.ts index c1d47d3..a475a7c 100644 --- a/src/api/routes/faq/controller.ts +++ b/src/api/routes/faq/controller.ts @@ -127,6 +127,25 @@ const themedCombosQuestions: QuestionType[] = [ }, ]; +const maintenanceQuestions: QuestionType[] = [ + { + answer: 'Ответ на вопрос как забронировать зал для проведения выездного праздника?', + id: uuid(), + question: 'Как забронировать зал для проведения Дня рождения?', + }, + { + answer: 'Мы не требуем предоплату. Для бронирования мероприятия достаточно Вашего номера телефона. ' + + 'Мероприятие оплачивается на месте перед его началом.', + id: uuid(), + question: 'Как производится оплата мероприятия?', + }, + { + answer: 'Ответ на вопрос какое максимальное количество детей допустимо на празднике?', + id: uuid(), + question: 'Какое максимальное количество детей допустимо на празднике?', + }, +]; + type QuestionsType = { categories: QuestionCategoryType[]; group: string; @@ -162,6 +181,10 @@ export const getFaq = (req: Request, res: Response) => { return res.status(200).json(themedCombosQuestions); } + case PAGE_LINK.MAINTENANCE: { + return res.status(200).json(maintenanceQuestions); + } + case PAGE_LINK.QUESTS: { switch (id) { case 'eger': diff --git a/src/api/routes/text/controller.ts b/src/api/routes/text/controller.ts index 1320aec..d3942ea 100644 --- a/src/api/routes/text/controller.ts +++ b/src/api/routes/text/controller.ts @@ -61,6 +61,43 @@ const priceTitleText = { title: 'Ценовая политика ', }; +const maintenanceTitleText = { + description: 'Едете с детьми на свадьбу, корпоратив или сами организуете\n' + + 'выездное мероприятие? Мы знаем, как помочь Вам отдохнуть\n' + + 'и организовать детский досуг!', + title: 'СОПРОВОЖДЕНИЕ ДЕТЕЙ на мероприятиях', +}; + +const maintenanceSteps = [ + { + description: 'Заполните заявку на странице,\\n' + + 'указав контактную информацию,\\n' + + 'формат мероприятия и адрес', + id: uuid(), + }, + { + description: + 'Обсуждаем с Вами дату, программу\\n' + + 'и развлечения, учитываем интересы\\n' + + 'детей и пожелания родителей', + id: uuid(), + }, + { + description: + 'Составляем план мероприятия\\n' + + '(сборы, игры, тематика, тайминг)\\n' + + 'и согласовываем стоимость', + id: uuid(), + }, + { + description: + 'Теперь можно не переживать за детей\\n' + + 'и спокойно отдыхать: организацию\\n' + + 'досуга маленьких гостей мы взяли на себя!', + id: uuid(), + }, +]; + const themedCombosTitleText = { age: { text: '2-15', @@ -284,6 +321,19 @@ export const getTitle = (req: Request, res: Response) => { } } + case PAGE_LINK.MAINTENANCE: { + switch (section) { + case TextSection.TITLE: + return res.status(200).json(maintenanceTitleText); + + case TextSection.STEPS: + return res.status(200).json(maintenanceSteps); + + default: + return res.status(404); + } + } + default: return res.status(404); } diff --git a/src/constants/index.ts b/src/constants/index.ts index a38f911..1a2b172 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -5,7 +5,6 @@ export const enum PAGE_LINK { BIRTHDAY = '/holidays/birthday', CONTACTS = '/contacts', COOPERATION = '/cooperation', - ESCORT = '/escort', FAQ = '/faq', FEEDBACK = '/feedback', FRANCHISE = '/franchise', @@ -13,6 +12,7 @@ export const enum PAGE_LINK { GRADUATION = '/holidays/graduation', HOLIDAYS = '/holidays', HOME = '/', + MAINTENANCE = '/services/maintenance', MASTER_CLASSES = '/services/master-classes', NEW_YEAR = '/new_year', OUTDOORS = '/holidays/outdoors', @@ -36,7 +36,7 @@ export const PAGE_LINK_LABEL: PAGE_LINK_LABEL_TYPE = { [PAGE_LINK.HOME]: 'Главная', [PAGE_LINK.CONTACTS]: 'Контакты', [PAGE_LINK.COOPERATION]: 'Сотрудничество', - [PAGE_LINK.ESCORT]: 'Сопровождение', + [PAGE_LINK.MAINTENANCE]: 'Сопровождение детей', [PAGE_LINK.FAQ]: 'Частые вопросы', [PAGE_LINK.FEEDBACK]: 'Отзывы', [PAGE_LINK.FRANCHISE]: 'Франшиза', @@ -59,6 +59,7 @@ export enum TextSection { DESCRIPTION = 'description', INFO = 'info', PARK = 'parkInfo', + STEPS = 'steps', TITLE = 'title', }