forked from MergeFi/backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathteam-member-split.entity.ts
More file actions
41 lines (33 loc) · 909 Bytes
/
Copy pathteam-member-split.entity.ts
File metadata and controls
41 lines (33 loc) · 909 Bytes
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
41
import {
Column,
CreateDateColumn,
Entity,
JoinColumn,
ManyToOne,
PrimaryGeneratedColumn,
} from 'typeorm';
import { Team } from './team.entity';
import { User } from './user.entity';
@Entity('team_member_splits')
export class TeamMemberSplit {
@PrimaryGeneratedColumn('uuid')
id: string;
@ManyToOne(() => Team, (team) => team.splits, { onDelete: 'CASCADE' })
@JoinColumn()
team: Team;
@Column()
teamId: string;
@ManyToOne(() => User, { onDelete: 'CASCADE' })
@JoinColumn()
user: User;
@Column()
userId: string;
/** Free-text label describing the member's contribution, e.g. "frontend". */
@Column({ type: 'varchar', nullable: true })
role: string | null;
/** Percentage of the bounty payout, 0-100. Sum across a team must equal 100. */
@Column({ type: 'decimal', precision: 5, scale: 2 })
percentage: string;
@CreateDateColumn()
createdAt: Date;
}