feat: update subscription and service entities with enhancements
- Update message enum for better error handling - Enhance service creation DTO with new fields - Modify danak-service entity structure - Update subscription DTOs and entities - Improve user subscription entity model
This commit is contained in:
@@ -15,11 +15,13 @@ export class SubscribeServiceDto {
|
||||
@ApiProperty({ description: "Name of business", example: "Test 1" })
|
||||
businessName: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsNotEmpty({ message: SubscriptionMessage.BUSINESS_PHONE_REQUIRED })
|
||||
@IsPhoneNumber("IR", { message: SubscriptionMessage.BUSINESS_PHONE_INVALID })
|
||||
@ApiProperty({ description: "Phone number of the business", example: "+98 234 567 8901", required: false })
|
||||
businessPhone: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsNotEmpty({ message: SubscriptionMessage.BUSINESS_DESCRIPTION_REQUIRED })
|
||||
@IsString({ message: SubscriptionMessage.BUSINESS_DESCRIPTION_STRING })
|
||||
@Length(5, 500, { message: SubscriptionMessage.BUSINESS_DESCRIPTION_LENGTH })
|
||||
|
||||
@@ -22,11 +22,11 @@ export class UserSubscription extends BaseEntity {
|
||||
@Column({ type: "varchar", length: 250, nullable: false })
|
||||
businessName: string;
|
||||
|
||||
@Column({ type: "varchar", length: 50, nullable: false })
|
||||
businessPhone: string;
|
||||
@Column({ type: "varchar", length: 50, nullable: true })
|
||||
businessPhone: string | null;
|
||||
|
||||
@Column({ type: "text", nullable: false })
|
||||
description: string;
|
||||
@Column({ type: "text", nullable: true })
|
||||
description: string | null;
|
||||
|
||||
@Column({ type: "varchar", length: 250, unique: true, nullable: true })
|
||||
slug: string;
|
||||
|
||||
Reference in New Issue
Block a user