61 lines
1.4 KiB
TypeScript
61 lines
1.4 KiB
TypeScript
import { BaseStatusDto } from 'src/core/modules/infrastructure/dto/base-status.dto';
|
|
import { SeasonPeriodEntity } from '../../domain/entities/season-period.entity';
|
|
import { EnumDays } from '../../constants';
|
|
import { ApiProperty } from '@nestjs/swagger';
|
|
import { IsObject, ValidateIf } from 'class-validator';
|
|
import { SeasonTypeModel } from 'src/modules/season-related/season-type/data/models/season-type.model';
|
|
import { Exclude } from 'class-transformer';
|
|
import { ItemRateModel } from 'src/modules/item-related/item-rate/data/models/item-rate.model';
|
|
import { SeasonPeriodHolidayDto } from './season-period-holiday.dto';
|
|
|
|
export class UpdateSeasonPeriodDto
|
|
extends BaseStatusDto
|
|
implements SeasonPeriodEntity
|
|
{
|
|
@ApiProperty({
|
|
type: Object,
|
|
required: true,
|
|
example: {
|
|
id: 'uuid',
|
|
name: 'High Season',
|
|
},
|
|
})
|
|
@IsObject()
|
|
season_type: SeasonTypeModel;
|
|
|
|
@ApiProperty({
|
|
type: Date,
|
|
required: true,
|
|
example: '01/01/2024',
|
|
})
|
|
start_date: Date;
|
|
|
|
@ApiProperty({
|
|
type: Date,
|
|
required: true,
|
|
example: '30/12/2024',
|
|
})
|
|
end_date: Date;
|
|
|
|
@ApiProperty({
|
|
type: [String],
|
|
required: false,
|
|
example: [EnumDays.FRIDAY, EnumDays.MONDAY],
|
|
})
|
|
@ValidateIf((body) => body.days)
|
|
days: EnumDays[];
|
|
|
|
@ApiProperty({
|
|
type: String,
|
|
required: false,
|
|
example: 'Hari Raya',
|
|
})
|
|
holiday_name: string;
|
|
|
|
@Exclude()
|
|
holidays: SeasonPeriodHolidayDto[];
|
|
|
|
@Exclude()
|
|
item_rates: any[];
|
|
}
|