chore: complete ads service

This commit is contained in:
mahyargdz
2025-02-15 12:08:19 +03:30
parent a13f374031
commit 817d638f3e
16 changed files with 475 additions and 5 deletions
+32
View File
@@ -0,0 +1,32 @@
import { Column, Entity, ManyToOne } from "typeorm";
import { BaseEntity } from "../../../common/entities/base.entity";
import { DanakService } from "../../danak-services/entities/danak-service.entity";
import { AdsDisplayLocation } from "../enums/ads-location.enum";
@Entity()
export class Ads extends BaseEntity {
@Column({ type: "varchar", length: 150, unique: true })
title: string;
@Column({ type: "enum", enum: AdsDisplayLocation, nullable: false })
displayLocation: AdsDisplayLocation;
@Column({ type: "timestamptz", nullable: false })
startDate: Date;
@Column({ type: "timestamptz", nullable: false })
endDate: Date;
@Column({ type: "boolean", default: true })
isActive: boolean;
@Column({ type: "varchar", length: 250, nullable: false })
imageUrl: string;
@Column({ type: "varchar", length: 250, nullable: false })
link: string;
@ManyToOne(() => DanakService, (danakService) => danakService.ads, { nullable: true, onDelete: "SET NULL" })
service: DanakService | null;
}