mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
add more typeorm models
This commit is contained in:
parent
aa0e84fbf6
commit
a42fce5e1f
23
backend/src/typeorm/entity/Transaction.ts
Normal file
23
backend/src/typeorm/entity/Transaction.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import { BaseEntity, Entity, PrimaryGeneratedColumn, Column, Timestamp } from 'typeorm'
|
||||
|
||||
@Entity('transactions')
|
||||
export class Transaction extends BaseEntity {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number
|
||||
|
||||
@Column({ name: 'transaction_type_id' })
|
||||
transactionTypeId: number
|
||||
|
||||
@Column({ name: 'tx_hash', type: 'binary', length: 48 })
|
||||
txHash: Buffer
|
||||
|
||||
@Column()
|
||||
memo: string
|
||||
|
||||
@Column({ type: 'timestamp' })
|
||||
received: Timestamp
|
||||
|
||||
@Column({ name: 'blockchain_type_id' })
|
||||
blockchainTypeId: number
|
||||
|
||||
}
|
||||
25
backend/src/typeorm/entity/TransactionCreation.ts
Normal file
25
backend/src/typeorm/entity/TransactionCreation.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import { BaseEntity, Entity, PrimaryGeneratedColumn, Column, Timestamp, OneToOne, JoinColumn } from 'typeorm'
|
||||
import { Transaction } from './Transaction'
|
||||
|
||||
@Entity('transaction_creations')
|
||||
export class TransactionCreation extends BaseEntity {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number
|
||||
|
||||
@Column({ name: 'transaction_id' })
|
||||
transactionId: number
|
||||
|
||||
@Column({ name: 'state_user_id' })
|
||||
userId: number
|
||||
|
||||
@Column()
|
||||
amount: number
|
||||
|
||||
@Column({ name: 'target_date', type: 'timestamp' })
|
||||
targetDate: Timestamp
|
||||
|
||||
@OneToOne(() => Transaction)
|
||||
@JoinColumn()
|
||||
transaction: Transaction
|
||||
|
||||
}
|
||||
31
backend/src/typeorm/entity/TransactionSendCoin.ts
Normal file
31
backend/src/typeorm/entity/TransactionSendCoin.ts
Normal file
@ -0,0 +1,31 @@
|
||||
import { BaseEntity, Entity, PrimaryGeneratedColumn, Column, OneToOne, JoinColumn } from 'typeorm'
|
||||
import { Transaction } from './Transaction'
|
||||
|
||||
@Entity('transaction_send_coins')
|
||||
export class TransactionSendCoin extends BaseEntity {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number
|
||||
|
||||
@Column({ name: 'transaction_id' })
|
||||
transactionId: number
|
||||
|
||||
@Column({ name: 'sender_public_key', type: 'binary', length: 32 })
|
||||
senderPublic: Buffer
|
||||
|
||||
@Column({ name: 'state_user_id' })
|
||||
userId: number
|
||||
|
||||
@Column({ name: 'receiver_public_key', type: 'binary', length: 32})
|
||||
recipiantPublic: Buffer
|
||||
|
||||
@Column({ name: 'receiver_user_id' })
|
||||
recipiantUserId: number
|
||||
|
||||
@Column()
|
||||
amount: number
|
||||
|
||||
@OneToOne(() => Transaction)
|
||||
@JoinColumn()
|
||||
transaction: Transaction
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user