From 0b677979e403fabf13ca90a8866420cd69de83bb Mon Sep 17 00:00:00 2001 From: Andrew Radulescu Date: Tue, 3 Sep 2024 11:52:27 +0300 Subject: [PATCH] feat: [contracts] expose more data to vic to be able to generate templates --- .../interfaces/user-with-organization.interface.ts | 3 +++ .../_publicAPI/services/user-organization.service.ts | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/backend/src/modules/_publicAPI/interfaces/user-with-organization.interface.ts b/backend/src/modules/_publicAPI/interfaces/user-with-organization.interface.ts index 7794df69..4af96de0 100644 --- a/backend/src/modules/_publicAPI/interfaces/user-with-organization.interface.ts +++ b/backend/src/modules/_publicAPI/interfaces/user-with-organization.interface.ts @@ -13,5 +13,8 @@ export interface IUserWithOrganization { activityArea: string; logo: string; description: string; + cui: string; + legalReprezentativeFullName: string; + legalReprezentativeRole: string; }; } diff --git a/backend/src/modules/_publicAPI/services/user-organization.service.ts b/backend/src/modules/_publicAPI/services/user-organization.service.ts index db9534cc..ebbff119 100644 --- a/backend/src/modules/_publicAPI/services/user-organization.service.ts +++ b/backend/src/modules/_publicAPI/services/user-organization.service.ts @@ -38,7 +38,7 @@ export class UserOrganizationService { } // check if there is an organization id - this methods also handles organization not found - const { organizationGeneral, organizationActivity } = + const { organizationGeneral, organizationActivity, organizationLegal } = await this.organizationService.findWithRelations(user.organizationId); // parse organization activityArea to string @@ -61,6 +61,11 @@ export class UserOrganizationService { activityArea: activityArea, logo: organizationGeneral.logo, description: organizationGeneral.shortDescription, + cui: organizationGeneral.cui, + legalReprezentativeFullName: + organizationLegal?.legalReprezentative?.fullName || '', + legalReprezentativeRole: + organizationLegal?.legalReprezentative?.role || '', }, }; } catch (error) {