Skip to content

Commit

Permalink
restore fix in statisticService
Browse files Browse the repository at this point in the history
  • Loading branch information
polinaKoroleva05 committed Dec 23, 2024
1 parent f8e5222 commit ba57394
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
3 changes: 2 additions & 1 deletion server/Services/StatisticsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ public async Task<List<EventCell>> CountCellEvents(ActionBody body)
foreach(Cell cell in cells)
{
string wID = "WAREHOUSE/" + body.warehouseKey;
string cID = "CELL/" + cell._key;
FormattableString filter1 = $"DATE_DIFF(x.dateAndTime, {body.end}, 's', true) > 0 AND DATE_DIFF({body.start}, x.dateAndTime, 's', true) > 0";
FormattableString filter2 = $"AND x.action == {body.eventAction} AND x._from == {wID}";
FormattableString filter2 = $"AND x.action == {body.eventAction} AND x._from == {wID} AND x._to == {cID}";

List<Event> events = await _arango.Query.FindAsync<Event>(_dbName, _eColName, $"{filter1} {filter2}");

Expand Down
30 changes: 15 additions & 15 deletions server/test_data/events_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -201,42 +201,42 @@
},
{
"_key": "7478hdsjk-4tfr-74ff-56d9-gfh5563g6fr",
"_from": "WAREHOUSE/32cc7b3d-7f1c-4757-813c-182182e67753",
"_to": "CELL/4196faf0-20ad-4b90-a329-98b237ad5900",
"cellKey": "4196faf0-20ad-4b90-a329-98b237ad5900",
"_from": "WAREHOUSE/94708a72-73b4-4d68-804b-ed55f6a8dea1",
"_to": "CELL/aa183db1-825d-415d-b314-4e914f7e6b8a",
"cellKey": "aa183db1-825d-415d-b314-4e914f7e6b8a",
"userKey": "e5ba8cfb-159d-4163-a212-2e2fcf5172c2",
"action": "FIXED",
"dateAndTime": "2024-12-19T21:06:49.7187898+00:00",
"dateAndTime": "2024-09-19T21:06:49.7187898+00:00",
"description": "the cell has been serviced"
},
{
"_key": "456ergs-456g-65ds-96d9-dtrh677hthj7r",
"_from": "WAREHOUSE/32cc7b3d-7f1c-4757-813c-182182e67753",
"_to": "CELL/014c9ead-c108-416f-94e4-9a35cf4d82a6",
"cellKey": "014c9ead-c108-416f-94e4-9a35cf4d82a6",
"_from": "WAREHOUSE/94708a72-73b4-4d68-804b-ed55f6a8dea1",
"_to": "CELL/aa183db1-825d-415d-b314-4e914f7e6b8a",
"cellKey": "aa183db1-825d-415d-b314-4e914f7e6b8a",
"userKey": "e5ba8cfb-159d-4163-a212-2e2fcf5172c2",
"action": "FIXED",
"dateAndTime": "2024-10-19T21:06:49.7187898+00:00",
"description": "the cell has been serviced"
},
{
"_key": "rt5tfggd-bdj0-74ff-96d9-dfhd8476rt56",
"_from": "WAREHOUSE/32cc7b3d-7f1c-4757-813c-182182e67753",
"_to": "CELL/4196faf0-20ad-4b90-a329-98b237ad5900",
"cellKey": "85537633-8ffc-45b0-a897-87146a086f05",
"_from": "WAREHOUSE/94708a72-73b4-4d68-804b-ed55f6a8dea1",
"_to": "CELL/61067a02-d840-4366-9783-368dcf7ecbae",
"cellKey": "61067a02-d840-4366-9783-368dcf7ecbae",
"userKey": "c1f66414-51bb-433f-8c78-5f236b217251",
"action": "FIXED",
"dateAndTime": "2024-12-19T21:06:49.7187898+00:00",
"dateAndTime": "2023-12-19T21:06:49.7187898+00:00",
"description": "the cell has been serviced"
},
{
"_key": "0953jgf51-bdj0-74ff-96d9-7jfdstrh5p9",
"_from": "WAREHOUSE/32cc7b3d-7f1c-4757-813c-182182e67753",
"_to": "CELL/4196faf0-20ad-4b90-a329-98b237ad5900",
"cellKey": "85537633-8ffc-45b0-a897-87146a086f05",
"_from": "WAREHOUSE/94708a72-73b4-4d68-804b-ed55f6a8dea1",
"_to": "CELL/0fe43b01-3c26-4b93-bf2b-043f69b89301",
"cellKey": "0fe43b01-3c26-4b93-bf2b-043f69b89301",
"userKey": "fec80ae6-d7b4-4020-8ec0-55765dac0c3d",
"action": "FIXED",
"dateAndTime": "2024-12-19T21:06:49.7187898+00:00",
"dateAndTime": "2020-12-19T21:06:49.7187898+00:00",
"description": "the cell has been serviced"
}
]

0 comments on commit ba57394

Please sign in to comment.