add sub title
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class AddBusinessSubtitle1789046600000 implements MigrationInterface {
|
||||
name = 'AddBusinessSubtitle1789046600000';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE "businesses"
|
||||
ADD COLUMN IF NOT EXISTS "subtitle" character varying(150)
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE "business_registration_requests"
|
||||
ADD COLUMN IF NOT EXISTS "subtitle" character varying(150)
|
||||
`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE "business_registration_requests"
|
||||
DROP COLUMN IF EXISTS "subtitle"
|
||||
`);
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE "businesses"
|
||||
DROP COLUMN IF EXISTS "subtitle"
|
||||
`);
|
||||
}
|
||||
}
|
||||
@@ -49,6 +49,9 @@ export class BusinessRegistrationRequestEntity {
|
||||
@Column('uuid')
|
||||
categoryId!: string;
|
||||
|
||||
@Column({ type: 'varchar', nullable: true, length: 150 })
|
||||
subtitle!: string | null;
|
||||
|
||||
@Column({ type: 'varchar', nullable: true, length: 500 })
|
||||
description!: string | null;
|
||||
|
||||
|
||||
@@ -28,6 +28,9 @@ export class BusinessEntity {
|
||||
@Column({ unique: true, length: 120 })
|
||||
slug!: string;
|
||||
|
||||
@Column({ type: 'varchar', nullable: true, length: 150 })
|
||||
subtitle!: string | null;
|
||||
|
||||
@Column({ type: 'varchar', nullable: true, length: 500 })
|
||||
description!: string | null;
|
||||
|
||||
|
||||
@@ -99,6 +99,7 @@ export class BusinessRegistrationRequestsService {
|
||||
title: dto.title.trim(),
|
||||
slug,
|
||||
categoryId: dto.categoryId,
|
||||
subtitle: dto.subtitle?.trim() ?? null,
|
||||
description: dto.description?.trim() ?? null,
|
||||
contactPhone: dto.contactPhone?.trim() ?? null,
|
||||
address: dto.address?.trim() ?? null,
|
||||
@@ -167,6 +168,7 @@ export class BusinessRegistrationRequestsService {
|
||||
title: request.title,
|
||||
slug: request.slug,
|
||||
categoryId: request.categoryId,
|
||||
subtitle: request.subtitle,
|
||||
description: request.description,
|
||||
contactPhone: request.contactPhone,
|
||||
address: request.address,
|
||||
|
||||
@@ -28,6 +28,12 @@ export class CreateBusinessRegistrationDto {
|
||||
})
|
||||
slug?: string;
|
||||
|
||||
@ApiPropertyOptional({ example: 'تمیزی که میدرخشد' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(150)
|
||||
subtitle?: string;
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
|
||||
@@ -110,6 +110,7 @@ export class BusinessesService {
|
||||
title: payload.title,
|
||||
slug,
|
||||
categoryId: payload.categoryId,
|
||||
subtitle: payload.subtitle ?? null,
|
||||
description: payload.description ?? null,
|
||||
contactPhone: payload.contactPhone ?? null,
|
||||
address: payload.address ?? null,
|
||||
|
||||
@@ -29,6 +29,12 @@ export class CreateBusinessDto {
|
||||
@IsUUID()
|
||||
categoryId!: string;
|
||||
|
||||
@ApiPropertyOptional({ example: 'تمیزی که میدرخشد' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(150)
|
||||
subtitle?: string;
|
||||
|
||||
@ApiPropertyOptional({ example: 'Premium carwash service' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
|
||||
@@ -34,6 +34,12 @@ export class UpdateBusinessDto {
|
||||
@IsUUID()
|
||||
categoryId?: string;
|
||||
|
||||
@ApiPropertyOptional({ example: 'تمیزی که میدرخشد', nullable: true })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(150)
|
||||
subtitle?: string | null;
|
||||
|
||||
@ApiPropertyOptional({ example: 'Premium carwash service', nullable: true })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
|
||||
Reference in New Issue
Block a user