Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 93c1b50

Browse files
authoredApr 22, 2021
Merge pull request #214 from eisbilir/dev
make Resource Booking model to not store time, only dates
2 parents 04fe63d + a7fbbac commit 93c1b50

File tree

11 files changed

+410
-2447
lines changed

11 files changed

+410
-2447
lines changed
 

‎config/default.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,5 @@ module.exports = {
147147
DEFAULT_TIMELINE_TEMPLATE_ID: process.env.DEFAULT_TIMELINE_TEMPLATE_ID || '53a307ce-b4b3-4d6f-b9a1-3741a58f77e6',
148148
DEFAULT_TRACK_ID: process.env.DEFAULT_TRACK_ID || '9b6fc876-f4d9-4ccb-9dfd-419247628825',
149149

150-
// default time zone for Work Periods
151-
WORK_PERIOD_TIME_ZONE: process.env.WORK_PERIOD_TIME_ZONE || 'America/New_York',
152150
PAYMENT_PROCESSING_SWITCH: process.env.PAYMENT_PROCESSING_SWITCH || 'OFF'
153151
}

‎config/test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ module.exports = {
44
AUTH0_AUDIENCE: 'http://example.com',
55
AUTH0_AUDIENCE_UBAHN: 'http://example.com',
66
AUTH0_CLIENT_ID: 'fake_id',
7-
AUTH0_CLIENT_SECRET: 'fake_secret',
8-
WORK_PERIOD_TIME_ZONE: 'America/New_York'
7+
AUTH0_CLIENT_SECRET: 'fake_secret'
98
}

‎data/demo-data.json

Lines changed: 1 addition & 2301 deletions
Large diffs are not rendered by default.

‎docs/Topcoder-bookings-api.postman_collection.json

Lines changed: 246 additions & 55 deletions
Large diffs are not rendered by default.

‎docs/swagger.yaml

