mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
entity transaction link
This commit is contained in:
parent
5f5bde2f0f
commit
19084d7514
55
database/entity/0030-transaction_link/TransactionLink.ts
Normal file
55
database/entity/0030-transaction_link/TransactionLink.ts
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
import Decimal from 'decimal.js-light'
|
||||||
|
import { BaseEntity, Entity, PrimaryGeneratedColumn, Column } from 'typeorm'
|
||||||
|
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
||||||
|
|
||||||
|
@Entity('transaction_links')
|
||||||
|
export class Transaction extends BaseEntity {
|
||||||
|
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
||||||
|
id: number
|
||||||
|
|
||||||
|
@Column({ unsigned: true, nullable: false })
|
||||||
|
userId: number
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
type: 'decimal',
|
||||||
|
precision: 40,
|
||||||
|
scale: 20,
|
||||||
|
nullable: false,
|
||||||
|
transformer: DecimalTransformer,
|
||||||
|
})
|
||||||
|
amount: Decimal
|
||||||
|
|
||||||
|
@Column({ length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
||||||
|
memo: string
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
type: 'datetime',
|
||||||
|
default: () => 'CURRENT_TIMESTAMP',
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
createdAt: Date
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
type: 'datetime',
|
||||||
|
default: () => 'CURRENT_TIMESTAMP',
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
validUntil: Date
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
type: 'datetime',
|
||||||
|
default: () => 'CURRENT_TIMESTAMP',
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
redeemedAt: Date
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
type: 'boolean',
|
||||||
|
default: () => false,
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
showEmail: boolean
|
||||||
|
|
||||||
|
@Column({ unsigned: true, nullable: true })
|
||||||
|
redeemedBy: number
|
||||||
|
}
|
||||||
1
database/entity/TransactionLink.ts
Normal file
1
database/entity/TransactionLink.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export { TransactionLink } from './0030-transaction_link/TransactionLink'
|
||||||
@ -3,6 +3,7 @@ import { LoginEmailOptIn } from './LoginEmailOptIn'
|
|||||||
import { Migration } from './Migration'
|
import { Migration } from './Migration'
|
||||||
import { ServerUser } from './ServerUser'
|
import { ServerUser } from './ServerUser'
|
||||||
import { Transaction } from './Transaction'
|
import { Transaction } from './Transaction'
|
||||||
|
import { TransactionLink } from './TransactionLink'
|
||||||
import { User } from './User'
|
import { User } from './User'
|
||||||
import { UserSetting } from './UserSetting'
|
import { UserSetting } from './UserSetting'
|
||||||
import { AdminPendingCreation } from './AdminPendingCreation'
|
import { AdminPendingCreation } from './AdminPendingCreation'
|
||||||
@ -14,6 +15,7 @@ export const entities = [
|
|||||||
Migration,
|
Migration,
|
||||||
ServerUser,
|
ServerUser,
|
||||||
Transaction,
|
Transaction,
|
||||||
|
TransactionLink,
|
||||||
User,
|
User,
|
||||||
UserSetting,
|
UserSetting,
|
||||||
]
|
]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user