forked from StellarSplit/StellarSplit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparticipant.entity.ts
More file actions
40 lines (29 loc) · 1.05 KB
/
Copy pathparticipant.entity.ts
File metadata and controls
40 lines (29 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn } from 'typeorm';
import { Split } from './split.entity';
@Entity('participants')
export class Participant {
@PrimaryGeneratedColumn('uuid')
id!: string;
@Column({ type: 'uuid' })
splitId!: string;
@Column({ type: 'uuid' })
userId!: string;
@Column({ type: 'decimal', precision: 10, scale: 2 })
amountOwed!: number;
@Column({ type: 'decimal', precision: 10, scale: 2, default: 0 })
amountPaid!: number;
@Column({ type: 'varchar', default: 'pending' })
status!: 'pending' | 'paid' | 'partial';
@Column({ type: 'varchar', nullable: true })
walletAddress?: string;
@CreateDateColumn()
createdAt!: Date;
@UpdateDateColumn()
updatedAt!: Date;
/** Soft delete: set when removed; records with this set are excluded from default queries. */
@DeleteDateColumn({ name: 'deleted_at' })
deletedAt!: Date | null;
@ManyToOne(() => Split, split => split.id)
@JoinColumn({ name: 'splitId' })
split?: Split;
}