mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-10 07:07:21 +00:00
make point nullable (#457)
This commit is contained in:
@ -40,8 +40,8 @@ export class BookableSpaceEntity extends AbstractEntity {
|
|||||||
@Column({ type: Boolean, default: true })
|
@Column({ type: Boolean, default: true })
|
||||||
active: boolean;
|
active: boolean;
|
||||||
|
|
||||||
@Column({ type: 'int' })
|
@Column({ type: 'int', default: null })
|
||||||
points: number;
|
points?: number;
|
||||||
|
|
||||||
@CreateDateColumn()
|
@CreateDateColumn()
|
||||||
createdAt: Date;
|
createdAt: Date;
|
||||||
|
@ -27,9 +27,10 @@ export class BookableSpaceConfigResponseDto {
|
|||||||
|
|
||||||
@ApiProperty({
|
@ApiProperty({
|
||||||
type: Number,
|
type: Number,
|
||||||
|
nullable: true,
|
||||||
})
|
})
|
||||||
@Expose()
|
@Expose()
|
||||||
points: number;
|
points?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class BookableSpaceResponseDto {
|
export class BookableSpaceResponseDto {
|
||||||
|
@ -1,16 +1,17 @@
|
|||||||
import { DaysEnum } from '@app/common/constants/days.enum';
|
import { DaysEnum } from '@app/common/constants/days.enum';
|
||||||
import { ApiProperty } from '@nestjs/swagger';
|
import { ApiProperty } from '@nestjs/swagger';
|
||||||
import {
|
import {
|
||||||
|
ArrayMinSize,
|
||||||
IsArray,
|
IsArray,
|
||||||
IsEnum,
|
IsEnum,
|
||||||
|
IsInt,
|
||||||
IsNotEmpty,
|
IsNotEmpty,
|
||||||
|
IsOptional,
|
||||||
IsString,
|
IsString,
|
||||||
IsUUID,
|
IsUUID,
|
||||||
IsInt,
|
Matches,
|
||||||
ArrayMinSize,
|
|
||||||
Max,
|
Max,
|
||||||
Min,
|
Min,
|
||||||
Matches,
|
|
||||||
} from 'class-validator';
|
} from 'class-validator';
|
||||||
|
|
||||||
export class CreateBookableSpaceDto {
|
export class CreateBookableSpaceDto {
|
||||||
@ -53,9 +54,10 @@ export class CreateBookableSpaceDto {
|
|||||||
})
|
})
|
||||||
endTime: string;
|
endTime: string;
|
||||||
|
|
||||||
@ApiProperty({ example: 10 })
|
@ApiProperty({ example: 10, required: false })
|
||||||
|
@IsOptional()
|
||||||
@IsInt()
|
@IsInt()
|
||||||
@Min(0, { message: 'Points cannot be negative' })
|
@Min(0, { message: 'Points cannot be negative' })
|
||||||
@Max(1000, { message: 'Points cannot exceed 1000' })
|
@Max(1000, { message: 'Points cannot exceed 1000' })
|
||||||
points: number;
|
points?: number;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user