fix: bug in repositry of subscriptions

This commit is contained in:
mahyargdz
2025-02-08 16:24:54 +03:30
parent ab3f3f8eaf
commit bc96f62782
14 changed files with 110 additions and 44 deletions
@@ -0,0 +1,27 @@
import { ApiProperty } from "@nestjs/swagger";
import { IsBoolean, IsInt, IsNotEmpty, IsString, Length } from "class-validator";
import { SubscriptionMessage } from "../../../common/enums/message.enum";
export class CreateSubscriptionPlanDto {
@IsNotEmpty({ message: SubscriptionMessage.NAME_REQUIRED })
@IsString({ message: SubscriptionMessage.NAME_SHOULD_BE_STRING })
@Length(3, 100, { message: SubscriptionMessage.NAME_LENGTH })
@ApiProperty({ description: "the name of the subscription plan", example: "یک ماهه" })
name: string;
@IsNotEmpty({ message: SubscriptionMessage.DURATION_REQUIRED })
@IsInt({ message: SubscriptionMessage.DURATION_SHOULD_BE_INT })
@ApiProperty({ description: "the duration of the subscription plan in days", example: 30 })
duration: number;
@IsNotEmpty({ message: SubscriptionMessage.PRICE_REQUIRED })
@IsInt({ message: SubscriptionMessage.PRICE_SHOULD_BE_INT })
@ApiProperty({ description: "the price of the subscription plan", example: 10_000_000 })
price: number;
@IsNotEmpty({ message: SubscriptionMessage.IS_ACTIVE_REQUIRED })
@IsBoolean({ message: SubscriptionMessage.IS_ACTIVE_SHOULD_BE_BOOLEAN })
@ApiProperty({ description: "the status of the subscription plan", example: true })
isActive: boolean;
}