Skip to content

Commit

Permalink
chore: put export-type enum in separate file
Browse files Browse the repository at this point in the history
AB#31009

To be able to use ExportType enum easily in Portalicious, we need to separate it into a file of its own. This should be in line with the 121-service guidelines so it shouldn't be an issue, and is worth the refactor on its own IMHO.
  • Loading branch information
aberonni committed Oct 30, 2024
1 parent 1a93e7e commit 9d5d96b
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 25 deletions.
2 changes: 1 addition & 1 deletion services/121-service/src/actions/action.entity.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Column, Entity, ManyToOne, Relation } from 'typeorm';

import { Base121AuditedEntity } from '@121-service/src/base-audited.entity';
import { ExportType } from '@121-service/src/metrics/dto/export-details.dto';
import { ExportType } from '@121-service/src/metrics/enum/export-type.enum';
import { ProgramEntity } from '@121-service/src/programs/program.entity';
import { UserEntity } from '@121-service/src/user/user.entity';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsOptional, IsString } from 'class-validator';

import { ExportType } from '@121-service/src/metrics/dto/export-details.dto';
import { ExportType } from '@121-service/src/metrics/enum/export-type.enum';
import { QuestionOption } from '@121-service/src/shared/enum/question.enums';
import { LocalizedString } from '@121-service/src/shared/types/localized-string.type';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {

import { Base121Entity } from '@121-service/src/base.entity';
import { FinancialServiceProviderEntity } from '@121-service/src/financial-service-providers/financial-service-provider.entity';
import { ExportType } from '@121-service/src/metrics/dto/export-details.dto';
import { ExportType } from '@121-service/src/metrics/enum/export-type.enum';
import { RegistrationDataEntity } from '@121-service/src/registration/registration-data.entity';
import { NameConstraintQuestions } from '@121-service/src/shared/const';
import { QuestionOption } from '@121-service/src/shared/enum/question.enums';
Expand Down
11 changes: 0 additions & 11 deletions services/121-service/src/metrics/dto/export-details.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,6 @@ import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsDate, IsNumber, IsOptional, IsString } from 'class-validator';

export enum ExportType {
allPeopleAffected = 'all-people-affected',
included = 'included',
payment = 'payment',
unusedVouchers = 'unused-vouchers',
vouchersWithBalance = 'vouchers-with-balance',
toCancelVouchers = 'to-cancel-vouchers',
duplicates = 'duplicates',
cardBalances = 'card-balances',
}

export class ExportDetailsQueryParamsDto {
@ApiProperty()
@IsNumber()
Expand Down
10 changes: 10 additions & 0 deletions services/121-service/src/metrics/enum/export-type.enum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export enum ExportType {
allPeopleAffected = 'all-people-affected',
included = 'included',
payment = 'payment',
unusedVouchers = 'unused-vouchers',
vouchersWithBalance = 'vouchers-with-balance',
toCancelVouchers = 'to-cancel-vouchers',
duplicates = 'duplicates',
cardBalances = 'card-balances',
}
6 changes: 2 additions & 4 deletions services/121-service/src/metrics/metrics.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@ import { Paginate, PaginatedSwaggerDocs, PaginateQuery } from 'nestjs-paginate';

import { AuthenticatedUser } from '@121-service/src/guards/authenticated-user.decorator';
import { AuthenticatedUserGuard } from '@121-service/src/guards/authenticated-user.guard';
import {
ExportDetailsQueryParamsDto,
ExportType,
} from '@121-service/src/metrics/dto/export-details.dto';
import { ExportDetailsQueryParamsDto } from '@121-service/src/metrics/dto/export-details.dto';
import { FileDto } from '@121-service/src/metrics/dto/file.dto';
import { PaymentStateSumDto } from '@121-service/src/metrics/dto/payment-state-sum.dto';
import { ProgramStats } from '@121-service/src/metrics/dto/program-stats.dto';
import { RegistrationStatusStats } from '@121-service/src/metrics/dto/registrationstatus-stats.dto';
import { ExportFileFormat } from '@121-service/src/metrics/enum/export-file-format.enum';
import { ExportType } from '@121-service/src/metrics/enum/export-type.enum';
import { MetricsService } from '@121-service/src/metrics/metrics.service';
import { PaginateConfigRegistrationViewOnlyFilters } from '@121-service/src/registration/const/filter-operation.const';
import { RegistrationViewEntity } from '@121-service/src/registration/registration-view.entity';
Expand Down
2 changes: 1 addition & 1 deletion services/121-service/src/metrics/metrics.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import { v4 as uuid } from 'uuid';
import { ActionsService } from '@121-service/src/actions/actions.service';
import { FinancialServiceProviderName } from '@121-service/src/financial-service-providers/enum/financial-service-provider-name.enum';
import { FspQuestionEntity } from '@121-service/src/financial-service-providers/fsp-question.entity';
import { ExportType } from '@121-service/src/metrics/dto/export-details.dto';
import { FileDto } from '@121-service/src/metrics/dto/file.dto';
import { PaymentStateSumDto } from '@121-service/src/metrics/dto/payment-state-sum.dto';
import { ProgramStats } from '@121-service/src/metrics/dto/program-stats.dto';
import { RegistrationType } from '@121-service/src/metrics/dto/registration-type.dto';
import { RegistrationStatusStats } from '@121-service/src/metrics/dto/registrationstatus-stats.dto';
import { RowType } from '@121-service/src/metrics/dto/rolo-type.dto';
import { ExportType } from '@121-service/src/metrics/enum/export-type.enum';
import { IntersolveVisaExportService } from '@121-service/src/payments/fsp-integration/intersolve-visa/services/intersolve-visa-export.service';
import { IntersolveVoucherService } from '@121-service/src/payments/fsp-integration/intersolve-voucher/intersolve-voucher.service';
import { TransactionStatusEnum } from '@121-service/src/payments/transactions/enums/transaction-status.enum';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
FinancialServiceProviderConfigurationEnum,
FinancialServiceProviderName,
} from '@121-service/src/financial-service-providers/enum/financial-service-provider-name.enum';
import { ExportType } from '@121-service/src/metrics/dto/export-details.dto';
import { ExportType } from '@121-service/src/metrics/enum/export-type.enum';
import {
CreateProgramCustomAttributeDto,
CustomAttributeType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
ValidateNested,
} from 'class-validator';

