templete campain
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
UpdateDateColumn,
|
||||
} from 'typeorm';
|
||||
import { Salon } from '../../salons/entities/salon.entity';
|
||||
import { SmsTemplate } from '../../sms-templates/entities/sms-template.entity';
|
||||
import { User } from '../../users/entities/user.entity';
|
||||
import { CampaignRunStatus } from '../enums/campaign-run-status.enum';
|
||||
import { CampaignTrigger } from '../enums/campaign-trigger.enum';
|
||||
@@ -77,6 +78,29 @@ export class CampaignRun {
|
||||
@JoinColumn({ name: 'triggeredByUserId' })
|
||||
triggeredByUser: User | null;
|
||||
|
||||
@Column({ type: 'uuid', nullable: true })
|
||||
templateId: string | null;
|
||||
|
||||
@ManyToOne(() => SmsTemplate, { onDelete: 'SET NULL', nullable: true })
|
||||
@JoinColumn({ name: 'templateId' })
|
||||
template: SmsTemplate | null;
|
||||
|
||||
@Column({ type: 'int', nullable: true })
|
||||
discountPercent: number | null;
|
||||
|
||||
@Column({
|
||||
type: 'decimal',
|
||||
precision: 14,
|
||||
scale: 2,
|
||||
nullable: true,
|
||||
transformer: {
|
||||
to: (value: number | null) => value,
|
||||
from: (value: string | null) =>
|
||||
value == null ? null : parseFloat(value),
|
||||
},
|
||||
})
|
||||
discountAmount: number | null;
|
||||
|
||||
@CreateDateColumn()
|
||||
createdAt: Date;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user