Register MDS is allowing to create a MDS with duplicate data

Story point estimate

Description

Register MDS is allowing to create a MDS with duplicate data.

Request: any mds details which already exist,
{
"id": "string",
"metadata": {},
"request": {
"deviceProviderId": "SYNCBYTE.MC01A",
"isActive": true,
"make": "make1",
"model": "model1",
"regDeviceSubCode": "Slab",
"regDeviceTypeCode": "Finger",
"swBinaryHash": "test",
"swCreateDateTime": "2019-11-19T07:00:13.375Z",
"swExpiryDateTime": "2020-11-30T07:00:13.375Z",
"swVersion": "TestMDS1"
},
"requesttime": "2020-03-06T06:16:30.119Z",
"version": "string"
}
Actual response:
{
"id": "string",
"version": "string",
"responsetime": "2020-03-06T06:16:35.921Z",
"errors": [
{
"errorCode": "ADM-DPM-022",
"message": "Error occurred while storing MDS Details ERROR: duplicate key value violates unique constraint \"uk_mds\"\n Detail: Key (sw_version, dprovider_id, dtype_code, dstype_code, make, model)\u003d(TestMDS1, SYNCBYTE.MC01A, Finger, Slab, make1, model1) already exists."
}
]
}
Expected response:
It should handle this scenario and provide proper error code messages. currently it is providing Data Base message.

Environment

qa

Activity

Show:

ravi.kant2@mindtree.com March 16, 2020 at 12:42 PM

Isssue is fixed and working as expected. result while creating duplicate MDS is:
{
"id": "string",
"version": "string",
"responsetime": "2020-03-16T07:22:46.116Z",
"errors": [
{
"errorCode": "ADM-DPM-021",
"message": "MOSIP-Device-Service already exist"
}
]
}

Ramadurai Pandian March 12, 2020 at 4:28 AM

Issue is fixed by adding the message for this scenario

Fixed

Details

Assignee

Reporter

Severity

Minor

Closed Date

Mar 16, 2020, 12:41 PM

Rootcause

Design issue

Time tracking

0.5h logged

Priority

Created March 9, 2020 at 6:21 AM
Updated March 16, 2020 at 12:42 PM
Resolved March 12, 2020 at 4:29 AM