import { ExportType } from '@121-service/src/metrics/dto/export-details.dto';
import { ExportType } from '@121-service/src/metrics/enum/export-type.enum';
import { CreateOptionsDto } from '@121-service/src/programs/dto/create-options.dto';
import { AnswerTypes } from '@121-service/src/registration/enum/custom-data-attributes';
import { QuestionOption } from '@121-service/src/shared/enum/question.enums';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from 'class-validator';

import { FinancialServiceProviderName } from '@121-service/src/financial-service-providers/enum/financial-service-provider-name.enum';
import { ExportType } from '@121-service/src/metrics/dto/export-details.dto';
import { ExportType } from '@121-service/src/metrics/enum/export-type.enum';
import { ProgramFinancialServiceProviderDto } from '@121-service/src/programs/dto/create-program.dto';
import {
CreateProgramCustomAttributeDto,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from 'typeorm';

import { CascadeDeleteEntity } from '@121-service/src/base.entity';
import { ExportType } from '@121-service/src/metrics/dto/export-details.dto';
import { ExportType } from '@121-service/src/metrics/enum/export-type.enum';
import { ProgramEntity } from '@121-service/src/programs/program.entity';
import { RegistrationDataEntity } from '@121-service/src/registration/registration-data.entity';
import { NameConstraintQuestions } from '@121-service/src/shared/const';
Expand Down
2 changes: 1 addition & 1 deletion services/121-service/src/programs/programs.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { DataSource, Equal, QueryFailedError, Repository } from 'typeorm';
import { ActionEntity } from '@121-service/src/actions/action.entity';
import { FinancialServiceProviderEntity } from '@121-service/src/financial-service-providers/financial-service-provider.entity';
import { FspQuestionEntity } from '@121-service/src/financial-service-providers/fsp-question.entity';
import { ExportType } from '@121-service/src/metrics/dto/export-details.dto';
import { ExportType } from '@121-service/src/metrics/enum/export-type.enum';
import { ProgramAttributesService } from '@121-service/src/program-attributes/program-attributes.service';
import { CreateProgramDto } from '@121-service/src/programs/dto/create-program.dto';
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable jest/no-conditional-expect */
import { HttpStatus } from '@nestjs/common';

import { ExportType } from '@121-service/src/metrics/dto/export-details.dto';
import { ExportType } from '@121-service/src/metrics/enum/export-type.enum';
import { CreateProgramQuestionDto } from '@121-service/src/programs/dto/program-question.dto';
import { SeedScript } from '@121-service/src/scripts/seed-script.enum';
import { postProgramQuestion } from '@121-service/test/helpers/program.helper';
Expand Down

0 comments on commit 9d5d96b

Please sign in to comment.