diff --git a/services/workflows-service/src/alert/alert.service.intg.test.ts b/services/workflows-service/src/alert/alert.service.intg.test.ts index cbfbd7d56a..94744414c2 100644 --- a/services/workflows-service/src/alert/alert.service.intg.test.ts +++ b/services/workflows-service/src/alert/alert.service.intg.test.ts @@ -24,7 +24,6 @@ import { ALERT_DEFINITIONS, getAlertDefinitionCreateData, } from '../../scripts/alerts/generate-alerts'; -import { TExecutionDetails } from './types'; describe('AlertService', () => { let prismaService: PrismaService; diff --git a/services/workflows-service/src/alert/dtos/create-alert-definition.dto.ts b/services/workflows-service/src/alert/dtos/create-alert-definition.dto.ts index 66e6976031..72e72a5308 100644 --- a/services/workflows-service/src/alert/dtos/create-alert-definition.dto.ts +++ b/services/workflows-service/src/alert/dtos/create-alert-definition.dto.ts @@ -1,5 +1,5 @@ import { ApiProperty } from '@nestjs/swagger'; -import { IsNotEmpty, IsString, IsOptional, IsBoolean, IsEnum } from 'class-validator'; +import { IsNotEmpty, IsString, IsOptional, IsBoolean } from 'class-validator'; export class CreateAlertDefinitionDto { @ApiProperty({ example: '[Payments] - High Cumulative Amount - Inbound' }) diff --git a/services/workflows-service/src/common/filters/HttpExceptions.filter.ts b/services/workflows-service/src/common/filters/HttpExceptions.filter.ts index 731599d55f..3492f1648b 100644 --- a/services/workflows-service/src/common/filters/HttpExceptions.filter.ts +++ b/services/workflows-service/src/common/filters/HttpExceptions.filter.ts @@ -1,4 +1,4 @@ -import { ArgumentsHost, Catch, HttpException, HttpStatus } from '@nestjs/common'; +import { ArgumentsHost, Catch, HttpStatus } from '@nestjs/common'; import { BaseExceptionFilter, HttpAdapterHost } from '@nestjs/core'; import { Prisma } from '@prisma/client'; import { PRISMA_UNIQUE_CONSTRAINT_ERROR } from '@/prisma/prisma.util'; diff --git a/services/workflows-service/src/customer/customer.service.ts b/services/workflows-service/src/customer/customer.service.ts index 341d71b25b..58c18ae8b7 100644 --- a/services/workflows-service/src/customer/customer.service.ts +++ b/services/workflows-service/src/customer/customer.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@nestjs/common'; import { CustomerRepository } from '@/customer/customer.repository'; -import { Prisma, Project } from '@prisma/client'; +import { Prisma } from '@prisma/client'; import { TCustomerWithDefinitionsFeatures } from '@/customer/types'; import { ApiKeyService } from '@/customer/api-key/api-key.service'; import { generateHashedKey } from '@/customer/api-key/utils'; diff --git a/services/workflows-service/src/data-analytics/types.ts b/services/workflows-service/src/data-analytics/types.ts index 3112dd62c8..0a94a234f0 100644 --- a/services/workflows-service/src/data-analytics/types.ts +++ b/services/workflows-service/src/data-analytics/types.ts @@ -1,5 +1,6 @@ import { TransactionDirection, PaymentMethod, TransactionRecordType } from '@prisma/client'; import { AggregateType, TIME_UNITS } from './consts'; + export type InlineRule = { id: string; subjects: string[] | readonly string[]; diff --git a/services/workflows-service/src/errors.ts b/services/workflows-service/src/errors.ts index 2532cc36e1..f664a4ecc2 100644 --- a/services/workflows-service/src/errors.ts +++ b/services/workflows-service/src/errors.ts @@ -85,6 +85,7 @@ export class ValidationError extends common.BadRequestException { static fromClassValidator(error: ClassValidatorValidationError[]) { const childrens = error[0]?.children ? error[0].children : []; + return new ValidationError( [...error, ...childrens].map(({ property, constraints = {} }) => ({ message: `${Object.values(constraints).join(', ')}.`, diff --git a/services/workflows-service/src/test/helpers/nest-app-helper.ts b/services/workflows-service/src/test/helpers/nest-app-helper.ts index 500cedf5f1..d694d9fd88 100644 --- a/services/workflows-service/src/test/helpers/nest-app-helper.ts +++ b/services/workflows-service/src/test/helpers/nest-app-helper.ts @@ -12,7 +12,6 @@ import { AppLoggerModule } from '@/common/app-logger/app-logger.module'; import { ClsMiddleware, ClsModule, ClsService } from 'nestjs-cls'; import { AuthKeyMiddleware } from '@/common/middlewares/auth-key.middleware'; import { CustomerModule } from '@/customer/customer.module'; -import { CustomerService } from '@/customer/customer.service'; import { HttpModule } from '@nestjs/axios'; import { ApiKeyService } from '@/customer/api-key/api-key.service'; diff --git a/services/workflows-service/src/transaction/dtos/transaction-create.dto.ts b/services/workflows-service/src/transaction/dtos/transaction-create.dto.ts index 56ddf03741..8e6f7c76c5 100644 --- a/services/workflows-service/src/transaction/dtos/transaction-create.dto.ts +++ b/services/workflows-service/src/transaction/dtos/transaction-create.dto.ts @@ -12,7 +12,6 @@ import { } from '@prisma/client'; import { IsBoolean, - IsDate, IsDateString, IsEnum, IsNotEmpty, diff --git a/services/workflows-service/src/transaction/transaction.controller.external.intg.test.ts b/services/workflows-service/src/transaction/transaction.controller.external.intg.test.ts index 4b90312b13..23ff5f2cc2 100644 --- a/services/workflows-service/src/transaction/transaction.controller.external.intg.test.ts +++ b/services/workflows-service/src/transaction/transaction.controller.external.intg.test.ts @@ -17,9 +17,7 @@ import { PaymentProcessor, PaymentType, Project, - ReviewStatus, TransactionDirection, - TransactionRecordStatus, TransactionRecordType, } from '@prisma/client'; import { createProject } from '@/test/helpers/create-project'; diff --git a/services/workflows-service/src/transaction/transaction.mapper.ts b/services/workflows-service/src/transaction/transaction.mapper.ts index 53b8cacecb..96fbb4a9c2 100644 --- a/services/workflows-service/src/transaction/transaction.mapper.ts +++ b/services/workflows-service/src/transaction/transaction.mapper.ts @@ -210,6 +210,7 @@ export class TransactionEntityMapper { }; let brandName; + if (altDto.tx_product.toLowerCase() in PaymentBrandName) { brandName = altDto.tx_product.toLowerCase() as PaymentBrandName; } else { @@ -261,6 +262,7 @@ export class TransactionEntityMapper { } const errors = validateSync(Object.assign(new TransactionCreateDto(), originalDto)); + if (errors.length > 0) { throw new ValidationError(errors as any); } else { diff --git a/services/workflows-service/src/webhooks/webhooks.service.ts b/services/workflows-service/src/webhooks/webhooks.service.ts index 0fc9a06394..c12804e840 100644 --- a/services/workflows-service/src/webhooks/webhooks.service.ts +++ b/services/workflows-service/src/webhooks/webhooks.service.ts @@ -60,6 +60,7 @@ export class WebhooksService { if (!config?.ongoingWorkflowDefinitionId) { this.logger.error('No ongoing workflow definition found for project', { projectId }); + return; }