Skip to content

Commit

Permalink
Change legacyReviewId datatype from UUID to int
Browse files Browse the repository at this point in the history
  • Loading branch information
meshde committed Sep 23, 2019
1 parent 54e5660 commit b08cf17
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 48 deletions.
6 changes: 3 additions & 3 deletions docs/Submission API.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@
],
"body": {
"mode": "raw",
"raw": "{\n\t\"score\": 92.5,\n\t\"legacyReviewId\": \"6b4faff1-7685-4866-a2e3-24afabf5c2c9\",\n\t\"scoreCardId\": 123456789,\n\t\"submissionId\": \"{{submissionID}}\",\n\t\"status\": \"queued\",\n\t\"typeId\": \"c56a4180-65aa-42ec-a945-5fd21dec0503\",\n\t\"reviewerId\": \"c56a4180-65aa-42ec-a945-5fd21d3d26f8\"\n}"
"raw": "{\n\t\"score\": 92.5,\n\t\"legacyReviewId\": 123456788,\n\t\"scoreCardId\": 123456789,\n\t\"submissionId\": \"{{submissionID}}\",\n\t\"status\": \"queued\",\n\t\"typeId\": \"c56a4180-65aa-42ec-a945-5fd21dec0503\",\n\t\"reviewerId\": \"c56a4180-65aa-42ec-a945-5fd21d3d26f8\"\n}"
},
"url": {
"raw": "{{URL}}/reviews",
Expand Down Expand Up @@ -1405,7 +1405,7 @@
],
"body": {
"mode": "raw",
"raw": "{\n\t\"score\": 90.5,\n\t\"legacyReviewId\": \"6b4faff1-7685-4866-a2e3-24afabf5c2c9\",\n\t\"scoreCardId\": 123456789,\n\t\"submissionId\": \"{{submissionID}}\",\n\t\"status\": \"completed\",\n\t\"typeId\": \"c56a4180-65aa-42ec-a945-5fd21dec0503\",\n\t\"reviewerId\": \"c56a4180-65aa-42ec-a945-5fd21d3d26f8\"\n}"
"raw": "{\n\t\"score\": 90.5,\n\t\"legacyReviewId\": 123456789,\n\t\"scoreCardId\": 123456789,\n\t\"submissionId\": \"{{submissionID}}\",\n\t\"status\": \"completed\",\n\t\"typeId\": \"c56a4180-65aa-42ec-a945-5fd21dec0503\",\n\t\"reviewerId\": \"c56a4180-65aa-42ec-a945-5fd21d3d26f8\"\n}"
},
"url": {
"raw": "{{URL}}/reviews/{{reviewID}}",
Expand Down Expand Up @@ -3179,4 +3179,4 @@
]
}
]
}
}
12 changes: 6 additions & 6 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ paths:
example:
- id: 'a12a4180-65aa-42ec-a945-5fd21dec0503'
score: 95.5
legacyReviewId: '6b4faff1-7685-4866-a2e3-24afabf5c2c1'
legacyReviewId: 1234567891
typeId: 'c56a4180-65aa-42ec-a945-5fd21dec0503'
reviewerId: 'c23a4180-65aa-42ec-a945-5fd21dec0503'
scoreCardId: 123456789
Expand All @@ -942,7 +942,7 @@ paths:
updatedBy: 'admin'
- id: 'a23c4180-65aa-42ec-a945-5fd21dec0503'
score: 73.2
legacyReviewId: '6b4faff1-7685-4866-a2e3-24afabf5c2c4'
legacyReviewId: 1234567892
typeId: 'c56a4180-65aa-42ec-a945-5fd21dec0503'
reviewerId: 'c23a4180-65aa-42ec-a945-5fd21dec0503'
scoreCardId: 123456789
Expand Down Expand Up @@ -1620,7 +1620,7 @@ parameters:
name: review.legacyReviewId
description: The legacy review id filter of the reviews associated with the submission.
required: false
type: string
type: integer

filterSubmissionReviewTypeId:
in: query
Expand Down Expand Up @@ -1735,7 +1735,7 @@ parameters:
name: legacyReviewId
description: The legacy review id filter for reviews.
required: false
type: string
type: integer

