diff --git a/src/modules/season-related/season-period/domain/usecases/managers/get-current-period.manager.ts b/src/modules/season-related/season-period/domain/usecases/managers/get-current-period.manager.ts index 8e47421..5dbfd08 100644 --- a/src/modules/season-related/season-period/domain/usecases/managers/get-current-period.manager.ts +++ b/src/modules/season-related/season-period/domain/usecases/managers/get-current-period.manager.ts @@ -72,8 +72,8 @@ export class CurrentSeasonPeriodManager extends BaseIndexManager { - const params = new FilterSeasonPeriodDto(); + async currentPeriod(params): Promise { this.currentPeriodManager.setFilterParam(params); this.currentPeriodManager.setService( this.serviceData, diff --git a/src/modules/season-related/season-period/infrastructure/dto/filter-current-season.dto.ts b/src/modules/season-related/season-period/infrastructure/dto/filter-current-season.dto.ts new file mode 100644 index 0000000..699e4d7 --- /dev/null +++ b/src/modules/season-related/season-period/infrastructure/dto/filter-current-season.dto.ts @@ -0,0 +1,6 @@ +import { ApiProperty } from '@nestjs/swagger'; + +export class FilterCurrentSeasonDto { + @ApiProperty({ type: Date, required: false, example: '2024-01-01' }) + date: Date; +} diff --git a/src/modules/season-related/season-period/infrastructure/season-period-read.controller.ts b/src/modules/season-related/season-period/infrastructure/season-period-read.controller.ts index 5c2bde6..463a35f 100644 --- a/src/modules/season-related/season-period/infrastructure/season-period-read.controller.ts +++ b/src/modules/season-related/season-period/infrastructure/season-period-read.controller.ts @@ -9,6 +9,7 @@ import { MODULE_NAME } from 'src/core/strings/constants/module.constants'; import { Public } from 'src/core/guards'; import { ItemRateEntity } from 'src/modules/item-related/item-rate/domain/entities/item-rate.entity'; import { FilterItemRateDto } from 'src/modules/item-related/item-rate/infrastructure/dto/filter-item-rate.dto'; +import { FilterCurrentSeasonDto } from './dto/filter-current-season.dto'; @ApiTags(`${MODULE_NAME.SEASON_PERIOD.split('-').join(' ')} - read`) @Controller(`v1/${MODULE_NAME.SEASON_PERIOD}`) @@ -26,8 +27,10 @@ export class SeasonPeriodReadController { } @Get('current-period') - async currentPeriod(): Promise { - return await this.orchestrator.currentPeriod(); + async currentPeriod( + @Query() params: FilterCurrentSeasonDto, + ): Promise { + return await this.orchestrator.currentPeriod(params); } @Get(':id') diff --git a/src/modules/transaction/transaction/domain/usecases/managers/helpers/mapping-transaction.helper.ts b/src/modules/transaction/transaction/domain/usecases/managers/helpers/mapping-transaction.helper.ts index 7da074a..3e948ba 100644 --- a/src/modules/transaction/transaction/domain/usecases/managers/helpers/mapping-transaction.helper.ts +++ b/src/modules/transaction/transaction/domain/usecases/managers/helpers/mapping-transaction.helper.ts @@ -100,10 +100,16 @@ export function mappingRevertTransaction(data, type) { season_period_name: data.season_period?.holiday_name ?? null, season_period_type_id: data.season_period?.season_type?.id ?? null, season_period_type_name: data.season_period?.season_type?.name ?? null, - payment_type_method_id: data.payment_type_method?.id, - payment_type_method_number: data.payment_type_method?.account_number, - payment_type_method_name: data.payment_type_method?.issuer_name, - payment_type_method_qr: data.payment_type_method?.qr_image, + payment_type_method_id: + data.payment_type_method?.id ?? data.payment_type_bank?.id, + payment_type_method_number: + data.payment_type_method?.account_number ?? + data.payment_type?.account_number, + payment_type_method_name: + data.payment_type_method?.issuer_name ?? + data.payment_type_bank?.issuer_name, + payment_type_method_qr: + data.payment_type_method?.qr_image ?? data.payment_type_bank?.qr_image, }); data.items?.map((item) => {