Skip to content

Commit 838615c

Browse files
committed
feat(subscription): add common fields
1 parent ad61f16 commit 838615c

1 file changed

Lines changed: 29 additions & 2 deletions

File tree

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,34 @@
1-
import { Entity, PrimaryGeneratedColumn } from 'typeorm';
1+
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
22

33
@Entity('subscription')
44
export default class SubscriptionEntity {
55
@PrimaryGeneratedColumn()
6-
id: string;
6+
id: number;
7+
8+
@Column({ type: 'varchar', length: 42 }) // Ethereum address
9+
subscriber: string;
10+
11+
@Column({ type: 'varchar', length: 42 }) // ERC20 token address
12+
token: string;
13+
14+
@Column({ type: 'decimal', precision: 78, scale: 0 }) // BigNumber safe
15+
amount: string;
16+
17+
@Column({ type: 'bigint' })
18+
nextPaymentTime: string; // unix timestamp
19+
20+
@Column({ type: 'bigint' })
21+
interval: string; // seconds
22+
23+
@Column({ type: 'int' })
24+
poolId: number;
25+
26+
@Column({ type: 'smallint', unsigned: true })
27+
remainingDuration: number;
28+
29+
@Column({ type: 'boolean', default: true })
30+
active: boolean;
31+
32+
@Column({ type: 'bigint', nullable: true })
33+
expiredAt: string | null;
734
}

0 commit comments

Comments
 (0)