WuriGuinea / mosip-guinea-ref-impl

Customized MOSIP hooks repository for Guinea implementation
Mozilla Public License 2.0
0 stars 2 forks source link

API center creation 500 duplicate #428

Closed mombe090 closed 3 years ago

mombe090 commented 3 years ago

Hey @ankitvaishnav, please as discuss this issue for error duplication found when we try to create a new center image

mombe090 commented 3 years ago

{ "id":"", "metadata":{ }, "request":{ "addressLine1":"Test FROM API 1", "addressLine2":"CONAKRY", "addressLine3":"GUINEE", "centerEndTime":"18:30:00", "centerStartTime":"08:00:00", "centerTypeCode":"CEI", "contactPerson":"Tech Team", "contactPhone":"62220000", "exceptionalHolidayPutPostDto":[], "holidayLocationCode":"GN", "id":"", "isActive":true, "langCode":"fra", "latitude":"0.0000", "locationCode":"0040205", "longitude":"0.0000", "lunchEndTime":"14:00:00", "lunchStartTime":"13:00:00", "name":"Test Center API", "perKioskProcessTime":"00:15:00", "timeZone":"(GMT+00h00) GREENWICH MEAN TIME", "workingHours":"8", "workingNonWorkingDays":{ "fri":true, "mon":true, "sat":false, "sun":false, "thu":true, "tue":true, "wed":true }, "zoneCode":"1" }, "requesttime":"2018-12-10T06:12:52.994Z", "version":"1.0" }

ankitvaishnav commented 3 years ago

Resolution: We have to update the rcid_seq with the last registration center id as we are inserting the data directly from the dmls.

Steps:

  1. Connect with mosip_master database
  2. Run query: Insert into rcid_seq (curr_seq_no, cr_by, cr_dtimes, upd_by, upd_dtimes) select max(id)::int, 'superadmin', now(), 'superadmin', now() from registration_center;
ankitvaishnav commented 3 years ago

@mombe090 Please try and confirm

mombe090 commented 3 years ago

hey @ankitvaishnav still not working { "id": "", "version": "1.0", "responsetime": "2021-03-23T12:19:42.909Z", "metadata": null, "response": null, "errors": [ { "errorCode": "KER-MSD-060", "message": "Error occurred while Inserting Registration Center details ERROR: duplicate key value violates unique constraint \"pk_regcntr_code\"\n Detail: Key (id, lang_code)=(10001, fra) already exists." } ] }

mombe090 commented 3 years ago

Thanks @ankitvaishnav with the script u share, it's work fine now Insert into rcid_seq (curr_seq_no, cr_by, cr_dtimes, upd_by, upd_dtimes) select max(id)::int, 'superadmin', now(), 'superadmin', now() from registration_center;