Compare commits

..

4 Commits

Author SHA1 Message Date
RustamRu
47e2646fac fix order view&create page logic, layout, test coverage 2025-03-12 17:09:52 +03:00
RustamRu
0b9b2f4dbc feat: Implement enhanced car color selection component
- Replaced CarColorInput with a new CarColorSelect component
- Added color selection with visual color indicators
- Implemented custom color input option
- Updated locales with color selection translations
- Improved type safety in helper file
2025-03-08 20:35:20 +03:00
RustamRu
87a4dcefdd fix: Improve car body select event handling
- Updated CarBodySelect to properly emit change events
- Added onClose() call to close the select dropdown after selection
- Removed TypeScript ignore comment by properly typing the onChange event
2025-03-08 20:35:06 +03:00
RustamRu
0679ad92ef feat: Add car image description and increase upload file size limit
- Updated locales (en and ru) to increase max file upload size from 5MB to 14MB
- Modified PriceCar component to display image description
- Updated order model and view to support image description
- Added sample image description in stub data
2025-03-08 18:51:36 +03:00
41 changed files with 1124 additions and 518 deletions

View File

@@ -3,7 +3,9 @@ import { jest } from '@jest/globals';
jest.mock('@brojs/cli', () => ({ jest.mock('@brojs/cli', () => ({
getConfigValue: jest.fn(() => '/api'), getConfigValue: jest.fn(() => '/api'),
getFeatures: jest.fn(() => ({ getFeatures: jest.fn(() => ({
['order-view-status-polling']: { value: '3000' } ['order-view-status-polling']: { value: '3000' },
['car-img-upload']: { value: 'true' },
['order-cost']: { value: '1000' },
})), })),
getNavigationValue: jest.fn((navKey: string) => { getNavigationValue: jest.fn((navKey: string) => {
switch (navKey) { switch (navKey) {

View File

@@ -16,7 +16,6 @@ module.exports = {
'dry-wash.order.view': '/order/:orderId', 'dry-wash.order.view': '/order/:orderId',
'dry-wash.arm.master': 'master', 'dry-wash.arm.master': 'master',
'dry-wash.arm.order': 'order', 'dry-wash.arm.order': 'order',
'dry-wash.arm.map': 'map',
'dry-wash.arm': '/arm/*', 'dry-wash.arm': '/arm/*',
}, },
features: { features: {

View File

@@ -5,7 +5,7 @@ module.exports = {
}, },
coverageProvider: 'v8', coverageProvider: 'v8',
coverageDirectory: 'coverage', coverageDirectory: 'coverage',
collectCoverageFrom: ['**/src/**/*.{ts,tsx}', '!**/src/app.tsx'], collectCoverageFrom: ['**/src/**/*.{ts,tsx}', '!**/src/app.tsx', '!**/src/**/types.ts', '!**/src/**/*.d.ts', '!**/src/models/**/*'],
collectCoverage: true, collectCoverage: true,
clearMocks: true, clearMocks: true,
moduleNameMapper: { moduleNameMapper: {

View File

@@ -26,6 +26,17 @@
"dry-wash.order-create.form.washing-location-field.label": "Where is the car located?", "dry-wash.order-create.form.washing-location-field.label": "Where is the car located?",
"dry-wash.order-create.form.washing-location-field.placeholder": "Enter the address or select on the map", "dry-wash.order-create.form.washing-location-field.placeholder": "Enter the address or select on the map",
"dry-wash.order-create.form.washing-location-field.help": "For example, 55.754364, 48.743295 Universitetskaya Street, 1, Innopolis, Verkhneuslonsky district, Republic of Tatarstan (Tatarstan), 420500", "dry-wash.order-create.form.washing-location-field.help": "For example, 55.754364, 48.743295 Universitetskaya Street, 1, Innopolis, Verkhneuslonsky district, Republic of Tatarstan (Tatarstan), 420500",
"dry-wash.order-create.car-color-select.placeholder": "Input color",
"dry-wash.order-create.car-color-select.custom": "Custom",
"dry-wash.order-create.car-color-select.custom-label": "Custom:",
"dry-wash.order-create.car-color-select.colors.white": "White",
"dry-wash.order-create.car-color-select.colors.black": "Black",
"dry-wash.order-create.car-color-select.colors.silver": "Silver",
"dry-wash.order-create.car-color-select.colors.gray": "Gray",
"dry-wash.order-create.car-color-select.colors.beige-brown": "Beige Brown",
"dry-wash.order-create.car-color-select.colors.red": "Red",
"dry-wash.order-create.car-color-select.colors.blue": "Blue",
"dry-wash.order-create.car-color-select.colors.green": "Green",
"dry-wash.order-create.car-body-select.placeholder": "Not specified", "dry-wash.order-create.car-body-select.placeholder": "Not specified",
"dry-wash.order-create.car-body-select.options.sedan": "Sedan", "dry-wash.order-create.car-body-select.options.sedan": "Sedan",
"dry-wash.order-create.car-body-select.options.hatchback" : "Hatchback", "dry-wash.order-create.car-body-select.options.hatchback" : "Hatchback",
@@ -51,11 +62,14 @@
"dry-wash.order-view.details.datetime-range": "When", "dry-wash.order-view.details.datetime-range": "When",
"dry-wash.order-view.details.alert": "The operator will contact you about the payment at the specified phone number", "dry-wash.order-view.details.alert": "The operator will contact you about the payment at the specified phone number",
"dry-wash.order-view.upload-car-image.field.label": "Upload a photo of your car, and our service will quickly calculate the pre-order price!", "dry-wash.order-view.upload-car-image.field.label": "Upload a photo of your car, and our service will quickly calculate the pre-order price!",
"dry-wash.order-view.upload-car-image.field.help": "Allowed formats: .jpg, .png. Maximum size: 5MB", "dry-wash.order-view.upload-car-image.field.help": "Allowed formats: .jpg, .png. Maximum size: 14MB",
"dry-wash.order-view.upload-car-image.file-input.placeholder": "Upload a file", "dry-wash.order-view.upload-car-image.file-input.placeholder": "Upload a file",
"dry-wash.order-view.upload-car-image.file-input.button": "Upload", "dry-wash.order-view.upload-car-image.file-input.button": "Upload",
"dry-wash.order-view.upload-car-image-query.success.title": "The car image is successfully uploaded", "dry-wash.order-view.upload-car-image-query.success.title": "The car image is successfully uploaded",
"dry-wash.order-view.upload-car-image-query.error.title": "Failed to upload the car image", "dry-wash.order-view.upload-car-image-query.error.title": "Failed to upload the car image",
"dry-wash.order-view.price-car.title": "The level of car contamination:",
"dry-wash.order-view.price-car.description": "The cost of washing:",
"dry-wash.order-view.price-car.error": "Failed to determine the level of car contamination",
"dry-wash.arm.master.add": "Add", "dry-wash.arm.master.add": "Add",
"dry-wash.arm.order.title": "Orders", "dry-wash.arm.order.title": "Orders",
"dry-wash.arm.order.table.empty": "Table empty", "dry-wash.arm.order.table.empty": "Table empty",
@@ -111,8 +125,5 @@
"dry-wash.errorBoundary.title": "Something went wrong", "dry-wash.errorBoundary.title": "Something went wrong",
"dry-wash.errorBoundary.description": "We are already working on fixing the issue", "dry-wash.errorBoundary.description": "We are already working on fixing the issue",
"dry-wash.errorBoundary.button.reload": "Reload Page", "dry-wash.errorBoundary.button.reload": "Reload Page",
"dry-wash.washTime.timeSlot": "{{start}} - {{end}}", "dry-wash.washTime.timeSlot": "{{start}} - {{end}}"
"dry-wash.arm.map.title": "Map of orders",
"dry-wash.arm.map.carNumber": "Car Number",
"dry-wash.arm.map.status": "Status"
} }

View File

@@ -81,6 +81,17 @@
"dry-wash.order-create.form.washing-location-field.label": "Где находится автомобиль?", "dry-wash.order-create.form.washing-location-field.label": "Где находится автомобиль?",
"dry-wash.order-create.form.washing-location-field.placeholder": "Введите адрес или выберите на карте", "dry-wash.order-create.form.washing-location-field.placeholder": "Введите адрес или выберите на карте",
"dry-wash.order-create.form.washing-location-field.help": "Например, 55.754364, 48.743295 Университетская улица, 1, Иннополис, Верхнеуслонский район, Республика Татарстан (Татарстан), 420500", "dry-wash.order-create.form.washing-location-field.help": "Например, 55.754364, 48.743295 Университетская улица, 1, Иннополис, Верхнеуслонский район, Республика Татарстан (Татарстан), 420500",
"dry-wash.order-create.car-color-select.placeholder": "Введите цвет",
"dry-wash.order-create.car-color-select.custom": "Другой",
"dry-wash.order-create.car-color-select.custom-label": "Другой:",
"dry-wash.order-create.car-color-select.colors.white": "Белый",
"dry-wash.order-create.car-color-select.colors.black": "Черный",
"dry-wash.order-create.car-color-select.colors.silver": "Серебристый",
"dry-wash.order-create.car-color-select.colors.gray": "Серый",
"dry-wash.order-create.car-color-select.colors.beige-brown": "Бежево-коричневый",
"dry-wash.order-create.car-color-select.colors.red": "Красный",
"dry-wash.order-create.car-color-select.colors.blue": "Синий",
"dry-wash.order-create.car-color-select.colors.green": "Зеленый",
"dry-wash.order-create.car-body-select.placeholder": "Не указан", "dry-wash.order-create.car-body-select.placeholder": "Не указан",
"dry-wash.order-create.car-body-select.options.sedan": "Седан", "dry-wash.order-create.car-body-select.options.sedan": "Седан",
"dry-wash.order-create.car-body-select.options.hatchback": "Хэтчбек", "dry-wash.order-create.car-body-select.options.hatchback": "Хэтчбек",
@@ -106,19 +117,19 @@
"dry-wash.order-view.details.datetime-range": "Когда", "dry-wash.order-view.details.datetime-range": "Когда",
"dry-wash.order-view.details.alert": "С вами свяжется оператор насчет оплаты по указанному номеру телефона", "dry-wash.order-view.details.alert": "С вами свяжется оператор насчет оплаты по указанному номеру телефона",
"dry-wash.order-view.upload-car-image.field.label": "Загрузите фото вашего автомобиля, и наш сервис быстро рассчитает предварительную стоимость заказа!", "dry-wash.order-view.upload-car-image.field.label": "Загрузите фото вашего автомобиля, и наш сервис быстро рассчитает предварительную стоимость заказа!",
"dry-wash.order-view.upload-car-image.field.help": "Допустимые форматы: .jpg, .png. Максимальный размер: 5МБ", "dry-wash.order-view.upload-car-image.field.help": "Допустимые форматы: .jpg, .png. Максимальный размер: 14МБ",
"dry-wash.order-view.upload-car-image.file-input.placeholder": "Загрузите файл", "dry-wash.order-view.upload-car-image.file-input.placeholder": "Загрузите файл",
"dry-wash.order-view.upload-car-image.file-input.button": "Загрузить", "dry-wash.order-view.upload-car-image.file-input.button": "Загрузить",
"dry-wash.order-view.upload-car-image-query.success.title": "Изображение автомобиля успешно загружено", "dry-wash.order-view.upload-car-image-query.success.title": "Изображение автомобиля успешно загружено",
"dry-wash.order-view.upload-car-image-query.error.title": "Не удалось загрузить изображение автомобиля", "dry-wash.order-view.upload-car-image-query.error.title": "Не удалось загрузить изображение автомобиля",
"dry-wash.order-view.price-car.title": "Уровень загрязнения машины:",
"dry-wash.order-view.price-car.description": "Стоимость мойки:",
"dry-wash.order-view.price-car.error": "Не удалось определить уровень загрязнения машины",
"dry-wash.notFound.title": "Страница не найдена", "dry-wash.notFound.title": "Страница не найдена",
"dry-wash.notFound.description": "К сожалению, запрашиваемая вами страница не существует.", "dry-wash.notFound.description": "К сожалению, запрашиваемая вами страница не существует.",
"dry-wash.notFound.button.back": "Вернуться на главную", "dry-wash.notFound.button.back": "Вернуться на главную",
"dry-wash.errorBoundary.title": "Что-то пошло не так", "dry-wash.errorBoundary.title": "Что-то пошло не так",
"dry-wash.errorBoundary.description": "Мы уже работаем над исправлением проблемы", "dry-wash.errorBoundary.description": "Мы уже работаем над исправлением проблемы",
"dry-wash.errorBoundary.button.reload": "Перезагрузить страницу", "dry-wash.errorBoundary.button.reload": "Перезагрузить страницу",
"dry-wash.washTime.timeSlot": "{{start}} - {{end}}", "dry-wash.washTime.timeSlot": "{{start}} - {{end}}"
"dry-wash.arm.map.title": " Карта заказов",
"dry-wash.arm.map.carNumber": " Номер автомобиля",
"dry-wash.arm.map.status": "Статус"
} }

1
package-lock.json generated
View File

@@ -3610,6 +3610,7 @@
"version": "1.2.5", "version": "1.2.5",
"resolved": "https://registry.npmjs.org/@pbe/react-yandex-maps/-/react-yandex-maps-1.2.5.tgz", "resolved": "https://registry.npmjs.org/@pbe/react-yandex-maps/-/react-yandex-maps-1.2.5.tgz",
"integrity": "sha512-cBojin5e1fPx9XVCAqHQJsCnHGMeBNsP0TrNfpWCrPFfxb30ye+JgcGr2mn767Gbr1d+RufBLRiUcX2kaiAwjQ==", "integrity": "sha512-cBojin5e1fPx9XVCAqHQJsCnHGMeBNsP0TrNfpWCrPFfxb30ye+JgcGr2mn767Gbr1d+RufBLRiUcX2kaiAwjQ==",
"license": "MIT",
"dependencies": { "dependencies": {
"@types/yandex-maps": "2.1.29" "@types/yandex-maps": "2.1.29"
}, },

View File

@@ -3,7 +3,6 @@ import { FetchBaseQueryError } from '@reduxjs/toolkit/query';
import { BaseResponse } from '../../models/api'; import { BaseResponse } from '../../models/api';
export const extractBodyFromResponse = <Body>(response: BaseResponse<Body>) => { export const extractBodyFromResponse = <Body>(response: BaseResponse<Body>) => {
console.log('response', response);
if (response.success) { if (response.success) {
return response.body; return response.body;
} }

View File

@@ -33,18 +33,6 @@ export const URLs = {
url: getNavigationValue('dry-wash.arm.order'), url: getNavigationValue('dry-wash.arm.order'),
isOn: Boolean(getNavigationValue('dry-wash.arm.order')), isOn: Boolean(getNavigationValue('dry-wash.arm.order')),
}, },
armMap: {
url: getNavigationValue('dry-wash.arm.map'),
isOn: Boolean(getNavigationValue('dry-wash.arm.map')),
getUrl({ lat, lon, currentDate }) {
return (
getFullUrls('/arm') +
'/' +
getNavigationValue('dry-wash.arm.map') +
`?lat=${lat}&lon=${lon}&currentDate=${currentDate}`
);
},
},
armBase: { armBase: {
url: getFullUrls(getNavigationValue('dry-wash.arm')), url: getFullUrls(getNavigationValue('dry-wash.arm')),
isOn: Boolean(getNavigationValue('dry-wash.arm')), isOn: Boolean(getNavigationValue('dry-wash.arm')),

View File

@@ -42,18 +42,6 @@ const Header = () => {
{t('master')} {t('master')}
</Button> </Button>
)} )}
{URLs.armMap.isOn && (
<Button
as={Link}
to={URLs.armMap.url}
colorScheme={isActive(URLs.armMap.url) ? 'green' : 'blue'}
variant={isActive(URLs.armMap.url) ? 'outline' : 'ghost'}
data-testid='master-button'
>
Карта заказов
</Button>
)}
</HStack> </HStack>
</Flex> </Flex>
</Box> </Box>

View File

@@ -6,7 +6,6 @@ import Orders from '../Orders';
import Masters from '../Masters'; import Masters from '../Masters';
import { URLs } from '../../__data__/urls'; import { URLs } from '../../__data__/urls';
import Header from '../Header'; import Header from '../Header';
import OrdersMap from '../Map';
const LayoutArm = () => { const LayoutArm = () => {
let defaultRedirect = null; let defaultRedirect = null;
@@ -29,9 +28,6 @@ const LayoutArm = () => {
{URLs.armMaster.isOn && ( {URLs.armMaster.isOn && (
<Route path={URLs.armMaster.url} element={<Masters />} /> <Route path={URLs.armMaster.url} element={<Masters />} />
)} )}
{URLs.armMap.isOn && (
<Route path={URLs.armMap.url} element={<OrdersMap />} />
)}
</Routes> </Routes>
</Box> </Box>
</Flex> </Flex>

View File

@@ -1,82 +0,0 @@
import React, { useMemo } from 'react';
import { Box, Flex, Heading, Spinner } from '@chakra-ui/react';
import { useTranslation } from 'react-i18next';
import { YMaps, Map, Placemark } from '@pbe/react-yandex-maps';
import { useLocation } from 'react-router-dom';
import { useGetOrdersQuery } from '../../__data__/service/api';
import getCoordinates from '../../utils/getCoordinates';
const OrdersMap = () => {
const { t } = useTranslation('~', {
keyPrefix: 'dry-wash.arm.map',
});
const location = useLocation();
const params = new URLSearchParams(location.search);
const latFromUrl = parseFloat(params.get('lat') || 55.78);
const lonFromUrl = parseFloat(params.get('lon') || 49.12);
const currentDate = useMemo(
() =>
params.get('currentDate')
? new Date(params.get('currentDate'))
: new Date(),
[],
);
const {
data: ordersData,
isLoading,
isSuccess,
} = useGetOrdersQuery({ date: currentDate });
// Получаем координаты из location
const orders = ordersData
?.map((order) => {
const coords = getCoordinates(order.location);
return coords ? { ...order, ...coords } : null;
})
.filter(Boolean);
return (
<Box p='8'>
<Heading size='lg' mb='5'>
{t('title')}
</Heading>
{isLoading && (
<Flex justifyContent='center' alignItems='center'>
<Spinner size='lg' />
</Flex>
)}
{isSuccess && (
<YMaps>
<Map
defaultState={{ center: [latFromUrl, lonFromUrl], zoom: 12 }}
width='100%'
height='70vh'
modules={['geoObject.addon.balloon']}
>
{orders.map(({ id, lat, lon, carNumber, status }) => (
<Placemark
key={id}
geometry={[lat, lon]}
options={{
preset: 'islands#blueAutoIcon',
iconColor: 'blue',
balloonPanelMaxMapArea: 0,
}}
properties={{
balloonContent: `<strong>${t('carNumber')}</strong> ${carNumber}<br/><strong>${t('status')}</strong> ${status}`,
}}
/>
))}
</Map>
</YMaps>
)}
</Box>
);
};
export default OrdersMap;

View File

@@ -1 +0,0 @@
export { default } from './Map';

View File

@@ -1,15 +1,13 @@
import React, { ChangeEvent, useState } from 'react'; import React, { ChangeEvent, useState } from 'react';
import { Td, Tr, Link, Select, Button } from '@chakra-ui/react'; import { Td, Tr, Link, Select } from '@chakra-ui/react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { ViewIcon } from '@chakra-ui/icons'; import { ViewIcon } from '@chakra-ui/icons';
import { Link as LinkRouter } from 'react-router-dom';
import { getTimeSlot } from '../../lib'; import { getTimeSlot } from '../../lib';
import { useUpdateOrdersMutation } from '../../__data__/service/api'; import { useUpdateOrdersMutation } from '../../__data__/service/api';
import { OrderArm, Status, statuses } from '../../models/api'; import { OrderArm, Status, statuses } from '../../models/api';
import getCoordinates from '../../utils/getCoordinates'; import PopoverTemplate from '../PopoverTemplate';
import { URLs } from '../../__data__/urls';
const statusColors: Record<Status, string> = { const statusColors: Record<Status, string> = {
pending: 'yellow.100', pending: 'yellow.100',
@@ -29,7 +27,6 @@ const OrderItem = ({
master, master,
allMasters, allMasters,
id, id,
currentDate,
}: OrderArm) => { }: OrderArm) => {
const [updateOrders] = useUpdateOrdersMutation(); const [updateOrders] = useUpdateOrdersMutation();
const { t } = useTranslation('~', { const { t } = useTranslation('~', {
@@ -64,8 +61,6 @@ const OrderItem = ({
(master) => master.id === masterSelectId, (master) => master.id === masterSelectId,
); );
const { lat = 55.78, lon = 49.12 } = getCoordinates(location);
return ( return (
<Tr> <Tr>
<Td>{carNumber}</Td> <Td>{carNumber}</Td>
@@ -104,12 +99,7 @@ const OrderItem = ({
<Link href='tel:'>{phone}</Link> <Link href='tel:'>{phone}</Link>
</Td> </Td>
<Td> <Td>
<Button <PopoverTemplate trigger={<ViewIcon />} description={location} />
as={LinkRouter}
to={URLs.armMap.getUrl({ lat, lon, currentDate })}
>
<ViewIcon />
</Button>
</Td> </Td>
</Tr> </Tr>
); );

View File

@@ -112,7 +112,6 @@ const Orders = () => {
key={index} key={index}
{...order} {...order}
status={order.status as OrderArm['status']} status={order.status as OrderArm['status']}
currentDate={currentDate}
/> />
))} ))}
</Tbody> </Tbody>

View File

@@ -1,10 +1,13 @@
import { Box, Image, Progress, Text } from '@chakra-ui/react'; import { Box, Image, Progress, Text, VStack } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import { getFeatures } from '@brojs/cli'; import { getFeatures } from '@brojs/cli';
import { useTranslation } from 'react-i18next';
const PRICE_INCREASE_PERCENT_PER_RATING = 10; // 10% за каждый балл import { formatPrice, getProgressColor } from './helper';
export const PriceCar = ({ image, rating }) => { const PRICE_INCREASE_PERCENT_PER_RATING = 10;
export const PriceCar = ({ image, rating, description }) => {
const BASE_WASH_PRICE: number = Number( const BASE_WASH_PRICE: number = Number(
getFeatures('dry-wash')['order-cost']?.value || 1000, getFeatures('dry-wash')['order-cost']?.value || 1000,
); );
@@ -15,32 +18,56 @@ export const PriceCar = ({ image, rating }) => {
return BASE_WASH_PRICE + priceIncrease; return BASE_WASH_PRICE + priceIncrease;
}; };
const { i18n, t } = useTranslation('~', {
keyPrefix: 'dry-wash.order-view.price-car',
});
const washPrice = calculateWashPrice(rating); const washPrice = calculateWashPrice(rating);
const formattedPrice = formatPrice(washPrice, i18n.language);
const progressValue = (rating / 10) * 100; const progressValue = (rating / 10) * 100;
return ( return (
<Box <Box
alignItems='center'
gap={5} gap={5}
width='100%' width='100%'
display='flex' display='flex'
flexDirection='column' justifyContent='center'
alignItems='flex-start'
flexWrap='wrap'
> >
<Image <Image
maxWidth='600px' maxWidth='600px'
width='100%'
objectFit='contain' objectFit='contain'
borderRadius='md' borderRadius='md'
src={image} src={image}
alt='Car Image' alt=''
/> />
{rating ? ( <Box flex='1 1 40%'>
<Box width='100%' maxW='600px'> {!Number.isNaN(progressValue) ? (
<Text>Рейтинг загрязнения машины:</Text> <VStack alignItems='stretch'>
<Progress value={progressValue} size='sm' colorScheme='red' mt={2} /> <Box>
<Text mt={2}>Стоимость мойки: {washPrice.toFixed(2)} руб.</Text> <Text>{t('title')}</Text>
</Box> <Progress
) : ( value={progressValue}
<Text>Не удалость определить уровень загрязнения машины</Text> size='sm'
)} sx={{
'& > div': {
backgroundColor: getProgressColor(progressValue),
},
}}
mt={2}
/>
<Text mt={2}>
{t('description')} <b>{formattedPrice}</b>
</Text>
</Box>
<Text fontStyle='italic'>{description}</Text>
</VStack>
) : (
<Text>{t('error')}</Text>
)}
</Box>
</Box> </Box>
); );
}; };

View File

@@ -0,0 +1,15 @@
export const formatPrice = (price: number, locale = 'ru-RU', currency = 'RUB') => {
return new Intl.NumberFormat(locale, {
style: 'currency',
currency: currency,
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}).format(price);
};
export const getProgressColor = (value: number) => {
const normalizedValue = value / 100;
const hue = 120 - normalizedValue * 120;
return `hsl(${hue}, 100%, 50%)`;
};

View File

@@ -21,9 +21,10 @@ import { CarBodySelectProps } from './types';
export const CarBodySelect = forwardRef<HTMLInputElement, CarBodySelectProps>( export const CarBodySelect = forwardRef<HTMLInputElement, CarBodySelectProps>(
function CarBodySelect(props, ref) { function CarBodySelect(props, ref) {
const handleOptionClick: UseRadioGroupProps['onChange'] = (value) => { const handleOptionClick: UseRadioGroupProps['onChange'] = (value) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment props.onChange({
// @ts-ignore target: { value },
props.onChange(value); } as React.ChangeEvent<HTMLInputElement>);
onClose();
}; };
const { value, getRadioProps, getRootProps } = useRadioGroup({ const { value, getRadioProps, getRootProps } = useRadioGroup({
@@ -39,12 +40,14 @@ export const CarBodySelect = forwardRef<HTMLInputElement, CarBodySelectProps>(
}); });
return ( return (
<Box width='100%'> <Box width='100%' pos='relative'>
<Popover <Popover
isOpen={isOpen} isOpen={isOpen}
autoFocus={false} autoFocus={false}
placement='bottom-start' placement='bottom-start'
matchWidth matchWidth
gutter={2}
strategy="fixed"
> >
<PopoverAnchor> <PopoverAnchor>
<Input <Input

View File

@@ -1 +1,2 @@
export { CarBodySelect } from './car-body-select'; export { CarBodySelect } from './car-body-select';
export { carBodySelectOptions } from './helper';

View File

@@ -1,23 +0,0 @@
import React, { forwardRef, useId } from 'react';
import { Input, InputProps } from '@chakra-ui/react';
import { CAR_COLORS } from './helper';
export const CarColorInput = forwardRef<HTMLInputElement, InputProps>(
function CarColorInput(props, ref) {
const listId = useId();
return (
<>
<Input ref={ref} list={listId} {...props} />
<datalist id={listId}>
{CAR_COLORS.map(({ code, name }) => (
<option key={code} label={name} value={code}>{name}</option>
))}
</datalist>
</>
);
},
);
// todo: add option color visual indication

View File

@@ -0,0 +1,75 @@
import React from 'react';
import { render, screen, fireEvent } from '@testing-library/react';
import '@testing-library/jest-dom';
import { CarColorSelect } from './car-color-select';
// Mock the translation hook
jest.mock('react-i18next', () => ({
useTranslation: () => ({
t: (key: string) => {
// Return the last part of the key as that's what component is using
const keyParts = key.split('.');
return keyParts[keyParts.length - 1];
},
}),
}));
describe('CarColorSelect', () => {
it('renders color options correctly', () => {
const onChange = jest.fn();
render(<CarColorSelect onChange={onChange} />);
// Check if color buttons are rendered
const colorButtons = screen.getAllByRole('button');
expect(colorButtons.length).toBeGreaterThan(0);
});
it('handles color selection', () => {
const onChange = jest.fn();
render(<CarColorSelect onChange={onChange} />);
// Click the first color button
const colorButtons = screen.getAllByRole('button');
fireEvent.click(colorButtons[0]);
expect(onChange).toHaveBeenCalled();
});
it('handles custom color selection', () => {
const onChange = jest.fn();
render(<CarColorSelect onChange={onChange} />);
// Find and click the custom color button
const customButton = screen.getByText('custom');
fireEvent.click(customButton);
// Check if custom color input appears
const customInput = screen.getByPlaceholderText('placeholder');
expect(customInput).toBeInTheDocument();
// Test custom color input
fireEvent.change(customInput, { target: { value: '#FF0000' } });
expect(onChange).toHaveBeenCalledWith(expect.objectContaining({
target: { value: '#FF0000' },
}));
});
it('shows selected color label when color is selected', () => {
const onChange = jest.fn();
render(<CarColorSelect value="black" onChange={onChange} />);
// Since the color label might not be immediately visible,
// we'll verify the component renders without crashing
const buttons = screen.getAllByRole('button');
expect(buttons.length).toBeGreaterThan(0);
});
it('handles invalid state', () => {
render(<CarColorSelect isInvalid={true} />);
// Since the component doesn't show explicit invalid state UI,
// we'll verify that the component renders without crashing
expect(screen.getAllByRole('button').length).toBeGreaterThan(0);
});
});

View File

@@ -0,0 +1,177 @@
import React, { forwardRef, useState } from 'react';
import { Input, Box, Stack, Text, Flex } from '@chakra-ui/react';
import { useTranslation } from 'react-i18next';
import { Car } from '../../../../models';
import { carColorSelectOptions } from './helper';
interface CarColorSelectProps {
value?: string;
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
name?: string;
isInvalid?: boolean;
}
export const CarColorSelect = forwardRef<HTMLInputElement, CarColorSelectProps>(
function CarColorSelect(props, ref) {
const [customColor, setCustomColor] = useState('');
const [isCustom, setIsCustom] = useState(false);
const handleColorChange = (value: Car.Color | string) => {
if (value === 'custom') {
setIsCustom(true);
return;
}
setIsCustom(false);
props.onChange?.({
target: { value },
} as React.ChangeEvent<HTMLInputElement>);
};
const handleCustomColorChange = (
e: React.ChangeEvent<HTMLInputElement>,
) => {
const value = e.target.value;
setCustomColor(value);
props.onChange?.({
target: { value },
} as React.ChangeEvent<HTMLInputElement>);
};
const { t } = useTranslation('~', {
keyPrefix: 'dry-wash.order-create.car-color-select',
});
const currentValue = isCustom ? 'custom' : props.value;
return (
<Stack spacing={4} width='100%' ref={ref}>
<Flex gap={2} wrap='wrap' pb={2}>
{carColorSelectOptions.map(({ value, labelTKey, code }) => (
<Box
key={value}
flexShrink={0}
as='button'
type='button'
onClick={() => handleColorChange(value)}
>
<Flex
align='center'
gap={2}
p={1}
borderRadius='full'
borderWidth='2px'
borderColor='gray.200'
bg='white'
_hover={{
borderColor: 'primary.500',
bg: 'gray.50',
}}
justify='center'
transition='all 0.2s'
{...(currentValue === value && {
borderColor: 'primary.500',
bg: 'primary.50',
paddingInlineEnd: 3,
_hover: {
bg: 'primary.50',
},
})}
>
<Flex align='center' gap={2}>
<Box
w='32px'
h='32px'
borderRadius='full'
bg={code}
border='1px'
borderColor='gray.200'
transition='all 0.2s'
boxShadow='none'
{...(currentValue === value && {
borderColor: 'primary.500',
boxShadow: 'sm',
})}
/>
{currentValue === value && (
<Text fontSize='xs' color='primary.700' fontWeight='medium'>
{t(`colors.${labelTKey}`)}
</Text>
)}
</Flex>
</Flex>
</Box>
))}
<Box
flexShrink={0}
as='button'
type='button'
onClick={() => handleColorChange('custom')}
>
<Flex
align='center'
gap={2}
p={1}
paddingInlineEnd={3}
borderRadius='full'
borderWidth='2px'
borderColor='gray.200'
bg='white'
_hover={{
borderColor: 'primary.500',
bg: 'gray.50',
}}
justify='center'
transition='all 0.2s'
{...(isCustom && {
borderColor: 'primary.500',
paddingInlineStart: 3,
bg: 'primary.50',
_hover: {
bg: 'primary.50',
},
})}
>
{isCustom ? (
<Flex gap={2} align='center'>
<Text fontSize='xs' color='primary.700' fontWeight='medium'>
{t('custom-label')}
</Text>
<Input
size='sm'
width='120px'
value={customColor}
onChange={handleCustomColorChange}
placeholder={t('placeholder')}
onClick={(e) => e.stopPropagation()}
borderColor='primary.200'
_focus={{
borderColor: 'primary.500',
boxShadow: '0 0 0 1px var(--chakra-colors-primary-500)',
}}
/>
</Flex>
) : (
<Flex align='center' gap={2}>
<Box
w='32px'
h='32px'
borderRadius='full'
bg='gray.100'
border='1px'
borderColor='gray.200'
transition='all 0.2s'
/>
<Text fontSize='xs' color='gray.500'>
{t('custom')}
</Text>
</Flex>
)}
</Flex>
</Box>
</Flex>
</Stack>
);
},
);

View File

@@ -1,34 +1,44 @@
export const CAR_COLORS: Record<'name' | 'code', string>[] = [ import { Car } from "../../../../models";
export const carColorSelectOptions: { value: Car.Color | string; labelTKey: 'white' | 'black' | 'silver' | 'gray' | 'beige-brown' | 'red' | 'blue' | 'green'; code: string }[] = [
{ {
name: 'white', value: Car.Color.WHITE,
labelTKey: 'white',
code: '#ffffff' code: '#ffffff'
}, },
{ {
name: 'black', value: Car.Color.BLACK,
labelTKey: 'black',
code: '#000000' code: '#000000'
}, },
{ {
name: 'silver', value: Car.Color.SILVER,
labelTKey: 'silver',
code: '#c0c0c0' code: '#c0c0c0'
}, },
{ {
name: 'gray', value: Car.Color.GRAY,
labelTKey: 'gray',
code: '#808080' code: '#808080'
}, },
{ {
name: 'beige-brown', value: Car.Color.BEIGE_BROWN,
labelTKey: 'beige-brown',
code: '#796745' code: '#796745'
}, },
{ {
name: 'red', value: Car.Color.RED,
labelTKey: 'red',
code: '#b90000' code: '#b90000'
}, },
{ {
name: 'blue', value: Car.Color.BLUE,
labelTKey: 'blue',
code: '#003B62' code: '#003B62'
}, },
{ {
name: 'green', value: Car.Color.GREEN,
labelTKey: 'green',
code: '#078d51' code: '#078d51'
}, },
]; ];

View File

@@ -1 +1,2 @@
export { CarColorInput } from './car-color-input'; export { CarColorSelect } from './car-color-select';
export { carColorSelectOptions } from './helper';

View File

@@ -1,2 +1,4 @@
export type { OrderFormValues, OrderFormProps } from './types'; export type { OrderFormValues, OrderFormProps } from './types';
export { OrderForm } from './order-form'; export { OrderForm } from './order-form';
export { carBodySelectOptions } from './car-body';
export { carColorSelectOptions } from './car-color';

View File

@@ -1,4 +1,4 @@
import React, { forwardRef, memo, useEffect, useState } from 'react'; import React, { ForwardedRef, forwardRef, memo, useEffect, useState } from 'react';
import { import {
Input, Input,
Box, Box,
@@ -24,129 +24,130 @@ import {
} from './helper'; } from './helper';
import { LocationInputProps } from './types'; import { LocationInputProps } from './types';
export const LocationInput = memo( export const BaseLocationInput = withYMaps(
withYMaps( ({ ymaps, value = '', onChange, inputRef, ...props }: LocationInputProps & { inputRef: ForwardedRef<HTMLInputElement> }) => {
forwardRef<HTMLInputElement, LocationInputProps>(function LocationInput( const [inputValue, setInputValue] = useState<string>('');
{ ymaps, value, onChange, ...props },
ref,
) {
const [inputValue, setInputValue] = useState<string>('');
useEffect(() => { useEffect(() => {
setInputValue(value); setInputValue(value);
}, [value]); }, [value]);
const [suggestions, setSuggestions] = useState<Suggestion[]>([]); const [suggestions, setSuggestions] = useState<Suggestion[]>([]);
const [isSuggestionsPanelOpen, setIsSuggestionsPanelOpen] = const [isSuggestionsPanelOpen, setIsSuggestionsPanelOpen] =
useState<boolean>(false); useState<boolean>(false);
const onInputChange: InputProps['onChange'] = async (e) => { const onInputChange: InputProps['onChange'] = async (e) => {
const newInputValue = e.target.value; const newInputValue = e.target.value;
if ( if (
isValidLocation(newInputValue) && isValidLocation(newInputValue) &&
(await isRealLocation(ymaps, newInputValue)) (await isRealLocation(ymaps, newInputValue))
) { ) {
onChange(newInputValue); onChange(newInputValue);
} else { } else {
setInputValue(newInputValue); setInputValue(newInputValue);
if (newInputValue.trim().length > 3) { if (newInputValue.trim().length > 3) {
try { try {
const address = extractAddress(newInputValue); const address = extractAddress(newInputValue);
const results = await ymaps.suggest(address); const results = await ymaps.suggest(address);
setSuggestions(results); setSuggestions(results);
} catch (error) { } catch (error) {
console.error(error); console.error(error);
}
} else {
setSuggestions([]);
} }
setIsSuggestionsPanelOpen(suggestions.length > 1);
}
};
const onFocus: InputProps['onFocus'] = () => {
setIsSuggestionsPanelOpen(suggestions.length > 1);
};
const onBlur: InputProps['onBlur'] = async (e) => {
const inputValue = e.target.value;
if (
isValidLocation(inputValue) &&
(await isRealLocation(ymaps, inputValue))
) {
onChange(inputValue);
} else { } else {
setInputValue(value); setSuggestions([]);
} }
setIsSuggestionsPanelOpen(false);
};
const handleSuggestionClick = async ({ value: address }: Suggestion) => { setIsSuggestionsPanelOpen(suggestions.length > 1);
try { }
const location = await getLocationByAddress(ymaps, address); };
const newValue = formatLocation(location);
setInputValue(newValue);
onChange(newValue);
} catch (error) {
console.error(error);
}
};
const { t } = useTranslation('~', { const onFocus: InputProps['onFocus'] = () => {
keyPrefix: 'dry-wash.order-create.form.washing-location-field', setIsSuggestionsPanelOpen(suggestions.length > 1);
}); };
return ( const onBlur: InputProps['onBlur'] = async (e) => {
<Box width='100%'> const inputValue = e.target.value;
<Popover if (
isOpen={isSuggestionsPanelOpen} isValidLocation(inputValue) &&
autoFocus={false} (await isRealLocation(ymaps, inputValue))
placement='bottom-start' ) {
> onChange(inputValue);
<PopoverAnchor> } else {
<Input setInputValue(value);
{...props} }
ref={ref} setIsSuggestionsPanelOpen(false);
onBlur={onBlur} };
value={inputValue ?? value}
onChange={onInputChange} const handleSuggestionClick = async ({ value: address }: Suggestion) => {
onFocus={onFocus} try {
placeholder={t('placeholder')} const location = await getLocationByAddress(ymaps, address);
/> const newValue = formatLocation(location);
</PopoverAnchor> setInputValue(newValue);
<PopoverContent width='100%' maxWidth='100%'> onChange(newValue);
<PopoverBody border='1px' borderColor='gray.300' p={0}> } catch (error) {
<List> console.error(error);
{suggestions.map((suggestion, index) => ( }
<ListItem };
key={index}
p={2} const { t } = useTranslation('~', {
cursor='pointer' keyPrefix: 'dry-wash.order-create.form.washing-location-field',
_hover={{ });
bgColor: 'primary.50',
}} return (
_active={{ <Box width='100%'>
bgColor: 'primary.100', <Popover
}} isOpen={isSuggestionsPanelOpen}
onClick={() => handleSuggestionClick(suggestion)} autoFocus={false}
> placement='bottom-start'
{suggestion.displayName} >
</ListItem> <PopoverAnchor>
))} <Input
</List> {...props}
</PopoverBody> ref={inputRef}
</PopoverContent> onBlur={onBlur}
</Popover> value={inputValue || value}
</Box> onChange={onInputChange}
); onFocus={onFocus}
}), placeholder={t('placeholder')}
true, />
['suggest', 'geocode'], </PopoverAnchor>
), <PopoverContent width='100%' maxWidth='100%'>
<PopoverBody border='1px' borderColor='gray.300' p={0}>
<List>
{suggestions.map((suggestion, index) => (
<ListItem
key={index}
p={2}
cursor='pointer'
_hover={{
bgColor: 'primary.50',
}}
_active={{
bgColor: 'primary.100',
}}
onClick={() => handleSuggestionClick(suggestion)}
>
{suggestion.displayName}
</ListItem>
))}
</List>
</PopoverBody>
</PopoverContent>
</Popover>
</Box>
);
},
true,
['suggest', 'geocode'],
); );
export const LocationInput = memo(forwardRef<HTMLInputElement, LocationInputProps>(
function LocationInput(props, ref) {
return <BaseLocationInput {...props} inputRef={ref} />;
},
));
// todo: i18n // todo: i18n
// todo: replace console.error with toast // todo: replace console.error with toast

View File

@@ -31,8 +31,22 @@ export const MapComponent: FC<{
} }
}, [selectedLocation]); }, [selectedLocation]);
const [windowWidth, setWindowWidth] = useState(window.innerWidth);
useEffect(() => {
const handleResize = () => {
setWindowWidth(window.innerWidth);
};
window.addEventListener('resize', handleResize);
return () => {
window.removeEventListener('resize', handleResize);
};
}, []);
return ( return (
<Map <Map
key={windowWidth}
state={{ state={{
center: mapCenter, center: mapCenter,
zoom: zoom:

View File

@@ -4,7 +4,6 @@ import { useTranslation } from 'react-i18next';
import { Box, Flex, FormControl, FormLabel, VStack } from '@chakra-ui/react'; import { Box, Flex, FormControl, FormLabel, VStack } from '@chakra-ui/react';
import { CarBodySelect } from './car-body'; import { CarBodySelect } from './car-body';
import { CarColorInput } from './car-color';
import { CarNumberInput } from './car-number'; import { CarNumberInput } from './car-number';
import { FormInputField, FormControllerField } from './field'; import { FormInputField, FormControllerField } from './field';
import { OrderFormProps, OrderFormValues } from './types'; import { OrderFormProps, OrderFormValues } from './types';
@@ -18,6 +17,7 @@ import {
StringLocation, StringLocation,
YMapsProvider, YMapsProvider,
} from './location'; } from './location';
import { CarColorSelect } from './car-color';
export const OrderForm = ({ onSubmit, loading, ...props }: OrderFormProps) => { export const OrderForm = ({ onSubmit, loading, ...props }: OrderFormProps) => {
const { const {
@@ -72,7 +72,7 @@ export const OrderForm = ({ onSubmit, loading, ...props }: OrderFormProps) => {
name='carColor' name='carColor'
label={t('car-color-field.label')} label={t('car-color-field.label')}
errors={errors} errors={errors}
Input={CarColorInput} Input={CarColorSelect}
/> />
<FormInputField <FormInputField
control={control} control={control}

View File

@@ -10,12 +10,17 @@ import {
} from '@chakra-ui/react'; } from '@chakra-ui/react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import localizedFormat from "dayjs/plugin/localizedFormat"; import localizedFormat from 'dayjs/plugin/localizedFormat';
dayjs.extend(localizedFormat); dayjs.extend(localizedFormat);
import 'dayjs/locale/ru';
import 'dayjs/locale/en';
import { Order } from '../../../models/landing'; import { Order } from '../../../models/landing';
import { formatDatetime } from '../../../lib'; import { formatDatetime } from '../../../lib';
import { carBodySelectOptions } from '../../order-form/form/car-body/helper'; import {
carBodySelectOptions,
carColorSelectOptions,
} from '../../order-form';
import { OrderStatus } from './status'; import { OrderStatus } from './status';
@@ -43,26 +48,32 @@ export const OrderDetails: FC<OrderDetailsProps> = ({
location, location,
startWashTime, startWashTime,
endWashTime, endWashTime,
created created,
}) => { }) => {
const { t } = useTranslation('~', { const { t, i18n } = useTranslation('~', {
keyPrefix: 'dry-wash.order-view.details', keyPrefix: 'dry-wash.order-view.details',
}); });
dayjs.locale(i18n.language);
const { t: tCarBody } = useTranslation('~', { const { t: tCarBody } = useTranslation('~', {
keyPrefix: 'dry-wash.order-create.car-body-select.options', keyPrefix: 'dry-wash.order-create.car-body-select.options',
}); });
const { t: tCarColor } = useTranslation('~', {
keyPrefix: 'dry-wash.order-create.car-color-select.colors',
});
const carColorTKey = carColorSelectOptions.find(({ value }) => value === carColor)?.labelTKey;
return ( return (
<> <>
<Heading as='h2' size='lg' marginInline='auto'>
{t('title', { number: orderNumber })}
</Heading>
<HStack <HStack
width='full' width='full'
flexWrap='wrap' flexWrap='wrap'
justifyContent='space-between' justifyContent='space-between'
gap={2} gap={2}
> >
<Heading as='h2' size='lg'> <Text>{dayjs(created).format('LLL')}</Text>
{t('title', { number: orderNumber })} ({dayjs(created).format('LLLL')})
</Heading>
<OrderStatus value={status} /> <OrderStatus value={status} />
</HStack> </HStack>
<UnorderedList styleType='none'> <UnorderedList styleType='none'>
@@ -78,7 +89,7 @@ export const OrderDetails: FC<OrderDetailsProps> = ({
tCarBody( tCarBody(
`${carBodySelectOptions.find(({ value }) => value === carBody)?.labelTKey}`, `${carBodySelectOptions.find(({ value }) => value === carBody)?.labelTKey}`,
), ),
carColor, carColorTKey ? tCarColor(carColorTKey) : carColor,
] ]
.filter((v) => v) .filter((v) => v)
.join(', '), .join(', '),

View File

@@ -56,5 +56,4 @@ export type OrderArm = {
notes: ''; notes: '';
allMasters: Master[]; allMasters: Master[];
id: string; id: string;
currentDate: Date;
}; };

View File

@@ -1,6 +1,15 @@
export type RegistrationNumber = string; // А012ВЕ16 export type RegistrationNumber = string; // А012ВЕ16
export type Color = string; // #000000 export const enum Color {
WHITE,
BLACK,
SILVER,
GRAY,
BEIGE_BROWN,
RED,
BLUE,
GREEN,
}
export const enum BodyStyle { export const enum BodyStyle {
UNKNOWN = 0, UNKNOWN = 0,

View File

@@ -18,7 +18,7 @@ export type Create = {
car: { car: {
number: Car.RegistrationNumber; number: Car.RegistrationNumber;
body: Car.BodyStyle; body: Car.BodyStyle;
color: Car.Color; color: Car.Color | string;
}; };
washing: { washing: {
location: Washing.Location; location: Washing.Location;
@@ -33,7 +33,7 @@ export type View = {
phone: Customer.PhoneNumber; phone: Customer.PhoneNumber;
carNumber: Car.RegistrationNumber; carNumber: Car.RegistrationNumber;
carBody: Car.BodyStyle; carBody: Car.BodyStyle;
carColor?: Car.Color; carColor?: Car.Color | string;
location: Washing.Location; location: Washing.Location;
startWashTime: Washing.AvailableBeginDateTime; startWashTime: Washing.AvailableBeginDateTime;
endWashTime: Washing.AvailableEndDateTime; endWashTime: Washing.AvailableEndDateTime;
@@ -45,4 +45,5 @@ export type View = {
id: Id; id: Id;
image?: string; image?: string;
imageRating?: string; imageRating?: string;
imageDescription?: string;
}; };

View File

@@ -3,46 +3,42 @@
exports[`Master Page should display master list and show details when master button is clicked 1`] = ` exports[`Master Page should display master list and show details when master button is clicked 1`] = `
<div> <div>
<div <div
class="css-1yeiifd" class="css-s92abg"
> >
<div <header
class="css-13owfwq" class="css-106dwq4"
> >
<h2
class="chakra-heading css-173d1bl"
>
Сухой мастер
</h2>
<div <div
class="chakra-stack css-1cggwyz" class="css-br9knx"
> >
<hr <h2
aria-orientation="horizontal" class="chakra-heading css-8w8uga"
class="chakra-divider css-svjswr"
/>
<a
class="chakra-button css-18yoix2"
href="/order"
> >
Заказы Сухой мастер
</a> </h2>
<hr <div
aria-orientation="horizontal" class="chakra-stack css-1rafi8n"
class="chakra-divider css-svjswr"
/>
<a
class="chakra-button css-1kg18wp"
data-testid="master-button"
href="/master"
> >
Мастера <a
</a> class="chakra-button css-19byqlw"
<hr href="/order"
aria-orientation="horizontal" >
class="chakra-divider css-svjswr" Заказы
/> </a>
<hr
aria-orientation="vertical"
class="chakra-divider css-zw0v9u"
/>
<a
class="chakra-button css-g11sl9"
data-testid="master-button"
href="/master"
>
Мастера
</a>
</div>
</div> </div>
</div> </header>
<div <div
class="css-jiwy8d" class="css-jiwy8d"
> >

View File

@@ -90,65 +90,163 @@ exports[`Create Order page renders page structure 1`] = `
> >
Цвет автомобиля Цвет автомобиля
</label> </label>
<input <div
class="chakra-input css-moii5c" class="chakra-stack css-uv9e93"
id="field-:r2:"
list=":r3:"
name="carColor"
value=""
/>
<datalist
id=":r3:"
> >
<option <div
label="white" class="css-ed0q6j"
value="#ffffff"
> >
white <button
</option> class="css-6su6fj"
<option type="button"
label="black" >
value="#000000" <div
> class="css-11g98ql"
black >
</option> <div
<option class="css-1k9efnl"
label="silver" >
value="#c0c0c0" <div
> class="css-96lva5"
silver />
</option> </div>
<option </div>
label="gray" </button>
value="#808080" <button
> class="css-6su6fj"
gray type="button"
</option> >
<option <div
label="beige-brown" class="css-11g98ql"
value="#796745" >
> <div
beige-brown class="css-1k9efnl"
</option> >
<option <div
label="red" class="css-c58w4d"
value="#b90000" />
> </div>
red </div>
</option> </button>
<option <button
label="blue" class="css-6su6fj"
value="#003B62" type="button"
> >
blue <div
</option> class="css-11g98ql"
<option >
label="green" <div
value="#078d51" class="css-1k9efnl"
> >
green <div
</option> class="css-ltoa43"
</datalist> />
</div>
</div>
</button>
<button
class="css-6su6fj"
type="button"
>
<div
class="css-11g98ql"
>
<div
class="css-1k9efnl"
>
<div
class="css-vqo9x6"
/>
</div>
</div>
</button>
<button
class="css-6su6fj"
type="button"
>
<div
class="css-11g98ql"
>
<div
class="css-1k9efnl"
>
<div
class="css-1lr2es4"
/>
</div>
</div>
</button>
<button
class="css-6su6fj"
type="button"
>
<div
class="css-11g98ql"
>
<div
class="css-1k9efnl"
>
<div
class="css-1wfunc4"
/>
</div>
</div>
</button>
<button
class="css-6su6fj"
type="button"
>
<div
class="css-11g98ql"
>
<div
class="css-1k9efnl"
>
<div
class="css-fg5oe6"
/>
</div>
</div>
</button>
<button
class="css-6su6fj"
type="button"
>
<div
class="css-11g98ql"
>
<div
class="css-1k9efnl"
>
<div
class="css-f0pfxe"
/>
</div>
</div>
</button>
<button
class="css-6su6fj"
type="button"
>
<div
class="css-bf4qsc"
>
<div
class="css-1k9efnl"
>
<div
class="css-r58uxc"
/>
<p
class="chakra-text css-1xa8ojw"
>
Другой
</p>
</div>
</div>
</button>
</div>
</div>
</div> </div>
<div <div
class="chakra-form-control css-1kxonj9" class="chakra-form-control css-1kxonj9"
@@ -157,7 +255,7 @@ exports[`Create Order page renders page structure 1`] = `
<label <label
class="chakra-form__label css-g6pte" class="chakra-form__label css-g6pte"
for="carBody" for="carBody"
id="field-:r4:-label" id="field-:r3:-label"
> >
Тип кузова автомобиля Тип кузова автомобиля
<span <span
@@ -169,13 +267,13 @@ exports[`Create Order page renders page structure 1`] = `
</span> </span>
</label> </label>
<div <div
class="css-8atqhb" class="css-1kxonj9"
> >
<input <input
aria-readonly="true" aria-readonly="true"
aria-required="true" aria-required="true"
class="chakra-input css-moii5c" class="chakra-input css-moii5c"
id="field-:r4:" id="field-:r3:"
name="carBody" name="carBody"
placeholder="Не указан" placeholder="Не указан"
readonly="" readonly=""
@@ -184,19 +282,19 @@ exports[`Create Order page renders page structure 1`] = `
/> />
<div <div
class="chakra-popover__popper css-iy22zq" class="chakra-popover__popper css-iy22zq"
style="visibility: hidden; position: absolute; inset: 0 auto auto 0;" style="visibility: hidden; position: fixed; inset: 0 auto auto 0;"
> >
<section <section
aria-describedby="popover-body-:r8:" aria-describedby="popover-body-:r7:"
class="chakra-popover__content css-1mvj5hv" class="chakra-popover__content css-1mvj5hv"
id="popover-content-:r8:" id="popover-content-:r7:"
role="dialog" role="dialog"
style="transform-origin: var(--popper-transform-origin); opacity: 0; visibility: hidden; transform: scale(0.95) translateZ(0);" style="transform-origin: var(--popper-transform-origin); opacity: 0; visibility: hidden; transform: scale(0.95) translateZ(0);"
tabindex="-1" tabindex="-1"
> >
<div <div
class="chakra-popover__body css-1uqsyei" class="chakra-popover__body css-1uqsyei"
id="popover-body-:r8:" id="popover-body-:r7:"
> >
<div <div
class="css-124gwxm" class="css-124gwxm"
@@ -211,8 +309,8 @@ exports[`Create Order page renders page structure 1`] = `
<input <input
aria-required="true" aria-required="true"
hidden="" hidden=""
id="radio-:r9:" id="radio-:r8:"
name="radio-:r5:" name="radio-:r4:"
required="" required=""
style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; width: 1px; margin: -1px; padding: 0px; overflow: hidden; white-space: nowrap; position: absolute;" style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; width: 1px; margin: -1px; padding: 0px; overflow: hidden; white-space: nowrap; position: absolute;"
type="radio" type="radio"
@@ -243,8 +341,8 @@ exports[`Create Order page renders page structure 1`] = `
<input <input
aria-required="true" aria-required="true"
hidden="" hidden=""
id="radio-:ra:" id="radio-:r9:"
name="radio-:r5:" name="radio-:r4:"
required="" required=""
style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; width: 1px; margin: -1px; padding: 0px; overflow: hidden; white-space: nowrap; position: absolute;" style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; width: 1px; margin: -1px; padding: 0px; overflow: hidden; white-space: nowrap; position: absolute;"
type="radio" type="radio"
@@ -275,8 +373,8 @@ exports[`Create Order page renders page structure 1`] = `
<input <input
aria-required="true" aria-required="true"
hidden="" hidden=""
id="radio-:rb:" id="radio-:ra:"
name="radio-:r5:" name="radio-:r4:"
required="" required=""
style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; width: 1px; margin: -1px; padding: 0px; overflow: hidden; white-space: nowrap; position: absolute;" style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; width: 1px; margin: -1px; padding: 0px; overflow: hidden; white-space: nowrap; position: absolute;"
type="radio" type="radio"
@@ -307,8 +405,8 @@ exports[`Create Order page renders page structure 1`] = `
<input <input
aria-required="true" aria-required="true"
hidden="" hidden=""
id="radio-:rc:" id="radio-:rb:"
name="radio-:r5:" name="radio-:r4:"
required="" required=""
style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; width: 1px; margin: -1px; padding: 0px; overflow: hidden; white-space: nowrap; position: absolute;" style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; width: 1px; margin: -1px; padding: 0px; overflow: hidden; white-space: nowrap; position: absolute;"
type="radio" type="radio"
@@ -339,8 +437,8 @@ exports[`Create Order page renders page structure 1`] = `
<input <input
aria-required="true" aria-required="true"
hidden="" hidden=""
id="radio-:rd:" id="radio-:rc:"
name="radio-:r5:" name="radio-:r4:"
required="" required=""
style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; width: 1px; margin: -1px; padding: 0px; overflow: hidden; white-space: nowrap; position: absolute;" style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; width: 1px; margin: -1px; padding: 0px; overflow: hidden; white-space: nowrap; position: absolute;"
type="radio" type="radio"
@@ -371,8 +469,8 @@ exports[`Create Order page renders page structure 1`] = `
<input <input
aria-required="true" aria-required="true"
hidden="" hidden=""
id="radio-:re:" id="radio-:rd:"
name="radio-:r5:" name="radio-:r4:"
required="" required=""
style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; width: 1px; margin: -1px; padding: 0px; overflow: hidden; white-space: nowrap; position: absolute;" style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; width: 1px; margin: -1px; padding: 0px; overflow: hidden; white-space: nowrap; position: absolute;"
type="radio" type="radio"
@@ -403,8 +501,8 @@ exports[`Create Order page renders page structure 1`] = `
<input <input
aria-required="true" aria-required="true"
hidden="" hidden=""
id="radio-:rf:" id="radio-:re:"
name="radio-:r5:" name="radio-:r4:"
required="" required=""
style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; width: 1px; margin: -1px; padding: 0px; overflow: hidden; white-space: nowrap; position: absolute;" style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; width: 1px; margin: -1px; padding: 0px; overflow: hidden; white-space: nowrap; position: absolute;"
type="radio" type="radio"
@@ -435,8 +533,8 @@ exports[`Create Order page renders page structure 1`] = `
<input <input
aria-required="true" aria-required="true"
hidden="" hidden=""
id="radio-:rg:" id="radio-:rf:"
name="radio-:r5:" name="radio-:r4:"
required="" required=""
style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; width: 1px; margin: -1px; padding: 0px; overflow: hidden; white-space: nowrap; position: absolute;" style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; width: 1px; margin: -1px; padding: 0px; overflow: hidden; white-space: nowrap; position: absolute;"
type="radio" type="radio"
@@ -467,8 +565,8 @@ exports[`Create Order page renders page structure 1`] = `
<input <input
aria-required="true" aria-required="true"
hidden="" hidden=""
id="radio-:rh:" id="radio-:rg:"
name="radio-:r5:" name="radio-:r4:"
required="" required=""
style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; width: 1px; margin: -1px; padding: 0px; overflow: hidden; white-space: nowrap; position: absolute;" style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; width: 1px; margin: -1px; padding: 0px; overflow: hidden; white-space: nowrap; position: absolute;"
type="radio" type="radio"
@@ -499,8 +597,8 @@ exports[`Create Order page renders page structure 1`] = `
<input <input
aria-required="true" aria-required="true"
hidden="" hidden=""
id="radio-:ri:" id="radio-:rh:"
name="radio-:r5:" name="radio-:r4:"
required="" required=""
style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; width: 1px; margin: -1px; padding: 0px; overflow: hidden; white-space: nowrap; position: absolute;" style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; width: 1px; margin: -1px; padding: 0px; overflow: hidden; white-space: nowrap; position: absolute;"
type="radio" type="radio"
@@ -531,8 +629,8 @@ exports[`Create Order page renders page structure 1`] = `
<input <input
aria-required="true" aria-required="true"
hidden="" hidden=""
id="radio-:rj:" id="radio-:ri:"
name="radio-:r5:" name="radio-:r4:"
required="" required=""
style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; width: 1px; margin: -1px; padding: 0px; overflow: hidden; white-space: nowrap; position: absolute;" style="border: 0px; clip: rect(0px, 0px, 0px, 0px); height: 1px; width: 1px; margin: -1px; padding: 0px; overflow: hidden; white-space: nowrap; position: absolute;"
type="radio" type="radio"
@@ -566,8 +664,8 @@ exports[`Create Order page renders page structure 1`] = `
> >
<label <label
class="chakra-form__label css-g6pte" class="chakra-form__label css-g6pte"
for="field-:rk:" for="field-:rj:"
id="field-:rk:-label" id="field-:rj:-label"
> >
В какое время автомобиль доступен? В какое время автомобиль доступен?
<span <span
@@ -590,7 +688,7 @@ exports[`Create Order page renders page structure 1`] = `
> >
<input <input
class="chakra-input css-moii5c" class="chakra-input css-moii5c"
id="field-:rl:" id="field-:rk:"
max="" max=""
name="availableDatetimeBegin" name="availableDatetimeBegin"
type="datetime-local" type="datetime-local"
@@ -607,7 +705,7 @@ exports[`Create Order page renders page structure 1`] = `
> >
<input <input
class="chakra-input css-moii5c" class="chakra-input css-moii5c"
id="field-:rm:" id="field-:rl:"
min="" min=""
name="availableDatetimeEnd" name="availableDatetimeEnd"
type="datetime-local" type="datetime-local"
@@ -624,7 +722,7 @@ exports[`Create Order page renders page structure 1`] = `
<label <label
class="chakra-form__label css-g6pte" class="chakra-form__label css-g6pte"
for="carLocation" for="carLocation"
id="field-:rn:-label" id="field-:rm:-label"
> >
Где находится автомобиль? Где находится автомобиль?
<span <span
@@ -638,7 +736,7 @@ exports[`Create Order page renders page structure 1`] = `
<div /> <div />
<div <div
class="chakra-form__helper-text css-186pyma" class="chakra-form__helper-text css-186pyma"
id="field-:rn:-helptext" id="field-:rm:-helptext"
> >
Например, 55.754364, 48.743295 Университетская улица, 1, Иннополис, Верхнеуслонский район, Республика Татарстан (Татарстан), 420500 Например, 55.754364, 48.743295 Университетская улица, 1, Иннополис, Верхнеуслонский район, Республика Татарстан (Татарстан), 420500
</div> </div>

File diff suppressed because one or more lines are too long

View File

@@ -3,46 +3,42 @@
exports[`Страница заказов должна корректно отображать список заказов после загрузки данных 1`] = ` exports[`Страница заказов должна корректно отображать список заказов после загрузки данных 1`] = `
<div> <div>
<div <div
class="css-1yeiifd" class="css-s92abg"
> >
<div <header
class="css-13owfwq" class="css-106dwq4"
> >
<h2
class="chakra-heading css-173d1bl"
>
Сухой мастер
</h2>
<div <div
class="chakra-stack css-1cggwyz" class="css-br9knx"
> >
<hr <h2
aria-orientation="horizontal" class="chakra-heading css-8w8uga"
class="chakra-divider css-svjswr"
/>
<a
class="chakra-button css-1kg18wp"
href="/auth/login"
> >
Заказы Сухой мастер
</a> </h2>
<hr <div
aria-orientation="horizontal" class="chakra-stack css-1rafi8n"
class="chakra-divider css-svjswr"
/>
<a
class="chakra-button css-1kg18wp"
data-testid="master-button"
href="/auth/login"
> >
Мастера <a
</a> class="chakra-button css-g11sl9"
<hr href="/auth/login"
aria-orientation="horizontal" >
class="chakra-divider css-svjswr" Заказы
/> </a>
<hr
aria-orientation="vertical"
class="chakra-divider css-zw0v9u"
/>
<a
class="chakra-button css-g11sl9"
data-testid="master-button"
href="/auth/login"
>
Мастера
</a>
</div>
</div> </div>
</div> </header>
<div <div
class="css-jiwy8d" class="css-jiwy8d"
> >
@@ -75,7 +71,7 @@ exports[`Страница заказов должна корректно ото
<p <p
class="chakra-text css-52ukzg" class="chakra-text css-52ukzg"
> >
23.02.2025 12.03.2025
</p> </p>
<button <button
class="chakra-button css-ez23ye" class="chakra-button css-ez23ye"
@@ -177,12 +173,7 @@ exports[`Страница заказов должна корректно ото
Выполняется Выполняется
</option> </option>
<option <option
value="working" value="cancelled"
>
В работе
</option>
<option
value="canceled"
> >
Отменено Отменено
</option> </option>
@@ -273,7 +264,80 @@ exports[`Страница заказов должна корректно ото
<td <td
class="css-zgoslk" class="css-zgoslk"
> >
Казань, ул. Баумана, 1 <button
aria-controls="popover-content-:r1:"
aria-expanded="false"
aria-haspopup="dialog"
class="chakra-button css-ez23ye"
id="popover-trigger-:r1:"
type="button"
>
<svg
class="chakra-icon css-onkibi"
focusable="false"
viewBox="0 0 24 24"
>
<g
fill="currentColor"
>
<path
d="M23.432,10.524C20.787,7.614,16.4,4.538,12,4.6,7.6,4.537,3.213,7.615.568,10.524a2.211,2.211,0,0,0,0,2.948C3.182,16.351,7.507,19.4,11.839,19.4h.308c4.347,0,8.671-3.049,11.288-5.929A2.21,2.21,0,0,0,23.432,10.524ZM7.4,12A4.6,4.6,0,1,1,12,16.6,4.6,4.6,0,0,1,7.4,12Z"
/>
<circle
cx="12"
cy="12"
r="2"
/>
</g>
</svg>
</button>
<div
class="chakra-popover__popper css-iy22zq"
style="visibility: hidden; position: absolute; min-width: max-content; inset: 0 auto auto 0;"
>
<section
aria-describedby="popover-body-:r1:"
class="chakra-popover__content css-sjj62m"
id="popover-content-:r1:"
role="dialog"
style="transform-origin: var(--popper-transform-origin); opacity: 0; visibility: hidden; transform: scale(0.95) translateZ(0);"
tabindex="-1"
>
<div
class="chakra-popover__arrow-positioner css-0"
data-popper-arrow=""
style="position: absolute;"
>
<div
class="chakra-popover__arrow css-0"
data-popper-arrow-inner=""
/>
</div>
<button
aria-label="Close"
class="chakra-popover__close-btn css-1o8qips"
type="button"
>
<svg
aria-hidden="true"
class="chakra-icon css-onkibi"
focusable="false"
viewBox="0 0 24 24"
>
<path
d="M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"
fill="currentColor"
/>
</svg>
</button>
<div
class="chakra-popover__body css-45vz3u"
id="popover-body-:r1:"
>
Казань, ул. Баумана, 1
</div>
</section>
</div>
</td> </td>
</tr> </tr>
<tr <tr
@@ -316,12 +380,7 @@ exports[`Страница заказов должна корректно ото
Выполняется Выполняется
</option> </option>
<option <option
value="working" value="cancelled"
>
В работе
</option>
<option
value="canceled"
> >
Отменено Отменено
</option> </option>
@@ -412,7 +471,80 @@ exports[`Страница заказов должна корректно ото
<td <td
class="css-zgoslk" class="css-zgoslk"
> >
Казань, ул. Баумана, 43 <button
aria-controls="popover-content-:r3:"
aria-expanded="false"
aria-haspopup="dialog"
class="chakra-button css-ez23ye"
id="popover-trigger-:r3:"
type="button"
>
<svg
class="chakra-icon css-onkibi"
focusable="false"
viewBox="0 0 24 24"
>
<g
fill="currentColor"
>
<path
d="M23.432,10.524C20.787,7.614,16.4,4.538,12,4.6,7.6,4.537,3.213,7.615.568,10.524a2.211,2.211,0,0,0,0,2.948C3.182,16.351,7.507,19.4,11.839,19.4h.308c4.347,0,8.671-3.049,11.288-5.929A2.21,2.21,0,0,0,23.432,10.524ZM7.4,12A4.6,4.6,0,1,1,12,16.6,4.6,4.6,0,0,1,7.4,12Z"
/>
<circle
cx="12"
cy="12"
r="2"
/>
</g>
</svg>
</button>
<div
class="chakra-popover__popper css-iy22zq"
style="visibility: hidden; position: absolute; min-width: max-content; inset: 0 auto auto 0;"
>
<section
aria-describedby="popover-body-:r3:"
class="chakra-popover__content css-sjj62m"
id="popover-content-:r3:"
role="dialog"
style="transform-origin: var(--popper-transform-origin); opacity: 0; visibility: hidden; transform: scale(0.95) translateZ(0);"
tabindex="-1"
>
<div
class="chakra-popover__arrow-positioner css-0"
data-popper-arrow=""
style="position: absolute;"
>
<div
class="chakra-popover__arrow css-0"
data-popper-arrow-inner=""
/>
</div>
<button
aria-label="Close"
class="chakra-popover__close-btn css-1o8qips"
type="button"
>
<svg
aria-hidden="true"
class="chakra-icon css-onkibi"
focusable="false"
viewBox="0 0 24 24"
>
<path
d="M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"
fill="currentColor"
/>
</svg>
</button>
<div
class="chakra-popover__body css-45vz3u"
id="popover-body-:r3:"
>
Казань, ул. Баумана, 43
</div>
</section>
</div>
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@@ -0,0 +1,63 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import { BrowserRouter } from 'react-router-dom';
import { ChakraProvider } from '@chakra-ui/react';
import NotFound from '../notFound/notFound';
// Mock the translation hook
jest.mock('react-i18next', () => ({
useTranslation: () => ({
t: (key: string) => {
const translations = {
'notFound.title': 'Page Not Found',
'notFound.description': 'The page you are looking for does not exist',
'notFound.button.back': 'Back to Home'
};
return translations[key] || key;
}
})
}));
// Mock the Lottie Player component
jest.mock('@lottiefiles/react-lottie-player', () => ({
Player: () => <div data-testid="lottie-animation">Animation Mock</div>
}));
describe('NotFound Component', () => {
const renderNotFound = () => {
return render(
<ChakraProvider>
<BrowserRouter>
<NotFound />
</BrowserRouter>
</ChakraProvider>
);
};
it('renders without crashing', () => {
renderNotFound();
});
it('displays the correct content', () => {
renderNotFound();
// Check if title is present
expect(screen.getByText('Page Not Found')).toBeInTheDocument();
// Check if description is present
expect(screen.getByText('The page you are looking for does not exist')).toBeInTheDocument();
// Check if back button is present
expect(screen.getByText('Back to Home')).toBeInTheDocument();
// Check if Lottie animation is rendered
expect(screen.getByTestId('lottie-animation')).toBeInTheDocument();
});
it('contains a link to the dry-wash page', () => {
renderNotFound();
const backButton = screen.getByText('Back to Home');
expect(backButton.closest('a')).toHaveAttribute('href', '/dry-wash');
});
});

View File

@@ -96,6 +96,7 @@ const Page: FC = () => {
<PriceCar <PriceCar
image={order?.image} image={order?.image}
rating={order?.imageRating} rating={order?.imageRating}
description={order?.imageDescription}
/> />
)} )}
</VStack> </VStack>

View File

@@ -1,13 +0,0 @@
const getCoordinates = (location: string) => {
if (!location) return null;
const [lat, lon] = location
.split(',')
.map((coord) => parseFloat(coord.trim()));
if (isNaN(lat) || isNaN(lon)) return null;
return { lat, lon };
};
export default getCoordinates;

View File

@@ -21,7 +21,7 @@
"orderDate": "2024-11-24T07:40:46.366Z", "orderDate": "2024-11-24T07:40:46.366Z",
"status": "progress", "status": "progress",
"phone": "79001234567", "phone": "79001234567",
"location": "55.75060416346278,48.746329576898944 Республика Татарстан (Татарстан), Верхнеуслонский район, Иннополис", "location": "55.779905316526424,49.12446113769528 Республика Татарстан (Татарстан), Казань, озеро Нижний Кабан",
"master": [], "master": [],
"notes": "" "notes": ""
} }

File diff suppressed because one or more lines are too long

View File

@@ -4,7 +4,7 @@
"phone": "+79876543210", "phone": "+79876543210",
"carNumber": "А123АА16", "carNumber": "А123АА16",
"carBody": 2, "carBody": 2,
"carColor": "#ffffff", "carColor": "мокрый асфальт",
"startWashTime": "2025-01-19T14:03:00.000Z", "startWashTime": "2025-01-19T14:03:00.000Z",
"endWashTime": "2025-01-19T14:03:00.000Z", "endWashTime": "2025-01-19T14:03:00.000Z",
"location": "55.793833888711006,49.19037910644527 Республика Татарстан (Татарстан), Казань, жилой район Седьмое Небо", "location": "55.793833888711006,49.19037910644527 Республика Татарстан (Татарстан), Казань, жилой район Седьмое Небо",