From 92f97c92ff29185bea3e0990a9528cc1a17d1137 Mon Sep 17 00:00:00 2001 From: NamrataSweya Date: Thu, 29 Aug 2024 16:17:17 +0530 Subject: [PATCH 1/4] fixed certificatelog in certifcate manu in apiuser login --- .../certificate-log.service.ts | 51 +++---- .../pods/device-group/device-group.service.ts | 133 ++++++++++-------- version | 2 +- 3 files changed, 104 insertions(+), 82 deletions(-) diff --git a/apps/drec-api/src/pods/certificate-log/certificate-log.service.ts b/apps/drec-api/src/pods/certificate-log/certificate-log.service.ts index 9218384b2..51992bbcd 100755 --- a/apps/drec-api/src/pods/certificate-log/certificate-log.service.ts +++ b/apps/drec-api/src/pods/certificate-log/certificate-log.service.ts @@ -54,7 +54,7 @@ export class CertificateLogService { private deviceService: DeviceService, private devicegroupService: DeviceGroupService, - ) {} + ) { } public async find(): Promise { this.logger.verbose(`With in find`); @@ -625,8 +625,8 @@ export class CertificateLogService { pageNumber: number, ): Promise<{ certificatelog: - | CertificateNewWithPerDeviceLog[] - | CertificateWithPerdevicelog[]; + | CertificateNewWithPerDeviceLog[] + | CertificateWithPerdevicelog[]; currentpage?: number; totalPages: number; totalCount: number; @@ -656,12 +656,6 @@ export class CertificateLogService { 'getoldreservationinfo', getoldreservationinfo.deviceGroups.length, ); - if (getoldreservationinfo.deviceGroups.length > 0) { - return this.getDeveloperfindreservationcertified( - getoldreservationinfo, - user.role, - ); - } if (getnewreservationinfo.deviceGroups.length > 0) { this.logger.debug('Line No: 580'); return this.getDeveloperCertificatesUsingGroupIDVersionUpdateOrigin247( @@ -669,6 +663,13 @@ export class CertificateLogService { user.role, ); } + if (getoldreservationinfo.deviceGroups.length > 0) { + return this.getDeveloperfindreservationcertified( + getoldreservationinfo, + user.role, + ); + } + return { certificatelog: [], currentpage: 0, @@ -680,11 +681,11 @@ export class CertificateLogService { async getDeveloperfindreservationcertified( certifiedreservation: | { - deviceGroups: any; - pageNumber: number; - totalPages: number; - totalCount: any; - } + deviceGroups: any; + pageNumber: number; + totalPages: number; + totalCount: any; + } | any, role: Role, ): Promise { @@ -695,7 +696,7 @@ export class CertificateLogService { const newq = await this.certificaterrepository .createQueryBuilder('issuar') .where( - `issuar.id IN (${JSON.stringify(group.internalCertificateId).replace(/[[]]/g, '')})`, + `issuar.id IN (${JSON.stringify(group.internalCertificateId).replace(/[[\]]/g, '')})`, ); const groupedDatasql = await newq.getQuery(); @@ -787,7 +788,7 @@ export class CertificateLogService { } } } - if (role === 'Buyer') { + if (role === 'Buyer' || role === Role.ApiUser) { devicelog = await this.getCheckCertificateIssueDateLogForDevice( parseInt(group.dg_id), @@ -829,11 +830,11 @@ export class CertificateLogService { async getDeveloperCertificatesUsingGroupIDVersionUpdateOrigin247( getreservationinfo: | { - deviceGroups: any; - pageNumber: number; - totalPages: number; - totalCount: any; - } + deviceGroups: any; + pageNumber: number; + totalPages: number; + totalCount: any; + } | any, role: Role, ): Promise { @@ -1061,10 +1062,10 @@ export class CertificateLogService { res.setHeader( 'Content-Disposition', 'attachment; filename=' + - name + - ' ' + - new Date().toLocaleDateString() + - '.csv', + name + + ' ' + + new Date().toLocaleDateString() + + '.csv', ); res.setHeader('Content-Type', 'text/csv'); const csvString = `${headers.join(',')}\n${data.map((obj) => headers.map((key) => obj[key]).join(',')).join('\n')}`; diff --git a/apps/drec-api/src/pods/device-group/device-group.service.ts b/apps/drec-api/src/pods/device-group/device-group.service.ts index c78431d18..d89e60bf3 100755 --- a/apps/drec-api/src/pods/device-group/device-group.service.ts +++ b/apps/drec-api/src/pods/device-group/device-group.service.ts @@ -112,7 +112,7 @@ export class DeviceGroupService { CertificateReadModelEntity >, private readonly userService: UserService, - ) {} + ) { } async getAll( user?: ILoggedInUser, @@ -123,11 +123,11 @@ export class DeviceGroupService { filterDto?: UnreservedDeviceGroupsFilterDTO, ): Promise< | { - devicegroups: DeviceGroupDTO[]; - currentPage: number; - totalPages: number; - totalCount: number; - } + devicegroups: DeviceGroupDTO[]; + currentPage: number; + totalPages: number; + totalCount: number; + } | any > { this.logger.verbose(`With in dg service ${filterDto}`); @@ -774,11 +774,11 @@ export class DeviceGroupService { limit?: number, ): Promise< | { - csvJobs: Array; - currentPage: number; - totalPages: number; - totalCount: number; - } + csvJobs: Array; + currentPage: number; + totalPages: number; + totalCount: number; + } | any > { this.logger.verbose(`With in getAllCSVJobsForOrganization`); @@ -819,11 +819,11 @@ export class DeviceGroupService { limit?: number, ): Promise< | { - csvJobs: Array; - currentPage: number; - totalPages: number; - totalCount: number; - } + csvJobs: Array; + currentPage: number; + totalPages: number; + totalCount: number; + } | any > { this.logger.verbose(`With in getAllCSVJobsForAdmin`); @@ -930,9 +930,9 @@ export class DeviceGroupService { devices.filter((ele) => { if ( new Date(data.reservationStartDate).getTime() < - new Date(ele.createdAt).getTime() && + new Date(ele.createdAt).getTime() && new Date(data.reservationEndDate).getTime() <= - new Date(ele.createdAt).getTime() + new Date(ele.createdAt).getTime() ) { return true; } @@ -1053,7 +1053,7 @@ export class DeviceGroupService { reservationStartDate: data.reservationStartDate, reservationEndDate: new Date(data.reservationEndDate).getTime() < - new Date(device.createdAt).getTime() + new Date(device.createdAt).getTime() ? data.reservationEndDate : device.createdAt, device_createdAt: device.createdAt, @@ -1088,8 +1088,8 @@ export class DeviceGroupService { devices.forEach((ele) => ele.groupId != null ? unavailableDeviceIdsDueToAlreadyIncludedInBuyerReservation.push( - ele.id, - ) + ele.id, + ) : '', ); devices = devices.filter((ele) => ele.groupId === null); @@ -1252,8 +1252,8 @@ export class DeviceGroupService { responseDeviceGroupDTO.unavailableDeviceIDsDueToAreIncludedInBuyerReservation = unavailableDeviceIdsDueToAlreadyIncludedInBuyerReservation.length > 0 ? unavailableDeviceIdsDueToAlreadyIncludedInBuyerReservation.join( - ' , ', - ) + ' , ', + ) : ''; delete responseDeviceGroupDTO['deviceIdsInt']; return responseDeviceGroupDTO; @@ -1941,7 +1941,7 @@ export class DeviceGroupService { ) { if ( recordsCopy[i].externalId.toLowerCase() === - recordsCopy[j].externalId.toLowerCase() && + recordsCopy[j].externalId.toLowerCase() && recordsCopy[j]['statusDuplicate'] === false ) { recordsCopy[j]['statusDuplicate'] = true; @@ -2585,6 +2585,13 @@ export class DeviceGroupService { certificateEndDate1: endTimestamp, }, ); + qb.orWhere( + 'crm.generationEndTime BETWEEN :certificateStartDate1 AND :certificateEndDate1', + { + certificateStartDate1: startTimestamp, + certificateEndDate1: endTimestamp, + }, + ); } if (filterDto.SDGBenefits) { const newsdg = filterDto.SDGBenefits.toString(); @@ -2636,11 +2643,6 @@ export class DeviceGroupService { ); }); const totalCountQuery = await queryBuilder.getRawMany(); - const groupedDatasql = await queryBuilder - .offset(skip) - .limit(pageSize) - .getSql(); - this.logger.debug(groupedDatasql); const groupedData = await queryBuilder .offset(skip) .limit(pageSize) @@ -2655,8 +2657,8 @@ export class DeviceGroupService { const existing = acc.find((item) => item.dg_id === curr.devicegroupid); if (existing) { - const existing1 = acc.find((item) => item.id === curr.id); - if (existing1) { + const existingDevice = existing.developerdeviceIds.find((item) => item === curr.id); + if (!existingDevice) { existing.developerdeviceIds.push(curr.id); } existing.internalCertificateId.push(curr.internalCertificateId); @@ -2729,7 +2731,7 @@ export class DeviceGroupService { 'CAST(issuer.deviceId AS INTEGER) = dg.id', ) .select( - 'DISTINCT ON (dg.id, issuer.id) dg.id AS deviceGroupId, dg.name, dg.deviceIdsInt, d.*, dg_log.readvalue_watthour, issuer.id', + 'DISTINCT ON (dg.id, issuer.id) dg.id AS deviceGroupId, dg.name, dg.deviceIdsInt, d.*, dg_log.readvalue_watthour, issuer.id As issuerId', ) .orderBy('dg.id, issuer.id, dg_log.readvalue_watthour', 'ASC'); @@ -2920,27 +2922,46 @@ export class DeviceGroupService { this.logger.debug('totalCountQuery', totalCount); const totalPages = Math.ceil(totalCount / pageSize); - const deviceGroups = groupedData.reduce((acc, curr) => { - const existing = acc.find((item) => item.dg_id === curr.dg_id); - if (existing) { - const existing1 = acc.find((item) => item.id === curr.id); - if (existing1) { - existing.developerdeviceIds.push(curr.id); - } - existing.internalCertificateId.push(curr.id); - } else { - acc.push({ - dg_id: curr.devicegroupid, - name: curr.name, - deviceIdsInt: curr.deviceIdsInt, + let deviceGroups: any; + if (role === 'OrganizationAdmin') { + deviceGroups = groupedData.reduce((acc, curr) => { + const existing = acc.find((item) => item.dg_id === curr.devicegroupid); - developerdeviceIds: [curr.id], - internalCertificateId: [curr.id], - }); - } - return acc; - }, []); + if (existing) { + const existingDevice = existing.developerdeviceIds.find((item) => item === curr.id); + if (!existingDevice) { + existing.developerdeviceIds.push(curr.id); + } + existing.internalCertificateId.push(curr.issuerid); + } else { + acc.push({ + dg_id: curr.devicegroupid, + name: curr.name, + deviceIdsInt: curr.deviceIdsInt, + developerdeviceIds: [curr.id], + internalCertificateId: [curr.issuerid], + }); + } + return acc; + }, []); + } + if (role === 'Buyer' || role === Role.ApiUser) { + deviceGroups = groupedData.reduce((acc, curr) => { + const existing = acc.find((item) => item.dg_id === curr.devicegroupid); + if (existing) { + existing.internalCertificateId.push(curr.issuerid); + } else { + acc.push({ + dg_id: curr.devicegroupid, + name: curr.name, + deviceIdsInt: curr.deviceIdsInt, + internalCertificateId: [curr.issuerid], + }); + } + return acc; + }, []); + } const response = { deviceGroups, pageNumber, @@ -2972,11 +2993,11 @@ export class DeviceGroupService { limit?: number, ): Promise< | { - csvJobs: Array; - currentPage: number; - totalPages: number; - totalCount: number; - } + csvJobs: Array; + currentPage: number; + totalPages: number; + totalCount: number; + } | any > { this.logger.verbose(`With in getAllCSVJobsForApiUser`); diff --git a/version b/version index bbb8b6ed7..798a352e0 100755 --- a/version +++ b/version @@ -1 +1 @@ -0.0.143 +0.0.144 From 934878991e7395bcc183b351100c8ad72dec228b Mon Sep 17 00:00:00 2001 From: NamrataSweya Date: Thu, 29 Aug 2024 16:20:51 +0530 Subject: [PATCH 2/4] fixed prettier issue --- .../certificate-log.service.ts | 36 +++++----- .../pods/device-group/device-group.service.ts | 66 ++++++++++--------- 2 files changed, 53 insertions(+), 49 deletions(-) diff --git a/apps/drec-api/src/pods/certificate-log/certificate-log.service.ts b/apps/drec-api/src/pods/certificate-log/certificate-log.service.ts index 51992bbcd..200ff7dd1 100755 --- a/apps/drec-api/src/pods/certificate-log/certificate-log.service.ts +++ b/apps/drec-api/src/pods/certificate-log/certificate-log.service.ts @@ -54,7 +54,7 @@ export class CertificateLogService { private deviceService: DeviceService, private devicegroupService: DeviceGroupService, - ) { } + ) {} public async find(): Promise { this.logger.verbose(`With in find`); @@ -625,8 +625,8 @@ export class CertificateLogService { pageNumber: number, ): Promise<{ certificatelog: - | CertificateNewWithPerDeviceLog[] - | CertificateWithPerdevicelog[]; + | CertificateNewWithPerDeviceLog[] + | CertificateWithPerdevicelog[]; currentpage?: number; totalPages: number; totalCount: number; @@ -669,7 +669,7 @@ export class CertificateLogService { user.role, ); } - + return { certificatelog: [], currentpage: 0, @@ -681,11 +681,11 @@ export class CertificateLogService { async getDeveloperfindreservationcertified( certifiedreservation: | { - deviceGroups: any; - pageNumber: number; - totalPages: number; - totalCount: any; - } + deviceGroups: any; + pageNumber: number; + totalPages: number; + totalCount: any; + } | any, role: Role, ): Promise { @@ -830,11 +830,11 @@ export class CertificateLogService { async getDeveloperCertificatesUsingGroupIDVersionUpdateOrigin247( getreservationinfo: | { - deviceGroups: any; - pageNumber: number; - totalPages: number; - totalCount: any; - } + deviceGroups: any; + pageNumber: number; + totalPages: number; + totalCount: any; + } | any, role: Role, ): Promise { @@ -1062,10 +1062,10 @@ export class CertificateLogService { res.setHeader( 'Content-Disposition', 'attachment; filename=' + - name + - ' ' + - new Date().toLocaleDateString() + - '.csv', + name + + ' ' + + new Date().toLocaleDateString() + + '.csv', ); res.setHeader('Content-Type', 'text/csv'); const csvString = `${headers.join(',')}\n${data.map((obj) => headers.map((key) => obj[key]).join(',')).join('\n')}`; diff --git a/apps/drec-api/src/pods/device-group/device-group.service.ts b/apps/drec-api/src/pods/device-group/device-group.service.ts index d89e60bf3..537891cea 100755 --- a/apps/drec-api/src/pods/device-group/device-group.service.ts +++ b/apps/drec-api/src/pods/device-group/device-group.service.ts @@ -112,7 +112,7 @@ export class DeviceGroupService { CertificateReadModelEntity >, private readonly userService: UserService, - ) { } + ) {} async getAll( user?: ILoggedInUser, @@ -123,11 +123,11 @@ export class DeviceGroupService { filterDto?: UnreservedDeviceGroupsFilterDTO, ): Promise< | { - devicegroups: DeviceGroupDTO[]; - currentPage: number; - totalPages: number; - totalCount: number; - } + devicegroups: DeviceGroupDTO[]; + currentPage: number; + totalPages: number; + totalCount: number; + } | any > { this.logger.verbose(`With in dg service ${filterDto}`); @@ -774,11 +774,11 @@ export class DeviceGroupService { limit?: number, ): Promise< | { - csvJobs: Array; - currentPage: number; - totalPages: number; - totalCount: number; - } + csvJobs: Array; + currentPage: number; + totalPages: number; + totalCount: number; + } | any > { this.logger.verbose(`With in getAllCSVJobsForOrganization`); @@ -819,11 +819,11 @@ export class DeviceGroupService { limit?: number, ): Promise< | { - csvJobs: Array; - currentPage: number; - totalPages: number; - totalCount: number; - } + csvJobs: Array; + currentPage: number; + totalPages: number; + totalCount: number; + } | any > { this.logger.verbose(`With in getAllCSVJobsForAdmin`); @@ -930,9 +930,9 @@ export class DeviceGroupService { devices.filter((ele) => { if ( new Date(data.reservationStartDate).getTime() < - new Date(ele.createdAt).getTime() && + new Date(ele.createdAt).getTime() && new Date(data.reservationEndDate).getTime() <= - new Date(ele.createdAt).getTime() + new Date(ele.createdAt).getTime() ) { return true; } @@ -1053,7 +1053,7 @@ export class DeviceGroupService { reservationStartDate: data.reservationStartDate, reservationEndDate: new Date(data.reservationEndDate).getTime() < - new Date(device.createdAt).getTime() + new Date(device.createdAt).getTime() ? data.reservationEndDate : device.createdAt, device_createdAt: device.createdAt, @@ -1088,8 +1088,8 @@ export class DeviceGroupService { devices.forEach((ele) => ele.groupId != null ? unavailableDeviceIdsDueToAlreadyIncludedInBuyerReservation.push( - ele.id, - ) + ele.id, + ) : '', ); devices = devices.filter((ele) => ele.groupId === null); @@ -1252,8 +1252,8 @@ export class DeviceGroupService { responseDeviceGroupDTO.unavailableDeviceIDsDueToAreIncludedInBuyerReservation = unavailableDeviceIdsDueToAlreadyIncludedInBuyerReservation.length > 0 ? unavailableDeviceIdsDueToAlreadyIncludedInBuyerReservation.join( - ' , ', - ) + ' , ', + ) : ''; delete responseDeviceGroupDTO['deviceIdsInt']; return responseDeviceGroupDTO; @@ -1941,7 +1941,7 @@ export class DeviceGroupService { ) { if ( recordsCopy[i].externalId.toLowerCase() === - recordsCopy[j].externalId.toLowerCase() && + recordsCopy[j].externalId.toLowerCase() && recordsCopy[j]['statusDuplicate'] === false ) { recordsCopy[j]['statusDuplicate'] = true; @@ -2657,7 +2657,9 @@ export class DeviceGroupService { const existing = acc.find((item) => item.dg_id === curr.devicegroupid); if (existing) { - const existingDevice = existing.developerdeviceIds.find((item) => item === curr.id); + const existingDevice = existing.developerdeviceIds.find( + (item) => item === curr.id, + ); if (!existingDevice) { existing.developerdeviceIds.push(curr.id); } @@ -2928,7 +2930,9 @@ export class DeviceGroupService { const existing = acc.find((item) => item.dg_id === curr.devicegroupid); if (existing) { - const existingDevice = existing.developerdeviceIds.find((item) => item === curr.id); + const existingDevice = existing.developerdeviceIds.find( + (item) => item === curr.id, + ); if (!existingDevice) { existing.developerdeviceIds.push(curr.id); } @@ -2993,11 +2997,11 @@ export class DeviceGroupService { limit?: number, ): Promise< | { - csvJobs: Array; - currentPage: number; - totalPages: number; - totalCount: number; - } + csvJobs: Array; + currentPage: number; + totalPages: number; + totalCount: number; + } | any > { this.logger.verbose(`With in getAllCSVJobsForApiUser`); From a3a2b9e1e062f8d6dbca33d32eb1d0e20a5ad172 Mon Sep 17 00:00:00 2001 From: NamrataSweya Date: Fri, 30 Aug 2024 11:38:26 +0530 Subject: [PATCH 3/4] added one more or condition in older for commissioning date filter and and added one more query param for check old and new log --- .../certificate-log.service.spec.ts | 2 ++ .../certificate-log.service.ts | 34 +++++++++++++++---- .../pods/certificate-log/dto/filter.dto.ts | 7 ++++ .../pods/device-group/device-group.service.ts | 13 +++++-- version | 2 +- 5 files changed, 47 insertions(+), 11 deletions(-) diff --git a/apps/drec-api/src/pods/certificate-log/certificate-log.service.spec.ts b/apps/drec-api/src/pods/certificate-log/certificate-log.service.spec.ts index 0f80412c5..d80670b3d 100644 --- a/apps/drec-api/src/pods/certificate-log/certificate-log.service.spec.ts +++ b/apps/drec-api/src/pods/certificate-log/certificate-log.service.spec.ts @@ -302,6 +302,7 @@ describe('CertificateLogService', () => { end_date: '2024-02-14 12:51:000Z', country: 'India', SDGBenefits: undefined, + oldcertificatelog: false, }; const pageNumber = 1; @@ -559,6 +560,7 @@ describe('CertificateLogService', () => { end_date: '2024-02-14 12:51:000Z', country: 'India', SDGBenefits: undefined, + oldcertificatelog: false, }; const pageNumber = 1; diff --git a/apps/drec-api/src/pods/certificate-log/certificate-log.service.ts b/apps/drec-api/src/pods/certificate-log/certificate-log.service.ts index 200ff7dd1..aa517dfc8 100755 --- a/apps/drec-api/src/pods/certificate-log/certificate-log.service.ts +++ b/apps/drec-api/src/pods/certificate-log/certificate-log.service.ts @@ -630,6 +630,7 @@ export class CertificateLogService { currentpage?: number; totalPages: number; totalCount: number; + oldcertificatelog: boolean; }> { this.logger.verbose(`With in getCertifiedlogofDevices`); const getnewreservationinfo = @@ -656,18 +657,33 @@ export class CertificateLogService { 'getoldreservationinfo', getoldreservationinfo.deviceGroups.length, ); - if (getnewreservationinfo.deviceGroups.length > 0) { + const oldcertificatelog = this.isTrue(filterDto.oldcertificatelog); + if (!oldcertificatelog && getnewreservationinfo.deviceGroups.length > 0) { this.logger.debug('Line No: 580'); - return this.getDeveloperCertificatesUsingGroupIDVersionUpdateOrigin247( - getnewreservationinfo, - user.role, - ); + const newlog = + await this.getDeveloperCertificatesUsingGroupIDVersionUpdateOrigin247( + getnewreservationinfo, + user.role, + ); + + return { + ...newlog, + oldcertificatelog: + getoldreservationinfo.deviceGroups.length > 0 ? true : false, + }; } - if (getoldreservationinfo.deviceGroups.length > 0) { - return this.getDeveloperfindreservationcertified( + + if (oldcertificatelog && getoldreservationinfo.deviceGroups.length > 0) { + this.logger.debug('Line No: 581'); + const oldlog = await this.getDeveloperfindreservationcertified( getoldreservationinfo, user.role, ); + return { + ...oldlog, + oldcertificatelog: + getoldreservationinfo.deviceGroups.length > 0 ? true : false, + }; } return { @@ -675,8 +691,12 @@ export class CertificateLogService { currentpage: 0, totalPages: 0, totalCount: 0, + oldcertificatelog: false, }; } + isTrue(value: any): boolean { + return value === 'true' || value === true; + } async getDeveloperfindreservationcertified( certifiedreservation: diff --git a/apps/drec-api/src/pods/certificate-log/dto/filter.dto.ts b/apps/drec-api/src/pods/certificate-log/dto/filter.dto.ts index 0b4d94c33..3eafd795a 100755 --- a/apps/drec-api/src/pods/certificate-log/dto/filter.dto.ts +++ b/apps/drec-api/src/pods/certificate-log/dto/filter.dto.ts @@ -54,6 +54,7 @@ export class FilterDTO { @IsOptional() @ApiPropertyOptional({ description: 'Certificate End date filter' }) end_date: string; + @IsOptional() @ApiPropertyOptional({ type: String, description: 'Country' }) country: string; @@ -65,6 +66,12 @@ export class FilterDTO { isArray: true, }) SDGBenefits?: string[] | undefined; + @IsOptional() + @ApiPropertyOptional({ + type: Boolean, + description: 'old certificate', + }) + oldcertificatelog?: boolean; } export class GroupIDBasedFilteringDTO { diff --git a/apps/drec-api/src/pods/device-group/device-group.service.ts b/apps/drec-api/src/pods/device-group/device-group.service.ts index 537891cea..2aaa1bf77 100755 --- a/apps/drec-api/src/pods/device-group/device-group.service.ts +++ b/apps/drec-api/src/pods/device-group/device-group.service.ts @@ -2586,10 +2586,10 @@ export class DeviceGroupService { }, ); qb.orWhere( - 'crm.generationEndTime BETWEEN :certificateStartDate1 AND :certificateEndDate1', + 'crm.generationEndTime BETWEEN :certificateStartDate2 AND :certificateEndDate2', { - certificateStartDate1: startTimestamp, - certificateEndDate1: endTimestamp, + certificateStartDate2: startTimestamp, + certificateEndDate2: endTimestamp, }, ); } @@ -2860,6 +2860,13 @@ export class DeviceGroupService { certificateEndDate1: endTimestamp, }, ); + qb.orWhere( + 'issuer.generationEndTime BETWEEN :certificateStartDate2 AND :certificateEndDate2', + { + certificateStartDate2: startTimestamp, + certificateEndDate2: endTimestamp, + }, + ); } if (filterDto.SDGBenefits) { const newsdg = filterDto.SDGBenefits.toString(); diff --git a/version b/version index 798a352e0..b054b1a5a 100755 --- a/version +++ b/version @@ -1 +1 @@ -0.0.144 +0.0.145 From 16431b9b4f9a85db8e5ee4960bc76783827cd1b0 Mon Sep 17 00:00:00 2001 From: NamrataSweya Date: Fri, 30 Aug 2024 11:46:37 +0530 Subject: [PATCH 4/4] fix eslint issue --- .../src/pods/certificate-log/certificate-log.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/drec-api/src/pods/certificate-log/certificate-log.service.ts b/apps/drec-api/src/pods/certificate-log/certificate-log.service.ts index aa517dfc8..c9812f115 100755 --- a/apps/drec-api/src/pods/certificate-log/certificate-log.service.ts +++ b/apps/drec-api/src/pods/certificate-log/certificate-log.service.ts @@ -694,7 +694,7 @@ export class CertificateLogService { oldcertificatelog: false, }; } - isTrue(value: any): boolean { + isTrue(value: string | boolean): boolean { return value === 'true' || value === true; }