chore: complete ads service
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user