Lines changed: 55 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,16 @@ paths:
589589
required: false
590590
schema:
591591
type: string
592-
enum: ['open', 'selected', 'shortlist', 'rejected', 'cancelled', 'interview', 'topcoder-rejected']
592+
enum:
593+
[
594+
"open",
595+
"selected",
596+
"shortlist",
597+
"rejected",
598+
"cancelled",
599+
"interview",
600+
"topcoder-rejected",
601+
]
593602
description: The job candidate status.
594603
- in: query
595604
name: externalId
@@ -1002,14 +1011,14 @@ paths:
10021011
required: false
10031012
schema:
10041013
type: string
1005-
format: date-time
1014+
format: date
10061015
description: The resource booking start date.
10071016
- in: query
10081017
name: endDate
10091018
required: false
10101019
schema:
10111020
type: string
1012-
format: date-time
1021+
format: date
10131022
description: The resource booking end date.
10141023
- in: query
10151024
name: rateType
@@ -1869,13 +1878,7 @@ paths:
18691878
schema:
18701879
type: string
18711880
default: createdAt
1872-
enum:
1873-
[
1874-
"status",
1875-
"amount",
1876-
"createdAt",
1877-
"updatedAt",
1878-
]
1881+
enum: ["status", "amount", "createdAt", "updatedAt"]
18791882
description: The sort by column.
18801883
- in: query
18811884
name: sortOrder
@@ -2976,7 +2979,16 @@ components:
29762979
description: "The user id."
29772980
status:
29782981
type: string
2979-
enum: ['open', 'selected', 'shortlist', 'rejected', 'cancelled', 'interview', 'topcoder-rejected']
2982+
enum:
2983+
[
2984+
"open",
2985+
"selected",
2986+
"shortlist",
2987+
"rejected",
2988+
"cancelled",
2989+
"interview",
2990+
"topcoder-rejected",
2991+
]
29802992
description: "The job candidate status."
29812993
externalId:
29822994
type: string
@@ -3033,7 +3045,16 @@ components:
30333045
properties:
30343046
status:
30353047
type: string
3036-
enum: ['open', 'selected', 'shortlist', 'rejected', 'cancelled', 'interview', 'topcoder-rejected']
3048+
enum:
3049+
[
3050+
"open",
3051+
"selected",
3052+
"shortlist",
3053+
"rejected",
3054+
"cancelled",
3055+
"interview",
3056+
"topcoder-rejected",
3057+
]
30373058
externalId:
30383059
type: string
30393060
example: "1212"
@@ -3119,13 +3140,13 @@ components:
31193140
description: "The job status."
31203141
startDate:
31213142
type: string
3122-
format: date-time
3123-
example: "2020-09-27T04:17:23.131Z"
3143+
format: date
3144+
example: "2020-09-27"
31243145
description: "The job start date."
31253146
endDate:
31263147
type: string
3127-
format: date-time
3128-
example: "2020-09-28T04:17:23.131Z"
3148+
format: date
3149+
example: "2020-09-28"
31293150
description: "The job end date."
31303151
memberRate:
31313152
type: integer
@@ -3183,13 +3204,13 @@ components:
31833204
default: sourcing
31843205
startDate:
31853206
type: string
3186-
format: date-time
3187-
example: "2020-09-27T04:17:23.131Z"
3207+
format: date
3208+
example: "2020-09-27"
31883209
description: "The job start date."
31893210
endDate:
31903211
type: string
3191-
format: date-time
3192-
example: "2020-09-28T04:17:23.131Z"
3212+
format: date
3213+
example: "2020-09-28"
31933214
description: "The job end date."
31943215
memberRate:
31953216
type: number
@@ -3212,13 +3233,13 @@ components:
32123233
enum: ["assigned", "closed", "cancelled"]
32133234
startDate:
32143235
type: string
3215-
format: date-time
3216-
example: "2020-09-27T04:17:23.131Z"
3236+
format: date
3237+
example: "2020-09-27"
32173238
description: "The job start date."
32183239
endDate:
32193240
type: string
3220-
format: date-time
3221-
example: "2020-09-28T04:17:23.131Z"
3241+
format: date
3242+
example: "2020-09-28"
32223243
description: "The job end date."
32233244
memberRate:
32243245
type: number
@@ -3822,7 +3843,16 @@ components:
38223843
description: "The link for the resume that can be downloaded"
38233844
status:
38243845
type: string
3825-
enum: ['open', 'selected', 'shortlist', 'rejected', 'cancelled', 'interview', 'topcoder-rejected']
3846+
enum:
3847+
[
3848+
"open",
3849+
"selected",
3850+
"shortlist",
3851+
"rejected",
3852+
"cancelled",
3853+
"interview",
3854+
"topcoder-rejected",
3855+
]
38263856
description: "The job candidate status."
38273857
skills:
38283858
type: array
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
const config = require('config')
2+
3+
/*
4+
* Make Resource Booking dates store no timestamps
5+
* start_date: 2021-04-21T16:59:18.089Z -> 2021-04-21
6+
* end_date: 2021-05-21T16:59:18.089Z -> 2021-05-21
7+
* description: change type to DATE (DATEONLY) from TIMESTAMPTZ (DATE).
8+
* By updating the column type, the existing data will be automatically cast to DATE.
9+
*/
10+
11+
module.exports = {
12+
up: async (queryInterface, Sequelize) => {
13+
const transaction = await queryInterface.sequelize.transaction()
14+
try {
15+
await queryInterface.changeColumn({ tableName: 'resource_bookings', schema: config.DB_SCHEMA_NAME }, 'start_date',
16+
{ type: Sequelize.DATEONLY },
17+
{ transaction })
18+
await queryInterface.changeColumn({ tableName: 'resource_bookings', schema: config.DB_SCHEMA_NAME }, 'end_date',
19+
{ type: Sequelize.DATEONLY },
20+
{ transaction })
21+
await transaction.commit()
22+
} catch (err) {
23+
await transaction.rollback()
24+
throw err
25+
}
26+
},
27+
down: async (queryInterface, Sequelize) => {
28+
const transaction = await queryInterface.sequelize.transaction()
29+
try {
30+
await queryInterface.changeColumn({ tableName: 'resource_bookings', schema: config.DB_SCHEMA_NAME }, 'start_date',
31+
{ type: Sequelize.DATE },
32+
{ transaction })
33+
await queryInterface.changeColumn({ tableName: 'resource_bookings', schema: config.DB_SCHEMA_NAME }, 'end_date',
34+
{ type: Sequelize.DATE },
35+
{ transaction })
36+
await transaction.commit()
37+
} catch (err) {
38+
await transaction.rollback()
39+
throw err
40+
}
41+
}
42+
}

