feat: gift journeys

This commit is contained in:
Abdalhamid Alhamad
2024-12-22 16:34:02 +03:00
parent 4cef58580e
commit 5e9e83cb74
28 changed files with 656 additions and 1 deletions

View File

@ -0,0 +1,30 @@
import {
BaseEntity,
Column,
CreateDateColumn,
Entity,
JoinColumn,
ManyToOne,
PrimaryGeneratedColumn,
UpdateDateColumn,
} from 'typeorm';
import { Gift } from './gift.entity';
@Entity('gift_redemptions')
export class GiftRedemption extends BaseEntity {
@PrimaryGeneratedColumn('uuid')
id!: string;
@Column({ type: 'uuid', name: 'gift_id' })
giftId!: string;
@ManyToOne(() => Gift, (gift) => gift.redemptions, { onDelete: 'CASCADE' })
@JoinColumn({ name: 'gift_id' })
gift!: Gift;
@CreateDateColumn({ name: 'created_at', type: 'timestamp with time zone', default: () => 'CURRENT_TIMESTAMP' })
createdAt!: Date;
@UpdateDateColumn({ name: 'updated_at', type: 'timestamp with time zone', default: () => 'CURRENT_TIMESTAMP' })
updatedAt!: Date;
}