Compare commits

...

4 Commits

Author SHA1 Message Date
b9c4308d1c Merge pull request #478 from SyncrowIOT/hotfix/booking-filter
Hotfix/booking filter
2025-07-21 09:38:32 +03:00
87c380ab6f fix validation 2025-07-20 13:49:15 +03:00
212d0d1974 change month format from MM/YYYY to MM-YYYY
change month format from MM/YYYY to MM-YYYY
2025-07-20 13:28:25 +03:00
6d529ee0ae change month format from MM/YYYY to MM-YYYY 2025-07-17 15:22:20 +04:00
2 changed files with 4 additions and 4 deletions

View File

@ -3,11 +3,11 @@ import { IsNotEmpty, IsOptional, IsUUID, Matches } from 'class-validator';
export class BookingRequestDto {
@ApiProperty({
description: 'Month in MM/YYYY format',
example: '07/2025',
description: 'Month in MM-YYYY format',
example: '07-2025',
})
@IsNotEmpty()
@Matches(/^(0[1-9]|1[0-2])\/\d{4}$/, {
@Matches(/^(0[1-9]|1[0-2])\-\d{4}$/, {
message: 'Date must be in MM/YYYY format',
})
month: string;

View File

@ -51,7 +51,7 @@ export class BookingService {
}
async findAll({ month, space }: BookingRequestDto, project: string) {
const [monthNumber, year] = month.split('/').map(Number);
const [monthNumber, year] = month.split('-').map(Number);
const fromDate = new Date(year, monthNumber - 1, 1);
const toDate = new Date(year, monthNumber, 0, 23, 59, 59);
return this.bookingEntityRepository.find({