diff --git a/apps/api-gateway/src/issuance/issuance.controller.ts b/apps/api-gateway/src/issuance/issuance.controller.ts index ac0341ee9..27bfb0477 100644 --- a/apps/api-gateway/src/issuance/issuance.controller.ts +++ b/apps/api-gateway/src/issuance/issuance.controller.ts @@ -42,6 +42,7 @@ import { ForbiddenErrorDto } from '../dtos/forbidden-error.dto'; import { Response } from 'express'; import IResponseType, { IResponse } from '@credebl/common/interfaces/response.interface'; import { IssuanceService } from './issuance.service'; +import { CommonConstants } from '../../../../libs/common/src/common.constant'; import { ClientDetails, CredentialQuery, @@ -401,7 +402,7 @@ async downloadBulkIssuanceCSVTemplate( required: true }) @UseInterceptors(FileInterceptor('file', { - limits: { fieldSize: Number(process.env.FIELD_UPLOAD_SIZE) || 100 * 1024 * 1024 } + limits: { fieldSize: Number(process.env.FIELD_UPLOAD_SIZE) || CommonConstants.DEFAULT_FIELD_UPLOAD_SIZE } })) async issueBulkCredentials( diff --git a/apps/issuance/src/issuance.service.ts b/apps/issuance/src/issuance.service.ts index b2119288f..ae9ba66d3 100644 --- a/apps/issuance/src/issuance.service.ts +++ b/apps/issuance/src/issuance.service.ts @@ -37,6 +37,7 @@ import * as pLimit from 'p-limit'; import { UserActivityRepository } from 'libs/user-activity/repositories'; import { validateW3CSchemaAttributes } from '../libs/helpers/attributes.validator'; import { ISchemaDetail } from '@credebl/common/interfaces/schema.interface'; +import { CommonConstants } from '../../../libs/common/src/common.constant'; @Injectable() export class IssuanceService { @@ -1173,7 +1174,7 @@ async sendEmailForCredentialOffer(sendEmailCredentialOffer: SendEmailCredentialO credentialPayload.fileName = fileName; const newCacheKey = uuidv4(); - const cacheTTL = Number(process.env.FILEUPLOAD_CACHE_TTL) || 60000; + const cacheTTL = Number(process.env.FILEUPLOAD_CACHE_TTL) || CommonConstants.DEFAULT_CACHE_TTL; await this.cacheManager.set(requestId || newCacheKey, JSON.stringify(credentialPayload), cacheTTL); return newCacheKey; diff --git a/libs/common/src/common.constant.ts b/libs/common/src/common.constant.ts index 9a9d8ad6e..39624ba1d 100644 --- a/libs/common/src/common.constant.ts +++ b/libs/common/src/common.constant.ts @@ -38,6 +38,9 @@ export enum CommonConstants { URL_WALLET_SET_TAGGING_POLICY = '/wallet/tag-policy/#', URL_WALLET_PROVISION = '/wallet/provision', + DEFAULT_CACHE_TTL = 60000, + DEFAULT_FIELD_UPLOAD_SIZE = 100 * 1024 * 1024, + // LEDGER SERVICES URL_LEDG_GET_DID_VERKEY = '/ledger/did-verkey?did=#', URL_LEDG_REGISTER_NYM = '/ledger/register-nym?did=#&verkey=@&role=$',