Skip to content

Commit

Permalink
fix:fixed-added-constants
Browse files Browse the repository at this point in the history
Signed-off-by: pallavicoder <[email protected]>
  • Loading branch information
pallavighule committed Oct 4, 2024
1 parent 341a650 commit 8777046
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion apps/api-gateway/src/issuance/issuance.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down
3 changes: 2 additions & 1 deletion apps/issuance/src/issuance.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions libs/common/src/common.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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=$',
Expand Down

0 comments on commit 8777046

Please sign in to comment.