forked from StellarSplit/StellarSplit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsplit-template.entity.ts
More file actions
49 lines (37 loc) · 906 Bytes
/
Copy pathsplit-template.entity.ts
File metadata and controls
49 lines (37 loc) · 906 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
42
43
44
45
46
47
48
49
import {
Entity,
PrimaryGeneratedColumn,
Column,
CreateDateColumn,
} from "typeorm";
export enum SplitType {
EQUAL = "equal",
ITEMIZED = "itemized",
PERCENTAGE = "percentage",
CUSTOM = "custom",
}
@Entity("split_templates")
export class SplitTemplate {
@PrimaryGeneratedColumn("uuid")
id!: string;
@Column()
userId!: string; // wallet address
@Column()
name!: string;
@Column({ type: "text", nullable: true })
description?: string;
@Column({ type: "enum", enum: SplitType })
splitType!: SplitType;
@Column({ type: "jsonb" })
defaultParticipants!: any[];
@Column({ type: "jsonb", nullable: true })
defaultItems?: any[];
@Column({ type: "decimal", default: 0 })
taxPercentage!: number;
@Column({ type: "decimal", default: 0 })
tipPercentage!: number;
@Column({ default: 0 })
usageCount!: number;
@CreateDateColumn()
createdAt!: Date;
}