diff --git a/database/migrations/.snapshot-dmenu.json b/database/migrations/.snapshot-dmenu.json index 2002607..71c052f 100644 --- a/database/migrations/.snapshot-dmenu.json +++ b/database/migrations/.snapshot-dmenu.json @@ -1025,6 +1025,16 @@ "length": 6, "mappedType": "datetime" }, + "bg_type": { + "name": "bg_type", + "type": "varchar(255)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 255, + "mappedType": "string" + }, "bg_url": { "name": "bg_url", "type": "varchar(255)", @@ -1246,6 +1256,26 @@ "length": 255, "mappedType": "string" }, + "card_number2": { + "name": "card_number2", + "type": "varchar(255)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 255, + "mappedType": "string" + }, + "card_number3": { + "name": "card_number3", + "type": "varchar(255)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 255, + "mappedType": "string" + }, "card_owner": { "name": "card_owner", "type": "varchar(255)", @@ -1256,6 +1286,26 @@ "length": 255, "mappedType": "string" }, + "card_owner2": { + "name": "card_owner2", + "type": "varchar(255)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 255, + "mappedType": "string" + }, + "card_owner3": { + "name": "card_owner3", + "type": "varchar(255)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 255, + "mappedType": "string" + }, "enabled": { "name": "enabled", "type": "boolean", diff --git a/database/migrations/Migration20260622080529.ts b/database/migrations/Migration20260622080529.ts new file mode 100644 index 0000000..108be9b --- /dev/null +++ b/database/migrations/Migration20260622080529.ts @@ -0,0 +1,10 @@ +import { Migration } from '@mikro-orm/migrations'; + +export class Migration20260622080529 extends Migration { + + override async up(): Promise { + this.addSql(`alter table "restaurants" add column "bg_type" varchar(255) null;`); + + } + +} diff --git a/src/modules/restaurants/dto/update-restaurant-bg.dto.ts b/src/modules/restaurants/dto/update-restaurant-bg.dto.ts index abefc3d..1fa19af 100644 --- a/src/modules/restaurants/dto/update-restaurant-bg.dto.ts +++ b/src/modules/restaurants/dto/update-restaurant-bg.dto.ts @@ -2,6 +2,11 @@ import { ApiPropertyOptional } from '@nestjs/swagger'; import { IsOptional, IsString } from 'class-validator'; export class UpdateRestaurantBgDto { + @ApiPropertyOptional({ example: 'image', description: 'نوع پس‌زمینه' }) + @IsOptional() + @IsString() + bgType?: string; + @ApiPropertyOptional({ example: 'https://cdn.example.com/backgrounds/wood.jpg', description: 'آدرس تصویر پس‌زمینه' }) @IsOptional() @IsString() diff --git a/src/modules/restaurants/entities/restaurant.entity.ts b/src/modules/restaurants/entities/restaurant.entity.ts index 150e4ce..fd4ad2f 100644 --- a/src/modules/restaurants/entities/restaurant.entity.ts +++ b/src/modules/restaurants/entities/restaurant.entity.ts @@ -109,6 +109,9 @@ export class Restaurant extends BaseEntity { @Property({ nullable: true }) subscriptionStartDate?: Date; + @Property({ nullable: true }) + bgType?: string; + @Property({ nullable: true }) bgUrl?: string;