@@ -44,7 +44,7 @@ describe('test accounting', () => {
44
44
const v1 = await addTaxi ( c1 , dummyCapacities ) ;
45
45
await setAvailability ( v1 , testDays [ 0 ] + HOUR * 5 , testDays [ 0 ] + HOUR * 6 ) ;
46
46
const t1 = ( await setTour ( v1 , testDays [ 0 ] + HOUR , testDays [ 0 ] + HOUR * 2 , 1000 ) ) ! . id ;
47
- await setRequest ( t1 , u . id , '' ) ;
47
+ await setRequest ( t1 , u . id , '' , 1 , true ) ;
48
48
const { companyCostsPerDay } = await getCompanyCosts ( ) ;
49
49
expect ( companyCostsPerDay ) . toHaveLength ( 1 ) ;
50
50
expect ( companyCostsPerDay [ 0 ] . taxameter ) . toBe ( 1000 ) ;
@@ -60,8 +60,8 @@ describe('test accounting', () => {
60
60
const v1 = await addTaxi ( c1 , dummyCapacities ) ;
61
61
await setAvailability ( v1 , testDays [ 0 ] + HOUR * 5 , testDays [ 0 ] + HOUR * 6 ) ;
62
62
const t1 = ( await setTour ( v1 , testDays [ 0 ] + HOUR , testDays [ 0 ] + HOUR * 2 , 400 ) ) ! . id ;
63
- await setRequest ( t1 , u . id , '' ) ;
64
- await setRequest ( t1 , u . id , '' ) ;
63
+ await setRequest ( t1 , u . id , '' , 1 , true ) ;
64
+ await setRequest ( t1 , u . id , '' , 1 , true ) ;
65
65
const { companyCostsPerDay } = await getCompanyCosts ( ) ;
66
66
expect ( companyCostsPerDay ) . toHaveLength ( 1 ) ;
67
67
expect ( companyCostsPerDay [ 0 ] . taxameter ) . toBe ( 400 ) ;
@@ -77,7 +77,7 @@ describe('test accounting', () => {
77
77
const v1 = await addTaxi ( c1 , dummyCapacities ) ;
78
78
await setAvailability ( v1 , testDays [ 0 ] + HOUR * 5 , testDays [ 0 ] + HOUR * 6 ) ;
79
79
const t1 = ( await setTour ( v1 , testDays [ 0 ] + HOUR , testDays [ 0 ] + HOUR * 2 , 5000 ) ) ! . id ;
80
- await setRequest ( t1 , u . id , '' ) ;
80
+ await setRequest ( t1 , u . id , '' , 1 , true ) ;
81
81
const { companyCostsPerDay } = await getCompanyCosts ( ) ;
82
82
expect ( companyCostsPerDay ) . toHaveLength ( 1 ) ;
83
83
expect ( companyCostsPerDay [ 0 ] . taxameter ) . toBe ( 5000 ) ;
@@ -94,8 +94,8 @@ describe('test accounting', () => {
94
94
await setAvailability ( v1 , testDays [ 0 ] + HOUR * 5 , testDays [ 0 ] + HOUR * 6 ) ;
95
95
const t1 = ( await setTour ( v1 , testDays [ 0 ] + HOUR , testDays [ 0 ] + HOUR * 2 , 2200 ) ) ! . id ;
96
96
const t2 = ( await setTour ( v1 , testDays [ 0 ] + HOUR , testDays [ 0 ] + HOUR * 2 , 3400 ) ) ! . id ;
97
- await setRequest ( t1 , u . id , '' ) ;
98
- await setRequest ( t2 , u . id , '' ) ;
97
+ await setRequest ( t1 , u . id , '' , 1 , true ) ;
98
+ await setRequest ( t2 , u . id , '' , 1 , true ) ;
99
99
const { companyCostsPerDay } = await getCompanyCosts ( ) ;
100
100
expect ( companyCostsPerDay ) . toHaveLength ( 1 ) ;
101
101
expect ( companyCostsPerDay [ 0 ] . taxameter ) . toBe ( 5600 ) ;
@@ -116,8 +116,8 @@ describe('test accounting', () => {
116
116
await setAvailability ( v1 , testDays [ 0 ] + HOUR * 14 , testDays [ 0 ] + HOUR * 14 + 30 * MINUTE ) ;
117
117
const t1 = ( await setTour ( v1 , testDays [ 0 ] + HOUR , testDays [ 0 ] + HOUR * 2 , 4250 ) ) ! . id ;
118
118
const t2 = ( await setTour ( v1 , testDays [ 0 ] + HOUR , testDays [ 0 ] + HOUR * 2 , 3400 ) ) ! . id ;
119
- await setRequest ( t1 , u . id , '' ) ;
120
- await setRequest ( t2 , u . id , '' ) ;
119
+ await setRequest ( t1 , u . id , '' , 1 , true ) ;
120
+ await setRequest ( t2 , u . id , '' , 1 , true ) ;
121
121
const { companyCostsPerDay } = await getCompanyCosts ( ) ;
122
122
expect ( companyCostsPerDay ) . toHaveLength ( 1 ) ;
123
123
expect ( companyCostsPerDay [ 0 ] . taxameter ) . toBe ( 7650 ) ;
@@ -133,7 +133,7 @@ describe('test accounting', () => {
133
133
const v1 = await addTaxi ( c1 , dummyCapacities ) ;
134
134
await setAvailability ( v1 , midnight + 30 * MINUTE , midnight + 90 * MINUTE ) ;
135
135
const t1 = ( await setTour ( v1 , testDays [ 0 ] + HOUR , testDays [ 0 ] + HOUR * 2 , 2600 ) ) ! . id ;
136
- await setRequest ( t1 , u . id , '' ) ;
136
+ await setRequest ( t1 , u . id , '' , 1 , true ) ;
137
137
const { companyCostsPerDay } = await getCompanyCosts ( ) ;
138
138
expect ( companyCostsPerDay ) . toHaveLength ( 1 ) ;
139
139
expect ( companyCostsPerDay [ 0 ] . taxameter ) . toBe ( 2600 ) ;
@@ -149,8 +149,8 @@ describe('test accounting', () => {
149
149
const v1 = await addTaxi ( c1 , dummyCapacities ) ;
150
150
const t1 = ( await setTour ( v1 , testDays [ 0 ] + HOUR , testDays [ 0 ] + HOUR * 2 , 2600 ) ) ! . id ;
151
151
const t2 = ( await setTour ( v1 , testDays [ 0 ] + HOUR , testDays [ 0 ] + HOUR * 2 , 3000 ) ) ! . id ;
152
- await setRequest ( t1 , u . id , '' ) ;
153
- await setRequest ( t2 , u . id , '' ) ;
152
+ await setRequest ( t1 , u . id , '' , 1 , true ) ;
153
+ await setRequest ( t2 , u . id , '' , 1 , true ) ;
154
154
const { companyCostsPerDay } = await getCompanyCosts ( ) ;
155
155
expect ( companyCostsPerDay ) . toHaveLength ( 1 ) ;
156
156
expect ( companyCostsPerDay [ 0 ] . taxameter ) . toBe ( 5600 ) ;
@@ -169,8 +169,8 @@ describe('test accounting', () => {
169
169
await setAvailability ( v2 , testDays [ 0 ] + 3 * HOUR , testDays [ 0 ] + 4 * HOUR ) ;
170
170
const t1 = ( await setTour ( v1 , testDays [ 0 ] + HOUR , testDays [ 0 ] + HOUR * 2 , 5100 ) ) ! . id ;
171
171
const t2 = ( await setTour ( v2 , testDays [ 0 ] + HOUR , testDays [ 0 ] + HOUR * 2 , 5100 ) ) ! . id ;
172
- await setRequest ( t1 , u . id , '' ) ;
173
- await setRequest ( t2 , u . id , '' ) ;
172
+ await setRequest ( t1 , u . id , '' , 1 , true ) ;
173
+ await setRequest ( t2 , u . id , '' , 1 , true ) ;
174
174
const { companyCostsPerDay } = await getCompanyCosts ( ) ;
175
175
expect ( companyCostsPerDay ) . toHaveLength ( 1 ) ;
176
176
expect ( companyCostsPerDay [ 0 ] . taxameter ) . toBe ( 10200 ) ;
@@ -186,7 +186,7 @@ describe('test accounting', () => {
186
186
const v1 = await addTaxi ( c1 , dummyCapacities ) ;
187
187
await setAvailability ( v1 , testDays [ 0 ] + 3 * HOUR , testDays [ 0 ] + 4 * HOUR ) ;
188
188
const t1 = ( await setTour ( v1 , testDays [ 0 ] + HOUR , testDays [ 0 ] + HOUR * 2 , 5700 ) ) ! . id ;
189
- await setRequest ( t1 , u . id , '' , 2 ) ;
189
+ await setRequest ( t1 , u . id , '' , 2 , true ) ;
190
190
const { companyCostsPerDay } = await getCompanyCosts ( ) ;
191
191
expect ( companyCostsPerDay ) . toHaveLength ( 1 ) ;
192
192
expect ( companyCostsPerDay [ 0 ] . taxameter ) . toBe ( 5700 ) ;
@@ -206,8 +206,8 @@ describe('test accounting', () => {
206
206
await setAvailability ( v2 , testDays [ 0 ] + 5 * HOUR , testDays [ 0 ] + 7 * HOUR ) ;
207
207
const t1 = ( await setTour ( v1 , testDays [ 0 ] + HOUR , testDays [ 0 ] + HOUR * 2 , 5100 ) ) ! . id ;
208
208
const t2 = ( await setTour ( v2 , testDays [ 0 ] + HOUR , testDays [ 0 ] + HOUR * 2 , 35300 ) ) ! . id ;
209
- await setRequest ( t1 , u . id , '' ) ;
210
- await setRequest ( t2 , u . id , '' ) ;
209
+ await setRequest ( t1 , u . id , '' , 1 , true ) ;
210
+ await setRequest ( t2 , u . id , '' , 1 , true ) ;
211
211
const { companyCostsPerDay } = await getCompanyCosts ( ) ;
212
212
expect ( companyCostsPerDay ) . toHaveLength ( 1 ) ;
213
213
expect ( companyCostsPerDay [ 0 ] . taxameter ) . toBe ( 40400 ) ;
@@ -227,8 +227,8 @@ describe('test accounting', () => {
227
227
await setAvailability ( v2 , testDays [ 0 ] + 2 * HOUR , testDays [ 0 ] + 4 * HOUR ) ;
228
228
const t1 = ( await setTour ( v1 , testDays [ 0 ] + HOUR , testDays [ 0 ] + HOUR * 2 , 5100 ) ) ! . id ;
229
229
const t2 = ( await setTour ( v2 , testDays [ 0 ] + HOUR , testDays [ 0 ] + HOUR * 2 , 9200 ) ) ! . id ;
230
- await setRequest ( t1 , u . id , '' ) ;
231
- await setRequest ( t2 , u . id , '' , 2 ) ;
230
+ await setRequest ( t1 , u . id , '' , 1 , true ) ;
231
+ await setRequest ( t2 , u . id , '' , 2 , true ) ;
232
232
const { companyCostsPerDay } = await getCompanyCosts ( ) ;
233
233
expect ( companyCostsPerDay ) . toHaveLength ( 2 ) ;
234
234
expect ( companyCostsPerDay [ 0 ] . timestamp ) . toBe ( companyCostsPerDay [ 1 ] . timestamp ) ;
0 commit comments