Open vhuty opened 6 months ago
When creating a certificate, it's possible for two connections to create same certificate multiple times: https://github.com/diia-open-source/be-user-service/blob/b45a0e2db354df110a99254516a414aaac43be61/src/services/diiaId.ts#L166
Executing countDocuments and confirmEresidentCreation in a single transaction should solve this issue
countDocuments
confirmEresidentCreation
When creating a certificate, it's possible for two connections to create same certificate multiple times: https://github.com/diia-open-source/be-user-service/blob/b45a0e2db354df110a99254516a414aaac43be61/src/services/diiaId.ts#L166
Executing
countDocuments
andconfirmEresidentCreation
in a single transaction should solve this issue