Compare commits
34 Commits
debug
...
feature/ma
| Author | SHA1 | Date | |
|---|---|---|---|
| fea4a54c83 | |||
| 9349a41f84 | |||
| 8103fdcb56 | |||
| a59864a3e2 | |||
| a252301ea0 | |||
| 48cdfb92bd | |||
|
|
279da05b32 | ||
|
|
c6d906ad62 | ||
|
|
418a121418 | ||
|
|
7647958e52 | ||
|
|
9e024af568 | ||
|
|
7fe62e7d6e | ||
|
|
f2db3774c9 | ||
|
|
02e3fdffa0 | ||
|
|
965d2d0be1 | ||
|
|
9121fcaa43 | ||
|
|
290bb3f0a3 | ||
|
|
e6e73e5289 | ||
|
|
b959fcf8db | ||
|
|
5e25848e22 | ||
|
|
ecf6c60cdc | ||
|
|
91fc91230b | ||
| d312445bf2 | |||
|
|
351420bc62 | ||
|
|
61b042eee6 | ||
|
|
ac006267a2 | ||
|
|
63d9d069c0 | ||
| c83ebf02bc | |||
|
|
1968df7bb3 | ||
|
|
811e0e3f24 | ||
| a2ffd6f38f | |||
|
|
20017cad3c | ||
|
|
de54ac6669 | ||
|
|
eda869622e |
@@ -16,12 +16,27 @@ module.exports = {
|
||||
'dry-wash.order.view': '/order/:orderId',
|
||||
'dry-wash.arm.master': 'master',
|
||||
'dry-wash.arm.order': 'order',
|
||||
'dry-wash.arm.map': 'map',
|
||||
'dry-wash.arm': '/arm/*',
|
||||
},
|
||||
features: {
|
||||
'dry-wash': {
|
||||
// add your features here in the format [featureName]: { value: string }
|
||||
'order-view-status-polling': { value: '3000' }
|
||||
'order-view-status-polling': {
|
||||
on: true,
|
||||
value: '3000',
|
||||
key: 'order-view-status-polling',
|
||||
},
|
||||
'car-img-upload': {
|
||||
on: true,
|
||||
value: 'true',
|
||||
key: 'car-img-upload',
|
||||
},
|
||||
'order-cost': {
|
||||
on: true,
|
||||
value: '1000',
|
||||
key: 'order-cost',
|
||||
},
|
||||
},
|
||||
},
|
||||
config: {
|
||||
|
||||
@@ -50,6 +50,12 @@
|
||||
"dry-wash.order-view.details.location": "Where",
|
||||
"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.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.file-input.placeholder": "Upload a file",
|
||||
"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.error.title": "Failed to upload the car image",
|
||||
"dry-wash.arm.master.add": "Add",
|
||||
"dry-wash.arm.order.title": "Orders",
|
||||
"dry-wash.arm.order.table.empty": "Table empty",
|
||||
@@ -58,7 +64,7 @@
|
||||
"dry-wash.arm.order.status.complete": "Completed",
|
||||
"dry-wash.arm.order.status.pending": "Pending",
|
||||
"dry-wash.arm.order.status.working": "Working",
|
||||
"dry-wash.arm.order.status.canceled": "Canceled",
|
||||
"dry-wash.arm.order.status.cancelled": "Canceled",
|
||||
"dry-wash.arm.order.status.placeholder": "Select status",
|
||||
"dry-wash.arm.order.master.placeholder": "Select master",
|
||||
"dry-wash.arm.order.table.header.carNumber": "Car Number",
|
||||
@@ -105,5 +111,8 @@
|
||||
"dry-wash.errorBoundary.title": "Something went wrong",
|
||||
"dry-wash.errorBoundary.description": "We are already working on fixing the issue",
|
||||
"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"
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"dry-wash.arm.order.status.complete": "Завершено",
|
||||
"dry-wash.arm.order.status.pending": "В ожидании",
|
||||
"dry-wash.arm.order.status.working": "В работе",
|
||||
"dry-wash.arm.order.status.canceled": "Отменено",
|
||||
"dry-wash.arm.order.status.cancelled": "Отменено",
|
||||
"dry-wash.arm.order.status.placeholder": "Выберите статус",
|
||||
"dry-wash.arm.order.master.placeholder": "Выберите мастера",
|
||||
"dry-wash.arm.order.table.header.carNumber": "Номер машины",
|
||||
@@ -105,11 +105,20 @@
|
||||
"dry-wash.order-view.details.location": "Где",
|
||||
"dry-wash.order-view.details.datetime-range": "Когда",
|
||||
"dry-wash.order-view.details.alert": "С вами свяжется оператор насчет оплаты по указанному номеру телефона",
|
||||
"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.file-input.placeholder": "Загрузите файл",
|
||||
"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.error.title": "Не удалось загрузить изображение автомобиля",
|
||||
"dry-wash.notFound.title": "Страница не найдена",
|
||||
"dry-wash.notFound.description": "К сожалению, запрашиваемая вами страница не существует.",
|
||||
"dry-wash.notFound.button.back": "Вернуться на главную",
|
||||
"dry-wash.errorBoundary.title": "Что-то пошло не так",
|
||||
"dry-wash.errorBoundary.description": "Мы уже работаем над исправлением проблемы",
|
||||
"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": "Статус"
|
||||
}
|
||||
|
||||
5
package-lock.json
generated
5
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "dry-wash",
|
||||
"version": "0.8.0",
|
||||
"version": "0.9.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "dry-wash",
|
||||
"version": "0.8.0",
|
||||
"version": "0.9.2",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.26.7",
|
||||
@@ -3610,7 +3610,6 @@
|
||||
"version": "1.2.5",
|
||||
"resolved": "https://registry.npmjs.org/@pbe/react-yandex-maps/-/react-yandex-maps-1.2.5.tgz",
|
||||
"integrity": "sha512-cBojin5e1fPx9XVCAqHQJsCnHGMeBNsP0TrNfpWCrPFfxb30ye+JgcGr2mn767Gbr1d+RufBLRiUcX2kaiAwjQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/yandex-maps": "2.1.29"
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "dry-wash",
|
||||
"version": "0.8.0",
|
||||
"version": "0.9.2",
|
||||
"description": "<a id=\"readme-top\"></a>",
|
||||
"main": "./src/index.tsx",
|
||||
"scripts": {
|
||||
|
||||
@@ -11,5 +11,8 @@ export const FEATURE = {
|
||||
return interval;
|
||||
}
|
||||
}
|
||||
},
|
||||
carImageUpload: {
|
||||
isOn: Boolean(features?.['car-img-upload'])
|
||||
}
|
||||
};
|
||||
@@ -1,4 +1,4 @@
|
||||
import { GetOrder, CreateOrder } from "../../models/api";
|
||||
import { GetOrder, CreateOrder, UploadCarImage } from "../../models/api";
|
||||
|
||||
import { api } from "./api";
|
||||
import { extractBodyFromResponse, extractErrorMessageFromResponse } from "./utils";
|
||||
@@ -19,5 +19,13 @@ export const landingApi = api.injectEndpoints({
|
||||
transformResponse: extractBodyFromResponse<CreateOrder.Response>,
|
||||
transformErrorResponse: extractErrorMessageFromResponse,
|
||||
}),
|
||||
uploadCarImage: mutation<UploadCarImage.Response, UploadCarImage.Params>({
|
||||
query: ({ orderId, body }) => ({
|
||||
url: `/order/${orderId}/upload-car-img`,
|
||||
body,
|
||||
method: 'POST'
|
||||
}),
|
||||
transformErrorResponse: extractErrorMessageFromResponse,
|
||||
}),
|
||||
})
|
||||
});
|
||||
|
||||
@@ -3,6 +3,7 @@ import { FetchBaseQueryError } from '@reduxjs/toolkit/query';
|
||||
import { BaseResponse } from '../../models/api';
|
||||
|
||||
export const extractBodyFromResponse = <Body>(response: BaseResponse<Body>) => {
|
||||
console.log('response', response);
|
||||
if (response.success) {
|
||||
return response.body;
|
||||
}
|
||||
@@ -13,9 +14,10 @@ export const extractErrorMessageFromResponse = ({
|
||||
}: FetchBaseQueryError) => {
|
||||
if (
|
||||
typeof data === 'object' &&
|
||||
'message' in data &&
|
||||
typeof data.message === 'string'
|
||||
data !== null &&
|
||||
'error' in data &&
|
||||
typeof data.error === 'string'
|
||||
) {
|
||||
return data.message;
|
||||
return data.error;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -33,6 +33,18 @@ export const URLs = {
|
||||
url: 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}¤tDate=${currentDate}`
|
||||
);
|
||||
},
|
||||
},
|
||||
armBase: {
|
||||
url: getFullUrls(getNavigationValue('dry-wash.arm')),
|
||||
isOn: Boolean(getNavigationValue('dry-wash.arm')),
|
||||
|
||||
63
src/components/Header/Header.tsx
Normal file
63
src/components/Header/Header.tsx
Normal file
@@ -0,0 +1,63 @@
|
||||
import { Box, Button, Heading, HStack, Divider, Flex } from '@chakra-ui/react';
|
||||
import React from 'react';
|
||||
import { useLocation, Link } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { URLs } from '../../__data__/urls';
|
||||
|
||||
const Header = () => {
|
||||
const location = useLocation();
|
||||
const isActive = (keyword: string) => location.pathname.includes(keyword);
|
||||
|
||||
const { t } = useTranslation('~', {
|
||||
keyPrefix: 'dry-wash.arm.master.sideBar',
|
||||
});
|
||||
|
||||
return (
|
||||
<Box as='header' bg='gray.50' boxShadow='md' px={6} py={4} w='100%'>
|
||||
<Flex gap={50} align='center'>
|
||||
<Heading color='green' size='lg'>
|
||||
{t('title')}
|
||||
</Heading>
|
||||
<HStack spacing={4}>
|
||||
{URLs.armOrder.isOn && (
|
||||
<Button
|
||||
as={Link}
|
||||
to={URLs.armOrder.url}
|
||||
colorScheme={isActive(URLs.armOrder.url) ? 'green' : 'blue'}
|
||||
variant={isActive(URLs.armOrder.url) ? 'outline' : 'ghost'}
|
||||
>
|
||||
{t('orders')}
|
||||
</Button>
|
||||
)}
|
||||
<Divider orientation='vertical' height='30px' />
|
||||
{URLs.armMaster.isOn && (
|
||||
<Button
|
||||
as={Link}
|
||||
to={URLs.armMaster.url}
|
||||
colorScheme={isActive(URLs.armMaster.url) ? 'green' : 'blue'}
|
||||
variant={isActive(URLs.armMaster.url) ? 'outline' : 'ghost'}
|
||||
data-testid='master-button'
|
||||
>
|
||||
{t('master')}
|
||||
</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>
|
||||
</Flex>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
export default Header;
|
||||
1
src/components/Header/index.ts
Normal file
1
src/components/Header/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { default } from './Header';
|
||||
@@ -2,10 +2,11 @@ import { Box, Flex } from '@chakra-ui/react';
|
||||
import React from 'react';
|
||||
import { Navigate, Route, Routes } from 'react-router-dom';
|
||||
|
||||
import Sidebar from '../Sidebar';
|
||||
import Orders from '../Orders';
|
||||
import Masters from '../Masters';
|
||||
import { URLs } from '../../__data__/urls';
|
||||
import Header from '../Header';
|
||||
import OrdersMap from '../Map';
|
||||
|
||||
const LayoutArm = () => {
|
||||
let defaultRedirect = null;
|
||||
@@ -17,8 +18,8 @@ const LayoutArm = () => {
|
||||
}
|
||||
|
||||
return (
|
||||
<Flex h='100vh'>
|
||||
<Sidebar />
|
||||
<Flex flexDirection='column' h='100vh'>
|
||||
<Header />
|
||||
<Box flex='1' bg='gray.50'>
|
||||
<Routes>
|
||||
<Route index element={<Navigate to={defaultRedirect} replace />} />
|
||||
@@ -28,6 +29,9 @@ const LayoutArm = () => {
|
||||
{URLs.armMaster.isOn && (
|
||||
<Route path={URLs.armMaster.url} element={<Masters />} />
|
||||
)}
|
||||
{URLs.armMap.isOn && (
|
||||
<Route path={URLs.armMap.url} element={<OrdersMap />} />
|
||||
)}
|
||||
</Routes>
|
||||
</Box>
|
||||
</Flex>
|
||||
|
||||
82
src/components/Map/Map.tsx
Normal file
82
src/components/Map/Map.tsx
Normal file
@@ -0,0 +1,82 @@
|
||||
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;
|
||||
1
src/components/Map/index.ts
Normal file
1
src/components/Map/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { default } from './Map';
|
||||
@@ -1,17 +1,20 @@
|
||||
import React, { ChangeEvent, useState } from 'react';
|
||||
import { Td, Tr, Link, Select } from '@chakra-ui/react';
|
||||
import { Td, Tr, Link, Select, Button } from '@chakra-ui/react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import dayjs from 'dayjs';
|
||||
import { ViewIcon } from '@chakra-ui/icons';
|
||||
import { Link as LinkRouter } from 'react-router-dom';
|
||||
|
||||
import { getTimeSlot } from '../../lib';
|
||||
import { useUpdateOrdersMutation } from '../../__data__/service/api';
|
||||
import { OrderArm, Status, statuses } from '../../models/api';
|
||||
import getCoordinates from '../../utils/getCoordinates';
|
||||
import { URLs } from '../../__data__/urls';
|
||||
|
||||
const statusColors: Record<Status, string> = {
|
||||
pending: 'yellow.100',
|
||||
progress: 'blue.100',
|
||||
working: 'orange.100',
|
||||
canceled: 'red.100',
|
||||
cancelled: 'red.100',
|
||||
complete: 'green.100',
|
||||
};
|
||||
|
||||
@@ -26,6 +29,7 @@ const OrderItem = ({
|
||||
master,
|
||||
allMasters,
|
||||
id,
|
||||
currentDate,
|
||||
}: OrderArm) => {
|
||||
const [updateOrders] = useUpdateOrdersMutation();
|
||||
const { t } = useTranslation('~', {
|
||||
@@ -34,7 +38,7 @@ const OrderItem = ({
|
||||
|
||||
const [statusSelect, setStatus] = useState(status);
|
||||
const bgColor = statusColors[statusSelect];
|
||||
const [masterSelect, setMaster] = useState(master?.name);
|
||||
const [masterSelectId, setMasterSelectId] = useState(master);
|
||||
|
||||
const handelChangeMasters = (e: ChangeEvent<HTMLSelectElement>) => {
|
||||
const masterName = e.target.value;
|
||||
@@ -43,7 +47,7 @@ const OrderItem = ({
|
||||
);
|
||||
|
||||
if (selectedMaster) {
|
||||
setMaster(masterName);
|
||||
setMasterSelectId(selectedMaster.id);
|
||||
updateOrders({ id, master: selectedMaster.id });
|
||||
} else {
|
||||
console.error('Master not found');
|
||||
@@ -56,6 +60,12 @@ const OrderItem = ({
|
||||
setStatus(status);
|
||||
};
|
||||
|
||||
const masterSelectChange = allMasters.find(
|
||||
(master) => master.id === masterSelectId,
|
||||
);
|
||||
|
||||
const { lat = 55.78, lon = 49.12 } = getCoordinates(location);
|
||||
|
||||
return (
|
||||
<Tr>
|
||||
<Td>{carNumber}</Td>
|
||||
@@ -79,7 +89,7 @@ const OrderItem = ({
|
||||
</Td>
|
||||
<Td>
|
||||
<Select
|
||||
value={masterSelect}
|
||||
value={masterSelectChange?.name}
|
||||
onChange={handelChangeMasters}
|
||||
placeholder={t(`master.placeholder`)}
|
||||
>
|
||||
@@ -93,7 +103,14 @@ const OrderItem = ({
|
||||
<Td>
|
||||
<Link href='tel:'>{phone}</Link>
|
||||
</Td>
|
||||
<Td>{location}</Td>
|
||||
<Td>
|
||||
<Button
|
||||
as={LinkRouter}
|
||||
to={URLs.armMap.getUrl({ lat, lon, currentDate })}
|
||||
>
|
||||
<ViewIcon />
|
||||
</Button>
|
||||
</Td>
|
||||
</Tr>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -112,6 +112,7 @@ const Orders = () => {
|
||||
key={index}
|
||||
{...order}
|
||||
status={order.status as OrderArm['status']}
|
||||
currentDate={currentDate}
|
||||
/>
|
||||
))}
|
||||
</Tbody>
|
||||
|
||||
35
src/components/PopoverTemplate/PopoverTemplate.tsx
Normal file
35
src/components/PopoverTemplate/PopoverTemplate.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
import React from 'react';
|
||||
import {
|
||||
Button,
|
||||
Popover,
|
||||
PopoverArrow,
|
||||
PopoverBody,
|
||||
PopoverCloseButton,
|
||||
PopoverContent,
|
||||
PopoverHeader,
|
||||
PopoverTrigger,
|
||||
} from '@chakra-ui/react';
|
||||
|
||||
interface Props {
|
||||
title?: string;
|
||||
description: string;
|
||||
trigger?: React.ReactNode;
|
||||
}
|
||||
|
||||
const PopoverTemplate = ({ title, description, trigger }: Props) => {
|
||||
return (
|
||||
<Popover>
|
||||
<PopoverTrigger>
|
||||
<Button>{trigger}</Button>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent>
|
||||
<PopoverArrow />
|
||||
<PopoverCloseButton />
|
||||
{title && <PopoverHeader>{title}!</PopoverHeader>}
|
||||
<PopoverBody mr={5}>{description}</PopoverBody>
|
||||
</PopoverContent>
|
||||
</Popover>
|
||||
);
|
||||
};
|
||||
|
||||
export default PopoverTemplate;
|
||||
1
src/components/PopoverTemplate/index.ts
Normal file
1
src/components/PopoverTemplate/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { default } from './PopoverTemplate';
|
||||
48
src/components/PriceCar/PriceCar.tsx
Normal file
48
src/components/PriceCar/PriceCar.tsx
Normal file
@@ -0,0 +1,48 @@
|
||||
import { Box, Image, Progress, Text } from '@chakra-ui/react';
|
||||
import React from 'react';
|
||||
import { getFeatures } from '@brojs/cli';
|
||||
|
||||
const PRICE_INCREASE_PERCENT_PER_RATING = 10; // 10% за каждый балл
|
||||
|
||||
export const PriceCar = ({ image, rating }) => {
|
||||
const BASE_WASH_PRICE: number = Number(
|
||||
getFeatures('dry-wash')['order-cost']?.value || 1000,
|
||||
);
|
||||
|
||||
const calculateWashPrice = (rating: number) => {
|
||||
const priceIncrease =
|
||||
(BASE_WASH_PRICE * PRICE_INCREASE_PERCENT_PER_RATING * rating) / 100;
|
||||
return BASE_WASH_PRICE + priceIncrease;
|
||||
};
|
||||
|
||||
const washPrice = calculateWashPrice(rating);
|
||||
const progressValue = (rating / 10) * 100;
|
||||
return (
|
||||
<Box
|
||||
alignItems='center'
|
||||
gap={5}
|
||||
width='100%'
|
||||
display='flex'
|
||||
flexDirection='column'
|
||||
>
|
||||
<Image
|
||||
maxWidth='600px'
|
||||
objectFit='contain'
|
||||
borderRadius='md'
|
||||
src={image}
|
||||
alt='Car Image'
|
||||
/>
|
||||
{rating ? (
|
||||
<Box width='100%' maxW='600px'>
|
||||
<Text>Рейтинг загрязнения машины:</Text>
|
||||
<Progress value={progressValue} size='sm' colorScheme='red' mt={2} />
|
||||
<Text mt={2}>Стоимость мойки: {washPrice.toFixed(2)} руб.</Text>
|
||||
</Box>
|
||||
) : (
|
||||
<Text>Не удалость определить уровень загрязнения машины</Text>
|
||||
)}
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
export default PriceCar;
|
||||
1
src/components/PriceCar/index.ts
Normal file
1
src/components/PriceCar/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { default } from './PriceCar';
|
||||
@@ -1,61 +0,0 @@
|
||||
import { Box, Button, Heading, VStack, Divider } from '@chakra-ui/react';
|
||||
import React from 'react';
|
||||
import { useLocation, Link } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { URLs } from '../../__data__/urls';
|
||||
|
||||
const Sidebar = () => {
|
||||
const location = useLocation();
|
||||
const isActive = (keyword: string) => location.pathname.includes(keyword);
|
||||
|
||||
const { t } = useTranslation('~', {
|
||||
keyPrefix: 'dry-wash.arm.master.sideBar',
|
||||
});
|
||||
|
||||
return (
|
||||
<Box
|
||||
borderRight='1px solid black'
|
||||
bg='gray.50'
|
||||
color='white'
|
||||
w='250px'
|
||||
p='5'
|
||||
pt='8'
|
||||
>
|
||||
<Heading color='green' size='lg' mb='5'>
|
||||
{t('title')}
|
||||
</Heading>
|
||||
|
||||
<VStack align='start' spacing='4'>
|
||||
<Divider />
|
||||
{URLs.armOrder.isOn && (
|
||||
<Button
|
||||
as={Link}
|
||||
to={URLs.armOrder.url}
|
||||
w='100%'
|
||||
colorScheme={isActive(URLs.armOrder.url) ? 'green' : 'blue'}
|
||||
variant={isActive(URLs.armOrder.url) ? 'solid' : 'ghost'}
|
||||
>
|
||||
{t('orders')}
|
||||
</Button>
|
||||
)}
|
||||
<Divider />
|
||||
{URLs.armMaster.isOn && (
|
||||
<Button
|
||||
as={Link}
|
||||
to={URLs.armMaster.url}
|
||||
w='100%'
|
||||
colorScheme={isActive(URLs.armMaster.url) ? 'green' : 'blue'}
|
||||
variant={isActive(URLs.armMaster.url) ? 'solid' : 'ghost'}
|
||||
data-testid='master-button'
|
||||
>
|
||||
{t('master')}
|
||||
</Button>
|
||||
)}
|
||||
<Divider />
|
||||
</VStack>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
export default Sidebar;
|
||||
@@ -1 +0,0 @@
|
||||
export { default } from './Sidebar';
|
||||
102
src/components/order-view/car-img/car-img-form.tsx
Normal file
102
src/components/order-view/car-img/car-img-form.tsx
Normal file
@@ -0,0 +1,102 @@
|
||||
import React, { FC, memo, useRef } from 'react';
|
||||
import { Controller, useForm } from 'react-hook-form';
|
||||
import {
|
||||
Button,
|
||||
FormControl,
|
||||
FormErrorMessage,
|
||||
FormHelperText,
|
||||
FormLabel,
|
||||
HStack,
|
||||
Input,
|
||||
} from '@chakra-ui/react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { landingApi } from '../../../__data__/service/landing.api';
|
||||
import { UploadCarImage } from '../../../models/api';
|
||||
|
||||
import { useHandleUploadCarImageResponse } from './helper';
|
||||
|
||||
type FormValues = {
|
||||
carImg: File & {
|
||||
fileName: string;
|
||||
};
|
||||
};
|
||||
|
||||
type CarImageFormProps = {
|
||||
orderId: UploadCarImage.Params['orderId'];
|
||||
};
|
||||
|
||||
export const CarImageForm: FC<CarImageFormProps> = memo(function CarImageForm({
|
||||
orderId,
|
||||
}) {
|
||||
const {
|
||||
handleSubmit,
|
||||
control,
|
||||
formState: { errors, isSubmitting },
|
||||
} = useForm<FormValues>({ shouldFocusError: true });
|
||||
|
||||
const [uploadCarImage, uploadCarImageMutation] =
|
||||
landingApi.useUploadCarImageMutation();
|
||||
useHandleUploadCarImageResponse(uploadCarImageMutation);
|
||||
|
||||
const onSubmit = (formData: FormValues) => {
|
||||
const body = new FormData();
|
||||
body.append('file', formData.carImg);
|
||||
uploadCarImage({ orderId, body });
|
||||
};
|
||||
|
||||
const fileInputRef = useRef(null);
|
||||
|
||||
const { t } = useTranslation('~', {
|
||||
keyPrefix: 'dry-wash.order-view.upload-car-image',
|
||||
});
|
||||
|
||||
return (
|
||||
<form>
|
||||
<FormControl>
|
||||
<FormLabel htmlFor='carImg'>{t('field.label')}</FormLabel>
|
||||
<Controller
|
||||
control={control}
|
||||
name='carImg'
|
||||
render={({ field: { value, onChange, ...field } }) => {
|
||||
return (
|
||||
<HStack gap={0}>
|
||||
<Input
|
||||
{...field}
|
||||
ref={fileInputRef}
|
||||
accept='image/png,image/jpeg'
|
||||
value={value?.fileName}
|
||||
onChange={(event) => {
|
||||
onChange(event.target.files[0]);
|
||||
handleSubmit(onSubmit)();
|
||||
}}
|
||||
type='file'
|
||||
hidden
|
||||
/>
|
||||
<Input
|
||||
placeholder={t('file-input.placeholder')}
|
||||
value={value?.name || ''}
|
||||
readOnly
|
||||
borderRightRadius={0}
|
||||
/>
|
||||
<Button
|
||||
onClick={() => {
|
||||
fileInputRef.current.click();
|
||||
}}
|
||||
isLoading={isSubmitting || uploadCarImageMutation.isLoading}
|
||||
colorScheme='primary'
|
||||
paddingInline={8}
|
||||
borderLeftRadius={0}
|
||||
>
|
||||
{t('file-input.button')}
|
||||
</Button>
|
||||
</HStack>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
<FormErrorMessage>{errors.carImg?.message}</FormErrorMessage>
|
||||
<FormHelperText>{t('field.help')}</FormHelperText>
|
||||
</FormControl>
|
||||
</form>
|
||||
);
|
||||
});
|
||||
35
src/components/order-view/car-img/helper.ts
Normal file
35
src/components/order-view/car-img/helper.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { useEffect } from "react";
|
||||
import { useToast } from "@chakra-ui/react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { isErrorMessage } from "../../../models/api";
|
||||
|
||||
export const useHandleUploadCarImageResponse = (query: {
|
||||
isSuccess: boolean;
|
||||
isError: boolean;
|
||||
error?: unknown;
|
||||
}) => {
|
||||
const toast = useToast();
|
||||
const { t } = useTranslation('~', {
|
||||
keyPrefix: 'dry-wash.order-view.upload-car-image-query',
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (query.isError) {
|
||||
toast({
|
||||
status: 'error',
|
||||
title: t('error.title'),
|
||||
description: isErrorMessage(query.error) ? query.error : undefined,
|
||||
});
|
||||
}
|
||||
}, [query.isError]);
|
||||
|
||||
useEffect(() => {
|
||||
if (query.isSuccess) {
|
||||
toast({
|
||||
status: 'success',
|
||||
title: t('success.title'),
|
||||
});
|
||||
}
|
||||
}, [query.isSuccess]);
|
||||
};
|
||||
1
src/components/order-view/car-img/index.ts
Normal file
1
src/components/order-view/car-img/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { CarImageForm } from './car-img-form';
|
||||
@@ -5,11 +5,13 @@ import {
|
||||
Heading,
|
||||
HStack,
|
||||
UnorderedList,
|
||||
VStack,
|
||||
ListItem,
|
||||
Text,
|
||||
} from '@chakra-ui/react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import dayjs from 'dayjs';
|
||||
import localizedFormat from "dayjs/plugin/localizedFormat";
|
||||
dayjs.extend(localizedFormat);
|
||||
|
||||
import { Order } from '../../../models/landing';
|
||||
import { formatDatetime } from '../../../lib';
|
||||
@@ -41,7 +43,7 @@ export const OrderDetails: FC<OrderDetailsProps> = ({
|
||||
location,
|
||||
startWashTime,
|
||||
endWashTime,
|
||||
...props
|
||||
created
|
||||
}) => {
|
||||
const { t } = useTranslation('~', {
|
||||
keyPrefix: 'dry-wash.order-view.details',
|
||||
@@ -51,7 +53,7 @@ export const OrderDetails: FC<OrderDetailsProps> = ({
|
||||
});
|
||||
|
||||
return (
|
||||
<VStack p={4} alignItems='flex-start' gap={4} {...props}>
|
||||
<>
|
||||
<HStack
|
||||
width='full'
|
||||
flexWrap='wrap'
|
||||
@@ -59,7 +61,7 @@ export const OrderDetails: FC<OrderDetailsProps> = ({
|
||||
gap={2}
|
||||
>
|
||||
<Heading as='h2' size='lg'>
|
||||
{t('title', { number: orderNumber })}
|
||||
{t('title', { number: orderNumber })} ({dayjs(created).format('LLLL')})
|
||||
</Heading>
|
||||
<OrderStatus value={status} />
|
||||
</HStack>
|
||||
@@ -105,7 +107,7 @@ export const OrderDetails: FC<OrderDetailsProps> = ({
|
||||
<AlertIcon />
|
||||
{t('alert')}
|
||||
</Alert>
|
||||
</VStack>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ export const isErrorMessage = (error: unknown): error is ErrorMessage => typeof
|
||||
|
||||
type ErrorResponse = {
|
||||
success: false;
|
||||
message: ErrorMessage;
|
||||
error: ErrorMessage;
|
||||
};
|
||||
|
||||
export type BaseResponse<Body> = SuccessResponse<Body> | ErrorResponse;
|
||||
|
||||
@@ -21,14 +21,24 @@ export namespace CreateOrder {
|
||||
};
|
||||
}
|
||||
|
||||
export namespace UploadCarImage {
|
||||
export type Response = void;
|
||||
export type Params = {
|
||||
orderId: Order.Id;
|
||||
/**
|
||||
* @example { file: File }
|
||||
*/
|
||||
body: FormData;
|
||||
};
|
||||
}
|
||||
|
||||
type GetArrItemType<ArrType> =
|
||||
ArrType extends Array<infer ItemType> ? ItemType : never;
|
||||
|
||||
export const statuses = [
|
||||
'pending' as const,
|
||||
'progress' as const,
|
||||
'working' as const,
|
||||
'canceled' as const,
|
||||
'cancelled' as const,
|
||||
'complete' as const,
|
||||
];
|
||||
|
||||
@@ -42,8 +52,9 @@ export type OrderArm = {
|
||||
status?: GetArrItemType<typeof statuses>;
|
||||
phone?: string;
|
||||
location?: string;
|
||||
master: Master;
|
||||
master: string | [];
|
||||
notes: '';
|
||||
allMasters: Master[];
|
||||
id: string;
|
||||
currentDate: Date;
|
||||
};
|
||||
|
||||
@@ -1,29 +1,30 @@
|
||||
import { IsoDate } from "../common";
|
||||
import { IsoDate } from '../common';
|
||||
|
||||
import { Car, Customer, Washing } from ".";
|
||||
import { Car, Customer, Washing } from '.';
|
||||
|
||||
export type Id = string;
|
||||
|
||||
export type Status = 'pending' |
|
||||
'progress' |
|
||||
'working' |
|
||||
'canceled' |
|
||||
'complete';
|
||||
export type Status =
|
||||
| 'pending'
|
||||
| 'progress'
|
||||
| 'working'
|
||||
| 'canceled'
|
||||
| 'complete';
|
||||
|
||||
export type Create = {
|
||||
customer: {
|
||||
phone: Customer.PhoneNumber,
|
||||
phone: Customer.PhoneNumber;
|
||||
};
|
||||
car: {
|
||||
number: Car.RegistrationNumber,
|
||||
body: Car.BodyStyle,
|
||||
color: Car.Color,
|
||||
},
|
||||
number: Car.RegistrationNumber;
|
||||
body: Car.BodyStyle;
|
||||
color: Car.Color;
|
||||
};
|
||||
washing: {
|
||||
location: Washing.Location
|
||||
begin: Washing.AvailableBeginDateTime,
|
||||
end: Washing.AvailableEndDateTime,
|
||||
}
|
||||
location: Washing.Location;
|
||||
begin: Washing.AvailableBeginDateTime;
|
||||
end: Washing.AvailableEndDateTime;
|
||||
};
|
||||
};
|
||||
|
||||
export type Number = string;
|
||||
@@ -36,10 +37,12 @@ export type View = {
|
||||
location: Washing.Location;
|
||||
startWashTime: Washing.AvailableBeginDateTime;
|
||||
endWashTime: Washing.AvailableEndDateTime;
|
||||
orderNumber: Number,
|
||||
status: Status,
|
||||
orderNumber: Number;
|
||||
status: Status;
|
||||
notes: string;
|
||||
created: IsoDate;
|
||||
updated: IsoDate;
|
||||
id: Id;
|
||||
};
|
||||
image?: string;
|
||||
imageRating?: string;
|
||||
};
|
||||
|
||||
@@ -16,7 +16,6 @@ exports[`Страница просмотра заказа отображает
|
||||
</h2>
|
||||
<div
|
||||
class="chakra-stack css-1n38vgh"
|
||||
created="2025-01-19T14:04:02.985Z"
|
||||
data-testid="order-details"
|
||||
>
|
||||
<div
|
||||
@@ -26,6 +25,9 @@ exports[`Страница просмотра заказа отображает
|
||||
class="chakra-heading css-1jb3vzl"
|
||||
>
|
||||
Заказ №{{number}}
|
||||
(
|
||||
Sunday, January 19, 2025 5:04 PM
|
||||
)
|
||||
</h2>
|
||||
<span
|
||||
class="css-6jfsiv"
|
||||
|
||||
@@ -75,7 +75,7 @@ exports[`Страница заказов должна корректно ото
|
||||
<p
|
||||
class="chakra-text css-52ukzg"
|
||||
>
|
||||
20.02.2025
|
||||
23.02.2025
|
||||
</p>
|
||||
<button
|
||||
class="chakra-button css-ez23ye"
|
||||
|
||||
@@ -21,6 +21,8 @@ import { Order } from '../../models/landing';
|
||||
import { landingApi } from '../../__data__/service/landing.api';
|
||||
import { isErrorMessage } from '../../models/api';
|
||||
import { FEATURE } from '../../__data__/features';
|
||||
import { CarImageForm } from '../../components/order-view/car-img';
|
||||
import PriceCar from '../../components/PriceCar';
|
||||
|
||||
const Page: FC = () => {
|
||||
const { t } = useTranslation('~', {
|
||||
@@ -69,24 +71,43 @@ const Page: FC = () => {
|
||||
<>
|
||||
<>
|
||||
{isSuccess && (
|
||||
<OrderDetails
|
||||
orderNumber={order.orderNumber}
|
||||
status={order.status}
|
||||
phone={order.phone}
|
||||
carNumber={order.carNumber}
|
||||
carBody={order.carBody}
|
||||
carColor={order.carColor}
|
||||
location={order.location}
|
||||
startWashTime={order.startWashTime}
|
||||
endWashTime={order.endWashTime}
|
||||
created={order.created}
|
||||
<VStack
|
||||
p={4}
|
||||
alignItems='flex-start'
|
||||
gap={4}
|
||||
data-testid='order-details'
|
||||
/>
|
||||
>
|
||||
<OrderDetails
|
||||
orderNumber={order.orderNumber}
|
||||
status={order.status}
|
||||
phone={order.phone}
|
||||
carNumber={order.carNumber}
|
||||
carBody={order.carBody}
|
||||
carColor={order.carColor}
|
||||
location={order.location}
|
||||
startWashTime={order.startWashTime}
|
||||
endWashTime={order.endWashTime}
|
||||
created={order.created}
|
||||
/>
|
||||
{FEATURE.carImageUpload.isOn && (
|
||||
<CarImageForm orderId={orderId} />
|
||||
)}
|
||||
{FEATURE.carImageUpload.isOn && order.image && (
|
||||
<PriceCar
|
||||
image={order?.image}
|
||||
rating={order?.imageRating}
|
||||
/>
|
||||
)}
|
||||
</VStack>
|
||||
)}
|
||||
</>
|
||||
<>
|
||||
{isError && (
|
||||
<Alert status='error' alignItems='flex-start' data-testid='error'>
|
||||
<Alert
|
||||
status='error'
|
||||
alignItems='flex-start'
|
||||
data-testid='error'
|
||||
>
|
||||
<AlertIcon />
|
||||
<Box>
|
||||
<AlertTitle>
|
||||
|
||||
13
src/utils/getCoordinates.ts
Normal file
13
src/utils/getCoordinates.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
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;
|
||||
@@ -2,7 +2,7 @@
|
||||
/* eslint-disable @typescript-eslint/no-require-imports */
|
||||
const router = require('express').Router();
|
||||
|
||||
const STUBS = { masters: 'success', orders: 'success', orderCreate: 'success', orderView: 'success-pending' };
|
||||
const STUBS = { masters: 'success', orders: 'success', orderCreate: 'success', orderView: 'success-pending', orderCarImg: 'success' };
|
||||
|
||||
router.get('/set/:name/:value', (req, res) => {
|
||||
const { name, value } = req.params;
|
||||
@@ -15,28 +15,34 @@ router.get('/set/:name/:value', (req, res) => {
|
||||
router.get('/', (req, res) => {
|
||||
res.send(`<div>
|
||||
<fieldset>
|
||||
<legend>Мастера</legend>
|
||||
<legend>Мастера</legend>
|
||||
${generateRadioInput('masters', 'success')}
|
||||
${generateRadioInput('masters', 'error')}
|
||||
${generateRadioInput('masters', 'empty')}
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>Заказы</legend>
|
||||
<legend>Заказы</legend>
|
||||
${generateRadioInput('orders', 'success')}
|
||||
${generateRadioInput('orders', 'error')}
|
||||
${generateRadioInput('orders', 'empty')}
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>Лендинг - Сделать заказ</legend>
|
||||
<legend>Лендинг - Сделать заказ</legend>
|
||||
${generateRadioInput('orderCreate', 'success')}
|
||||
${generateRadioInput('orderCreate', 'error')}
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>Лендинг - Детали заказа</legend>
|
||||
<legend>Лендинг - Детали заказа</legend>
|
||||
${generateRadioInput('orderView', 'success-pending')}
|
||||
${generateRadioInput('orderView', 'success-working')}
|
||||
${generateRadioInput('orderView', 'error')}
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>Лендинг - Детали заказа, фото машины</legend>
|
||||
${generateRadioInput('orderCarImg', 'success')}
|
||||
${generateRadioInput('orderCarImg', 'error-file-type')}
|
||||
${generateRadioInput('orderCarImg', 'error-file-size')}
|
||||
</fieldset>
|
||||
</div>`);
|
||||
});
|
||||
|
||||
|
||||
@@ -98,6 +98,22 @@ router.post('/order/create', (req, res) => {
|
||||
);
|
||||
});
|
||||
|
||||
router.post('/order/:orderId/upload-car-img', (req, res) => {
|
||||
const { orderId } = req.params;
|
||||
const stubName = `${orderId}-${STUBS.orderCarImg}`;
|
||||
|
||||
try {
|
||||
res
|
||||
.status(/error/.test(stubName) ? 500 : 200)
|
||||
.send(require(`../json/landing-order-car-image-upload/${stubName}.json`));
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
res
|
||||
.status(500)
|
||||
.send(commonError);
|
||||
}
|
||||
});
|
||||
|
||||
router.use('/admin', require('./admin'));
|
||||
|
||||
module.exports = router;
|
||||
|
||||
@@ -9,12 +9,8 @@
|
||||
"orderDate": "2024-11-24T08:41:46.366Z",
|
||||
"status": "pending",
|
||||
"phone": "79001234563",
|
||||
"location": "Казань, ул. Баумана, 1",
|
||||
"master": {
|
||||
"name": "Олег Макаров",
|
||||
"phone": "79001234567",
|
||||
"id": "23423442"
|
||||
},
|
||||
"location": "55.779905316526424,49.12446113769528 Республика Татарстан (Татарстан),н Казань, ул. Баумана, 1",
|
||||
"master": "4545423234",
|
||||
"notes": ""
|
||||
},
|
||||
{
|
||||
@@ -25,7 +21,7 @@
|
||||
"orderDate": "2024-11-24T07:40:46.366Z",
|
||||
"status": "progress",
|
||||
"phone": "79001234567",
|
||||
"location": "Казань, ул. Баумана, 43",
|
||||
"location": "55.75060416346278,48.746329576898944 Республика Татарстан (Татарстан), Верхнеуслонский район, Иннополис",
|
||||
"master": [],
|
||||
"notes": ""
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"success": false,
|
||||
"error": "Invalid car image file size. Limit is 5MB"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"success": false,
|
||||
"error": "Invalid car image file type. Allowed types: jpg, png"
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"success": true
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"success": false,
|
||||
"message": "Не удалось создать заказ"
|
||||
"error": "Не удалось создать заказ"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"success": false,
|
||||
"message": "Не удалось загрузить детали заказа"
|
||||
"error": "Не удалось загрузить детали заказа"
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -15,4 +15,4 @@
|
||||
"updated": "2025-01-19T14:04:02.987Z",
|
||||
"id": "id1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user