‎package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"http-status-codes": "^2.1.4",
5151
"joi": "^17.2.1",
5252
"lodash": "^4.17.20",
53-
"moment-timezone": "^0.5.33",
5453
"pg": "^8.4.0",
5554
"pg-hstore": "^2.3.3",
5655
"prompt-confirm": "^2.0.4",

‎src/common/helper.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const logger = require('./logger')
1717
const models = require('../models')
1818
const eventDispatcher = require('./eventDispatcher')
1919
const busApi = require('@topcoder-platform/topcoder-bus-api-wrapper')
20-
const moment = require('moment-timezone')
20+
const moment = require('moment')
2121

2222
const localLogger = {
2323
debug: (message) => logger.debug({ component: 'helper', context: message.context, message: message.message }),
@@ -93,8 +93,8 @@ esIndexPropertyMapping[config.get('esConfig.ES_INDEX_RESOURCE_BOOKING')] = {
9393
userId: { type: 'keyword' },
9494
jobId: { type: 'keyword' },
9595
status: { type: 'keyword' },
96-
startDate: { type: 'date' },
97-
endDate: { type: 'date' },
96+
startDate: { type: 'date', format: 'yyyy-MM-dd' },
97+
endDate: { type: 'date', format: 'yyyy-MM-dd' },
9898
memberRate: { type: 'float' },
9999
customerRate: { type: 'float' },
100100
rateType: { type: 'keyword' },
@@ -1276,12 +1276,10 @@ function extractWorkPeriods (start, end) {
12761276
return periods
12771277
}
12781278
const startDate = moment(start)
1279-
startDate.tz(config.WORK_PERIOD_TIME_ZONE, false)
12801279
const startDay = startDate.get('day')
12811280
startDate.set('day', 0).startOf('day')
12821281

12831282
const endDate = moment(end)
1284-
endDate.tz(config.WORK_PERIOD_TIME_ZONE, false)
12851283
const endDay = endDate.get('day')
12861284
endDate.set('day', 6).endOf('day')
12871285

‎src/models/ResourceBooking.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ module.exports = (sequelize) => {
5858
},
5959
startDate: {
6060
field: 'start_date',
61-
type: Sequelize.DATE
61+
type: Sequelize.DATEONLY
6262
},
6363
endDate: {
6464
field: 'end_date',
65-
type: Sequelize.DATE
65+
type: Sequelize.DATEONLY
6666
},
6767
memberRate: {
6868
field: 'member_rate',

‎src/services/ResourceBookingService.js

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44

55
const _ = require('lodash')
6-
const Joi = require('joi')
6+
const Joi = require('joi').extend(require('@joi/date'))
77
const config = require('config')
88
const HttpStatus = require('http-status-codes')
99
const { Op } = require('sequelize')
@@ -12,6 +12,7 @@ const helper = require('../common/helper')
1212
const logger = require('../common/logger')
1313
const errors = require('../common/errors')
1414
const models = require('../models')
15+
const moment = require('moment')
1516

1617
const ResourceBooking = models.ResourceBooking
1718
const WorkPeriod = models.WorkPeriod
@@ -162,14 +163,14 @@ createResourceBooking.schema = Joi.object().keys({
162163
projectId: Joi.number().integer().required(),
163164
userId: Joi.string().uuid().required(),
164165
jobId: Joi.string().uuid().allow(null),
165-
startDate: Joi.date().allow(null),
166-
endDate: Joi.date().when('startDate', {
166+
startDate: Joi.date().format('YYYY-MM-DD').allow(null),
167+
endDate: Joi.date().format('YYYY-MM-DD').when('startDate', {
167168
is: Joi.exist(),
168-
then: Joi.date().allow(null).min(Joi.ref('startDate')
169+
then: Joi.date().format('YYYY-MM-DD').allow(null).min(Joi.ref('startDate')
169170
).messages({
170171
'date.min': 'endDate cannot be earlier than startDate'
171172
}),
172-
otherwise: Joi.date().allow(null)
173+
otherwise: Joi.date().format('YYYY-MM-DD').allow(null)
173174
}),
174175
memberRate: Joi.number().allow(null),
175176
customerRate: Joi.number().allow(null),
@@ -199,8 +200,7 @@ async function updateResourceBooking (currentUser, id, data) {
199200

200201
const updated = await resourceBooking.update(data)
201202
await helper.postEvent(config.TAAS_RESOURCE_BOOKING_UPDATE_TOPIC, updated.toJSON(), { oldValue: oldValue })
202-
const result = _.assign(resourceBooking.dataValues, data)
203-
return result
203+
return updated.dataValues
204204
}
205205

206206
/**
@@ -219,14 +219,14 @@ partiallyUpdateResourceBooking.schema = Joi.object().keys({
219219
id: Joi.string().uuid().required(),
220220
data: Joi.object().keys({
221221
status: Joi.resourceBookingStatus(),
222-
startDate: Joi.date().allow(null),
223-
endDate: Joi.date().when('startDate', {
222+
startDate: Joi.date().format('YYYY-MM-DD').allow(null),
223+
endDate: Joi.date().format('YYYY-MM-DD').when('startDate', {
224224
is: Joi.exist(),
225-
then: Joi.date().allow(null).min(Joi.ref('startDate')
225+
then: Joi.date().format('YYYY-MM-DD').allow(null).min(Joi.ref('startDate')
226226
).messages({
227227
'date.min': 'endDate cannot be earlier than startDate'
228228
}),
229-
otherwise: Joi.date().allow(null)
229+
otherwise: Joi.date().format('YYYY-MM-DD').allow(null)
230230
}),
231231
memberRate: Joi.number().allow(null),
232232
customerRate: Joi.number().allow(null),
@@ -256,14 +256,14 @@ fullyUpdateResourceBooking.schema = Joi.object().keys({
256256
projectId: Joi.number().integer().required(),
257257
userId: Joi.string().uuid().required(),
258258
jobId: Joi.string().uuid().allow(null).default(null),
259-
startDate: Joi.date().allow(null).default(null),
260-
endDate: Joi.date().when('startDate', {
259+
startDate: Joi.date().format('YYYY-MM-DD').allow(null).default(null),
260+
endDate: Joi.date().format('YYYY-MM-DD').when('startDate', {
261261
is: Joi.exist(),
262-
then: Joi.date().allow(null).default(null).min(Joi.ref('startDate')
262+
then: Joi.date().format('YYYY-MM-DD').allow(null).default(null).min(Joi.ref('startDate')
263263
).messages({
264264
'date.min': 'endDate cannot be earlier than startDate'
265265
}),
266-
otherwise: Joi.date().allow(null).default(null)
266+
otherwise: Joi.date().format('YYYY-MM-DD').allow(null).default(null)
267267
}),
268268
memberRate: Joi.number().allow(null).default(null),
269269
customerRate: Joi.number().allow(null).default(null),
@@ -357,7 +357,13 @@ async function searchResourceBookings (currentUser, criteria, options = { return
357357
sort
358358
}
359359
}
360-
360+
// change the date format to match with index schema
361+
if (criteria.startDate) {
362+
criteria.startDate = moment(criteria.startDate).format('YYYY-MM-DD')
363+
}
364+
if (criteria.endDate) {
365+
criteria.endDate = moment(criteria.endDate).format('YYYY-MM-DD')
366+
}
361367
_.each(_.pick(criteria, ['status', 'startDate', 'endDate', 'rateType', 'projectId', 'jobId', 'userId']), (value, key) => {
362368
esQuery.body.query.bool.must.push({
363369
term: {
@@ -423,8 +429,8 @@ searchResourceBookings.schema = Joi.object().keys({
423429
sortBy: Joi.string().valid('id', 'rateType', 'startDate', 'endDate', 'customerRate', 'memberRate', 'status'),
424430
sortOrder: Joi.string().valid('desc', 'asc'),
425431
status: Joi.resourceBookingStatus(),
426-
startDate: Joi.date(),
427-
endDate: Joi.date(),
432+
startDate: Joi.date().format('YYYY-MM-DD'),
433+
endDate: Joi.date().format('YYYY-MM-DD'),
428434
rateType: Joi.rateType(),
429435
jobId: Joi.string().uuid(),
430436
userId: Joi.string().uuid(),

‎test/unit/common/testData.js

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ const resourceBooking5Week = {
1212
projectId: 21,
1313
userId: 'a55fe1bc-1754-45fa-9adc-cf3d6d7c377a',
1414
jobId: '36762910-4efa-4db4-9b2a-c9ab54c232ed',
15-
startDate: '2020-09-27T04:17:23.131Z',
16-
endDate: '2020-10-27T04:17:23.131Z',
15+
startDate: '2020-09-27',
16+
endDate: '2020-10-27',
1717
memberRate: 13.23,
1818
customerRate: 13,
1919
rateType: 'hourly'
@@ -24,8 +24,8 @@ const resourceBooking5Week = {
2424
projectId: 21,
2525
userId: 'a55fe1bc-1754-45fa-9adc-cf3d6d7c377a',
2626
jobId: '6093e58c-683d-4022-8482-5515e8345016',
27-
startDate: '2020-09-27T04:17:23.131Z',
28-
endDate: '2020-10-27T04:17:23.131Z',
27+
startDate: '2020-09-27',
28+
endDate: '2020-10-27',
2929
memberRate: 13.23,
3030
customerRate: 13,
3131
rateType: 'hourly',
@@ -78,8 +78,8 @@ const resourceBooking1Week = {
7878
projectId: 21,
7979
userId: 'a55fe1bc-1754-45fa-9adc-cf3d6d7c377a',
8080
jobId: '36762910-4efa-4db4-9b2a-c9ab54c232ed',
81-
startDate: '2020-11-20T04:17:23.131Z',
82-
endDate: '2020-11-21T04:17:23.131Z',
81+
startDate: '2020-11-20',
82+
endDate: '2020-11-21',
8383
memberRate: 13.23,
8484
customerRate: 13,
8585
rateType: 'hourly'
@@ -90,8 +90,8 @@ const resourceBooking1Week = {
9090
projectId: 21,
9191
userId: 'a55fe1bc-1754-45fa-9adc-cf3d6d7c377a',
9292
jobId: '6093e58c-683d-4022-8482-5515e8345016',
93-
startDate: '2020-11-20T04:17:23.131Z',
94-
endDate: '2020-11-21T04:17:23.131Z',
93+
startDate: '2020-11-20',
94+
endDate: '2020-11-21',
9595
memberRate: 13.23,
9696
customerRate: 13,
9797
rateType: 'hourly',
@@ -104,7 +104,7 @@ const resourceBooking1Week = {
104104
resourceBookingId: '520bb632-a02a-415e-9857-93b2ecbf7d60',
105105
startDate: '2020-11-15',
106106
endDate: '2020-11-21',
107-
daysWorked: 2,
107+
daysWorked: 1,
108108
paymentStatus: 'pending'
109109
}],
110110
workPeriodResponse: [{
@@ -124,16 +124,16 @@ const resourceBooking1Week = {
124124
updatedAt: '2021-04-10T22:25:08.289Z'
125125
}],
126126
updateRequest: {
127-
startDate: '2020-11-18T04:17:23.131Z'
127+
startDate: '2020-11-18'
128128
},
129129
updateResponse: {
130130
dataValues: {
131131
id: '520bb632-a02a-415e-9857-93b2ecbf7d60',
132132
projectId: 21,
133133
userId: 'a55fe1bc-1754-45fa-9adc-cf3d6d7c377a',
134134
jobId: '6093e58c-683d-4022-8482-5515e8345016',
135-
startDate: new Date('2020-11-18T04:17:23.131Z'),
136-
endDate: '2020-11-21T04:17:23.131Z',
135+
startDate: '2020-11-18',
136+
endDate: '2020-11-21',
137137
memberRate: 13.23,
138138
customerRate: 13,
139139
rateType: 'hourly',
@@ -144,7 +144,7 @@ const resourceBooking1Week = {
144144
}
145145
},
146146
workPeriodUpdateRequests: [{
147-
daysWorked: 4
147+
daysWorked: 3
148148
}]
149149
}
150150
resourceBooking1Week.response.toJSON = function () {
@@ -163,8 +163,8 @@ const resourceBookingUpdate = {
163163
projectId: 21,
164164
userId: 'a55fe1bc-1754-45fa-9adc-cf3d6d7c377a',
165165
jobId: '6093e58c-683d-4022-8482-5515e8345016',
166-
startDate: '2020-08-20T04:17:23.131Z',
167-
endDate: '2020-09-10T04:17:23.131Z',
166+
startDate: '2020-08-20',
167+
endDate: '2020-09-10',
168168
memberRate: 13.23,
169169
customerRate: 13,
170170
rateType: 'hourly',
@@ -235,16 +235,16 @@ const resourceBookingUpdate = {
235235
updatedAt: '2021-04-10T22:25:08.289Z'
236236
}],
237237
updateRequest: {
238-
endDate: '2020-09-12T04:17:23.131Z'
238+
endDate: '2020-09-12'
239239
},
240240
updateResponse: {
241241
dataValues: {
242242
id: '520bb632-a02a-415e-9857-93b2ecbf7d60',
243243
projectId: 21,
244244
userId: 'a55fe1bc-1754-45fa-9adc-cf3d6d7c377a',
245245
jobId: '6093e58c-683d-4022-8482-5515e8345016',
246-
startDate: '2020-08-20T04:17:23.131Z',
247-
endDate: new Date('2020-09-12T04:17:23.131Z'),
246+
startDate: '2020-08-20',
247+
endDate: '2020-09-12',
248248
memberRate: 13.23,
249249
customerRate: 13,
250250
rateType: 'hourly',
@@ -263,8 +263,8 @@ const resourceBookingUpdate = {
263263
projectId: 21,
264264
userId: 'a55fe1bc-1754-45fa-9adc-cf3d6d7c377a',
265265
jobId: '6093e58c-683d-4022-8482-5515e8345016',
266-
startDate: '2020-08-20T04:17:23.131Z',
267-
endDate: '2020-09-10T04:17:23.131Z',
266+
startDate: '2020-08-20',
267+
endDate: '2020-09-10',
268268
memberRate: 13.23,
269269
customerRate: 13,
270270
rateType: 'hourly',
@@ -274,16 +274,16 @@ const resourceBookingUpdate = {
274274
}
275275
},
276276
updateRequest2: {
277-
endDate: '2020-09-15T04:17:23.131Z'
277+
endDate: '2020-09-15'
278278
},
279279
updateResponse2: {
280280
dataValues: {
281281
id: '520bb632-a02a-415e-9857-93b2ecbf7d60',
282282
projectId: 21,
283283
userId: 'a55fe1bc-1754-45fa-9adc-cf3d6d7c377a',
284284
jobId: '6093e58c-683d-4022-8482-5515e8345016',
285-
startDate: '2020-08-20T04:17:23.131Z',
286-
endDate: new Date('2020-09-15T04:17:23.131Z'),
285+
startDate: '2020-08-20',
286+
endDate: '2020-09-15',
287287
memberRate: 13.23,
288288
customerRate: 13,
289289
rateType: 'hourly',
@@ -308,8 +308,8 @@ const resourceBookingUpdate = {
308308
projectId: 21,
309309
userId: 'a55fe1bc-1754-45fa-9adc-cf3d6d7c377a',
310310
jobId: '6093e58c-683d-4022-8482-5515e8345016',
311-
startDate: '2020-08-20T04:17:23.131Z',
312-
endDate: '2020-09-10T04:17:23.131Z',
311+
startDate: '2020-08-20',
312+
endDate: '2020-09-10',
313313
memberRate: 13.23,
314314
customerRate: 13,
315315
rateType: 'hourly',
@@ -319,16 +319,16 @@ const resourceBookingUpdate = {
319319
}
320320
},
321321
updateRequest3: {
322-
startDate: '2020-08-25T04:17:23.131Z'
322+
startDate: '2020-08-25'
323323
},
324324
updateResponse3: {
325325
dataValues: {
326326
id: '520bb632-a02a-415e-9857-93b2ecbf7d60',
327327
projectId: 21,
328328
userId: 'a55fe1bc-1754-45fa-9adc-cf3d6d7c377a',
329329
jobId: '6093e58c-683d-4022-8482-5515e8345016',
330-
startDate: new Date('2020-08-25T04:17:23.131Z'),
331-
endDate: '2020-09-10T04:17:23.131Z',
330+
startDate: '2020-08-25',
331+
endDate: '2020-09-10',
332332
memberRate: 13.23,
333333
customerRate: 13,
334334
rateType: 'hourly',
@@ -354,8 +354,8 @@ const resourceBookingUpdate = {
354354
projectId: 21,
355355
userId: 'a55fe1bc-1754-45fa-9adc-cf3d6d7c377a',
356356
jobId: '6093e58c-683d-4022-8482-5515e8345016',
357-
startDate: '2020-08-20T04:17:23.131Z',
358-
endDate: '2020-09-10T04:17:23.131Z',
357+
startDate: '2020-08-20',
358+
endDate: '2020-09-10',
359359
memberRate: 13.23,
360360
customerRate: 13,
361361
rateType: 'hourly',
@@ -426,17 +426,17 @@ const resourceBookingUpdate = {
426426
updatedAt: '2021-04-10T22:25:08.289Z'
427427
}],
428428
updateRequest4: {
429-
startDate: '2020-08-25T04:17:23.131Z',
430-
endDate: '2020-09-05T04:17:23.131Z'
429+
startDate: '2020-08-25',
430+
endDate: '2020-09-05'
431431
},
432432
updateResponse4: {
433433
dataValues: {
434434
id: '520bb632-a02a-415e-9857-93b2ecbf7d60',
435435
projectId: 21,
436436
userId: 'a55fe1bc-1754-45fa-9adc-cf3d6d7c377a',
437437
jobId: '6093e58c-683d-4022-8482-5515e8345016',
438-
startDate: new Date('2020-08-25T04:17:23.131Z'),
439-
endDate: new Date('2020-09-05T04:17:23.131Z'),
438+
startDate: '2020-08-25',
439+
endDate: '2020-09-05',
440440
memberRate: 13.23,
441441
customerRate: 13,
442442
rateType: 'hourly',
@@ -450,8 +450,8 @@ const resourceBookingUpdate = {
450450
daysWorked: 4
451451
}, '10faf505-d0e3-4d13-a817-7f1319625e91', '3907e916-efdc-49d3-b0ef-970ccf7d78b0'],
452452
updateRequest5: {
453-
startDate: '2020-08-24T04:17:23.131Z',
454-
endDate: '2020-08-29T04:17:23.131Z'
453+
startDate: '2020-08-24',
454+
endDate: '2020-08-29'
455455
},
456456
updateRequest6: {
457457
status: 'cancelled'

0 commit comments

Comments
 (0)
Please sign in to comment.