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')
|
@Column('uuid')
|
||||||
categoryId!: string;
|
categoryId!: string;
|
||||||
|
|
||||||
|
@Column({ type: 'varchar', nullable: true, length: 150 })
|
||||||
|
subtitle!: string | null;
|
||||||
|
|
||||||
@Column({ type: 'varchar', nullable: true, length: 500 })
|
@Column({ type: 'varchar', nullable: true, length: 500 })
|
||||||
description!: string | null;
|
description!: string | null;
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ export class BusinessEntity {
|
|||||||
@Column({ unique: true, length: 120 })
|
@Column({ unique: true, length: 120 })
|
||||||
slug!: string;
|
slug!: string;
|
||||||
|
|
||||||
|
@Column({ type: 'varchar', nullable: true, length: 150 })
|
||||||
|
subtitle!: string | null;
|
||||||
|
|
||||||
@Column({ type: 'varchar', nullable: true, length: 500 })
|
@Column({ type: 'varchar', nullable: true, length: 500 })
|
||||||
description!: string | null;
|
description!: string | null;
|
||||||
|
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ export class BusinessRegistrationRequestsService {
|
|||||||
title: dto.title.trim(),
|
title: dto.title.trim(),
|
||||||
slug,
|
slug,
|
||||||
categoryId: dto.categoryId,
|
categoryId: dto.categoryId,
|
||||||
|
subtitle: dto.subtitle?.trim() ?? null,
|
||||||
description: dto.description?.trim() ?? null,
|
description: dto.description?.trim() ?? null,
|
||||||
contactPhone: dto.contactPhone?.trim() ?? null,
|
contactPhone: dto.contactPhone?.trim() ?? null,
|
||||||
address: dto.address?.trim() ?? null,
|
address: dto.address?.trim() ?? null,
|
||||||
@@ -167,6 +168,7 @@ export class BusinessRegistrationRequestsService {
|
|||||||
title: request.title,
|
title: request.title,
|
||||||
slug: request.slug,
|
slug: request.slug,
|
||||||
categoryId: request.categoryId,
|
categoryId: request.categoryId,
|
||||||
|
subtitle: request.subtitle,
|
||||||
description: request.description,
|
description: request.description,
|
||||||
contactPhone: request.contactPhone,
|
contactPhone: request.contactPhone,
|
||||||
address: request.address,
|
address: request.address,
|
||||||
|
|||||||
@@ -28,6 +28,12 @@ export class CreateBusinessRegistrationDto {
|
|||||||
})
|
})
|
||||||
slug?: string;
|
slug?: string;
|
||||||
|
|
||||||
|
@ApiPropertyOptional({ example: 'تمیزی که میدرخشد' })
|
||||||
|
@IsOptional()
|
||||||
|
@IsString()
|
||||||
|
@MaxLength(150)
|
||||||
|
subtitle?: string;
|
||||||
|
|
||||||
@ApiPropertyOptional()
|
@ApiPropertyOptional()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsString()
|
@IsString()
|
||||||
|
|||||||
@@ -110,6 +110,7 @@ export class BusinessesService {
|
|||||||
title: payload.title,
|
title: payload.title,
|
||||||
slug,
|
slug,
|
||||||
categoryId: payload.categoryId,
|
categoryId: payload.categoryId,
|
||||||
|
subtitle: payload.subtitle ?? null,
|
||||||
description: payload.description ?? null,
|
description: payload.description ?? null,
|
||||||
contactPhone: payload.contactPhone ?? null,
|
contactPhone: payload.contactPhone ?? null,
|
||||||
address: payload.address ?? null,
|
address: payload.address ?? null,
|
||||||
|
|||||||
@@ -29,6 +29,12 @@ export class CreateBusinessDto {
|
|||||||
@IsUUID()
|
@IsUUID()
|
||||||
categoryId!: string;
|
categoryId!: string;
|
||||||
|
|
||||||
|
@ApiPropertyOptional({ example: 'تمیزی که میدرخشد' })
|
||||||
|
@IsOptional()
|
||||||
|
@IsString()
|
||||||
|
@MaxLength(150)
|
||||||
|
subtitle?: string;
|
||||||
|
|
||||||
@ApiPropertyOptional({ example: 'Premium carwash service' })
|
@ApiPropertyOptional({ example: 'Premium carwash service' })
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsString()
|
@IsString()
|
||||||
|
|||||||
@@ -34,6 +34,12 @@ export class UpdateBusinessDto {
|
|||||||
@IsUUID()
|
@IsUUID()
|
||||||
categoryId?: string;
|
categoryId?: string;
|
||||||
|
|
||||||
|
@ApiPropertyOptional({ example: 'تمیزی که میدرخشد', nullable: true })
|
||||||
|
@IsOptional()
|
||||||
|
@IsString()
|
||||||
|
@MaxLength(150)
|
||||||
|
subtitle?: string | null;
|
||||||
|
|
||||||
@ApiPropertyOptional({ example: 'Premium carwash service', nullable: true })
|
@ApiPropertyOptional({ example: 'Premium carwash service', nullable: true })
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsString()
|
@IsString()
|
||||||
|
|||||||
Reference in New Issue
Block a user