Skip to content

Commit

Permalink
feat: [590] fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dragos1195 committed Jul 29, 2024
1 parent ac931ca commit 5d4ca7a
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@ export class OrganizationGeneralService {
{ id: Not(orgGeneralId), alias: newDTO?.alias },
{ id: Not(orgGeneralId), email: newDTO?.email },
{ id: Not(orgGeneralId), phone: newDTO?.phone },
{
id: Not(orgGeneralId),
nationalRegistryNumber: newDTO?.nationalRegistryNumber,
},
{
id: Not(orgGeneralId),
associationRegistryNumber: newDTO?.associationRegistryNumber,
},
],
});
for (let i = 0; i < existing.length; i++) {
Expand All @@ -179,6 +187,21 @@ export class OrganizationGeneralService {
ORGANIZATION_REQUEST_ERRORS.CREATE.ORGANIZATION_PHONE_EXISTS,
);
}
if (
existing[i].nationalRegistryNumber === newDTO?.nationalRegistryNumber
) {
errors.push(
ORGANIZATION_REQUEST_ERRORS.CREATE.NATIONAL_REGISTRY_NUMBER_EXISTS,
);
}
if (
existing[i].associationRegistryNumber ===
newDTO?.associationRegistryNumber
) {
errors.push(
ORGANIZATION_REQUEST_ERRORS.CREATE.ASSOCIATION_REGISTRY_NUMBER_EXISTS,
);
}
}

if (errors.length) {
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/assets/locales/ro/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@
"REQ_010": "Există deja o organizație cu acest alias",
"REQ_011": "Există deja o organizație cu acest e-mail",
"REQ_012": "Există deja o organizație cu acest număr de telefon",
"REQ_013": "Există deja o organizație cu acest Număr si data de înscriere în Registrul Special",
"REQ_014": "Există deja o organizație cu acest Numărul de înregistrare în Registrul Național",
"REQ_002": "Există deja o cerere cu acest e-mail sau cu acest număr de telefon.",
"ORG_026": "Eroare la actualizarea datelor generale"
}
Expand Down Expand Up @@ -330,7 +332,7 @@
"required": "Secțiunea din Registrul Special este obligatorie",
"max": "Secțiunea din Registrul Special poate avea maxim 10 de caractere",
"helper": "Secțiunea care apare pe Certificatul de înscriere a persoanei juridice fără scop patrimonial, după număr, dată și parte.",
"label": "Secțiuna",
"label": "Secțiunea",
"placeholder": "I"
},
"association_registry_issuer": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export const enum CREATE_ORGANIZARION_ERRORS {
REQ_010 = 'REQ_010',
REQ_011 = 'REQ_011',
REQ_012 = 'REQ_012',
REQ_013 = 'REQ_013',
REQ_014 = 'REQ_014',
FILE_002 = 'FILE_002',
FILE_003 = 'FILE_003',
FILE_004 = 'FILE_004',
Expand Down Expand Up @@ -39,6 +41,8 @@ export class CreateOrganizationError extends ErrorClass<CREATE_ORGANIZARION_ERRO
[CREATE_ORGANIZARION_ERRORS.REQ_010]: i18n.t('organization:create.errors.REQ_010'),
[CREATE_ORGANIZARION_ERRORS.REQ_011]: i18n.t('organization:create.errors.REQ_011'),
[CREATE_ORGANIZARION_ERRORS.REQ_012]: i18n.t('organization:create.errors.REQ_012'),
[CREATE_ORGANIZARION_ERRORS.REQ_013]: i18n.t('organization:create.errors.REQ_013'),
[CREATE_ORGANIZARION_ERRORS.REQ_014]: i18n.t('organization:create.errors.REQ_014'),
});
}

Expand Down
4 changes: 3 additions & 1 deletion frontend/src/services/nomenclature/Nomenclature.queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ export const useCountiesQuery = () => {

export const useIssuersQuery = () => {
const { setIssuers } = useStore();
return useQuery('issuers', () => getIssuers(), {
return useQuery(['issuers'], () => getIssuers(), {
cacheTime: 1000 * 60 * 60,
staleTime: 1000 * 60 * 60,
onSuccess: (data: Issuer[]) => {
setIssuers(data);
},
Expand Down

0 comments on commit 5d4ca7a

Please sign in to comment.