filterReviewTypeId:
in: query
Expand Down Expand Up @@ -2009,9 +2009,9 @@ definitions:
description: The review score.
example: 95.5
legacyReviewId:
type: string
type: integer
description: The legacy review id.
example: 'a12bc180-65ab-42ec-a945-5fd21dec1567'
example: 123456789
typeId:
type: string
description: The review type id.
Expand Down
18 changes: 9 additions & 9 deletions scripts/data/Reviews.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"id": "d24d4180-65aa-42ec-a945-5fd21dec0501",
"score": 95.5,
"legacyReviewId": "6b4faff1-7685-4866-a2e3-24afabf5c2c1",
"legacyReviewId": 1234567891,
"typeId": "c56a4180-65aa-42ec-a945-5fd21dec0503",
"reviewerId": "c23a4180-65aa-42ec-a945-5fd21dec0503",
"scoreCardId": 123456789,
Expand All @@ -15,7 +15,7 @@
{
"id": "d24d4180-65aa-42ec-a945-5fd21dec0502",
"score": 92.0,
"legacyReviewId": "6b4faff1-7685-4866-a2e3-24afabf5c2c2",
"legacyReviewId": 1234567892,
"typeId": "c56a4180-65aa-42ec-a945-5fd21dec0501",
"reviewerId": "c23a4180-65aa-42ec-a945-5fd21dec0503",
"scoreCardId": 123456789,
Expand All @@ -28,7 +28,7 @@
{
"id": "d24d4180-65aa-42ec-a945-5fd21dec0503",
"score": 80.83,
"legacyReviewId": "6b4faff1-7685-4866-a2e3-24afabf5c2c3",
"legacyReviewId": 1234567893,
"typeId": "c56a4180-65aa-42ec-a945-5fd21dec0503",
"reviewerId": "c23a4180-65aa-42ec-a945-5fd21dec0503",
"scoreCardId": 123456789,
Expand All @@ -41,7 +41,7 @@
{
"id": "d24d4180-65aa-42ec-a945-5fd21dec0504",
"score": 85.62,
"legacyReviewId": "6b4faff1-7685-4866-a2e3-24afabf5c2c4",
"legacyReviewId": 1234567894,
"typeId": "c56a4180-65aa-42ec-a945-5fd21dec0503",
"reviewerId": "c23a4180-65aa-42ec-a945-5fd21dec0502",
"scoreCardId": 123456789,
Expand All @@ -54,7 +54,7 @@
{
"id": "d24d4180-65aa-42ec-a945-5fd21dec0505",
"score": 100,
"legacyReviewId": "6b4faff1-7685-4866-a2e3-24afabf5c2c5",
"legacyReviewId": 1234567895,
"typeId": "f28b2725-ef90-4495-af59-ceb2bd98fc10",
"reviewerId": "c23a4180-65aa-42ec-a945-5fd21dec0503",
"scoreCardId": 123456789,
Expand All @@ -67,7 +67,7 @@
{
"id": "d24d4180-65aa-42ec-a945-5fd21dec0506",
"score": 65.0,
"legacyReviewId": "6b4faff1-7685-4866-a2e3-24afabf5c2c6",
"legacyReviewId": 1234567896,
"typeId": "c56a4180-65aa-42ec-a945-5fd21dec0503",
"reviewerId": "c23a4180-65aa-42ec-a945-5fd21dec0503",
"scoreCardId": 123456789,
Expand All @@ -80,7 +80,7 @@
{
"id": "d24d4180-65aa-42ec-a945-5fd21dec0507",
"score": 68.0,
"legacyReviewId": "6b4faff1-7685-4866-a2e3-24afabf5c2c7",
"legacyReviewId": 1234567897,
"typeId": "c56a4180-65aa-42ec-a945-5fd21dec0503",
"reviewerId": "c23a4180-65aa-42ec-a945-5fd21dec0502",
"scoreCardId": 123456789,
Expand All @@ -93,7 +93,7 @@
{
"id": "d24d4180-65aa-42ec-a945-5fd21dec0508",
"score": 100,
"legacyReviewId": "6b4faff1-7685-4866-a2e3-24afabf5c2c8",
"legacyReviewId": 1234567898,
"typeId": "f28b2725-ef90-4495-af59-ceb2bd98fc10",
"reviewerId": "c23a4180-65aa-42ec-a945-5fd21dec0503",
"scoreCardId": 123456789,
Expand All @@ -106,7 +106,7 @@
{
"id": "d24d4180-65aa-42ec-a945-5fd21dec0509",
"score": 92.5,
"legacyReviewId": "6b4faff1-7685-4866-a2e3-24afabf5c2c9",
"legacyReviewId": 1234567899,
"typeId": "c56a4180-65aa-42ec-a945-5fd21dec0503",
"reviewerId": "c23a4180-65aa-42ec-a945-5fd21dec0503",
"scoreCardId": 123456789,
Expand Down
18 changes: 9 additions & 9 deletions scripts/data/Submissions.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{
"id": "d24d4180-65aa-42ec-a945-5fd21dec0501",
"score": 95.5,
"legacyReviewId": "6b4faff1-7685-4866-a2e3-24afabf5c2c1",
"legacyReviewId": 1234567891,
"typeId": "c56a4180-65aa-42ec-a945-5fd21dec0503",
"reviewerId": "c23a4180-65aa-42ec-a945-5fd21dec0503",
"scoreCardId": 123456789,
Expand All @@ -26,7 +26,7 @@
{
"id": "d24d4180-65aa-42ec-a945-5fd21dec0502",
"score": 92.0,
"legacyReviewId": "6b4faff1-7685-4866-a2e3-24afabf5c2c2",
"legacyReviewId": 1234567892,
"typeId": "c56a4180-65aa-42ec-a945-5fd21dec0501",
"reviewerId": "c23a4180-65aa-42ec-a945-5fd21dec0503",
"scoreCardId": 123456789,
Expand Down Expand Up @@ -80,7 +80,7 @@
{
"id": "d24d4180-65aa-42ec-a945-5fd21dec0503",
"score": 80.83,
"legacyReviewId": "6b4faff1-7685-4866-a2e3-24afabf5c2c9",
"legacyReviewId": 1234567899,
"typeId": "c56a4180-65aa-42ec-a945-5fd21dec0503",
"reviewerId": "c23a4180-65aa-42ec-a945-5fd21dec0503",
"scoreCardId": 123456789,
Expand All @@ -97,7 +97,7 @@
{
"id": "d24d4180-65aa-42ec-a945-5fd21dec0504",
"score": 85.62,
"legacyReviewId": "6b4faff1-7685-4866-a2e3-24afabf5c2c8",
"legacyReviewId": 1234567898,
"typeId": "c56a4180-65aa-42ec-a945-5fd21dec0503",
"reviewerId": "c23a4180-65aa-42ec-a945-5fd21dec0502",
"scoreCardId": 123456789,
Expand All @@ -114,7 +114,7 @@
{
"id": "d24d4180-65aa-42ec-a945-5fd21dec0505",
"score": 100,
"legacyReviewId": "6b4faff1-7685-4866-a2e3-24afabf5c2c7",
"legacyReviewId": 1234567897,
"typeId": "f28b2725-ef90-4495-af59-ceb2bd98fc10",
"reviewerId": "c23a4180-65aa-42ec-a945-5fd21dec0503",
"scoreCardId": 123456789,
Expand Down Expand Up @@ -144,7 +144,7 @@
{
"id": "d24d4180-65aa-42ec-a945-5fd21dec0506",
"score": 65.0,
"legacyReviewId": "6b4faff1-7685-4866-a2e3-24afabf5c2c3",
"legacyReviewId": 1234567893,
"typeId": "c56a4180-65aa-42ec-a945-5fd21dec0503",
"reviewerId": "c23a4180-65aa-42ec-a945-5fd21dec0503",
"scoreCardId": 123456789,
Expand All @@ -161,7 +161,7 @@
{
"id": "d24d4180-65aa-42ec-a945-5fd21dec0507",
"score": 68.0,
"legacyReviewId": "6b4faff1-7685-4866-a2e3-24afabf5c2c4",
"legacyReviewId": 1234567894,
"typeId": "c56a4180-65aa-42ec-a945-5fd21dec0503",
"reviewerId": "c23a4180-65aa-42ec-a945-5fd21dec0502",
"scoreCardId": 123456789,
Expand Down Expand Up @@ -191,7 +191,7 @@
{
"id": "d24d4180-65aa-42ec-a945-5fd21dec0508",
"score": 100,
"legacyReviewId": "6b4faff1-7685-4866-a2e3-24afabf5c2c5",
"legacyReviewId": 1234567895,
"typeId": "f28b2725-ef90-4495-af59-ceb2bd98fc10",
"reviewerId": "c23a4180-65aa-42ec-a945-5fd21dec0503",
"scoreCardId": 123456789,
Expand Down Expand Up @@ -221,7 +221,7 @@
{
"id": "d24d4180-65aa-42ec-a945-5fd21dec0509",
"score": 92.5,
"legacyReviewId": "6b4faff1-7685-4866-a2e3-24afabf5c2c6",
"legacyReviewId": 1234567896,
"typeId": "c56a4180-65aa-42ec-a945-5fd21dec0503",
"reviewerId": "c23a4180-65aa-42ec-a945-5fd21dec0503",
"scoreCardId": 123456789,
Expand Down
12 changes: 4 additions & 8 deletions src/services/ReviewService.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function* listReviews(query) {

const listReviewsQuerySchema = {
score: joi.score(),
legacyReviewId: joi.string().uuid(),
legacyReviewId: joi.id(),
typeId: joi.string().uuid(),
reviewerId: joi.alternatives().try(joi.id(), joi.string().uuid()),
scoreCardId: joi.id(),
Expand Down Expand Up @@ -182,9 +182,7 @@ createReview.schema = {
.object()
.keys({
score: joi.score().required(),
legacyReviewId: joi
.string()
.uuid(),
legacyReviewId: joi.id(),
typeId: joi
.string()
.uuid()
Expand Down Expand Up @@ -317,9 +315,7 @@ updateReview.schema = {
.object()
.keys({
score: joi.score().required(),
legacyReviewId: joi
.string()
.uuid(),
legacyReviewId: joi.id(),
typeId: joi
.string()
.uuid()
Expand Down Expand Up @@ -358,7 +354,7 @@ patchReview.schema = {
.required(),
entity: joi.object().keys({
score: joi.score(),
legacyReviewId: joi.string().uuid(),
legacyReviewId: joi.id(),
typeId: joi.string().uuid(),
reviewerId: joi.alternatives().try(joi.id(), joi.string().uuid()),
scoreCardId: joi.id(),
Expand Down
2 changes: 1 addition & 1 deletion src/services/SubmissionService.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ const listSubmissionsQuerySchema = {
perPage: joi.pageSize(),
orderBy: joi.sortOrder(),
'review.score': joi.score(),
'review.legacyReviewId': joi.string().uuid(),
'review.legacyReviewId': joi.id(),
'review.typeId': joi.string().uuid(),
'review.reviewerId': joi.string().uuid(),
'review.scoreCardId': joi.id(),
Expand Down
24 changes: 12 additions & 12 deletions test/common/testData.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ const testSubmissionsES = {
review: [ {
id: 'd24d4180-65aa-42ec-a945-5fd21dec0502',
score: 92,
legacyReviewId: '6b4faff1-7685-4866-a2e3-24afabf5c2c1',
legacyReviewId: 1234567891,
reviewerId: 'c23a4180-65aa-42ec-a945-5fd21dec0503',
submissionId: 'a12a4180-65aa-42ec-a945-5fd21dec0501',
scoreCardId: 123456789,
Expand Down Expand Up @@ -217,7 +217,7 @@ const testSubmissionsES = {
review: [ {
id: 'd24d4180-65aa-42ec-a945-5fd21dec0502',
score: 92,
legacyReviewId: '6b4faff1-7685-4866-a2e3-24afabf5c2c1',
legacyReviewId: 1234567891,
reviewerId: 'c23a4180-65aa-42ec-a945-5fd21dec0503',
submissionId: 'a12a4180-65aa-42ec-a945-5fd21dec0501',
scoreCardId: 123456789,
Expand Down Expand Up @@ -249,7 +249,7 @@ const testSubmissionsES = {
review: [ {
id: 'd24d4180-65aa-42ec-a945-5fd21dec0502',
score: 92,
legacyReviewId: '6b4faff1-7685-4866-a2e3-24afabf5c2c1',
legacyReviewId: 1234567891,
reviewerId: 'c23a4180-65aa-42ec-a945-5fd21dec0503',
submissionId: 'a12a4180-65aa-42ec-a945-5fd21dec0501',
scoreCardId: 123456789,
Expand Down Expand Up @@ -281,7 +281,7 @@ const testSubmissionsES = {
review: [ {
id: 'd24d4180-65aa-42ec-a945-5fd21dec0502',
score: 92,
legacyReviewId: '6b4faff1-7685-4866-a2e3-24afabf5c2c1',
legacyReviewId: 1234567891,
reviewerId: 'c23a4180-65aa-42ec-a945-5fd21dec0503',
submissionId: 'a12a4180-65aa-42ec-a945-5fd21dec0501',
scoreCardId: 123456789,
Expand Down Expand Up @@ -313,7 +313,7 @@ const testSubmissionsES = {
review: [ {
id: 'd24d4180-65aa-42ec-a945-5fd21dec0502',
score: 92,
legacyReviewId: '6b4faff1-7685-4866-a2e3-24afabf5c2c1',
legacyReviewId: 1234567891,
reviewerId: 'c23a4180-65aa-42ec-a945-5fd21dec0503',
submissionId: 'a12a4180-65aa-42ec-a945-5fd21dec0501',
scoreCardId: 123456789,
Expand All @@ -339,7 +339,7 @@ const testReview = {
Item: {
id: 'd24d4180-65aa-42ec-a945-5fd21dec0502',
score: 92,
legacyReviewId: '6b4faff1-7685-4866-a2e3-24afabf5c2c1',
legacyReviewId: 1234567891,
reviewerId: 'c23a4180-65aa-42ec-a945-5fd21dec0503',
submissionId: 'a12a4180-65aa-42ec-a945-5fd21dec0501',
scoreCardId: 123456789,
Expand All @@ -356,7 +356,7 @@ const testReviewPatch = {
Item: {
id: 'd24d4180-65aa-42ec-a945-5fd21dec0502',
score: 90,
legacyReviewId: '6b4faff1-7685-4866-a2e3-24afabf5c2c1',
legacyReviewId: 1234567891,
reviewerId: 'c23a4180-65aa-42ec-a945-5fd21dec0503',
submissionId: 'a12a4180-65aa-42ec-a945-5fd21dec0501',
scoreCardId: 123456789,
Expand All @@ -380,7 +380,7 @@ const testReviewES = {
_source: {
id: 'd24d4180-65aa-42ec-a945-5fd21dec0502',
score: 92,
legacyReviewId: '6b4faff1-7685-4866-a2e3-24afabf5c2c3',
legacyReviewId: 1234567893,
reviewerId: 'c23a4180-65aa-42ec-a945-5fd21dec0503',
submissionId: 'a12a4180-65aa-42ec-a945-5fd21dec0501',
scoreCardId: 123456789,
Expand All @@ -405,7 +405,7 @@ const testReviewsES = {
_score: 0,
_source:
{ score: 95.5,
legacyReviewId: '6b4faff1-7685-4866-a2e3-24afabf5c2c1',
legacyReviewId: 1234567891,
reviewerId: 'c23a4180-65aa-42ec-a945-5fd21dec0503',
submissionId: 'a12a4180-65aa-42ec-a945-5fd21dec0501',
status: 'queued',
Expand All @@ -422,7 +422,7 @@ const testReviewsES = {
_score: 0,
_source:
{ score: 65,
legacyReviewId: '6b4faff1-7685-4866-a2e3-24afabf5c2c2',
legacyReviewId: 1234567892,
reviewerId: 'c23a4180-65aa-42ec-a945-5fd21dec0503',
submissionId: 'a12a4180-65aa-42ec-a945-5fd21dec0504',
updatedBy: 'admin',
Expand All @@ -439,7 +439,7 @@ const testReviewsES = {
_score: 0,
_source:
{ score: 92,
legacyReviewId: '6b4faff1-7685-4866-a2e3-24afabf5c2c3',
legacyReviewId: 1234567893,
reviewerId: 'c23a4180-65aa-42ec-a945-5fd21dec0503',
submissionId: 'a12a4180-65aa-42ec-a945-5fd21dec0502',
updatedBy: 'admin',
Expand All @@ -456,7 +456,7 @@ const testReviewsES = {
_score: 0,
_source:
{ score: 80.83,
legacyReviewId: '6b4faff1-7685-4866-a2e3-24afabf5c2c4',
legacyReviewId: 1234567894,
reviewerId: 'c23a4180-65aa-42ec-a945-5fd21dec0503',
submissionId: 'a12a4180-65aa-42ec-a945-5fd21dec0503',
updatedBy: 'admin',
Expand Down

0 comments on commit b08cf17

Please sign in to comment.