From 3d52ef9d4cd7f322c5f6c3b7213d60fd9ca928a2 Mon Sep 17 00:00:00 2001 From: Andrey Ivlev Date: Fri, 13 Dec 2024 22:05:42 +0300 Subject: [PATCH] feat: freetracker dashboard-performer stubs --- server/index.js | 1 + .../freetracker/dashboard-performer/index.js | 23 +++ .../json/active-order-error.json | 6 + .../json/active-order-success.json | 46 +++++ .../json/history-error.json | 9 + .../json/history-success.json | 187 ++++++++++++++++++ server/routers/freetracker/index.js | 5 + 7 files changed, 277 insertions(+) create mode 100644 server/routers/freetracker/dashboard-performer/index.js create mode 100644 server/routers/freetracker/dashboard-performer/json/active-order-error.json create mode 100644 server/routers/freetracker/dashboard-performer/json/active-order-success.json create mode 100644 server/routers/freetracker/dashboard-performer/json/history-error.json create mode 100644 server/routers/freetracker/dashboard-performer/json/history-success.json create mode 100644 server/routers/freetracker/index.js diff --git a/server/index.js b/server/index.js index aaa41f8..43f10d7 100644 --- a/server/index.js +++ b/server/index.js @@ -48,6 +48,7 @@ app.use('/dogsitters-finder', require('./routers/dogsitters-finder')) app.use('/kazan-explore', require('./routers/kazan-explore')) app.use('/edateam', require('./routers/edateam-legacy')) app.use('/dry-wash', require('./routers/dry-wash')) +app.use('/freetracker', require('./routers/freetracker')) app.use(require('./error')) diff --git a/server/routers/freetracker/dashboard-performer/index.js b/server/routers/freetracker/dashboard-performer/index.js new file mode 100644 index 0000000..09e0cb3 --- /dev/null +++ b/server/routers/freetracker/dashboard-performer/index.js @@ -0,0 +1,23 @@ +const Router = require('express').Router; + +const router = Router() + +const timer = (_req, _res, next) => { + setTimeout(() => next(), 500) +} + +router.use(timer) + +router.get( + '/active', + (req, res) => + res.send(require(`./json/active-order-success.json`)) +) + +router.get( + '/history', + (req, res) => + res.send(require(`./json/history-success.json`)) +) + +module.exports = router \ No newline at end of file diff --git a/server/routers/freetracker/dashboard-performer/json/active-order-error.json b/server/routers/freetracker/dashboard-performer/json/active-order-error.json new file mode 100644 index 0000000..d98f116 --- /dev/null +++ b/server/routers/freetracker/dashboard-performer/json/active-order-error.json @@ -0,0 +1,6 @@ +{ + "success": false, + "errors": [ + "Не получилось получить заказ с id = 123123" + ] +} \ No newline at end of file diff --git a/server/routers/freetracker/dashboard-performer/json/active-order-success.json b/server/routers/freetracker/dashboard-performer/json/active-order-success.json new file mode 100644 index 0000000..c41225e --- /dev/null +++ b/server/routers/freetracker/dashboard-performer/json/active-order-success.json @@ -0,0 +1,46 @@ +{ + "success": true, + "body": { + "id": "1212", + "createdAt": "2024-11-29 13:24:08", + "updatedAt": "2024-11-29 13:24:10", + "status": "in_progress", + "timeline": [ + { + "color": "gray", + "children": "Москва" + }, + { + "children": "Владимир, 25.10.2024 18:02" + }, + { + "children": "Нижний новгород, 25.10.2024 12:21" + }, + { + "children": "Казань, 25.10.2024 03:00" + } + ], + "statistics": [ + { + "key": "address-from", + "value": "г. Казань, ул Ильи Давыдова, стр. 87а" + }, + { + "key": "address-to", + "value": "г. Москва, ул. Тверская, д. 12" + }, + { + "key": "delivery", + "value": "26.10.2024 23:08" + }, + { + "key": "cost", + "value": "100500₽" + }, + { + "key": "customer", + "value": "ООО \"Сидоров\"" + } + ] + } +} \ No newline at end of file diff --git a/server/routers/freetracker/dashboard-performer/json/history-error.json b/server/routers/freetracker/dashboard-performer/json/history-error.json new file mode 100644 index 0000000..45f09a6 --- /dev/null +++ b/server/routers/freetracker/dashboard-performer/json/history-error.json @@ -0,0 +1,9 @@ +{ + "success": false, + "body": { + "history": [] + }, + "errors": [ + "Что-то пошло не так" + ] +} \ No newline at end of file diff --git a/server/routers/freetracker/dashboard-performer/json/history-success.json b/server/routers/freetracker/dashboard-performer/json/history-success.json new file mode 100644 index 0000000..20d26be --- /dev/null +++ b/server/routers/freetracker/dashboard-performer/json/history-success.json @@ -0,0 +1,187 @@ +{ + "success": true, + "body": { + "history": [ + { + "key": 1, + "number": "12324", + "cost": 15000, + "dateEnd": 1685998800000, + "customer": "ООО \"Иванов\"", + "cityFrom": "Псков", + "cityTo": "Мурманск" + }, + { + "key": 2, + "number": "12323", + "cost": 10000, + "dateEnd": 1686085200000, + "customer": "ООО \"Попов\"", + "cityFrom": "Астрахань", + "cityTo": "Ставрополь" + }, + { + "key": 3, + "number": "12325", + "cost": 12000, + "dateEnd": 1686171600000, + "customer": "ООО \"Сидоров\"", + "cityFrom": "Москва", + "cityTo": "Казань" + }, + { + "key": 4, + "number": "12326", + "cost": 9000, + "dateEnd": 1686258000000, + "customer": "ООО \"Петров\"", + "cityFrom": "Новосибирск", + "cityTo": "Томск" + }, + { + "key": 5, + "number": "12327", + "cost": 13000, + "dateEnd": 1686344400000, + "customer": "ООО \"Смирнов\"", + "cityFrom": "Омск", + "cityTo": "Тюмень" + }, + { + "key": 6, + "number": "12328", + "cost": 14000, + "dateEnd": 1686430800000, + "customer": "ООО \"Кузнецов\"", + "cityFrom": "Саратов", + "cityTo": "Самара" + }, + { + "key": 7, + "number": "12329", + "cost": 11000, + "dateEnd": 1686517200000, + "customer": "ООО \"Васильев\"", + "cityFrom": "Краснодар", + "cityTo": "Сочи" + }, + { + "key": 8, + "number": "12330", + "cost": 8000, + "dateEnd": 1686603600000, + "customer": "ООО \"Зайцев\"", + "cityFrom": "Пермь", + "cityTo": "Екатеринбург" + }, + { + "key": 9, + "number": "12331", + "cost": 7000, + "dateEnd": 1686690000000, + "customer": "ООО \"Морозов\"", + "cityFrom": "Челябинск", + "cityTo": "Уфа" + }, + { + "key": 10, + "number": "12332", + "cost": 16000, + "dateEnd": 1686776400000, + "customer": "ООО \"Павлов\"", + "cityFrom": "Волгоград", + "cityTo": "Ростов-на-Дону" + }, + { + "key": 11, + "number": "12333", + "cost": 9000, + "dateEnd": 1686862800000, + "customer": "ООО \"Фролов\"", + "cityFrom": "Калининград", + "cityTo": "Смоленск" + }, + { + "key": 12, + "number": "12334", + "cost": 15500, + "dateEnd": 1686949200000, + "customer": "ООО \"Богданов\"", + "cityFrom": "Нижний Новгород", + "cityTo": "Киров" + }, + { + "key": 13, + "number": "12335", + "cost": 13500, + "dateEnd": 1687035600000, + "customer": "ООО \"Григорьев\"", + "cityFrom": "Тверь", + "cityTo": "Ярославль" + }, + { + "key": 14, + "number": "12336", + "cost": 12500, + "dateEnd": 1687122000000, + "customer": "ООО \"Дмитриев\"", + "cityFrom": "Сургут", + "cityTo": "Ханты-Мансийск" + }, + { + "key": 15, + "number": "12337", + "cost": 14500, + "dateEnd": 1687208400000, + "customer": "ООО \"Михайлов\"", + "cityFrom": "Иркутск", + "cityTo": "Братск" + }, + { + "key": 16, + "number": "12338", + "cost": 10500, + "dateEnd": 1687294800000, + "customer": "ООО \"Романов\"", + "cityFrom": "Владивосток", + "cityTo": "Хабаровск" + }, + { + "key": 17, + "number": "12339", + "cost": 9500, + "dateEnd": 1687381200000, + "customer": "ООО \"Федоров\"", + "cityFrom": "Якутск", + "cityTo": "Магадан" + }, + { + "key": 18, + "number": "12340", + "cost": 8500, + "dateEnd": 1687467600000, + "customer": "ООО \"Жуков\"", + "cityFrom": "Симферополь", + "cityTo": "Севастополь" + }, + { + "key": 19, + "number": "12341", + "cost": 11500, + "dateEnd": 1687554000000, + "customer": "ООО \"Николаев\"", + "cityFrom": "Барнаул", + "cityTo": "Бийск" + }, + { + "key": 20, + "number": "12342", + "cost": 10000, + "dateEnd": 1687640400000, + "customer": "ООО \"Орлов\"", + "cityFrom": "Кемерово", + "cityTo": "Новокузнецк" + } + ] + } +} \ No newline at end of file diff --git a/server/routers/freetracker/index.js b/server/routers/freetracker/index.js new file mode 100644 index 0000000..3d621fe --- /dev/null +++ b/server/routers/freetracker/index.js @@ -0,0 +1,5 @@ +const router = require('express').Router(); + +router.use('/performer', require('./dashboard-performer')) + +module.exports = router; \ No newline at end of file