mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
Merge pull request #3495 from gradido/refactor_database_ms_git_compatible
refactor(database): ms precision and git compatible entity versioning
This commit is contained in:
commit
4a985ed0fd
@ -1,24 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { User } from '../User'
|
|
||||||
|
|
||||||
@Entity('state_balances')
|
|
||||||
export class Balance extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn()
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'state_user_id' })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({ type: 'datetime' })
|
|
||||||
modified: Date
|
|
||||||
|
|
||||||
@Column({ name: 'record_date', type: 'datetime' })
|
|
||||||
recordDate: Date
|
|
||||||
|
|
||||||
@Column({ type: 'bigint' })
|
|
||||||
amount: number
|
|
||||||
|
|
||||||
@OneToOne(() => User, { nullable: false })
|
|
||||||
@JoinColumn({ name: 'state_user_id' })
|
|
||||||
user: User
|
|
||||||
}
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
|
|
||||||
@Entity('migrations')
|
|
||||||
export class Migration extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn() // This is actually not a primary column
|
|
||||||
version: number
|
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 256, nullable: true, default: null })
|
|
||||||
fileName: string
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP' })
|
|
||||||
date: Date
|
|
||||||
}
|
|
||||||
@ -1,31 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
|
|
||||||
@Entity('server_users')
|
|
||||||
export class ServerUser extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ length: 50 })
|
|
||||||
username: string
|
|
||||||
|
|
||||||
@Column({ length: 255 })
|
|
||||||
password: string
|
|
||||||
|
|
||||||
@Column({ length: 50, unique: true })
|
|
||||||
email: string
|
|
||||||
|
|
||||||
@Column({ length: 20, default: 'admin' })
|
|
||||||
role: string
|
|
||||||
|
|
||||||
@Column({ default: 0 })
|
|
||||||
activated: number
|
|
||||||
|
|
||||||
@Column({ name: 'last_login', default: null, nullable: true })
|
|
||||||
lastLogin: Date
|
|
||||||
|
|
||||||
@Column({ default: () => 'CURRENT_TIMESTAMP' })
|
|
||||||
created: Date
|
|
||||||
|
|
||||||
@Column({ default: () => 'CURRENT_TIMESTAMP' })
|
|
||||||
modified: Date
|
|
||||||
}
|
|
||||||
@ -1,45 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, OneToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { TransactionCreation } from './TransactionCreation'
|
|
||||||
import { TransactionSendCoin } from './TransactionSendCoin'
|
|
||||||
|
|
||||||
@Entity('transactions')
|
|
||||||
export class Transaction extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn()
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'state_group_id', unsigned: true, default: null })
|
|
||||||
stateGroupId: number
|
|
||||||
|
|
||||||
@Column({ name: 'transaction_type_id', unsigned: true, nullable: false })
|
|
||||||
transactionTypeId: number
|
|
||||||
|
|
||||||
@Column({ name: 'tx_hash', type: 'binary', length: 48, default: null })
|
|
||||||
txHash: Buffer
|
|
||||||
|
|
||||||
@Column({ length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
memo: string
|
|
||||||
|
|
||||||
@Column({ type: 'timestamp', nullable: false, default: () => 'CURRENT_TIMESTAMP' })
|
|
||||||
received: Date
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'blockchain_type_id',
|
|
||||||
type: 'bigint',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: false,
|
|
||||||
default: 1,
|
|
||||||
})
|
|
||||||
blockchainTypeId: number
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => TransactionSendCoin,
|
|
||||||
(transactionSendCoin) => transactionSendCoin.transaction,
|
|
||||||
)
|
|
||||||
transactionSendCoin: TransactionSendCoin
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => TransactionCreation,
|
|
||||||
(transactionCreation) => transactionCreation.transaction,
|
|
||||||
)
|
|
||||||
transactionCreation: TransactionCreation
|
|
||||||
}
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } 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: Date
|
|
||||||
|
|
||||||
@OneToOne(() => Transaction)
|
|
||||||
@JoinColumn({ name: 'transaction_id' })
|
|
||||||
transaction: Transaction
|
|
||||||
}
|
|
||||||
@ -1,33 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } 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
|
|
||||||
|
|
||||||
@Column({ name: 'sender_final_balance' })
|
|
||||||
senderFinalBalance: number
|
|
||||||
|
|
||||||
@OneToOne(() => Transaction)
|
|
||||||
@JoinColumn({ name: 'transaction_id' })
|
|
||||||
transaction: Transaction
|
|
||||||
}
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { Transaction } from '../Transaction'
|
|
||||||
|
|
||||||
@Entity('transaction_signatures')
|
|
||||||
export class TransactionSignature extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'transaction_id' })
|
|
||||||
transactionId: number
|
|
||||||
|
|
||||||
@Column({ type: 'binary', length: 64, nullable: false })
|
|
||||||
signature: Buffer
|
|
||||||
|
|
||||||
@Column({ type: 'binary', length: 32, nullable: false })
|
|
||||||
pubkey: Buffer
|
|
||||||
|
|
||||||
@OneToOne(() => Transaction)
|
|
||||||
@JoinColumn({ name: 'transaction_id' })
|
|
||||||
transaction: Transaction
|
|
||||||
}
|
|
||||||
@ -1,51 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, OneToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { Balance } from './Balance'
|
|
||||||
|
|
||||||
// Moriz: I do not like the idea of having two user tables
|
|
||||||
@Entity('state_users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class User extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'index_id', type: 'smallint', default: 0, nullable: false })
|
|
||||||
indexId: number
|
|
||||||
|
|
||||||
@Column({ name: 'group_id', default: 0, unsigned: true })
|
|
||||||
groupId: number
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
pubkey: Buffer
|
|
||||||
|
|
||||||
@Column({ length: 255, nullable: true, default: null, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
email: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'first_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
firstName: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'last_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
lastName: string
|
|
||||||
|
|
||||||
@Column({ length: 255, nullable: true, default: null, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
username: string
|
|
||||||
|
|
||||||
@Column({ type: 'bool', default: false })
|
|
||||||
disabled: boolean
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => Balance,
|
|
||||||
(balance) => balance.user,
|
|
||||||
)
|
|
||||||
balance: Balance
|
|
||||||
}
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
|
|
||||||
@Entity('state_user_transactions')
|
|
||||||
export class UserTransaction extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn()
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'state_user_id' })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({ name: 'transaction_id' })
|
|
||||||
transactionId: number
|
|
||||||
|
|
||||||
@Column({ name: 'transaction_type_id' })
|
|
||||||
transactionTypeId: number
|
|
||||||
|
|
||||||
@Column({ name: 'balance', type: 'bigint' })
|
|
||||||
balance: number
|
|
||||||
|
|
||||||
@Column({ name: 'balance_date', type: 'timestamp' })
|
|
||||||
balanceDate: Date
|
|
||||||
}
|
|
||||||
@ -1,51 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { UserSetting } from './UserSetting'
|
|
||||||
|
|
||||||
// Moriz: I do not like the idea of having two user tables
|
|
||||||
@Entity('state_users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class User extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'index_id', type: 'smallint', default: 0, nullable: false })
|
|
||||||
indexId: number
|
|
||||||
|
|
||||||
@Column({ name: 'group_id', default: 0, unsigned: true })
|
|
||||||
groupId: number
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
pubkey: Buffer
|
|
||||||
|
|
||||||
@Column({ length: 255, nullable: true, default: null, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
email: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'first_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
firstName: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'last_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
lastName: string
|
|
||||||
|
|
||||||
@Column({ length: 255, nullable: true, default: null, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
username: string
|
|
||||||
|
|
||||||
@Column({ type: 'bool', default: false })
|
|
||||||
disabled: boolean
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => UserSetting,
|
|
||||||
(userSetting) => userSetting.user,
|
|
||||||
)
|
|
||||||
settings: UserSetting[]
|
|
||||||
}
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { User } from '../0034-drop_server_user_table/User'
|
|
||||||
|
|
||||||
@Entity()
|
|
||||||
export class UserSetting extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn()
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column()
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@ManyToOne(
|
|
||||||
() => User,
|
|
||||||
(user) => user.settings,
|
|
||||||
)
|
|
||||||
user: User
|
|
||||||
|
|
||||||
@Column()
|
|
||||||
key: string
|
|
||||||
|
|
||||||
@Column()
|
|
||||||
value: string
|
|
||||||
}
|
|
||||||
@ -1,52 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
|
|
||||||
@Entity('login_elopage_buys')
|
|
||||||
export class LoginElopageBuys extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ type: 'int', width: 11, name: 'elopage_user_id', nullable: true, default: null })
|
|
||||||
elopageUserId: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'affiliate_program_id', nullable: false })
|
|
||||||
affiliateProgramId: number
|
|
||||||
|
|
||||||
@Column({ name: 'publisher_id', nullable: false })
|
|
||||||
publisherId: number
|
|
||||||
|
|
||||||
@Column({ name: 'order_id', nullable: false })
|
|
||||||
orderId: number
|
|
||||||
|
|
||||||
@Column({ name: 'product_id', nullable: false })
|
|
||||||
productId: number
|
|
||||||
|
|
||||||
@Column({ name: 'product_price', nullable: false })
|
|
||||||
productPrice: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'payer_email',
|
|
||||||
length: 255,
|
|
||||||
nullable: false,
|
|
||||||
charset: 'utf8',
|
|
||||||
collation: 'utf8_bin',
|
|
||||||
})
|
|
||||||
payerEmail: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'publisher_email',
|
|
||||||
length: 255,
|
|
||||||
nullable: false,
|
|
||||||
charset: 'utf8',
|
|
||||||
collation: 'utf8_bin',
|
|
||||||
})
|
|
||||||
publisherEmail: string
|
|
||||||
|
|
||||||
@Column({ nullable: false })
|
|
||||||
payed: boolean
|
|
||||||
|
|
||||||
@Column({ name: 'success_date', nullable: false })
|
|
||||||
successDate: Date
|
|
||||||
|
|
||||||
@Column({ length: 255, nullable: false })
|
|
||||||
event: string
|
|
||||||
}
|
|
||||||
@ -1,26 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
|
|
||||||
// Moriz: I do not like the idea of having two user tables
|
|
||||||
@Entity('login_email_opt_in')
|
|
||||||
export class LoginEmailOptIn extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', type: 'bigint', unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({ name: 'verification_code', type: 'bigint', unsigned: true, unique: true })
|
|
||||||
verificationCode: BigInt
|
|
||||||
|
|
||||||
@Column({ name: 'email_opt_in_type_id', type: 'int', unsigned: true, nullable: false })
|
|
||||||
emailOptInTypeId: number
|
|
||||||
|
|
||||||
@Column({ name: 'created', type: 'datetime', default: () => 'CURRENT_TIMESTAMP' })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ name: 'resend_count', type: 'int', unsigned: true, default: 0 })
|
|
||||||
resendCount: number
|
|
||||||
|
|
||||||
@Column({ name: 'updated', type: 'datetime', default: () => 'CURRENT_TIMESTAMP' })
|
|
||||||
updatedAt: Date
|
|
||||||
}
|
|
||||||
@ -1,63 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, OneToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { LoginUserBackup } from './LoginUserBackup'
|
|
||||||
|
|
||||||
// Moriz: I do not like the idea of having two user tables
|
|
||||||
@Entity('login_users')
|
|
||||||
export class LoginUser extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ length: 191, unique: true })
|
|
||||||
email: string
|
|
||||||
|
|
||||||
@Column({ name: 'first_name', length: 150 })
|
|
||||||
firstName: string
|
|
||||||
|
|
||||||
@Column({ name: 'last_name', length: 255, default: '' })
|
|
||||||
lastName: string
|
|
||||||
|
|
||||||
@Column({ length: 255, default: '' })
|
|
||||||
username: string
|
|
||||||
|
|
||||||
@Column({ type: 'mediumtext', default: '', nullable: true })
|
|
||||||
description: string
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', default: 0, unsigned: true })
|
|
||||||
password: BigInt
|
|
||||||
|
|
||||||
@Column({ name: 'pubkey', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
pubKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'privkey', type: 'binary', length: 80, default: null, nullable: true })
|
|
||||||
privKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'email_hash', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
emailHash: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'created', default: () => 'CURRENT_TIMESTAMP', nullable: false })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ name: 'email_checked', type: 'bool', nullable: false, default: false })
|
|
||||||
emailChecked: boolean
|
|
||||||
|
|
||||||
@Column({ name: 'passphrase_shown', type: 'bool', nullable: false, default: false })
|
|
||||||
passphraseShown: boolean
|
|
||||||
|
|
||||||
@Column({ length: 4, default: 'de', nullable: false })
|
|
||||||
language: string
|
|
||||||
|
|
||||||
@Column({ type: 'bool', default: false })
|
|
||||||
disabled: boolean
|
|
||||||
|
|
||||||
@Column({ name: 'group_id', default: 0, unsigned: true })
|
|
||||||
groupId: number
|
|
||||||
|
|
||||||
@Column({ name: 'publisher_id', default: 0 })
|
|
||||||
publisherId: number
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => LoginUserBackup,
|
|
||||||
(loginUserBackup) => loginUserBackup.loginUser,
|
|
||||||
)
|
|
||||||
loginUserBackup: LoginUserBackup
|
|
||||||
}
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { LoginUser } from './LoginUser'
|
|
||||||
|
|
||||||
@Entity('login_user_backups')
|
|
||||||
export class LoginUserBackup extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ type: 'text', name: 'passphrase', nullable: false })
|
|
||||||
passphrase: string
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({ name: 'mnemonic_type', default: -1 })
|
|
||||||
mnemonicType: number
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => LoginUser,
|
|
||||||
(loginUser) => loginUser.loginUserBackup,
|
|
||||||
{ nullable: false },
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
loginUser: LoginUser
|
|
||||||
}
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
|
|
||||||
@Entity('login_user_roles')
|
|
||||||
export class LoginUserRoles extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'user_id' })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({ name: 'role_id' })
|
|
||||||
roleId: number
|
|
||||||
}
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
|
|
||||||
@Entity('login_pending_tasks_admin')
|
|
||||||
export class LoginPendingTasksAdmin extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP' })
|
|
||||||
created: Date
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', nullable: false })
|
|
||||||
date: Date
|
|
||||||
|
|
||||||
@Column({ length: 256, nullable: true, default: null })
|
|
||||||
memo: string
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', nullable: false })
|
|
||||||
amount: BigInt
|
|
||||||
|
|
||||||
@Column()
|
|
||||||
moderator: number
|
|
||||||
}
|
|
||||||
@ -1,63 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, OneToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { LoginUserBackup } from '../0003-login_server_tables/LoginUserBackup'
|
|
||||||
|
|
||||||
// Moriz: I do not like the idea of having two user tables
|
|
||||||
@Entity('login_users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class LoginUser extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ length: 191, unique: true, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
email: string
|
|
||||||
|
|
||||||
@Column({ name: 'first_name', length: 150, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
firstName: string
|
|
||||||
|
|
||||||
@Column({ name: 'last_name', length: 255, default: '', collation: 'utf8mb4_unicode_ci' })
|
|
||||||
lastName: string
|
|
||||||
|
|
||||||
@Column({ length: 255, default: '', collation: 'utf8mb4_unicode_ci' })
|
|
||||||
username: string
|
|
||||||
|
|
||||||
@Column({ type: 'mediumtext', default: '', collation: 'utf8mb4_unicode_ci', nullable: true })
|
|
||||||
description: string
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', default: 0, unsigned: true })
|
|
||||||
password: BigInt
|
|
||||||
|
|
||||||
@Column({ name: 'pubkey', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
pubKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'privkey', type: 'binary', length: 80, default: null, nullable: true })
|
|
||||||
privKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'email_hash', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
emailHash: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'created', default: () => 'CURRENT_TIMESTAMP', nullable: false })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ name: 'email_checked', type: 'bool', nullable: false, default: false })
|
|
||||||
emailChecked: boolean
|
|
||||||
|
|
||||||
@Column({ name: 'passphrase_shown', type: 'bool', nullable: false, default: false })
|
|
||||||
passphraseShown: boolean
|
|
||||||
|
|
||||||
@Column({ length: 4, default: 'de', collation: 'utf8mb4_unicode_ci', nullable: false })
|
|
||||||
language: string
|
|
||||||
|
|
||||||
@Column({ type: 'bool', default: false })
|
|
||||||
disabled: boolean
|
|
||||||
|
|
||||||
@Column({ name: 'group_id', default: 0, unsigned: true })
|
|
||||||
groupId: number
|
|
||||||
|
|
||||||
@Column({ name: 'publisher_id', default: 0 })
|
|
||||||
publisherId: number
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => LoginUserBackup,
|
|
||||||
(loginUserBackup) => loginUserBackup.loginUser,
|
|
||||||
)
|
|
||||||
loginUserBackup: LoginUserBackup
|
|
||||||
}
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
|
|
||||||
@Entity('admin_pending_creations')
|
|
||||||
export class AdminPendingCreation extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP' })
|
|
||||||
created: Date
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', nullable: false })
|
|
||||||
date: Date
|
|
||||||
|
|
||||||
@Column({ length: 256, nullable: true, default: null })
|
|
||||||
memo: string
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', nullable: false })
|
|
||||||
amount: BigInt
|
|
||||||
|
|
||||||
@Column()
|
|
||||||
moderator: number
|
|
||||||
}
|
|
||||||
@ -1,40 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, OneToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { TransactionCreation } from '../0001-init_db/TransactionCreation'
|
|
||||||
import { TransactionSendCoin } from '../0001-init_db/TransactionSendCoin'
|
|
||||||
|
|
||||||
@Entity('transactions')
|
|
||||||
export class Transaction extends BaseEntity {
|
|
||||||
// TODO the id is defined as bigint(20) - there might be problems with that: https://github.com/typeorm/typeorm/issues/2400
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'transaction_type_id', unsigned: true, nullable: false })
|
|
||||||
transactionTypeId: number
|
|
||||||
|
|
||||||
@Column({ name: 'tx_hash', type: 'binary', length: 48, default: null })
|
|
||||||
txHash: Buffer
|
|
||||||
|
|
||||||
@Column({ length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
memo: string
|
|
||||||
|
|
||||||
@Column({ type: 'timestamp', nullable: false, default: () => 'CURRENT_TIMESTAMP' })
|
|
||||||
received: Date
|
|
||||||
|
|
||||||
@Column({ type: 'binary', length: 64, nullable: true, default: null })
|
|
||||||
signature: Buffer
|
|
||||||
|
|
||||||
@Column({ type: 'binary', length: 32, nullable: true, default: null })
|
|
||||||
pubkey: Buffer
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => TransactionSendCoin,
|
|
||||||
(transactionSendCoin) => transactionSendCoin.transaction,
|
|
||||||
)
|
|
||||||
transactionSendCoin: TransactionSendCoin
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => TransactionCreation,
|
|
||||||
(transactionCreation) => transactionCreation.transaction,
|
|
||||||
)
|
|
||||||
transactionCreation: TransactionCreation
|
|
||||||
}
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
|
|
||||||
@Entity('login_user_backups')
|
|
||||||
export class LoginUserBackup extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ type: 'text', name: 'passphrase', nullable: false })
|
|
||||||
passphrase: string
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({ name: 'mnemonic_type', default: -1 })
|
|
||||||
mnemonicType: number
|
|
||||||
}
|
|
||||||
@ -1,77 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { UserSetting } from '../0002-add_settings/UserSetting'
|
|
||||||
|
|
||||||
@Entity('state_users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class User extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'login_user_id', default: null, unsigned: true })
|
|
||||||
loginUserId: number
|
|
||||||
|
|
||||||
@Column({ name: 'index_id', type: 'smallint', default: 0, nullable: false })
|
|
||||||
indexId: number
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
pubKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'privkey', type: 'binary', length: 80, default: null, nullable: true })
|
|
||||||
privKey: Buffer
|
|
||||||
|
|
||||||
@Column({ length: 255, unique: true, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
email: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'first_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
firstName: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'last_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
lastName: string
|
|
||||||
|
|
||||||
@Column({ length: 255, nullable: true, default: null, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
username: string
|
|
||||||
|
|
||||||
@Column({ type: 'bool', default: false })
|
|
||||||
disabled: boolean
|
|
||||||
|
|
||||||
@Column({ type: 'mediumtext', default: '', collation: 'utf8mb4_unicode_ci', nullable: true })
|
|
||||||
description: string
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', default: 0, unsigned: true })
|
|
||||||
password: BigInt
|
|
||||||
|
|
||||||
@Column({ name: 'email_hash', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
emailHash: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'created', default: () => 'CURRENT_TIMESTAMP', nullable: false })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ name: 'email_checked', type: 'bool', nullable: false, default: false })
|
|
||||||
emailChecked: boolean
|
|
||||||
|
|
||||||
@Column({ name: 'passphrase_shown', type: 'bool', nullable: false, default: false })
|
|
||||||
passphraseShown: boolean
|
|
||||||
|
|
||||||
@Column({ length: 4, default: 'de', collation: 'utf8mb4_unicode_ci', nullable: false })
|
|
||||||
language: string
|
|
||||||
|
|
||||||
@Column({ name: 'publisher_id', default: 0 })
|
|
||||||
publisherId: number
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => UserSetting,
|
|
||||||
(userSetting) => userSetting.user,
|
|
||||||
)
|
|
||||||
settings: UserSetting[]
|
|
||||||
}
|
|
||||||
@ -1,86 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { UserSetting } from '../0002-add_settings/UserSetting'
|
|
||||||
|
|
||||||
@Entity('state_users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class User extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'login_user_id', default: null, unsigned: true })
|
|
||||||
loginUserId: number
|
|
||||||
|
|
||||||
@Column({ name: 'index_id', type: 'smallint', default: 0, nullable: false })
|
|
||||||
indexId: number
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
pubKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'privkey', type: 'binary', length: 80, default: null, nullable: true })
|
|
||||||
privKey: Buffer
|
|
||||||
|
|
||||||
@Column({ length: 255, unique: true, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
email: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'first_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
firstName: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'last_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
lastName: string
|
|
||||||
|
|
||||||
@Column({ length: 255, nullable: true, default: null, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
username: string
|
|
||||||
|
|
||||||
@Column({ type: 'bool', default: false })
|
|
||||||
disabled: boolean
|
|
||||||
|
|
||||||
@Column({ type: 'mediumtext', default: '', collation: 'utf8mb4_unicode_ci', nullable: true })
|
|
||||||
description: string
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', default: 0, unsigned: true })
|
|
||||||
password: BigInt
|
|
||||||
|
|
||||||
@Column({ name: 'email_hash', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
emailHash: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'created', default: () => 'CURRENT_TIMESTAMP', nullable: false })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ name: 'email_checked', type: 'bool', nullable: false, default: false })
|
|
||||||
emailChecked: boolean
|
|
||||||
|
|
||||||
@Column({ name: 'passphrase_shown', type: 'bool', nullable: false, default: false })
|
|
||||||
passphraseShown: boolean
|
|
||||||
|
|
||||||
@Column({ length: 4, default: 'de', collation: 'utf8mb4_unicode_ci', nullable: false })
|
|
||||||
language: string
|
|
||||||
|
|
||||||
@Column({ name: 'publisher_id', default: 0 })
|
|
||||||
publisherId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'text',
|
|
||||||
name: 'passphrase',
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
passphrase: string
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => UserSetting,
|
|
||||||
(userSetting) => userSetting.user,
|
|
||||||
)
|
|
||||||
settings: UserSetting[]
|
|
||||||
}
|
|
||||||
@ -1,83 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { UserSetting } from '../0002-add_settings/UserSetting'
|
|
||||||
|
|
||||||
@Entity('state_users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class User extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'index_id', type: 'smallint', default: 0, nullable: false })
|
|
||||||
indexId: number
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
pubKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'privkey', type: 'binary', length: 80, default: null, nullable: true })
|
|
||||||
privKey: Buffer
|
|
||||||
|
|
||||||
@Column({ length: 255, unique: true, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
email: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'first_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
firstName: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'last_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
lastName: string
|
|
||||||
|
|
||||||
@Column({ length: 255, nullable: true, default: null, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
username: string
|
|
||||||
|
|
||||||
@Column({ type: 'bool', default: false })
|
|
||||||
disabled: boolean
|
|
||||||
|
|
||||||
@Column({ type: 'mediumtext', default: '', collation: 'utf8mb4_unicode_ci', nullable: true })
|
|
||||||
description: string
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', default: 0, unsigned: true })
|
|
||||||
password: BigInt
|
|
||||||
|
|
||||||
@Column({ name: 'email_hash', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
emailHash: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'created', default: () => 'CURRENT_TIMESTAMP', nullable: false })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ name: 'email_checked', type: 'bool', nullable: false, default: false })
|
|
||||||
emailChecked: boolean
|
|
||||||
|
|
||||||
@Column({ name: 'passphrase_shown', type: 'bool', nullable: false, default: false })
|
|
||||||
passphraseShown: boolean
|
|
||||||
|
|
||||||
@Column({ length: 4, default: 'de', collation: 'utf8mb4_unicode_ci', nullable: false })
|
|
||||||
language: string
|
|
||||||
|
|
||||||
@Column({ name: 'publisher_id', default: 0 })
|
|
||||||
publisherId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'text',
|
|
||||||
name: 'passphrase',
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
passphrase: string
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => UserSetting,
|
|
||||||
(userSetting) => userSetting.user,
|
|
||||||
)
|
|
||||||
settings: UserSetting[]
|
|
||||||
}
|
|
||||||
@ -1,71 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { UserSetting } from '../0002-add_settings/UserSetting'
|
|
||||||
|
|
||||||
@Entity('users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class User extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
pubKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'privkey', type: 'binary', length: 80, default: null, nullable: true })
|
|
||||||
privKey: Buffer
|
|
||||||
|
|
||||||
@Column({ length: 255, unique: true, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
email: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'first_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
firstName: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'last_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
lastName: string
|
|
||||||
|
|
||||||
@Column({ type: 'bool', default: false })
|
|
||||||
disabled: boolean
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', default: 0, unsigned: true })
|
|
||||||
password: BigInt
|
|
||||||
|
|
||||||
@Column({ name: 'email_hash', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
emailHash: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'created', default: () => 'CURRENT_TIMESTAMP', nullable: false })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ name: 'email_checked', type: 'bool', nullable: false, default: false })
|
|
||||||
emailChecked: boolean
|
|
||||||
|
|
||||||
@Column({ length: 4, default: 'de', collation: 'utf8mb4_unicode_ci', nullable: false })
|
|
||||||
language: string
|
|
||||||
|
|
||||||
@Column({ name: 'publisher_id', default: 0 })
|
|
||||||
publisherId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'text',
|
|
||||||
name: 'passphrase',
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
passphrase: string
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => UserSetting,
|
|
||||||
(userSetting) => userSetting.user,
|
|
||||||
)
|
|
||||||
settings: UserSetting[]
|
|
||||||
}
|
|
||||||
@ -1,54 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
|
|
||||||
@Entity('login_elopage_buys')
|
|
||||||
export class LoginElopageBuys extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ type: 'int', width: 11, name: 'elopage_user_id', nullable: true, default: null })
|
|
||||||
elopageUserId: number | null
|
|
||||||
|
|
||||||
@Column({ type: 'int', width: 11, name: 'affiliate_program_id', nullable: true, default: null })
|
|
||||||
affiliateProgramId: number | null
|
|
||||||
|
|
||||||
@Column({ type: 'int', width: 11, name: 'publisher_id', nullable: true, default: null })
|
|
||||||
publisherId: number | null
|
|
||||||
|
|
||||||
@Column({ type: 'int', width: 11, name: 'order_id', nullable: true, default: null })
|
|
||||||
orderId: number | null
|
|
||||||
|
|
||||||
@Column({ type: 'int', width: 11, name: 'product_id', nullable: true, default: null })
|
|
||||||
productId: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'product_price', type: 'int', nullable: false })
|
|
||||||
productPrice: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'payer_email',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 255,
|
|
||||||
nullable: false,
|
|
||||||
charset: 'utf8',
|
|
||||||
collation: 'utf8_bin',
|
|
||||||
})
|
|
||||||
payerEmail: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'publisher_email',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 255,
|
|
||||||
nullable: false,
|
|
||||||
charset: 'utf8',
|
|
||||||
collation: 'utf8_bin',
|
|
||||||
})
|
|
||||||
publisherEmail: string
|
|
||||||
|
|
||||||
@Column({ type: 'bool', nullable: false })
|
|
||||||
payed: boolean
|
|
||||||
|
|
||||||
@Column({ name: 'success_date', type: 'datetime', nullable: false })
|
|
||||||
successDate: Date
|
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
||||||
event: string
|
|
||||||
}
|
|
||||||
@ -1,78 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
OneToMany,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { UserSetting } from '../0002-add_settings/UserSetting'
|
|
||||||
|
|
||||||
@Entity('users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class User extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
pubKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'privkey', type: 'binary', length: 80, default: null, nullable: true })
|
|
||||||
privKey: Buffer
|
|
||||||
|
|
||||||
@Column({ length: 255, unique: true, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
email: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'first_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
firstName: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'last_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
lastName: string
|
|
||||||
|
|
||||||
@DeleteDateColumn()
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', default: 0, unsigned: true })
|
|
||||||
password: BigInt
|
|
||||||
|
|
||||||
@Column({ name: 'email_hash', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
emailHash: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'created', default: () => 'CURRENT_TIMESTAMP', nullable: false })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ name: 'email_checked', type: 'bool', nullable: false, default: false })
|
|
||||||
emailChecked: boolean
|
|
||||||
|
|
||||||
@Column({ length: 4, default: 'de', collation: 'utf8mb4_unicode_ci', nullable: false })
|
|
||||||
language: string
|
|
||||||
|
|
||||||
@Column({ name: 'publisher_id', default: 0 })
|
|
||||||
publisherId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'text',
|
|
||||||
name: 'passphrase',
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
passphrase: string
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => UserSetting,
|
|
||||||
(userSetting) => userSetting.user,
|
|
||||||
)
|
|
||||||
settings: UserSetting[]
|
|
||||||
}
|
|
||||||
@ -1,70 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
|
|
||||||
@Entity('transactions')
|
|
||||||
export class Transaction extends BaseEntity {
|
|
||||||
// TODO the id is defined as bigint(20) - there might be problems with that: https://github.com/typeorm/typeorm/issues/2400
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'transaction_type_id', unsigned: true, nullable: false })
|
|
||||||
transactionTypeId: number
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', nullable: false })
|
|
||||||
amount: BigInt
|
|
||||||
|
|
||||||
@Column({ name: 'tx_hash', type: 'binary', length: 48, default: null, nullable: true })
|
|
||||||
txHash: Buffer
|
|
||||||
|
|
||||||
@Column({ length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
memo: string
|
|
||||||
|
|
||||||
@Column({ type: 'timestamp', nullable: false, default: () => 'CURRENT_TIMESTAMP' })
|
|
||||||
received: Date
|
|
||||||
|
|
||||||
@Column({ type: 'binary', length: 64, nullable: true, default: null })
|
|
||||||
signature: Buffer
|
|
||||||
|
|
||||||
@Column({ type: 'binary', length: 32, nullable: true, default: null })
|
|
||||||
pubkey: Buffer
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'creation_ident_hash',
|
|
||||||
type: 'binary',
|
|
||||||
length: 32,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
creationIdentHash: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'creation_date', type: 'timestamp', nullable: true, default: null })
|
|
||||||
creationDate: Date
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'send_receiver_public_key',
|
|
||||||
type: 'binary',
|
|
||||||
length: 32,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
sendReceiverPublicKey: Buffer | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'send_receiver_user_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
sendReceiverUserId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'send_sender_final_balance',
|
|
||||||
type: 'bigint',
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
sendSenderFinalBalance: BigInt | null
|
|
||||||
}
|
|
||||||
@ -1,83 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
|
|
||||||
@Entity('transactions')
|
|
||||||
export class Transaction extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({ name: 'transaction_id', unsigned: true, nullable: false })
|
|
||||||
transactionId: number
|
|
||||||
|
|
||||||
@Column({ name: 'transaction_type_id', unsigned: true, nullable: false })
|
|
||||||
transactionTypeId: number
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', nullable: false })
|
|
||||||
amount: BigInt
|
|
||||||
|
|
||||||
@Column({ length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
memo: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'send_sender_final_balance',
|
|
||||||
type: 'bigint',
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
sendSenderFinalBalance: BigInt | null
|
|
||||||
|
|
||||||
@Column({ name: 'balance', type: 'bigint', default: 0 })
|
|
||||||
balance: BigInt
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'balance_date',
|
|
||||||
type: 'timestamp',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
balanceDate: Date
|
|
||||||
|
|
||||||
@Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP', nullable: false })
|
|
||||||
received: Date
|
|
||||||
|
|
||||||
@Column({ name: 'creation_date', type: 'timestamp', nullable: true, default: null })
|
|
||||||
creationDate: Date
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_user_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
linkedUserId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_state_user_transaction_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
linkedStateUserTransactionId?: number | null
|
|
||||||
|
|
||||||
@Column({ type: 'binary', length: 64, nullable: true, default: null })
|
|
||||||
signature: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'tx_hash', type: 'binary', length: 48, default: null, nullable: true })
|
|
||||||
txHash: Buffer
|
|
||||||
|
|
||||||
@Column({ type: 'binary', length: 32, nullable: true, default: null })
|
|
||||||
pubkey: Buffer
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'creation_ident_hash',
|
|
||||||
type: 'binary',
|
|
||||||
length: 32,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
creationIdentHash: Buffer
|
|
||||||
}
|
|
||||||
@ -1,59 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
|
|
||||||
@Entity('transactions')
|
|
||||||
export class Transaction extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({ name: 'type_id', unsigned: true, nullable: false })
|
|
||||||
typeId: number
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', nullable: false })
|
|
||||||
amount: BigInt
|
|
||||||
|
|
||||||
@Column({ length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
memo: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'send_sender_final_balance',
|
|
||||||
type: 'bigint',
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
sendSenderFinalBalance: BigInt | null
|
|
||||||
|
|
||||||
@Column({ name: 'balance', type: 'bigint', default: 0 })
|
|
||||||
balance: BigInt
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'balance_date',
|
|
||||||
type: 'timestamp',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
balanceDate: Date
|
|
||||||
|
|
||||||
@Column({ name: 'creation_date', type: 'timestamp', nullable: true, default: null })
|
|
||||||
creationDate: Date
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_user_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
linkedUserId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_transaction_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
linkedTransactionId?: number | null
|
|
||||||
}
|
|
||||||
@ -1,146 +0,0 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
|
||||||
|
|
||||||
@Entity('transactions')
|
|
||||||
export class Transaction extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({ type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
previous: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'type_id', unsigned: true, nullable: false })
|
|
||||||
typeId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'dec_amount',
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
decAmount: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'dec_balance',
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
decBalance: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'balance_date',
|
|
||||||
type: 'datetime',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
balanceDate: Date
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'dec_decay',
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
decDecay: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'decay_start',
|
|
||||||
type: 'datetime',
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
decayStart: Date | null
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', nullable: false })
|
|
||||||
amount: BigInt
|
|
||||||
|
|
||||||
@Column({ length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
memo: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'send_sender_final_balance',
|
|
||||||
type: 'bigint',
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
sendSenderFinalBalance: BigInt | null
|
|
||||||
|
|
||||||
@Column({ name: 'balance', type: 'bigint', default: 0 })
|
|
||||||
balance: BigInt
|
|
||||||
|
|
||||||
@Column({ name: 'creation_date', type: 'datetime', nullable: true, default: null })
|
|
||||||
creationDate: Date
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_user_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
linkedUserId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_transaction_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
linkedTransactionId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'temp_dec_send_sender_final_balance',
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
tempDecSendSenderFinalBalance: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'temp_dec_diff_send_sender_final_balance',
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
tempDecDiffSendSenderFinalBalance: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'temp_dec_old_balance',
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
tempDecOldBalance: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'temp_dec_diff_balance',
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
tempDecDiffBalance: Decimal
|
|
||||||
}
|
|
||||||
@ -1,85 +0,0 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
|
||||||
|
|
||||||
@Entity('transactions')
|
|
||||||
export class Transaction extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({ type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
previous: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'type_id', unsigned: true, nullable: false })
|
|
||||||
typeId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
amount: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
balance: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'balance_date',
|
|
||||||
type: 'datetime',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
balanceDate: Date
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
decay: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'decay_start',
|
|
||||||
type: 'datetime',
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
decayStart: Date | null
|
|
||||||
|
|
||||||
@Column({ length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
memo: string
|
|
||||||
|
|
||||||
@Column({ name: 'creation_date', type: 'datetime', nullable: true, default: null })
|
|
||||||
creationDate: Date | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_user_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
linkedUserId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_transaction_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
linkedTransactionId?: number | null
|
|
||||||
}
|
|
||||||
@ -1,68 +0,0 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { BaseEntity, Column, DeleteDateColumn, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
|
||||||
|
|
||||||
@Entity('transaction_links')
|
|
||||||
export class TransactionLink 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({
|
|
||||||
type: 'decimal',
|
|
||||||
name: 'hold_available_amount',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
holdAvailableAmount: Decimal
|
|
||||||
|
|
||||||
@Column({ length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
memo: string
|
|
||||||
|
|
||||||
@Column({ length: 24, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
code: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'datetime',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@DeleteDateColumn()
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'datetime',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
validUntil: Date
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'boolean',
|
|
||||||
default: () => false,
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
showEmail: boolean
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'datetime',
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
redeemedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ type: 'int', unsigned: true, nullable: true })
|
|
||||||
redeemedBy: number | null
|
|
||||||
}
|
|
||||||
@ -1,61 +0,0 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { BaseEntity, Column, DeleteDateColumn, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
|
||||||
|
|
||||||
@Entity('transaction_links')
|
|
||||||
export class TransactionLink extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
amount: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
name: 'hold_available_amount',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
holdAvailableAmount: Decimal
|
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
memo: string
|
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 24, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
code: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'datetime',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@DeleteDateColumn()
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'datetime',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
validUntil: Date
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'datetime',
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
redeemedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ type: 'int', unsigned: true, nullable: true })
|
|
||||||
redeemedBy: number | null
|
|
||||||
}
|
|
||||||
@ -1,94 +0,0 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
|
||||||
|
|
||||||
@Entity('transactions')
|
|
||||||
export class Transaction extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({ type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
previous: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'type_id', unsigned: true, nullable: false })
|
|
||||||
typeId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
amount: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
balance: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'balance_date',
|
|
||||||
type: 'datetime',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
balanceDate: Date
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
decay: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'decay_start',
|
|
||||||
type: 'datetime',
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
decayStart: Date | null
|
|
||||||
|
|
||||||
@Column({ length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
memo: string
|
|
||||||
|
|
||||||
@Column({ name: 'creation_date', type: 'datetime', nullable: true, default: null })
|
|
||||||
creationDate: Date | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_user_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
linkedUserId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_transaction_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
linkedTransactionId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'transaction_link_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
transactionLinkId?: number | null
|
|
||||||
}
|
|
||||||
@ -1,81 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
OneToMany,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { UserSetting } from '../0002-add_settings/UserSetting'
|
|
||||||
|
|
||||||
@Entity('users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class User extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
pubKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'privkey', type: 'binary', length: 80, default: null, nullable: true })
|
|
||||||
privKey: Buffer
|
|
||||||
|
|
||||||
@Column({ length: 255, unique: true, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
email: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'first_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
firstName: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'last_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
lastName: string
|
|
||||||
|
|
||||||
@DeleteDateColumn()
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', default: 0, unsigned: true })
|
|
||||||
password: BigInt
|
|
||||||
|
|
||||||
@Column({ name: 'email_hash', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
emailHash: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'created', default: () => 'CURRENT_TIMESTAMP', nullable: false })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ name: 'email_checked', type: 'bool', nullable: false, default: false })
|
|
||||||
emailChecked: boolean
|
|
||||||
|
|
||||||
@Column({ length: 4, default: 'de', collation: 'utf8mb4_unicode_ci', nullable: false })
|
|
||||||
language: string
|
|
||||||
|
|
||||||
@Column({ name: 'referrer_id', type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
referrerId?: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'publisher_id', default: 0 })
|
|
||||||
publisherId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'text',
|
|
||||||
name: 'passphrase',
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
passphrase: string
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => UserSetting,
|
|
||||||
(userSetting) => userSetting.user,
|
|
||||||
)
|
|
||||||
settings: UserSetting[]
|
|
||||||
}
|
|
||||||
@ -1,84 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
OneToMany,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { UserSetting } from '../0002-add_settings/UserSetting'
|
|
||||||
|
|
||||||
@Entity('users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class User extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
pubKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'privkey', type: 'binary', length: 80, default: null, nullable: true })
|
|
||||||
privKey: Buffer
|
|
||||||
|
|
||||||
@Column({ length: 255, unique: true, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
email: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'first_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
firstName: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'last_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
lastName: string
|
|
||||||
|
|
||||||
@DeleteDateColumn()
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', default: 0, unsigned: true })
|
|
||||||
password: BigInt
|
|
||||||
|
|
||||||
@Column({ name: 'email_hash', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
emailHash: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'created', default: () => 'CURRENT_TIMESTAMP', nullable: false })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ name: 'email_checked', type: 'bool', nullable: false, default: false })
|
|
||||||
emailChecked: boolean
|
|
||||||
|
|
||||||
@Column({ length: 4, default: 'de', collation: 'utf8mb4_unicode_ci', nullable: false })
|
|
||||||
language: string
|
|
||||||
|
|
||||||
@Column({ name: 'is_admin', type: 'datetime', nullable: true, default: null })
|
|
||||||
isAdmin: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'referrer_id', type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
referrerId?: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'publisher_id', default: 0 })
|
|
||||||
publisherId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'text',
|
|
||||||
name: 'passphrase',
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
passphrase: string
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => UserSetting,
|
|
||||||
(userSetting) => userSetting.user,
|
|
||||||
)
|
|
||||||
settings: UserSetting[]
|
|
||||||
}
|
|
||||||
@ -1,33 +0,0 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
|
||||||
|
|
||||||
@Entity('admin_pending_creations')
|
|
||||||
export class AdminPendingCreation extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP' })
|
|
||||||
created: Date
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', nullable: false })
|
|
||||||
date: Date
|
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
memo: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
amount: Decimal
|
|
||||||
|
|
||||||
@Column()
|
|
||||||
moderator: number
|
|
||||||
}
|
|
||||||
@ -1,107 +0,0 @@
|
|||||||
/* eslint-disable no-use-before-define */
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { BaseEntity, Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
|
||||||
import { Contribution } from '../Contribution'
|
|
||||||
|
|
||||||
@Entity('transactions')
|
|
||||||
export class Transaction extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({ type: 'int', unsigned: true, unique: true, nullable: true, default: null })
|
|
||||||
previous: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'type_id', unsigned: true, nullable: false })
|
|
||||||
typeId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
amount: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
balance: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'balance_date',
|
|
||||||
type: 'datetime',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
balanceDate: Date
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
decay: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'decay_start',
|
|
||||||
type: 'datetime',
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
decayStart: Date | null
|
|
||||||
|
|
||||||
@Column({ length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
memo: string
|
|
||||||
|
|
||||||
@Column({ name: 'creation_date', type: 'datetime', nullable: true, default: null })
|
|
||||||
creationDate: Date | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_user_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
linkedUserId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_transaction_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
linkedTransactionId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'transaction_link_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
transactionLinkId?: number | null
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => Contribution,
|
|
||||||
(contribution) => contribution.transaction,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'id', referencedColumnName: 'transactionId' })
|
|
||||||
contribution?: Contribution | null
|
|
||||||
|
|
||||||
@OneToOne(() => Transaction)
|
|
||||||
@JoinColumn({ name: 'previous' })
|
|
||||||
previousTransaction?: Transaction | null
|
|
||||||
}
|
|
||||||
@ -1,70 +0,0 @@
|
|||||||
import { BaseEntity, Column, DeleteDateColumn, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
|
|
||||||
@Entity('users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class User extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
pubKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'privkey', type: 'binary', length: 80, default: null, nullable: true })
|
|
||||||
privKey: Buffer
|
|
||||||
|
|
||||||
@Column({ length: 255, unique: true, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
email: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'first_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
firstName: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'last_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
lastName: string
|
|
||||||
|
|
||||||
@DeleteDateColumn()
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', default: 0, unsigned: true })
|
|
||||||
password: BigInt
|
|
||||||
|
|
||||||
@Column({ name: 'email_hash', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
emailHash: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'created', default: () => 'CURRENT_TIMESTAMP', nullable: false })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ name: 'email_checked', type: 'bool', nullable: false, default: false })
|
|
||||||
emailChecked: boolean
|
|
||||||
|
|
||||||
@Column({ length: 4, default: 'de', collation: 'utf8mb4_unicode_ci', nullable: false })
|
|
||||||
language: string
|
|
||||||
|
|
||||||
@Column({ name: 'is_admin', type: 'datetime', nullable: true, default: null })
|
|
||||||
isAdmin: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'referrer_id', type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
referrerId?: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'publisher_id', default: 0 })
|
|
||||||
publisherId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'text',
|
|
||||||
name: 'passphrase',
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
passphrase: string
|
|
||||||
}
|
|
||||||
@ -1,88 +0,0 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { BaseEntity, Column, DeleteDateColumn, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
|
||||||
|
|
||||||
@Entity('contribution_links')
|
|
||||||
export class ContributionLink extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 100, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
name: string
|
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
memo: string
|
|
||||||
|
|
||||||
@Column({ name: 'valid_from', type: 'datetime', nullable: false })
|
|
||||||
validFrom: Date
|
|
||||||
|
|
||||||
@Column({ name: 'valid_to', type: 'datetime', nullable: true, default: null })
|
|
||||||
validTo: Date | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
amount: Decimal
|
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 12, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
cycle: string
|
|
||||||
|
|
||||||
@Column({ name: 'max_per_cycle', type: 'int', unsigned: true, nullable: false, default: 1 })
|
|
||||||
maxPerCycle: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'max_amount_per_month',
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
maxAmountPerMonth: Decimal | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'total_max_count_of_contribution',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
totalMaxCountOfContribution: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'max_account_balance',
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
maxAccountBalance: Decimal | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'min_gap_hours',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
minGapHours: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'created_at', type: 'datetime', default: () => 'CURRENT_TIMESTAMP' })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@DeleteDateColumn({ name: 'deleted_at', type: 'datetime' })
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 24, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
code: string
|
|
||||||
|
|
||||||
@Column({ name: 'link_enabled', type: 'boolean', default: true })
|
|
||||||
linkEnabled: boolean
|
|
||||||
}
|
|
||||||
@ -1,64 +0,0 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
JoinColumn,
|
|
||||||
ManyToOne,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
|
||||||
import { User } from '../User'
|
|
||||||
|
|
||||||
@Entity('contributions')
|
|
||||||
export class Contribution extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: false, name: 'user_id' })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@ManyToOne(
|
|
||||||
() => User,
|
|
||||||
(user) => user.contributions,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
user: User
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP', name: 'created_at' })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', nullable: false, name: 'contribution_date' })
|
|
||||||
contributionDate: Date
|
|
||||||
|
|
||||||
@Column({ length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
memo: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
amount: Decimal
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'moderator_id' })
|
|
||||||
moderatorId: number
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'contribution_link_id' })
|
|
||||||
contributionLinkId: number
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'confirmed_by' })
|
|
||||||
confirmedBy: number
|
|
||||||
|
|
||||||
@Column({ nullable: true, name: 'confirmed_at' })
|
|
||||||
confirmedAt: Date
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'transaction_id' })
|
|
||||||
transactionId: number
|
|
||||||
|
|
||||||
@DeleteDateColumn({ name: 'deleted_at' })
|
|
||||||
deletedAt: Date | null
|
|
||||||
}
|
|
||||||
@ -1,86 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
JoinColumn,
|
|
||||||
OneToMany,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { Contribution } from '../Contribution'
|
|
||||||
|
|
||||||
@Entity('users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class User extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
pubKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'privkey', type: 'binary', length: 80, default: null, nullable: true })
|
|
||||||
privKey: Buffer
|
|
||||||
|
|
||||||
@Column({ length: 255, unique: true, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
email: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'first_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
firstName: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'last_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
lastName: string
|
|
||||||
|
|
||||||
@DeleteDateColumn()
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', default: 0, unsigned: true })
|
|
||||||
password: BigInt
|
|
||||||
|
|
||||||
@Column({ name: 'email_hash', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
emailHash: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'created', default: () => 'CURRENT_TIMESTAMP', nullable: false })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ name: 'email_checked', type: 'bool', nullable: false, default: false })
|
|
||||||
emailChecked: boolean
|
|
||||||
|
|
||||||
@Column({ length: 4, default: 'de', collation: 'utf8mb4_unicode_ci', nullable: false })
|
|
||||||
language: string
|
|
||||||
|
|
||||||
@Column({ name: 'is_admin', type: 'datetime', nullable: true, default: null })
|
|
||||||
isAdmin: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'referrer_id', type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
referrerId?: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'publisher_id', default: 0 })
|
|
||||||
publisherId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'text',
|
|
||||||
name: 'passphrase',
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
passphrase: string
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => Contribution,
|
|
||||||
(contribution) => contribution.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
contributions?: Contribution[]
|
|
||||||
}
|
|
||||||
@ -1,95 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
JoinColumn,
|
|
||||||
OneToMany,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { Contribution } from '../Contribution'
|
|
||||||
|
|
||||||
@Entity('users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class User extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
pubKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'privkey', type: 'binary', length: 80, default: null, nullable: true })
|
|
||||||
privKey: Buffer
|
|
||||||
|
|
||||||
@Column({ length: 255, unique: true, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
email: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'first_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
firstName: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'last_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
lastName: string
|
|
||||||
|
|
||||||
@DeleteDateColumn()
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', default: 0, unsigned: true })
|
|
||||||
password: BigInt
|
|
||||||
|
|
||||||
@Column({ name: 'email_hash', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
emailHash: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'created', default: () => 'CURRENT_TIMESTAMP', nullable: false })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ name: 'email_checked', type: 'bool', nullable: false, default: false })
|
|
||||||
emailChecked: boolean
|
|
||||||
|
|
||||||
@Column({ length: 4, default: 'de', collation: 'utf8mb4_unicode_ci', nullable: false })
|
|
||||||
language: string
|
|
||||||
|
|
||||||
@Column({ name: 'is_admin', type: 'datetime', nullable: true, default: null })
|
|
||||||
isAdmin: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'referrer_id', type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
referrerId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'contribution_link_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
contributionLinkId?: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'publisher_id', default: 0 })
|
|
||||||
publisherId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'text',
|
|
||||||
name: 'passphrase',
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
passphrase: string
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => Contribution,
|
|
||||||
(contribution) => contribution.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
contributions?: Contribution[]
|
|
||||||
}
|
|
||||||
@ -1,39 +0,0 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
|
||||||
|
|
||||||
@Entity('event_protocol')
|
|
||||||
export class EventProtocol extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ length: 100, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
type: string
|
|
||||||
|
|
||||||
@Column({ name: 'created_at', type: 'datetime', default: () => 'CURRENT_TIMESTAMP' })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({ name: 'x_user_id', unsigned: true, nullable: true })
|
|
||||||
xUserId: number
|
|
||||||
|
|
||||||
@Column({ name: 'x_community_id', unsigned: true, nullable: true })
|
|
||||||
xCommunityId: number
|
|
||||||
|
|
||||||
@Column({ name: 'transaction_id', unsigned: true, nullable: true })
|
|
||||||
transactionId: number
|
|
||||||
|
|
||||||
@Column({ name: 'contribution_id', unsigned: true, nullable: true })
|
|
||||||
contributionId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: true,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
amount: Decimal
|
|
||||||
}
|
|
||||||
@ -1,86 +0,0 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
JoinColumn,
|
|
||||||
ManyToOne,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
|
||||||
import { User } from '../User'
|
|
||||||
|
|
||||||
@Entity('contributions')
|
|
||||||
export class Contribution extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: false, name: 'user_id' })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@ManyToOne(
|
|
||||||
() => User,
|
|
||||||
(user) => user.contributions,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
user: User
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP', name: 'created_at' })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', nullable: false, name: 'contribution_date' })
|
|
||||||
contributionDate: Date
|
|
||||||
|
|
||||||
@Column({ length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
memo: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
amount: Decimal
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'moderator_id' })
|
|
||||||
moderatorId: number
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'contribution_link_id' })
|
|
||||||
contributionLinkId: number
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'confirmed_by' })
|
|
||||||
confirmedBy: number
|
|
||||||
|
|
||||||
@Column({ nullable: true, name: 'confirmed_at' })
|
|
||||||
confirmedAt: Date
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'denied_by' })
|
|
||||||
deniedBy: number
|
|
||||||
|
|
||||||
@Column({ nullable: true, name: 'denied_at' })
|
|
||||||
deniedAt: Date
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'contribution_type',
|
|
||||||
length: 12,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
contributionType: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'contribution_status',
|
|
||||||
length: 12,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
contributionStatus: string
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'transaction_id' })
|
|
||||||
transactionId: number
|
|
||||||
|
|
||||||
@DeleteDateColumn({ name: 'deleted_at' })
|
|
||||||
deletedAt: Date | null
|
|
||||||
}
|
|
||||||
@ -1,114 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
JoinColumn,
|
|
||||||
OneToMany,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { Contribution } from '../Contribution'
|
|
||||||
|
|
||||||
@Entity('users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class User extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'gradido_id',
|
|
||||||
length: 36,
|
|
||||||
nullable: false,
|
|
||||||
unique: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
gradidoID: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'alias',
|
|
||||||
length: 20,
|
|
||||||
nullable: true,
|
|
||||||
unique: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
alias: string
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
pubKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'privkey', type: 'binary', length: 80, default: null, nullable: true })
|
|
||||||
privKey: Buffer
|
|
||||||
|
|
||||||
@Column({ length: 255, unique: true, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
email: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'first_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
firstName: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'last_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
lastName: string
|
|
||||||
|
|
||||||
@DeleteDateColumn()
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', default: 0, unsigned: true })
|
|
||||||
password: BigInt
|
|
||||||
|
|
||||||
@Column({ name: 'email_hash', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
emailHash: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'created', default: () => 'CURRENT_TIMESTAMP', nullable: false })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ name: 'email_checked', type: 'bool', nullable: false, default: false })
|
|
||||||
emailChecked: boolean
|
|
||||||
|
|
||||||
@Column({ length: 4, default: 'de', collation: 'utf8mb4_unicode_ci', nullable: false })
|
|
||||||
language: string
|
|
||||||
|
|
||||||
@Column({ name: 'is_admin', type: 'datetime', nullable: true, default: null })
|
|
||||||
isAdmin: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'referrer_id', type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
referrerId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'contribution_link_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
contributionLinkId?: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'publisher_id', default: 0 })
|
|
||||||
publisherId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'text',
|
|
||||||
name: 'passphrase',
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
passphrase: string
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => Contribution,
|
|
||||||
(contribution) => contribution.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
contributions?: Contribution[]
|
|
||||||
}
|
|
||||||
@ -1,95 +0,0 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
JoinColumn,
|
|
||||||
ManyToOne,
|
|
||||||
OneToMany,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
|
||||||
import { ContributionMessage } from '../ContributionMessage'
|
|
||||||
import { User } from '../User'
|
|
||||||
|
|
||||||
@Entity('contributions')
|
|
||||||
export class Contribution extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: false, name: 'user_id' })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@ManyToOne(
|
|
||||||
() => User,
|
|
||||||
(user) => user.contributions,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
user: User
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP', name: 'created_at' })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', nullable: false, name: 'contribution_date' })
|
|
||||||
contributionDate: Date
|
|
||||||
|
|
||||||
@Column({ length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
memo: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
amount: Decimal
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'moderator_id' })
|
|
||||||
moderatorId: number
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'contribution_link_id' })
|
|
||||||
contributionLinkId: number
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'confirmed_by' })
|
|
||||||
confirmedBy: number
|
|
||||||
|
|
||||||
@Column({ nullable: true, name: 'confirmed_at' })
|
|
||||||
confirmedAt: Date
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'denied_by' })
|
|
||||||
deniedBy: number
|
|
||||||
|
|
||||||
@Column({ nullable: true, name: 'denied_at' })
|
|
||||||
deniedAt: Date
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'contribution_type',
|
|
||||||
length: 12,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
contributionType: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'contribution_status',
|
|
||||||
length: 12,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
contributionStatus: string
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'transaction_id' })
|
|
||||||
transactionId: number
|
|
||||||
|
|
||||||
@DeleteDateColumn({ name: 'deleted_at' })
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => ContributionMessage,
|
|
||||||
(message) => message.contribution,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'contribution_id' })
|
|
||||||
messages?: ContributionMessage[]
|
|
||||||
}
|
|
||||||
@ -1,57 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
JoinColumn,
|
|
||||||
ManyToOne,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { Contribution } from '../Contribution'
|
|
||||||
import { User } from '../User'
|
|
||||||
|
|
||||||
@Entity('contribution_messages', {
|
|
||||||
engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
export class ContributionMessage extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'contribution_id', unsigned: true, nullable: false })
|
|
||||||
contributionId: number
|
|
||||||
|
|
||||||
@ManyToOne(
|
|
||||||
() => Contribution,
|
|
||||||
(contribution) => contribution.messages,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'contribution_id' })
|
|
||||||
contribution: Contribution
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@ManyToOne(
|
|
||||||
() => User,
|
|
||||||
(user) => user.messages,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
user: User
|
|
||||||
|
|
||||||
@Column({ length: 2000, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
message: string
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP', name: 'created_at' })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', default: null, nullable: true, name: 'updated_at' })
|
|
||||||
updatedAt: Date
|
|
||||||
|
|
||||||
@DeleteDateColumn({ name: 'deleted_at' })
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'deleted_by', default: null, unsigned: true, nullable: true })
|
|
||||||
deletedBy: number
|
|
||||||
|
|
||||||
@Column({ length: 12, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
type: string
|
|
||||||
}
|
|
||||||
@ -1,122 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
JoinColumn,
|
|
||||||
OneToMany,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { Contribution } from '../Contribution'
|
|
||||||
import { ContributionMessage } from '../ContributionMessage'
|
|
||||||
|
|
||||||
@Entity('users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class User extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'gradido_id',
|
|
||||||
length: 36,
|
|
||||||
nullable: false,
|
|
||||||
unique: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
gradidoID: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'alias',
|
|
||||||
length: 20,
|
|
||||||
nullable: true,
|
|
||||||
unique: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
alias: string
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
pubKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'privkey', type: 'binary', length: 80, default: null, nullable: true })
|
|
||||||
privKey: Buffer
|
|
||||||
|
|
||||||
@Column({ length: 255, unique: true, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
email: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'first_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
firstName: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'last_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
lastName: string
|
|
||||||
|
|
||||||
@DeleteDateColumn()
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', default: 0, unsigned: true })
|
|
||||||
password: BigInt
|
|
||||||
|
|
||||||
@Column({ name: 'email_hash', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
emailHash: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'created', default: () => 'CURRENT_TIMESTAMP', nullable: false })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ name: 'email_checked', type: 'bool', nullable: false, default: false })
|
|
||||||
emailChecked: boolean
|
|
||||||
|
|
||||||
@Column({ length: 4, default: 'de', collation: 'utf8mb4_unicode_ci', nullable: false })
|
|
||||||
language: string
|
|
||||||
|
|
||||||
@Column({ name: 'is_admin', type: 'datetime', nullable: true, default: null })
|
|
||||||
isAdmin: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'referrer_id', type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
referrerId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'contribution_link_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
contributionLinkId?: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'publisher_id', default: 0 })
|
|
||||||
publisherId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'text',
|
|
||||||
name: 'passphrase',
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
passphrase: string
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => Contribution,
|
|
||||||
(contribution) => contribution.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
contributions?: Contribution[]
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => ContributionMessage,
|
|
||||||
(message) => message.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
messages?: ContributionMessage[]
|
|
||||||
}
|
|
||||||
@ -1,60 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
JoinColumn,
|
|
||||||
ManyToOne,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { Contribution } from '../Contribution'
|
|
||||||
import { User } from '../User'
|
|
||||||
|
|
||||||
@Entity('contribution_messages', {
|
|
||||||
engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
export class ContributionMessage extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'contribution_id', unsigned: true, nullable: false })
|
|
||||||
contributionId: number
|
|
||||||
|
|
||||||
@ManyToOne(
|
|
||||||
() => Contribution,
|
|
||||||
(contribution) => contribution.messages,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'contribution_id' })
|
|
||||||
contribution: Contribution
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@ManyToOne(
|
|
||||||
() => User,
|
|
||||||
(user) => user.messages,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
user: User
|
|
||||||
|
|
||||||
@Column({ length: 2000, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
message: string
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP', name: 'created_at' })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', default: null, nullable: true, name: 'updated_at' })
|
|
||||||
updatedAt: Date
|
|
||||||
|
|
||||||
@DeleteDateColumn({ name: 'deleted_at' })
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'deleted_by', default: null, unsigned: true, nullable: true })
|
|
||||||
deletedBy: number
|
|
||||||
|
|
||||||
@Column({ length: 12, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
type: string
|
|
||||||
|
|
||||||
@Column({ name: 'is_moderator', type: 'bool', nullable: false, default: false })
|
|
||||||
isModerator: boolean
|
|
||||||
}
|
|
||||||
@ -1,138 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
JoinColumn,
|
|
||||||
OneToMany,
|
|
||||||
OneToOne,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { Contribution } from '../Contribution'
|
|
||||||
import { ContributionMessage } from '../ContributionMessage'
|
|
||||||
import { UserContact } from '../UserContact'
|
|
||||||
|
|
||||||
@Entity('users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class User extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'gradido_id',
|
|
||||||
length: 36,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
gradidoID: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'alias',
|
|
||||||
length: 20,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
alias: string
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
pubKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'privkey', type: 'binary', length: 80, default: null, nullable: true })
|
|
||||||
privKey: Buffer
|
|
||||||
|
|
||||||
/*
|
|
||||||
@Column({ length: 255, unique: true, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
email: string
|
|
||||||
*/
|
|
||||||
@OneToOne(
|
|
||||||
() => UserContact,
|
|
||||||
(emailContact: UserContact) => emailContact.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'email_id' })
|
|
||||||
emailContact: UserContact
|
|
||||||
|
|
||||||
@Column({ name: 'email_id', type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
emailId: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'first_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
firstName: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'last_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
lastName: string
|
|
||||||
|
|
||||||
@DeleteDateColumn()
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', default: 0, unsigned: true })
|
|
||||||
password: BigInt
|
|
||||||
|
|
||||||
@Column({ name: 'created', default: () => 'CURRENT_TIMESTAMP', nullable: false })
|
|
||||||
createdAt: Date
|
|
||||||
/*
|
|
||||||
@Column({ name: 'email_checked', type: 'bool', nullable: false, default: false })
|
|
||||||
emailChecked: boolean
|
|
||||||
*/
|
|
||||||
|
|
||||||
@Column({ length: 4, default: 'de', collation: 'utf8mb4_unicode_ci', nullable: false })
|
|
||||||
language: string
|
|
||||||
|
|
||||||
@Column({ name: 'is_admin', type: 'datetime', nullable: true, default: null })
|
|
||||||
isAdmin: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'referrer_id', type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
referrerId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'contribution_link_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
contributionLinkId?: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'publisher_id', default: 0 })
|
|
||||||
publisherId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'text',
|
|
||||||
name: 'passphrase',
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
passphrase: string
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => Contribution,
|
|
||||||
(contribution) => contribution.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
contributions?: Contribution[]
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => ContributionMessage,
|
|
||||||
(message) => message.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
messages?: ContributionMessage[]
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => UserContact,
|
|
||||||
(userContact: UserContact) => userContact.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
userContacts?: UserContact[]
|
|
||||||
}
|
|
||||||
@ -1,63 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
OneToOne,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { User } from './User'
|
|
||||||
|
|
||||||
@Entity('user_contacts', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class UserContact extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'type',
|
|
||||||
length: 100,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
type: string
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => User,
|
|
||||||
(user) => user.emailContact,
|
|
||||||
)
|
|
||||||
user: User
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', type: 'int', unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({ length: 255, unique: true, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
email: string
|
|
||||||
|
|
||||||
@Column({ name: 'email_verification_code', type: 'bigint', unsigned: true, unique: true })
|
|
||||||
emailVerificationCode: BigInt
|
|
||||||
|
|
||||||
@Column({ name: 'email_opt_in_type_id' })
|
|
||||||
emailOptInTypeId: number
|
|
||||||
|
|
||||||
@Column({ name: 'email_resend_count' })
|
|
||||||
emailResendCount: number
|
|
||||||
|
|
||||||
// @Column({ name: 'email_hash', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
// emailHash: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'email_checked', type: 'bool', nullable: false, default: false })
|
|
||||||
emailChecked: boolean
|
|
||||||
|
|
||||||
@Column({ length: 255, unique: false, nullable: true, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
phone: string
|
|
||||||
|
|
||||||
@Column({ name: 'created_at', default: () => 'CURRENT_TIMESTAMP', nullable: false })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ name: 'updated_at', nullable: true, default: null, type: 'datetime' })
|
|
||||||
updatedAt: Date | null
|
|
||||||
|
|
||||||
@DeleteDateColumn({ name: 'deleted_at', nullable: true })
|
|
||||||
deletedAt: Date | null
|
|
||||||
}
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
|
||||||
|
|
||||||
@Entity('event_protocol')
|
|
||||||
export class EventProtocol extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ length: 100, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
type: string
|
|
||||||
|
|
||||||
@Column({ name: 'created_at', type: 'datetime', default: () => 'CURRENT_TIMESTAMP' })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({ name: 'x_user_id', type: 'int', unsigned: true, nullable: true })
|
|
||||||
xUserId: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'x_community_id', type: 'int', unsigned: true, nullable: true })
|
|
||||||
xCommunityId: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'transaction_id', type: 'int', unsigned: true, nullable: true })
|
|
||||||
transactionId: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'contribution_id', type: 'int', unsigned: true, nullable: true })
|
|
||||||
contributionId: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: true,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
amount: Decimal | null
|
|
||||||
|
|
||||||
@Column({ name: 'message_id', type: 'int', unsigned: true, nullable: true })
|
|
||||||
messageId: number | null
|
|
||||||
}
|
|
||||||
@ -1,98 +0,0 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
JoinColumn,
|
|
||||||
ManyToOne,
|
|
||||||
OneToMany,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
|
||||||
import { ContributionMessage } from '../ContributionMessage'
|
|
||||||
import { User } from '../User'
|
|
||||||
|
|
||||||
@Entity('contributions')
|
|
||||||
export class Contribution extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: false, name: 'user_id' })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@ManyToOne(
|
|
||||||
() => User,
|
|
||||||
(user) => user.contributions,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
user: User
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP', name: 'created_at' })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', nullable: false, name: 'contribution_date' })
|
|
||||||
contributionDate: Date
|
|
||||||
|
|
||||||
@Column({ length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
memo: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
amount: Decimal
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'moderator_id' })
|
|
||||||
moderatorId: number
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'contribution_link_id' })
|
|
||||||
contributionLinkId: number
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'confirmed_by' })
|
|
||||||
confirmedBy: number
|
|
||||||
|
|
||||||
@Column({ nullable: true, name: 'confirmed_at' })
|
|
||||||
confirmedAt: Date
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'denied_by' })
|
|
||||||
deniedBy: number
|
|
||||||
|
|
||||||
@Column({ nullable: true, name: 'denied_at' })
|
|
||||||
deniedAt: Date
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'contribution_type',
|
|
||||||
length: 12,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
contributionType: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'contribution_status',
|
|
||||||
length: 12,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
contributionStatus: string
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'transaction_id' })
|
|
||||||
transactionId: number
|
|
||||||
|
|
||||||
@DeleteDateColumn({ name: 'deleted_at' })
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@DeleteDateColumn({ unsigned: true, nullable: true, name: 'deleted_by' })
|
|
||||||
deletedBy: number
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => ContributionMessage,
|
|
||||||
(message) => message.contribution,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'contribution_id' })
|
|
||||||
messages?: ContributionMessage[]
|
|
||||||
}
|
|
||||||
@ -1,110 +0,0 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
JoinColumn,
|
|
||||||
ManyToOne,
|
|
||||||
OneToMany,
|
|
||||||
OneToOne,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
|
||||||
import { ContributionMessage } from '../ContributionMessage'
|
|
||||||
import { Transaction } from '../Transaction'
|
|
||||||
import { User } from '../User'
|
|
||||||
|
|
||||||
@Entity('contributions')
|
|
||||||
export class Contribution extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: false, name: 'user_id' })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@ManyToOne(
|
|
||||||
() => User,
|
|
||||||
(user) => user.contributions,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
user: User
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP', name: 'created_at' })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', nullable: false, name: 'contribution_date' })
|
|
||||||
contributionDate: Date
|
|
||||||
|
|
||||||
@Column({ length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
memo: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
amount: Decimal
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'moderator_id' })
|
|
||||||
moderatorId: number
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'contribution_link_id' })
|
|
||||||
contributionLinkId: number
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'confirmed_by' })
|
|
||||||
confirmedBy: number
|
|
||||||
|
|
||||||
@Column({ nullable: true, name: 'confirmed_at' })
|
|
||||||
confirmedAt: Date
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'denied_by' })
|
|
||||||
deniedBy: number
|
|
||||||
|
|
||||||
@Column({ nullable: true, name: 'denied_at' })
|
|
||||||
deniedAt: Date
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'contribution_type',
|
|
||||||
length: 12,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
contributionType: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'contribution_status',
|
|
||||||
length: 12,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
contributionStatus: string
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'transaction_id' })
|
|
||||||
transactionId: number
|
|
||||||
|
|
||||||
@Column({ nullable: true, name: 'updated_at' })
|
|
||||||
updatedAt: Date
|
|
||||||
|
|
||||||
@DeleteDateColumn({ name: 'deleted_at' })
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@DeleteDateColumn({ unsigned: true, nullable: true, name: 'deleted_by' })
|
|
||||||
deletedBy: number
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => ContributionMessage,
|
|
||||||
(message) => message.contribution,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'contribution_id' })
|
|
||||||
messages?: ContributionMessage[]
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => Transaction,
|
|
||||||
(transaction) => transaction.contribution,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'transaction_id' })
|
|
||||||
transaction?: Transaction | null
|
|
||||||
}
|
|
||||||
@ -1,139 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
JoinColumn,
|
|
||||||
OneToMany,
|
|
||||||
OneToOne,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { Contribution } from '../Contribution'
|
|
||||||
import { ContributionMessage } from '../ContributionMessage'
|
|
||||||
import { UserContact } from '../UserContact'
|
|
||||||
|
|
||||||
@Entity('users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class User extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'gradido_id',
|
|
||||||
length: 36,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
gradidoID: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'alias',
|
|
||||||
length: 20,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
alias: string
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
pubKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'privkey', type: 'binary', length: 80, default: null, nullable: true })
|
|
||||||
privKey: Buffer
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'text',
|
|
||||||
name: 'passphrase',
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
passphrase: string
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => UserContact,
|
|
||||||
(emailContact: UserContact) => emailContact.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'email_id' })
|
|
||||||
emailContact: UserContact
|
|
||||||
|
|
||||||
@Column({ name: 'email_id', type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
emailId: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'first_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
firstName: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'last_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
lastName: string
|
|
||||||
|
|
||||||
@Column({ name: 'created_at', default: () => 'CURRENT_TIMESTAMP', nullable: false })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@DeleteDateColumn({ name: 'deleted_at', nullable: true })
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', default: 0, unsigned: true })
|
|
||||||
password: BigInt
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'password_encryption_type',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: false,
|
|
||||||
default: 0,
|
|
||||||
})
|
|
||||||
passwordEncryptionType: number
|
|
||||||
|
|
||||||
@Column({ length: 4, default: 'de', collation: 'utf8mb4_unicode_ci', nullable: false })
|
|
||||||
language: string
|
|
||||||
|
|
||||||
@Column({ name: 'is_admin', type: 'datetime', nullable: true, default: null })
|
|
||||||
isAdmin: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'referrer_id', type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
referrerId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'contribution_link_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
contributionLinkId?: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'publisher_id', default: 0 })
|
|
||||||
publisherId: number
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => Contribution,
|
|
||||||
(contribution) => contribution.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
contributions?: Contribution[]
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => ContributionMessage,
|
|
||||||
(message) => message.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
messages?: ContributionMessage[]
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => UserContact,
|
|
||||||
(userContact: UserContact) => userContact.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
userContacts?: UserContact[]
|
|
||||||
}
|
|
||||||
@ -1,63 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
OneToOne,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { User } from './User'
|
|
||||||
|
|
||||||
@Entity('user_contacts', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class UserContact extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'type',
|
|
||||||
length: 100,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
type: string
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => User,
|
|
||||||
(user) => user.emailContact,
|
|
||||||
)
|
|
||||||
user: User
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', type: 'int', unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({ length: 255, unique: true, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
email: string
|
|
||||||
|
|
||||||
@Column({ name: 'email_verification_code', type: 'bigint', unsigned: true, unique: true })
|
|
||||||
emailVerificationCode: BigInt
|
|
||||||
|
|
||||||
@Column({ name: 'email_opt_in_type_id' })
|
|
||||||
emailOptInTypeId: number
|
|
||||||
|
|
||||||
@Column({ name: 'email_resend_count' })
|
|
||||||
emailResendCount: number
|
|
||||||
|
|
||||||
// @Column({ name: 'email_hash', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
// emailHash: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'email_checked', type: 'bool', nullable: false, default: false })
|
|
||||||
emailChecked: boolean
|
|
||||||
|
|
||||||
@Column({ length: 255, unique: false, nullable: true, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
phone: string
|
|
||||||
|
|
||||||
@Column({ name: 'created_at', default: () => 'CURRENT_TIMESTAMP', nullable: false })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ name: 'updated_at', nullable: true, default: null, type: 'datetime' })
|
|
||||||
updatedAt: Date | null
|
|
||||||
|
|
||||||
@DeleteDateColumn({ name: 'deleted_at', nullable: true })
|
|
||||||
deletedAt: Date | null
|
|
||||||
}
|
|
||||||
@ -1,124 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
JoinColumn,
|
|
||||||
OneToMany,
|
|
||||||
OneToOne,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { Contribution } from '../Contribution'
|
|
||||||
import { ContributionMessage } from '../ContributionMessage'
|
|
||||||
import { UserContact } from '../UserContact'
|
|
||||||
|
|
||||||
@Entity('users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class User extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'gradido_id',
|
|
||||||
length: 36,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
gradidoID: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'alias',
|
|
||||||
length: 20,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
alias: string
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => UserContact,
|
|
||||||
(emailContact: UserContact) => emailContact.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'email_id' })
|
|
||||||
emailContact: UserContact
|
|
||||||
|
|
||||||
@Column({ name: 'email_id', type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
emailId: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'first_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
firstName: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'last_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
lastName: string
|
|
||||||
|
|
||||||
@Column({ name: 'created_at', default: () => 'CURRENT_TIMESTAMP', nullable: false })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@DeleteDateColumn({ name: 'deleted_at', nullable: true })
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', default: 0, unsigned: true })
|
|
||||||
password: BigInt
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'password_encryption_type',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: false,
|
|
||||||
default: 0,
|
|
||||||
})
|
|
||||||
passwordEncryptionType: number
|
|
||||||
|
|
||||||
@Column({ length: 4, default: 'de', collation: 'utf8mb4_unicode_ci', nullable: false })
|
|
||||||
language: string
|
|
||||||
|
|
||||||
@Column({ name: 'is_admin', type: 'datetime', nullable: true, default: null })
|
|
||||||
isAdmin: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'referrer_id', type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
referrerId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'contribution_link_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
contributionLinkId?: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'publisher_id', default: 0 })
|
|
||||||
publisherId: number
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => Contribution,
|
|
||||||
(contribution) => contribution.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
contributions?: Contribution[]
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => ContributionMessage,
|
|
||||||
(message) => message.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
messages?: ContributionMessage[]
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => UserContact,
|
|
||||||
(userContact: UserContact) => userContact.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
userContacts?: UserContact[]
|
|
||||||
}
|
|
||||||
@ -1,60 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
OneToOne,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { User } from '../User'
|
|
||||||
|
|
||||||
@Entity('user_contacts', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class UserContact extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'type',
|
|
||||||
length: 100,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
type: string
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => User,
|
|
||||||
(user) => user.emailContact,
|
|
||||||
)
|
|
||||||
user: User
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', type: 'int', unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({ length: 255, unique: true, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
email: string
|
|
||||||
|
|
||||||
@Column({ name: 'email_verification_code', type: 'bigint', unsigned: true, unique: true })
|
|
||||||
emailVerificationCode: string
|
|
||||||
|
|
||||||
@Column({ name: 'email_opt_in_type_id' })
|
|
||||||
emailOptInTypeId: number
|
|
||||||
|
|
||||||
@Column({ name: 'email_resend_count' })
|
|
||||||
emailResendCount: number
|
|
||||||
|
|
||||||
@Column({ name: 'email_checked', type: 'bool', nullable: false, default: false })
|
|
||||||
emailChecked: boolean
|
|
||||||
|
|
||||||
@Column({ length: 255, unique: false, nullable: true, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
phone: string
|
|
||||||
|
|
||||||
@Column({ name: 'created_at', default: () => 'CURRENT_TIMESTAMP', nullable: false })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ name: 'updated_at', nullable: true, default: null, type: 'datetime' })
|
|
||||||
updatedAt: Date | null
|
|
||||||
|
|
||||||
@DeleteDateColumn({ name: 'deleted_at', nullable: true })
|
|
||||||
deletedAt: Date | null
|
|
||||||
}
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
CreateDateColumn,
|
|
||||||
Entity,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
UpdateDateColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
|
|
||||||
@Entity('communities')
|
|
||||||
export class Community extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 64, default: null, nullable: true })
|
|
||||||
publicKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'api_version', length: 10, nullable: false })
|
|
||||||
apiVersion: string
|
|
||||||
|
|
||||||
@Column({ name: 'end_point', length: 255, nullable: false })
|
|
||||||
endPoint: string
|
|
||||||
|
|
||||||
@Column({ name: 'last_announced_at', type: 'datetime', nullable: false })
|
|
||||||
lastAnnouncedAt: Date
|
|
||||||
|
|
||||||
@CreateDateColumn({
|
|
||||||
name: 'created_at',
|
|
||||||
type: 'datetime',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@UpdateDateColumn({
|
|
||||||
name: 'updated_at',
|
|
||||||
type: 'datetime',
|
|
||||||
onUpdate: 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
updatedAt: Date | null
|
|
||||||
}
|
|
||||||
@ -1,130 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
JoinColumn,
|
|
||||||
OneToMany,
|
|
||||||
OneToOne,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { Contribution } from '../Contribution'
|
|
||||||
import { ContributionMessage } from '../ContributionMessage'
|
|
||||||
import { UserContact } from '../UserContact'
|
|
||||||
|
|
||||||
@Entity('users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class User extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'gradido_id',
|
|
||||||
length: 36,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
gradidoID: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'alias',
|
|
||||||
length: 20,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
alias: string
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => UserContact,
|
|
||||||
(emailContact: UserContact) => emailContact.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'email_id' })
|
|
||||||
emailContact: UserContact
|
|
||||||
|
|
||||||
@Column({ name: 'email_id', type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
emailId: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'first_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
firstName: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'last_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
lastName: string
|
|
||||||
|
|
||||||
@Column({ name: 'created_at', default: () => 'CURRENT_TIMESTAMP', nullable: false })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@DeleteDateColumn({ name: 'deleted_at', nullable: true })
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', default: 0, unsigned: true })
|
|
||||||
password: BigInt
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'password_encryption_type',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: false,
|
|
||||||
default: 0,
|
|
||||||
})
|
|
||||||
passwordEncryptionType: number
|
|
||||||
|
|
||||||
@Column({ length: 4, default: 'de', collation: 'utf8mb4_unicode_ci', nullable: false })
|
|
||||||
language: string
|
|
||||||
|
|
||||||
@Column({ type: 'bool', default: false })
|
|
||||||
hideAmountGDD: boolean
|
|
||||||
|
|
||||||
@Column({ type: 'bool', default: false })
|
|
||||||
hideAmountGDT: boolean
|
|
||||||
|
|
||||||
@Column({ name: 'is_admin', type: 'datetime', nullable: true, default: null })
|
|
||||||
isAdmin: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'referrer_id', type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
referrerId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'contribution_link_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
contributionLinkId?: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'publisher_id', default: 0 })
|
|
||||||
publisherId: number
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => Contribution,
|
|
||||||
(contribution) => contribution.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
contributions?: Contribution[]
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => ContributionMessage,
|
|
||||||
(message) => message.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
messages?: ContributionMessage[]
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => UserContact,
|
|
||||||
(userContact: UserContact) => userContact.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
userContacts?: UserContact[]
|
|
||||||
}
|
|
||||||
@ -1,51 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
CreateDateColumn,
|
|
||||||
Entity,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
UpdateDateColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
|
|
||||||
@Entity('communities')
|
|
||||||
export class Community extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'foreign', type: 'bool', nullable: false, default: true })
|
|
||||||
foreign: boolean
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 64, default: null, nullable: true })
|
|
||||||
publicKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'api_version', length: 10, nullable: false })
|
|
||||||
apiVersion: string
|
|
||||||
|
|
||||||
@Column({ name: 'end_point', length: 255, nullable: false })
|
|
||||||
endPoint: string
|
|
||||||
|
|
||||||
@Column({ name: 'last_announced_at', type: 'datetime', nullable: true })
|
|
||||||
lastAnnouncedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'verified_at', type: 'datetime', nullable: true })
|
|
||||||
verifiedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'last_error_at', type: 'datetime', nullable: true })
|
|
||||||
lastErrorAt: Date | null
|
|
||||||
|
|
||||||
@CreateDateColumn({
|
|
||||||
name: 'created_at',
|
|
||||||
type: 'datetime',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@UpdateDateColumn({
|
|
||||||
name: 'updated_at',
|
|
||||||
type: 'datetime',
|
|
||||||
onUpdate: 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
updatedAt: Date | null
|
|
||||||
}
|
|
||||||
@ -1,83 +0,0 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
CreateDateColumn,
|
|
||||||
Entity,
|
|
||||||
JoinColumn,
|
|
||||||
ManyToOne,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
|
||||||
import { Contribution } from '../Contribution'
|
|
||||||
import { ContributionMessage } from '../ContributionMessage'
|
|
||||||
import { Transaction } from '../Transaction'
|
|
||||||
import { User } from '../User'
|
|
||||||
|
|
||||||
@Entity('events')
|
|
||||||
export class Event extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ length: 100, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
type: string
|
|
||||||
|
|
||||||
@CreateDateColumn({
|
|
||||||
name: 'created_at',
|
|
||||||
type: 'datetime',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ name: 'affected_user_id', unsigned: true, nullable: false })
|
|
||||||
affectedUserId: number
|
|
||||||
|
|
||||||
@ManyToOne(() => User)
|
|
||||||
@JoinColumn({ name: 'affected_user_id', referencedColumnName: 'id' })
|
|
||||||
affectedUser: User
|
|
||||||
|
|
||||||
@Column({ name: 'acting_user_id', unsigned: true, nullable: false })
|
|
||||||
actingUserId: number
|
|
||||||
|
|
||||||
@ManyToOne(() => User)
|
|
||||||
@JoinColumn({ name: 'acting_user_id', referencedColumnName: 'id' })
|
|
||||||
actingUser: User
|
|
||||||
|
|
||||||
@Column({ name: 'involved_user_id', type: 'int', unsigned: true, nullable: true })
|
|
||||||
involvedUserId: number | null
|
|
||||||
|
|
||||||
@ManyToOne(() => User)
|
|
||||||
@JoinColumn({ name: 'involved_user_id', referencedColumnName: 'id' })
|
|
||||||
involvedUser: User | null
|
|
||||||
|
|
||||||
@Column({ name: 'involved_transaction_id', type: 'int', unsigned: true, nullable: true })
|
|
||||||
involvedTransactionId: number | null
|
|
||||||
|
|
||||||
@ManyToOne(() => Transaction)
|
|
||||||
@JoinColumn({ name: 'involved_transaction_id', referencedColumnName: 'id' })
|
|
||||||
involvedTransaction: Transaction | null
|
|
||||||
|
|
||||||
@Column({ name: 'involved_contribution_id', type: 'int', unsigned: true, nullable: true })
|
|
||||||
involvedContributionId: number | null
|
|
||||||
|
|
||||||
@ManyToOne(() => Contribution)
|
|
||||||
@JoinColumn({ name: 'involved_contribution_id', referencedColumnName: 'id' })
|
|
||||||
involvedContribution: Contribution | null
|
|
||||||
|
|
||||||
@Column({ name: 'involved_contribution_message_id', type: 'int', unsigned: true, nullable: true })
|
|
||||||
involvedContributionMessageId: number | null
|
|
||||||
|
|
||||||
@ManyToOne(() => ContributionMessage)
|
|
||||||
@JoinColumn({ name: 'involved_contribution_message_id', referencedColumnName: 'id' })
|
|
||||||
involvedContributionMessage: ContributionMessage | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: true,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
amount: Decimal | null
|
|
||||||
}
|
|
||||||
@ -1,104 +0,0 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
CreateDateColumn,
|
|
||||||
Entity,
|
|
||||||
JoinColumn,
|
|
||||||
ManyToOne,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
|
||||||
import { Contribution } from '../Contribution'
|
|
||||||
import { ContributionLink } from '../ContributionLink'
|
|
||||||
import { ContributionMessage } from '../ContributionMessage'
|
|
||||||
import { Transaction } from '../Transaction'
|
|
||||||
import { TransactionLink } from '../TransactionLink'
|
|
||||||
import { User } from '../User'
|
|
||||||
|
|
||||||
@Entity('events')
|
|
||||||
export class Event extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 100, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
type: string
|
|
||||||
|
|
||||||
@CreateDateColumn({
|
|
||||||
name: 'created_at',
|
|
||||||
type: 'datetime',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ name: 'affected_user_id', type: 'bigint', unsigned: true, nullable: false })
|
|
||||||
affectedUserId: number
|
|
||||||
|
|
||||||
@ManyToOne(() => User)
|
|
||||||
@JoinColumn({ name: 'affected_user_id', referencedColumnName: 'id' })
|
|
||||||
affectedUser: User
|
|
||||||
|
|
||||||
@Column({ name: 'acting_user_id', type: 'bigint', unsigned: true, nullable: false })
|
|
||||||
actingUserId: number
|
|
||||||
|
|
||||||
@ManyToOne(() => User)
|
|
||||||
@JoinColumn({ name: 'acting_user_id', referencedColumnName: 'id' })
|
|
||||||
actingUser: User
|
|
||||||
|
|
||||||
@Column({ name: 'involved_user_id', type: 'bigint', unsigned: true, nullable: true })
|
|
||||||
involvedUserId: number | null
|
|
||||||
|
|
||||||
@ManyToOne(() => User)
|
|
||||||
@JoinColumn({ name: 'involved_user_id', referencedColumnName: 'id' })
|
|
||||||
involvedUser: User | null
|
|
||||||
|
|
||||||
@Column({ name: 'involved_transaction_id', type: 'bigint', unsigned: true, nullable: true })
|
|
||||||
involvedTransactionId: number | null
|
|
||||||
|
|
||||||
@ManyToOne(() => Transaction)
|
|
||||||
@JoinColumn({ name: 'involved_transaction_id', referencedColumnName: 'id' })
|
|
||||||
involvedTransaction: Transaction | null
|
|
||||||
|
|
||||||
@Column({ name: 'involved_contribution_id', type: 'bigint', unsigned: true, nullable: true })
|
|
||||||
involvedContributionId: number | null
|
|
||||||
|
|
||||||
@ManyToOne(() => Contribution)
|
|
||||||
@JoinColumn({ name: 'involved_contribution_id', referencedColumnName: 'id' })
|
|
||||||
involvedContribution: Contribution | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'involved_contribution_message_id',
|
|
||||||
type: 'bigint',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
involvedContributionMessageId: number | null
|
|
||||||
|
|
||||||
@ManyToOne(() => ContributionMessage)
|
|
||||||
@JoinColumn({ name: 'involved_contribution_message_id', referencedColumnName: 'id' })
|
|
||||||
involvedContributionMessage: ContributionMessage | null
|
|
||||||
|
|
||||||
@Column({ name: 'involved_transaction_link_id', type: 'bigint', unsigned: true, nullable: true })
|
|
||||||
involvedTransactionLinkId: number | null
|
|
||||||
|
|
||||||
@ManyToOne(() => TransactionLink)
|
|
||||||
@JoinColumn({ name: 'involved_transaction_link_id', referencedColumnName: 'id' })
|
|
||||||
involvedTransactionLink: TransactionLink | null
|
|
||||||
|
|
||||||
@Column({ name: 'involved_contribution_link_id', type: 'bigint', unsigned: true, nullable: true })
|
|
||||||
involvedContributionLinkId: number | null
|
|
||||||
|
|
||||||
@ManyToOne(() => ContributionLink)
|
|
||||||
@JoinColumn({ name: 'involved_contribution_link_id', referencedColumnName: 'id' })
|
|
||||||
involvedContributionLink: ContributionLink | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: true,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
amount: Decimal | null
|
|
||||||
}
|
|
||||||
@ -1,60 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
CreateDateColumn,
|
|
||||||
Entity,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
UpdateDateColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
|
|
||||||
@Entity('communities')
|
|
||||||
export class Community extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'foreign', type: 'bool', nullable: false, default: true })
|
|
||||||
foreign: boolean
|
|
||||||
|
|
||||||
@Column({ name: 'url', length: 255, nullable: false })
|
|
||||||
url: string
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 64, nullable: false })
|
|
||||||
publicKey: Buffer
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'community_uuid',
|
|
||||||
type: 'char',
|
|
||||||
length: 36,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
communityUuid: string | null
|
|
||||||
|
|
||||||
@Column({ name: 'authenticated_at', type: 'datetime', nullable: true })
|
|
||||||
authenticatedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'name', type: 'varchar', length: 40, nullable: true })
|
|
||||||
name: string | null
|
|
||||||
|
|
||||||
@Column({ name: 'description', type: 'varchar', length: 255, nullable: true })
|
|
||||||
description: string | null
|
|
||||||
|
|
||||||
@CreateDateColumn({ name: 'creation_date', type: 'datetime', nullable: true })
|
|
||||||
creationDate: Date | null
|
|
||||||
|
|
||||||
@CreateDateColumn({
|
|
||||||
name: 'created_at',
|
|
||||||
type: 'datetime',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@UpdateDateColumn({
|
|
||||||
name: 'updated_at',
|
|
||||||
type: 'datetime',
|
|
||||||
onUpdate: 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
updatedAt: Date | null
|
|
||||||
}
|
|
||||||
@ -1,51 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
CreateDateColumn,
|
|
||||||
Entity,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
UpdateDateColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
|
|
||||||
@Entity('federated_communities')
|
|
||||||
export class FederatedCommunity extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'foreign', type: 'bool', nullable: false, default: true })
|
|
||||||
foreign: boolean
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 64, default: null, nullable: true })
|
|
||||||
publicKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'api_version', length: 10, nullable: false })
|
|
||||||
apiVersion: string
|
|
||||||
|
|
||||||
@Column({ name: 'end_point', length: 255, nullable: false })
|
|
||||||
endPoint: string
|
|
||||||
|
|
||||||
@Column({ name: 'last_announced_at', type: 'datetime', nullable: true })
|
|
||||||
lastAnnouncedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'verified_at', type: 'datetime', nullable: true })
|
|
||||||
verifiedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'last_error_at', type: 'datetime', nullable: true })
|
|
||||||
lastErrorAt: Date | null
|
|
||||||
|
|
||||||
@CreateDateColumn({
|
|
||||||
name: 'created_at',
|
|
||||||
type: 'datetime',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@UpdateDateColumn({
|
|
||||||
name: 'updated_at',
|
|
||||||
type: 'datetime',
|
|
||||||
onUpdate: 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
updatedAt: Date | null
|
|
||||||
}
|
|
||||||
@ -1,143 +0,0 @@
|
|||||||
/* eslint-disable no-use-before-define */
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { BaseEntity, Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
|
||||||
import { Contribution } from '../Contribution'
|
|
||||||
|
|
||||||
@Entity('transactions')
|
|
||||||
export class Transaction extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ type: 'int', unsigned: true, unique: true, nullable: true, default: null })
|
|
||||||
previous: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'type_id', unsigned: true, nullable: false })
|
|
||||||
typeId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'transaction_link_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
transactionLinkId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
amount: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
balance: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'balance_date',
|
|
||||||
type: 'datetime',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
balanceDate: Date
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
decay: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'decay_start',
|
|
||||||
type: 'datetime',
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
decayStart: Date | null
|
|
||||||
|
|
||||||
@Column({ length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
memo: string
|
|
||||||
|
|
||||||
@Column({ name: 'creation_date', type: 'datetime', nullable: true, default: null })
|
|
||||||
creationDate: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'user_gradido_id',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 36,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
userGradidoID: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'user_name',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 512,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
userName: string | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_user_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
linkedUserId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_user_gradido_id',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 36,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
linkedUserGradidoID: string | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_user_name',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 512,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
linkedUserName: string | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_transaction_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
linkedTransactionId?: number | null
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => Contribution,
|
|
||||||
(contribution) => contribution.transaction,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'id', referencedColumnName: 'transactionId' })
|
|
||||||
contribution?: Contribution | null
|
|
||||||
|
|
||||||
@OneToOne(() => Transaction)
|
|
||||||
@JoinColumn({ name: 'previous' })
|
|
||||||
previousTransaction?: Transaction | null
|
|
||||||
}
|
|
||||||
@ -1,63 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
CreateDateColumn,
|
|
||||||
Entity,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
UpdateDateColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
|
|
||||||
@Entity('communities')
|
|
||||||
export class Community extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'foreign', type: 'bool', nullable: false, default: true })
|
|
||||||
foreign: boolean
|
|
||||||
|
|
||||||
@Column({ name: 'url', length: 255, nullable: false })
|
|
||||||
url: string
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 64, nullable: false })
|
|
||||||
publicKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'private_key', type: 'binary', length: 64, nullable: true })
|
|
||||||
privateKey: Buffer | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'community_uuid',
|
|
||||||
type: 'char',
|
|
||||||
length: 36,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
communityUuid: string | null
|
|
||||||
|
|
||||||
@Column({ name: 'authenticated_at', type: 'datetime', nullable: true })
|
|
||||||
authenticatedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'name', type: 'varchar', length: 40, nullable: true })
|
|
||||||
name: string | null
|
|
||||||
|
|
||||||
@Column({ name: 'description', type: 'varchar', length: 255, nullable: true })
|
|
||||||
description: string | null
|
|
||||||
|
|
||||||
@CreateDateColumn({ name: 'creation_date', type: 'datetime', nullable: true })
|
|
||||||
creationDate: Date | null
|
|
||||||
|
|
||||||
@CreateDateColumn({
|
|
||||||
name: 'created_at',
|
|
||||||
type: 'datetime',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@UpdateDateColumn({
|
|
||||||
name: 'updated_at',
|
|
||||||
type: 'datetime',
|
|
||||||
onUpdate: 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
updatedAt: Date | null
|
|
||||||
}
|
|
||||||
@ -1,63 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
CreateDateColumn,
|
|
||||||
Entity,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
UpdateDateColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
|
|
||||||
@Entity('communities')
|
|
||||||
export class Community extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'foreign', type: 'bool', nullable: false, default: true })
|
|
||||||
foreign: boolean
|
|
||||||
|
|
||||||
@Column({ name: 'url', length: 255, nullable: false })
|
|
||||||
url: string
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 32, nullable: false })
|
|
||||||
publicKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'private_key', type: 'binary', length: 64, nullable: true })
|
|
||||||
privateKey: Buffer | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'community_uuid',
|
|
||||||
type: 'char',
|
|
||||||
length: 36,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
communityUuid: string | null
|
|
||||||
|
|
||||||
@Column({ name: 'authenticated_at', type: 'datetime', nullable: true })
|
|
||||||
authenticatedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'name', type: 'varchar', length: 40, nullable: true })
|
|
||||||
name: string | null
|
|
||||||
|
|
||||||
@Column({ name: 'description', type: 'varchar', length: 255, nullable: true })
|
|
||||||
description: string | null
|
|
||||||
|
|
||||||
@CreateDateColumn({ name: 'creation_date', type: 'datetime', nullable: true })
|
|
||||||
creationDate: Date | null
|
|
||||||
|
|
||||||
@CreateDateColumn({
|
|
||||||
name: 'created_at',
|
|
||||||
type: 'datetime',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@UpdateDateColumn({
|
|
||||||
name: 'updated_at',
|
|
||||||
type: 'datetime',
|
|
||||||
onUpdate: 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
updatedAt: Date | null
|
|
||||||
}
|
|
||||||
@ -1,51 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
CreateDateColumn,
|
|
||||||
Entity,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
UpdateDateColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
|
|
||||||
@Entity('federated_communities')
|
|
||||||
export class FederatedCommunity extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'foreign', type: 'bool', nullable: false, default: true })
|
|
||||||
foreign: boolean
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
publicKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'api_version', length: 10, nullable: false })
|
|
||||||
apiVersion: string
|
|
||||||
|
|
||||||
@Column({ name: 'end_point', length: 255, nullable: false })
|
|
||||||
endPoint: string
|
|
||||||
|
|
||||||
@Column({ name: 'last_announced_at', type: 'datetime', nullable: true })
|
|
||||||
lastAnnouncedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'verified_at', type: 'datetime', nullable: true })
|
|
||||||
verifiedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'last_error_at', type: 'datetime', nullable: true })
|
|
||||||
lastErrorAt: Date | null
|
|
||||||
|
|
||||||
@CreateDateColumn({
|
|
||||||
name: 'created_at',
|
|
||||||
type: 'datetime',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@UpdateDateColumn({
|
|
||||||
name: 'updated_at',
|
|
||||||
type: 'datetime',
|
|
||||||
onUpdate: 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
updatedAt: Date | null
|
|
||||||
}
|
|
||||||
@ -1,135 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
JoinColumn,
|
|
||||||
OneToMany,
|
|
||||||
OneToOne,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { Contribution } from '../Contribution'
|
|
||||||
import { ContributionMessage } from '../ContributionMessage'
|
|
||||||
import { UserContact } from '../UserContact'
|
|
||||||
import { UserRole } from './UserRole'
|
|
||||||
|
|
||||||
@Entity('users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class User extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'gradido_id',
|
|
||||||
length: 36,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
gradidoID: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'alias',
|
|
||||||
length: 20,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
alias: string
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => UserContact,
|
|
||||||
(emailContact: UserContact) => emailContact.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'email_id' })
|
|
||||||
emailContact: UserContact
|
|
||||||
|
|
||||||
@Column({ name: 'email_id', type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
emailId: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'first_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
firstName: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'last_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
lastName: string
|
|
||||||
|
|
||||||
@Column({ name: 'created_at', default: () => 'CURRENT_TIMESTAMP(3)', nullable: false })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@DeleteDateColumn({ name: 'deleted_at', nullable: true })
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', default: 0, unsigned: true })
|
|
||||||
password: BigInt
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'password_encryption_type',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: false,
|
|
||||||
default: 0,
|
|
||||||
})
|
|
||||||
passwordEncryptionType: number
|
|
||||||
|
|
||||||
@Column({ length: 4, default: 'de', collation: 'utf8mb4_unicode_ci', nullable: false })
|
|
||||||
language: string
|
|
||||||
|
|
||||||
@Column({ type: 'bool', default: false })
|
|
||||||
hideAmountGDD: boolean
|
|
||||||
|
|
||||||
@Column({ type: 'bool', default: false })
|
|
||||||
hideAmountGDT: boolean
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => UserRole,
|
|
||||||
(userRole) => userRole.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
userRoles: UserRole[]
|
|
||||||
|
|
||||||
@Column({ name: 'referrer_id', type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
referrerId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'contribution_link_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
contributionLinkId?: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'publisher_id', default: 0 })
|
|
||||||
publisherId: number
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => Contribution,
|
|
||||||
(contribution) => contribution.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
contributions?: Contribution[]
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => ContributionMessage,
|
|
||||||
(message) => message.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
messages?: ContributionMessage[]
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => UserContact,
|
|
||||||
(userContact: UserContact) => userContact.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
userContacts?: UserContact[]
|
|
||||||
}
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { User } from '../User'
|
|
||||||
|
|
||||||
@Entity('user_roles', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class UserRole extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', type: 'int', unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 40, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
role: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'created_at',
|
|
||||||
type: 'datetime',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ name: 'updated_at', type: 'datetime', nullable: true, default: null })
|
|
||||||
updatedAt: Date | null
|
|
||||||
|
|
||||||
@ManyToOne(
|
|
||||||
() => User,
|
|
||||||
(user) => user.userRoles,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
user: User
|
|
||||||
}
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { Transaction } from '../Transaction'
|
|
||||||
|
|
||||||
@Entity('dlt_transactions', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class DltTransaction extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'transactions_id', type: 'int', unsigned: true, nullable: false })
|
|
||||||
transactionId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'message_id',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 64,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
messageId: string
|
|
||||||
|
|
||||||
@Column({ name: 'verified', type: 'bool', nullable: false, default: false })
|
|
||||||
verified: boolean
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'created_at',
|
|
||||||
type: 'datetime',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ name: 'verified_at', type: 'datetime', nullable: true, default: null })
|
|
||||||
verifiedAt: Date | null
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => Transaction,
|
|
||||||
(transaction) => transaction.dltTransaction,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'transactions_id' })
|
|
||||||
transaction?: Transaction | null
|
|
||||||
}
|
|
||||||
@ -1,151 +0,0 @@
|
|||||||
/* eslint-disable no-use-before-define */
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { BaseEntity, Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
|
||||||
import { Contribution } from '../Contribution'
|
|
||||||
import { DltTransaction } from './DltTransaction'
|
|
||||||
|
|
||||||
@Entity('transactions')
|
|
||||||
export class Transaction extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ type: 'int', unsigned: true, unique: true, nullable: true, default: null })
|
|
||||||
previous: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'type_id', unsigned: true, nullable: false })
|
|
||||||
typeId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'transaction_link_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
transactionLinkId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
amount: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
balance: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'balance_date',
|
|
||||||
type: 'datetime',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
balanceDate: Date
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
decay: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'decay_start',
|
|
||||||
type: 'datetime',
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
decayStart: Date | null
|
|
||||||
|
|
||||||
@Column({ length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
memo: string
|
|
||||||
|
|
||||||
@Column({ name: 'creation_date', type: 'datetime', nullable: true, default: null })
|
|
||||||
creationDate: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'user_gradido_id',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 36,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
userGradidoID: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'user_name',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 512,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
userName: string | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_user_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
linkedUserId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_user_gradido_id',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 36,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
linkedUserGradidoID: string | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_user_name',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 512,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
linkedUserName: string | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_transaction_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
linkedTransactionId?: number | null
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => Contribution,
|
|
||||||
(contribution) => contribution.transaction,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'id', referencedColumnName: 'transactionId' })
|
|
||||||
contribution?: Contribution | null
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => DltTransaction,
|
|
||||||
(dlt) => dlt.transactionId,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'id', referencedColumnName: 'transactionId' })
|
|
||||||
dltTransaction?: DltTransaction | null
|
|
||||||
|
|
||||||
@OneToOne(() => Transaction)
|
|
||||||
@JoinColumn({ name: 'previous' })
|
|
||||||
previousTransaction?: Transaction | null
|
|
||||||
}
|
|
||||||
@ -1,152 +0,0 @@
|
|||||||
/* eslint-disable no-use-before-define */
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
|
||||||
|
|
||||||
@Entity('pending_transactions')
|
|
||||||
export class PendingTransaction extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'state', type: 'int', unsigned: true, nullable: false })
|
|
||||||
state: number
|
|
||||||
|
|
||||||
@Column({ type: 'int', unsigned: true, unique: true, nullable: true, default: null })
|
|
||||||
previous: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'type_id', type: 'int', unsigned: true, nullable: false })
|
|
||||||
typeId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'transaction_link_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
transactionLinkId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
amount: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
balance: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'balance_date',
|
|
||||||
type: 'datetime',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
balanceDate: Date
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
decay: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'decay_start',
|
|
||||||
type: 'datetime',
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
decayStart: Date | null
|
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
memo: string
|
|
||||||
|
|
||||||
@Column({ name: 'creation_date', type: 'datetime', nullable: true, default: null })
|
|
||||||
creationDate: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', type: 'bigint', unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'user_gradido_id',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 36,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
userGradidoID: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'user_name',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 512,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
userName: string | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'user_community_uuid',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 36,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
userCommunityUuid: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_user_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
linkedUserId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_user_gradido_id',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 36,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
linkedUserGradidoID: string | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_user_name',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 512,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
linkedUserName: string | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_user_community_uuid',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 36,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
linkedUserCommunityUuid: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_transaction_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
linkedTransactionId?: number | null
|
|
||||||
}
|
|
||||||
@ -1,169 +0,0 @@
|
|||||||
/* eslint-disable no-use-before-define */
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { BaseEntity, Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
|
||||||
import { Contribution } from '../Contribution'
|
|
||||||
import { DltTransaction } from '../DltTransaction'
|
|
||||||
|
|
||||||
@Entity('transactions')
|
|
||||||
export class Transaction extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ type: 'int', unsigned: true, unique: true, nullable: true, default: null })
|
|
||||||
previous: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'type_id', type: 'int', unsigned: true, nullable: false })
|
|
||||||
typeId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'transaction_link_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
transactionLinkId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
amount: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
balance: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'balance_date',
|
|
||||||
type: 'datetime',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
balanceDate: Date
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
decay: Decimal
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'decay_start',
|
|
||||||
type: 'datetime',
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
decayStart: Date | null
|
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
memo: string
|
|
||||||
|
|
||||||
@Column({ name: 'creation_date', type: 'datetime', nullable: true, default: null })
|
|
||||||
creationDate: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', type: 'bigint', unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'user_community_uuid',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 36,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
userCommunityUuid: string | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'user_gradido_id',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 36,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
userGradidoID: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'user_name',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 512,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
userName: string | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_user_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
linkedUserId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_user_community_uuid',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 36,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
linkedUserCommunityUuid: string | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_user_gradido_id',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 36,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
linkedUserGradidoID: string | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_user_name',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 512,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
linkedUserName: string | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'linked_transaction_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
linkedTransactionId?: number | null
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => Contribution,
|
|
||||||
(contribution) => contribution.transaction,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'id', referencedColumnName: 'transactionId' })
|
|
||||||
contribution?: Contribution | null
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => DltTransaction,
|
|
||||||
(dlt) => dlt.transactionId,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'id', referencedColumnName: 'transactionId' })
|
|
||||||
dltTransaction?: DltTransaction | null
|
|
||||||
|
|
||||||
@OneToOne(() => Transaction)
|
|
||||||
@JoinColumn({ name: 'previous' })
|
|
||||||
previousTransaction?: Transaction | null
|
|
||||||
}
|
|
||||||
@ -1,147 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
JoinColumn,
|
|
||||||
OneToMany,
|
|
||||||
OneToOne,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { Contribution } from '../Contribution'
|
|
||||||
import { ContributionMessage } from '../ContributionMessage'
|
|
||||||
import { UserContact } from '../UserContact'
|
|
||||||
import { UserRole } from '../UserRole'
|
|
||||||
|
|
||||||
@Entity('users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class User extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ type: 'bool', default: false })
|
|
||||||
foreign: boolean
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'gradido_id',
|
|
||||||
length: 36,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
gradidoID: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'community_uuid',
|
|
||||||
type: 'char',
|
|
||||||
length: 36,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
communityUuid: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'alias',
|
|
||||||
length: 20,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
alias: string
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => UserContact,
|
|
||||||
(emailContact: UserContact) => emailContact.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'email_id' })
|
|
||||||
emailContact: UserContact
|
|
||||||
|
|
||||||
@Column({ name: 'email_id', type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
emailId: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'first_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
firstName: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'last_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
lastName: string
|
|
||||||
|
|
||||||
@Column({ name: 'created_at', default: () => 'CURRENT_TIMESTAMP(3)', nullable: false })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@DeleteDateColumn({ name: 'deleted_at', nullable: true })
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', default: 0, unsigned: true })
|
|
||||||
password: BigInt
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'password_encryption_type',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: false,
|
|
||||||
default: 0,
|
|
||||||
})
|
|
||||||
passwordEncryptionType: number
|
|
||||||
|
|
||||||
@Column({ length: 4, default: 'de', collation: 'utf8mb4_unicode_ci', nullable: false })
|
|
||||||
language: string
|
|
||||||
|
|
||||||
@Column({ type: 'bool', default: false })
|
|
||||||
hideAmountGDD: boolean
|
|
||||||
|
|
||||||
@Column({ type: 'bool', default: false })
|
|
||||||
hideAmountGDT: boolean
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => UserRole,
|
|
||||||
(userRole) => userRole.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
userRoles: UserRole[]
|
|
||||||
|
|
||||||
@Column({ name: 'referrer_id', type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
referrerId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'contribution_link_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
contributionLinkId?: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'publisher_id', default: 0 })
|
|
||||||
publisherId: number
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => Contribution,
|
|
||||||
(contribution) => contribution.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
contributions?: Contribution[]
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => ContributionMessage,
|
|
||||||
(message) => message.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
messages?: ContributionMessage[]
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => UserContact,
|
|
||||||
(userContact: UserContact) => userContact.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
userContacts?: UserContact[]
|
|
||||||
}
|
|
||||||
@ -1,62 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
Index,
|
|
||||||
JoinColumn,
|
|
||||||
ManyToOne,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { Contribution } from '../Contribution'
|
|
||||||
import { User } from '../User'
|
|
||||||
|
|
||||||
@Entity('contribution_messages', {
|
|
||||||
engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
export class ContributionMessage extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Index()
|
|
||||||
@Column({ name: 'contribution_id', unsigned: true, nullable: false })
|
|
||||||
contributionId: number
|
|
||||||
|
|
||||||
@ManyToOne(
|
|
||||||
() => Contribution,
|
|
||||||
(contribution) => contribution.messages,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'contribution_id' })
|
|
||||||
contribution: Contribution
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@ManyToOne(
|
|
||||||
() => User,
|
|
||||||
(user) => user.messages,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
user: User
|
|
||||||
|
|
||||||
@Column({ length: 2000, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
message: string
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP', name: 'created_at' })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', default: null, nullable: true, name: 'updated_at' })
|
|
||||||
updatedAt: Date
|
|
||||||
|
|
||||||
@DeleteDateColumn({ name: 'deleted_at' })
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'deleted_by', default: null, unsigned: true, nullable: true })
|
|
||||||
deletedBy: number
|
|
||||||
|
|
||||||
@Column({ length: 12, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
type: string
|
|
||||||
|
|
||||||
@Column({ name: 'is_moderator', type: 'bool', nullable: false, default: false })
|
|
||||||
isModerator: boolean
|
|
||||||
}
|
|
||||||
@ -1,113 +0,0 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
JoinColumn,
|
|
||||||
ManyToOne,
|
|
||||||
OneToMany,
|
|
||||||
OneToOne,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
|
||||||
import { ContributionMessage } from '../ContributionMessage'
|
|
||||||
import { Transaction } from '../Transaction'
|
|
||||||
import { User } from '../User'
|
|
||||||
|
|
||||||
@Entity('contributions')
|
|
||||||
export class Contribution extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: false, name: 'user_id' })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@ManyToOne(
|
|
||||||
() => User,
|
|
||||||
(user) => user.contributions,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
user: User
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP', name: 'created_at' })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', nullable: false, name: 'contribution_date' })
|
|
||||||
contributionDate: Date
|
|
||||||
|
|
||||||
@Column({ length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
memo: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
amount: Decimal
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'moderator_id' })
|
|
||||||
moderatorId: number
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'contribution_link_id' })
|
|
||||||
contributionLinkId: number
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'confirmed_by' })
|
|
||||||
confirmedBy: number
|
|
||||||
|
|
||||||
@Column({ nullable: true, name: 'confirmed_at' })
|
|
||||||
confirmedAt: Date
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'denied_by' })
|
|
||||||
deniedBy: number
|
|
||||||
|
|
||||||
@Column({ nullable: true, name: 'denied_at' })
|
|
||||||
deniedAt: Date
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'contribution_type',
|
|
||||||
length: 12,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
contributionType: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'contribution_status',
|
|
||||||
length: 12,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
contributionStatus: string
|
|
||||||
|
|
||||||
@Column({ unsigned: true, nullable: true, name: 'transaction_id' })
|
|
||||||
transactionId: number
|
|
||||||
|
|
||||||
@Column({ nullable: true, name: 'updated_at' })
|
|
||||||
updatedAt: Date
|
|
||||||
|
|
||||||
@Column({ nullable: true, unsigned: true, name: 'updated_by', type: 'int' })
|
|
||||||
updatedBy: number | null
|
|
||||||
|
|
||||||
@DeleteDateColumn({ name: 'deleted_at' })
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@DeleteDateColumn({ unsigned: true, nullable: true, name: 'deleted_by' })
|
|
||||||
deletedBy: number
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => ContributionMessage,
|
|
||||||
(message) => message.contribution,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'contribution_id' })
|
|
||||||
messages?: ContributionMessage[]
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => Transaction,
|
|
||||||
(transaction) => transaction.contribution,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'transaction_id' })
|
|
||||||
transaction?: Transaction | null
|
|
||||||
}
|
|
||||||
@ -1,69 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
CreateDateColumn,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
Index,
|
|
||||||
JoinColumn,
|
|
||||||
ManyToOne,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
UpdateDateColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { Contribution } from '../Contribution'
|
|
||||||
import { User } from '../User'
|
|
||||||
|
|
||||||
@Entity('contribution_messages', {
|
|
||||||
engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
export class ContributionMessage extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Index()
|
|
||||||
@Column({ name: 'contribution_id', unsigned: true, nullable: false })
|
|
||||||
contributionId: number
|
|
||||||
|
|
||||||
@ManyToOne(
|
|
||||||
() => Contribution,
|
|
||||||
(contribution) => contribution.messages,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'contribution_id' })
|
|
||||||
contribution: Contribution
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@ManyToOne(
|
|
||||||
() => User,
|
|
||||||
(user) => user.messages,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
user: User
|
|
||||||
|
|
||||||
@Column({ length: 2000, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
message: string
|
|
||||||
|
|
||||||
@CreateDateColumn()
|
|
||||||
@Column({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP', name: 'created_at' })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@UpdateDateColumn()
|
|
||||||
@Column({ type: 'datetime', default: null, nullable: true, name: 'updated_at' })
|
|
||||||
updatedAt: Date
|
|
||||||
|
|
||||||
@DeleteDateColumn({ name: 'deleted_at' })
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'deleted_by', default: null, unsigned: true, nullable: true })
|
|
||||||
deletedBy: number
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', name: 'resubmission_at', default: null, nullable: true })
|
|
||||||
resubmissionAt: Date | null
|
|
||||||
|
|
||||||
@Column({ length: 12, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
type: string
|
|
||||||
|
|
||||||
@Column({ name: 'is_moderator', type: 'bool', nullable: false, default: false })
|
|
||||||
isModerator: boolean
|
|
||||||
}
|
|
||||||
@ -1,118 +0,0 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
JoinColumn,
|
|
||||||
ManyToOne,
|
|
||||||
OneToMany,
|
|
||||||
OneToOne,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { DecimalTransformer } from '../../src/typeorm/DecimalTransformer'
|
|
||||||
import { ContributionMessage } from '../ContributionMessage'
|
|
||||||
import { Transaction } from '../Transaction'
|
|
||||||
import { User } from '../User'
|
|
||||||
|
|
||||||
@Entity('contributions')
|
|
||||||
export class Contribution extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', unsigned: true, nullable: false, name: 'user_id' })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@ManyToOne(
|
|
||||||
() => User,
|
|
||||||
(user) => user.contributions,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
user: User
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP', name: 'created_at' })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', name: 'resubmission_at', default: null, nullable: true })
|
|
||||||
resubmissionAt: Date | null
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', nullable: false, name: 'contribution_date' })
|
|
||||||
contributionDate: Date
|
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
memo: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'decimal',
|
|
||||||
precision: 40,
|
|
||||||
scale: 20,
|
|
||||||
nullable: false,
|
|
||||||
transformer: DecimalTransformer,
|
|
||||||
})
|
|
||||||
amount: Decimal
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', unsigned: true, nullable: true, name: 'moderator_id' })
|
|
||||||
moderatorId: number
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', unsigned: true, nullable: true, name: 'contribution_link_id' })
|
|
||||||
contributionLinkId: number
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', unsigned: true, nullable: true, name: 'confirmed_by' })
|
|
||||||
confirmedBy: number
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', nullable: true, name: 'confirmed_at' })
|
|
||||||
confirmedAt: Date
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', unsigned: true, nullable: true, name: 'denied_by' })
|
|
||||||
deniedBy: number
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', nullable: true, name: 'denied_at' })
|
|
||||||
deniedAt: Date
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'contribution_type',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 12,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
contributionType: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'contribution_status',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 12,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
contributionStatus: string
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', unsigned: true, nullable: true, name: 'transaction_id' })
|
|
||||||
transactionId: number
|
|
||||||
|
|
||||||
@Column({ type: 'datetime', nullable: true, name: 'updated_at' })
|
|
||||||
updatedAt: Date
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', nullable: true, unsigned: true, name: 'updated_by' })
|
|
||||||
updatedBy: number | null
|
|
||||||
|
|
||||||
@DeleteDateColumn({ type: 'datetime', name: 'deleted_at' })
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@DeleteDateColumn({ type: 'bigint', unsigned: true, nullable: true, name: 'deleted_by' })
|
|
||||||
deletedBy: number
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => ContributionMessage,
|
|
||||||
(message) => message.contribution,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'contribution_id' })
|
|
||||||
messages?: ContributionMessage[]
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => Transaction,
|
|
||||||
(transaction) => transaction.contribution,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'transaction_id' })
|
|
||||||
transaction?: Transaction | null
|
|
||||||
}
|
|
||||||
@ -1,66 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
CreateDateColumn,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
Index,
|
|
||||||
JoinColumn,
|
|
||||||
ManyToOne,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
UpdateDateColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { Contribution } from '../Contribution'
|
|
||||||
import { User } from '../User'
|
|
||||||
|
|
||||||
@Entity('contribution_messages', {
|
|
||||||
engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
export class ContributionMessage extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Index()
|
|
||||||
@Column({ name: 'contribution_id', type: 'bigint', unsigned: true, nullable: false })
|
|
||||||
contributionId: number
|
|
||||||
|
|
||||||
@ManyToOne(
|
|
||||||
() => Contribution,
|
|
||||||
(contribution) => contribution.messages,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'contribution_id' })
|
|
||||||
contribution: Contribution
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', type: 'bigint', unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@ManyToOne(
|
|
||||||
() => User,
|
|
||||||
(user) => user.messages,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
user: User
|
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 2000, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
message: string
|
|
||||||
|
|
||||||
@CreateDateColumn()
|
|
||||||
@Column({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP', name: 'created_at' })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@UpdateDateColumn()
|
|
||||||
@Column({ type: 'datetime', default: null, nullable: true, name: 'updated_at' })
|
|
||||||
updatedAt: Date
|
|
||||||
|
|
||||||
@DeleteDateColumn({ name: 'deleted_at' })
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'deleted_by', type: 'bigint', default: null, unsigned: true, nullable: true })
|
|
||||||
deletedBy: number
|
|
||||||
|
|
||||||
@Column({ type: 'varchar', length: 12, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
|
||||||
type: string
|
|
||||||
|
|
||||||
@Column({ name: 'is_moderator', type: 'bool', nullable: false, default: false })
|
|
||||||
isModerator: boolean
|
|
||||||
}
|
|
||||||
@ -1,73 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
CreateDateColumn,
|
|
||||||
Entity,
|
|
||||||
JoinColumn,
|
|
||||||
OneToMany,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
UpdateDateColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { User } from '../User'
|
|
||||||
|
|
||||||
@Entity('communities')
|
|
||||||
export class Community extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'foreign', type: 'bool', nullable: false, default: true })
|
|
||||||
foreign: boolean
|
|
||||||
|
|
||||||
@Column({ name: 'url', length: 255, nullable: false })
|
|
||||||
url: string
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 32, nullable: false })
|
|
||||||
publicKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'private_key', type: 'binary', length: 64, nullable: true })
|
|
||||||
privateKey: Buffer | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'community_uuid',
|
|
||||||
type: 'char',
|
|
||||||
length: 36,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
communityUuid: string | null
|
|
||||||
|
|
||||||
@Column({ name: 'authenticated_at', type: 'datetime', nullable: true })
|
|
||||||
authenticatedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'name', type: 'varchar', length: 40, nullable: true })
|
|
||||||
name: string | null
|
|
||||||
|
|
||||||
@Column({ name: 'description', type: 'varchar', length: 255, nullable: true })
|
|
||||||
description: string | null
|
|
||||||
|
|
||||||
@CreateDateColumn({ name: 'creation_date', type: 'datetime', nullable: true })
|
|
||||||
creationDate: Date | null
|
|
||||||
|
|
||||||
@CreateDateColumn({
|
|
||||||
name: 'created_at',
|
|
||||||
type: 'datetime',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@UpdateDateColumn({
|
|
||||||
name: 'updated_at',
|
|
||||||
type: 'datetime',
|
|
||||||
onUpdate: 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
updatedAt: Date | null
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => User,
|
|
||||||
(user) => user.community,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'community_uuid', referencedColumnName: 'communityUuid' })
|
|
||||||
users: User[]
|
|
||||||
}
|
|
||||||
@ -1,156 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
JoinColumn,
|
|
||||||
ManyToOne,
|
|
||||||
OneToMany,
|
|
||||||
OneToOne,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { Community } from '../Community'
|
|
||||||
import { Contribution } from '../Contribution'
|
|
||||||
import { ContributionMessage } from '../ContributionMessage'
|
|
||||||
import { UserContact } from '../UserContact'
|
|
||||||
import { UserRole } from '../UserRole'
|
|
||||||
|
|
||||||
@Entity('users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class User extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ type: 'bool', default: false })
|
|
||||||
foreign: boolean
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'gradido_id',
|
|
||||||
length: 36,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
gradidoID: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'community_uuid',
|
|
||||||
type: 'char',
|
|
||||||
length: 36,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
communityUuid: string
|
|
||||||
|
|
||||||
@ManyToOne(
|
|
||||||
() => Community,
|
|
||||||
(community) => community.users,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'community_uuid', referencedColumnName: 'communityUuid' })
|
|
||||||
community: Community | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'alias',
|
|
||||||
length: 20,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
alias: string
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => UserContact,
|
|
||||||
(emailContact: UserContact) => emailContact.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'email_id' })
|
|
||||||
emailContact: UserContact
|
|
||||||
|
|
||||||
@Column({ name: 'email_id', type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
emailId: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'first_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
firstName: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'last_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
lastName: string
|
|
||||||
|
|
||||||
@Column({ name: 'created_at', default: () => 'CURRENT_TIMESTAMP(3)', nullable: false })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@DeleteDateColumn({ name: 'deleted_at', nullable: true })
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', default: 0, unsigned: true })
|
|
||||||
password: BigInt
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'password_encryption_type',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: false,
|
|
||||||
default: 0,
|
|
||||||
})
|
|
||||||
passwordEncryptionType: number
|
|
||||||
|
|
||||||
@Column({ length: 4, default: 'de', collation: 'utf8mb4_unicode_ci', nullable: false })
|
|
||||||
language: string
|
|
||||||
|
|
||||||
@Column({ type: 'bool', default: false })
|
|
||||||
hideAmountGDD: boolean
|
|
||||||
|
|
||||||
@Column({ type: 'bool', default: false })
|
|
||||||
hideAmountGDT: boolean
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => UserRole,
|
|
||||||
(userRole) => userRole.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
userRoles: UserRole[]
|
|
||||||
|
|
||||||
@Column({ name: 'referrer_id', type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
referrerId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'contribution_link_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
contributionLinkId?: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'publisher_id', default: 0 })
|
|
||||||
publisherId: number
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => Contribution,
|
|
||||||
(contribution) => contribution.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
contributions?: Contribution[]
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => ContributionMessage,
|
|
||||||
(message) => message.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
messages?: ContributionMessage[]
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => UserContact,
|
|
||||||
(userContact: UserContact) => userContact.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
userContacts?: UserContact[]
|
|
||||||
}
|
|
||||||
@ -1,76 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
CreateDateColumn,
|
|
||||||
Entity,
|
|
||||||
JoinColumn,
|
|
||||||
OneToMany,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
UpdateDateColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { User } from '../User'
|
|
||||||
|
|
||||||
@Entity('communities')
|
|
||||||
export class Community extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'foreign', type: 'bool', nullable: false, default: true })
|
|
||||||
foreign: boolean
|
|
||||||
|
|
||||||
@Column({ name: 'url', length: 255, nullable: false })
|
|
||||||
url: string
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 32, nullable: false })
|
|
||||||
publicKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'private_key', type: 'binary', length: 64, nullable: true })
|
|
||||||
privateKey: Buffer | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'community_uuid',
|
|
||||||
type: 'char',
|
|
||||||
length: 36,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
communityUuid: string | null
|
|
||||||
|
|
||||||
@Column({ name: 'authenticated_at', type: 'datetime', nullable: true })
|
|
||||||
authenticatedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'name', type: 'varchar', length: 40, nullable: true })
|
|
||||||
name: string | null
|
|
||||||
|
|
||||||
@Column({ name: 'description', type: 'varchar', length: 255, nullable: true })
|
|
||||||
description: string | null
|
|
||||||
|
|
||||||
@CreateDateColumn({ name: 'creation_date', type: 'datetime', nullable: true })
|
|
||||||
creationDate: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'gms_api_key', type: 'varchar', length: 512, nullable: true, default: null })
|
|
||||||
gmsApiKey: string | null
|
|
||||||
|
|
||||||
@CreateDateColumn({
|
|
||||||
name: 'created_at',
|
|
||||||
type: 'datetime',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@UpdateDateColumn({
|
|
||||||
name: 'updated_at',
|
|
||||||
type: 'datetime',
|
|
||||||
onUpdate: 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
updatedAt: Date | null
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => User,
|
|
||||||
(user) => user.community,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'community_uuid', referencedColumnName: 'communityUuid' })
|
|
||||||
users: User[]
|
|
||||||
}
|
|
||||||
@ -1,188 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
Geometry,
|
|
||||||
JoinColumn,
|
|
||||||
ManyToOne,
|
|
||||||
OneToMany,
|
|
||||||
OneToOne,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { GeometryTransformer } from '../../src/typeorm/GeometryTransformer'
|
|
||||||
import { Community } from '../Community'
|
|
||||||
import { Contribution } from '../Contribution'
|
|
||||||
import { ContributionMessage } from '../ContributionMessage'
|
|
||||||
import { UserContact } from '../UserContact'
|
|
||||||
import { UserRole } from '../UserRole'
|
|
||||||
|
|
||||||
@Entity('users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class User extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ type: 'bool', default: false })
|
|
||||||
foreign: boolean
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'gradido_id',
|
|
||||||
length: 36,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
gradidoID: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'community_uuid',
|
|
||||||
type: 'char',
|
|
||||||
length: 36,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
communityUuid: string
|
|
||||||
|
|
||||||
@ManyToOne(
|
|
||||||
() => Community,
|
|
||||||
(community) => community.users,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'community_uuid', referencedColumnName: 'communityUuid' })
|
|
||||||
community: Community | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'alias',
|
|
||||||
length: 20,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
alias: string
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => UserContact,
|
|
||||||
(emailContact: UserContact) => emailContact.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'email_id' })
|
|
||||||
emailContact: UserContact
|
|
||||||
|
|
||||||
@Column({ name: 'email_id', type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
emailId: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'first_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
firstName: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'last_name',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
lastName: string
|
|
||||||
|
|
||||||
@Column({ name: 'gms_publish_name', type: 'int', unsigned: true, nullable: false, default: 0 })
|
|
||||||
gmsPublishName: number
|
|
||||||
|
|
||||||
@Column({ name: 'created_at', default: () => 'CURRENT_TIMESTAMP(3)', nullable: false })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@DeleteDateColumn({ name: 'deleted_at', nullable: true })
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', default: 0, unsigned: true })
|
|
||||||
password: BigInt
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'password_encryption_type',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: false,
|
|
||||||
default: 0,
|
|
||||||
})
|
|
||||||
passwordEncryptionType: number
|
|
||||||
|
|
||||||
@Column({ length: 4, default: 'de', collation: 'utf8mb4_unicode_ci', nullable: false })
|
|
||||||
language: string
|
|
||||||
|
|
||||||
@Column({ type: 'bool', default: false })
|
|
||||||
hideAmountGDD: boolean
|
|
||||||
|
|
||||||
@Column({ type: 'bool', default: false })
|
|
||||||
hideAmountGDT: boolean
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => UserRole,
|
|
||||||
(userRole) => userRole.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
userRoles: UserRole[]
|
|
||||||
|
|
||||||
@Column({ name: 'referrer_id', type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
referrerId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'contribution_link_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
contributionLinkId?: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'publisher_id', default: 0 })
|
|
||||||
publisherId: number
|
|
||||||
|
|
||||||
@Column({ name: 'gms_allowed', type: 'bool', default: true })
|
|
||||||
gmsAllowed: boolean
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'location',
|
|
||||||
type: 'geometry',
|
|
||||||
default: null,
|
|
||||||
nullable: true,
|
|
||||||
transformer: GeometryTransformer,
|
|
||||||
})
|
|
||||||
location: Geometry | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'gms_publish_location',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: false,
|
|
||||||
default: 2,
|
|
||||||
})
|
|
||||||
gmsPublishLocation: number
|
|
||||||
|
|
||||||
@Column({ name: 'gms_registered', type: 'bool', default: false })
|
|
||||||
gmsRegistered: boolean
|
|
||||||
|
|
||||||
@Column({ name: 'gms_registered_at', type: 'datetime', default: null, nullable: true })
|
|
||||||
gmsRegisteredAt: Date | null
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => Contribution,
|
|
||||||
(contribution) => contribution.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
contributions?: Contribution[]
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => ContributionMessage,
|
|
||||||
(message) => message.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
messages?: ContributionMessage[]
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => UserContact,
|
|
||||||
(userContact: UserContact) => userContact.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
userContacts?: UserContact[]
|
|
||||||
}
|
|
||||||
@ -1,111 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
CreateDateColumn,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
OneToOne,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
UpdateDateColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { User } from '../User'
|
|
||||||
|
|
||||||
@Entity('user_contacts', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class UserContact extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'type',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 100,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
type: string
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => User,
|
|
||||||
(user) => user.emailContact,
|
|
||||||
)
|
|
||||||
user: User
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', type: 'int', unsigned: true, nullable: false })
|
|
||||||
userId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'varchar',
|
|
||||||
length: 255,
|
|
||||||
unique: true,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
email: string
|
|
||||||
|
|
||||||
@Column({ name: 'gms_publish_email', type: 'bool', nullable: false, default: false })
|
|
||||||
gmsPublishEmail: boolean
|
|
||||||
|
|
||||||
@Column({ name: 'email_verification_code', type: 'bigint', unsigned: true, unique: true })
|
|
||||||
emailVerificationCode: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'email_opt_in_type_id',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: false,
|
|
||||||
default: 0,
|
|
||||||
})
|
|
||||||
emailOptInTypeId: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'email_resend_count',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: false,
|
|
||||||
default: 0,
|
|
||||||
})
|
|
||||||
emailResendCount: number
|
|
||||||
|
|
||||||
@Column({ name: 'email_checked', type: 'bool', nullable: false, default: false })
|
|
||||||
emailChecked: boolean
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'country_code',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 255,
|
|
||||||
unique: false,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
countryCode: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'varchar',
|
|
||||||
length: 255,
|
|
||||||
unique: false,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
phone: string
|
|
||||||
|
|
||||||
@Column({ name: 'gms_publish_phone', type: 'int', unsigned: true, nullable: false, default: 0 })
|
|
||||||
gmsPublishPhone: number
|
|
||||||
|
|
||||||
@CreateDateColumn({
|
|
||||||
name: 'created_at',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@UpdateDateColumn({
|
|
||||||
name: 'updated_at',
|
|
||||||
nullable: true,
|
|
||||||
onUpdate: 'CURRENT_TIMESTAMP(3)',
|
|
||||||
})
|
|
||||||
updatedAt: Date | null
|
|
||||||
|
|
||||||
@DeleteDateColumn({ name: 'deleted_at', nullable: true })
|
|
||||||
deletedAt: Date | null
|
|
||||||
}
|
|
||||||
@ -1,84 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
CreateDateColumn,
|
|
||||||
Entity,
|
|
||||||
JoinColumn,
|
|
||||||
OneToMany,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
UpdateDateColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { FederatedCommunity } from '../FederatedCommunity'
|
|
||||||
import { User } from '../User'
|
|
||||||
|
|
||||||
@Entity('communities')
|
|
||||||
export class Community extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'foreign', type: 'bool', nullable: false, default: true })
|
|
||||||
foreign: boolean
|
|
||||||
|
|
||||||
@Column({ name: 'url', length: 255, nullable: false })
|
|
||||||
url: string
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 32, nullable: false })
|
|
||||||
publicKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'private_key', type: 'binary', length: 64, nullable: true })
|
|
||||||
privateKey: Buffer | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'community_uuid',
|
|
||||||
type: 'char',
|
|
||||||
length: 36,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
communityUuid: string | null
|
|
||||||
|
|
||||||
@Column({ name: 'authenticated_at', type: 'datetime', nullable: true })
|
|
||||||
authenticatedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'name', type: 'varchar', length: 40, nullable: true })
|
|
||||||
name: string | null
|
|
||||||
|
|
||||||
@Column({ name: 'description', type: 'varchar', length: 255, nullable: true })
|
|
||||||
description: string | null
|
|
||||||
|
|
||||||
@CreateDateColumn({ name: 'creation_date', type: 'datetime', nullable: true })
|
|
||||||
creationDate: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'gms_api_key', type: 'varchar', length: 512, nullable: true, default: null })
|
|
||||||
gmsApiKey: string | null
|
|
||||||
|
|
||||||
@CreateDateColumn({
|
|
||||||
name: 'created_at',
|
|
||||||
type: 'datetime',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@UpdateDateColumn({
|
|
||||||
name: 'updated_at',
|
|
||||||
type: 'datetime',
|
|
||||||
onUpdate: 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
updatedAt: Date | null
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => User,
|
|
||||||
(user) => user.community,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'community_uuid', referencedColumnName: 'communityUuid' })
|
|
||||||
users: User[]
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => FederatedCommunity,
|
|
||||||
(federatedCommunity) => federatedCommunity.community,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'public_key', referencedColumnName: 'publicKey' })
|
|
||||||
federatedCommunities?: FederatedCommunity[]
|
|
||||||
}
|
|
||||||
@ -1,61 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
CreateDateColumn,
|
|
||||||
Entity,
|
|
||||||
JoinColumn,
|
|
||||||
ManyToOne,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
UpdateDateColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { Community } from '../Community'
|
|
||||||
|
|
||||||
@Entity('federated_communities')
|
|
||||||
export class FederatedCommunity extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'foreign', type: 'bool', nullable: false, default: true })
|
|
||||||
foreign: boolean
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 32, default: null, nullable: true })
|
|
||||||
publicKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'api_version', type: 'varchar', length: 10, nullable: false })
|
|
||||||
apiVersion: string
|
|
||||||
|
|
||||||
@Column({ name: 'end_point', type: 'varchar', length: 255, nullable: false })
|
|
||||||
endPoint: string
|
|
||||||
|
|
||||||
@Column({ name: 'last_announced_at', type: 'datetime', nullable: true })
|
|
||||||
lastAnnouncedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'verified_at', type: 'datetime', nullable: true })
|
|
||||||
verifiedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'last_error_at', type: 'datetime', nullable: true })
|
|
||||||
lastErrorAt: Date | null
|
|
||||||
|
|
||||||
@CreateDateColumn({
|
|
||||||
name: 'created_at',
|
|
||||||
type: 'datetime',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@UpdateDateColumn({
|
|
||||||
name: 'updated_at',
|
|
||||||
type: 'datetime',
|
|
||||||
onUpdate: 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
updatedAt: Date | null
|
|
||||||
|
|
||||||
@ManyToOne(
|
|
||||||
() => Community,
|
|
||||||
(community) => community.federatedCommunities,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'public_key', referencedColumnName: 'publicKey' })
|
|
||||||
community?: Community
|
|
||||||
}
|
|
||||||
@ -1,209 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
DeleteDateColumn,
|
|
||||||
Entity,
|
|
||||||
Geometry,
|
|
||||||
JoinColumn,
|
|
||||||
ManyToOne,
|
|
||||||
OneToMany,
|
|
||||||
OneToOne,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { GeometryTransformer } from '../../src/typeorm/GeometryTransformer'
|
|
||||||
import { Community } from '../Community'
|
|
||||||
import { Contribution } from '../Contribution'
|
|
||||||
import { ContributionMessage } from '../ContributionMessage'
|
|
||||||
import { UserContact } from '../UserContact'
|
|
||||||
import { UserRole } from '../UserRole'
|
|
||||||
|
|
||||||
@Entity('users', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
|
||||||
export class User extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ type: 'bool', default: false })
|
|
||||||
foreign: boolean
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'gradido_id',
|
|
||||||
type: 'char',
|
|
||||||
length: 36,
|
|
||||||
nullable: false,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
gradidoID: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'community_uuid',
|
|
||||||
type: 'char',
|
|
||||||
length: 36,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
communityUuid: string
|
|
||||||
|
|
||||||
@ManyToOne(
|
|
||||||
() => Community,
|
|
||||||
(community) => community.users,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'community_uuid', referencedColumnName: 'communityUuid' })
|
|
||||||
community: Community | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'alias',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 20,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
alias: string
|
|
||||||
|
|
||||||
@OneToOne(
|
|
||||||
() => UserContact,
|
|
||||||
(emailContact: UserContact) => emailContact.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'email_id' })
|
|
||||||
emailContact: UserContact
|
|
||||||
|
|
||||||
@Column({ name: 'email_id', type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
emailId: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'first_name',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
firstName: string
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'last_name',
|
|
||||||
type: 'varchar',
|
|
||||||
length: 255,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
lastName: string
|
|
||||||
|
|
||||||
@Column({ name: 'gms_publish_name', type: 'int', unsigned: true, nullable: false, default: 0 })
|
|
||||||
gmsPublishName: number
|
|
||||||
|
|
||||||
@Column({ name: 'humhub_publish_name', type: 'int', unsigned: true, nullable: false, default: 0 })
|
|
||||||
humhubPublishName: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'created_at',
|
|
||||||
type: 'datetime',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@DeleteDateColumn({ name: 'deleted_at', type: 'datetime', nullable: true })
|
|
||||||
deletedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ type: 'bigint', default: 0, unsigned: true })
|
|
||||||
password: BigInt
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'password_encryption_type',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: false,
|
|
||||||
default: 0,
|
|
||||||
})
|
|
||||||
passwordEncryptionType: number
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: 'varchar',
|
|
||||||
length: 4,
|
|
||||||
default: 'de',
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
language: string
|
|
||||||
|
|
||||||
@Column({ type: 'bool', default: false })
|
|
||||||
hideAmountGDD: boolean
|
|
||||||
|
|
||||||
@Column({ type: 'bool', default: false })
|
|
||||||
hideAmountGDT: boolean
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => UserRole,
|
|
||||||
(userRole) => userRole.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
userRoles: UserRole[]
|
|
||||||
|
|
||||||
@Column({ name: 'referrer_id', type: 'bigint', unsigned: true, nullable: true, default: null })
|
|
||||||
referrerId?: number | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'contribution_link_id',
|
|
||||||
type: 'bigint',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
contributionLinkId?: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'publisher_id', type: 'bigint', unsigned: true, default: 0 })
|
|
||||||
publisherId: number
|
|
||||||
|
|
||||||
@Column({ name: 'gms_allowed', type: 'bool', default: true })
|
|
||||||
gmsAllowed: boolean
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'location',
|
|
||||||
type: 'geometry',
|
|
||||||
default: null,
|
|
||||||
nullable: true,
|
|
||||||
transformer: GeometryTransformer,
|
|
||||||
})
|
|
||||||
location: Geometry | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'gms_publish_location',
|
|
||||||
type: 'int',
|
|
||||||
unsigned: true,
|
|
||||||
nullable: false,
|
|
||||||
default: 2,
|
|
||||||
})
|
|
||||||
gmsPublishLocation: number
|
|
||||||
|
|
||||||
@Column({ name: 'gms_registered', type: 'bool', default: false })
|
|
||||||
gmsRegistered: boolean
|
|
||||||
|
|
||||||
@Column({ name: 'gms_registered_at', type: 'datetime', default: null, nullable: true })
|
|
||||||
gmsRegisteredAt: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'humhub_allowed', type: 'bool', default: false })
|
|
||||||
humhubAllowed: boolean
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => Contribution,
|
|
||||||
(contribution) => contribution.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
contributions?: Contribution[]
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => ContributionMessage,
|
|
||||||
(message) => message.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
messages?: ContributionMessage[]
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => UserContact,
|
|
||||||
(userContact: UserContact) => userContact.user,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'user_id' })
|
|
||||||
userContacts?: UserContact[]
|
|
||||||
}
|
|
||||||
@ -1,95 +0,0 @@
|
|||||||
import {
|
|
||||||
BaseEntity,
|
|
||||||
Column,
|
|
||||||
CreateDateColumn,
|
|
||||||
Entity,
|
|
||||||
Geometry,
|
|
||||||
JoinColumn,
|
|
||||||
OneToMany,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
UpdateDateColumn,
|
|
||||||
} from 'typeorm'
|
|
||||||
import { GeometryTransformer } from '../../src/typeorm/GeometryTransformer'
|
|
||||||
import { FederatedCommunity } from '../FederatedCommunity'
|
|
||||||
import { User } from '../User'
|
|
||||||
|
|
||||||
@Entity('communities')
|
|
||||||
export class Community extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'foreign', type: 'bool', nullable: false, default: true })
|
|
||||||
foreign: boolean
|
|
||||||
|
|
||||||
@Column({ name: 'url', type: 'varchar', length: 255, nullable: false })
|
|
||||||
url: string
|
|
||||||
|
|
||||||
@Column({ name: 'public_key', type: 'binary', length: 32, nullable: false })
|
|
||||||
publicKey: Buffer
|
|
||||||
|
|
||||||
@Column({ name: 'private_key', type: 'binary', length: 64, nullable: true })
|
|
||||||
privateKey: Buffer | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'community_uuid',
|
|
||||||
type: 'char',
|
|
||||||
length: 36,
|
|
||||||
nullable: true,
|
|
||||||
collation: 'utf8mb4_unicode_ci',
|
|
||||||
})
|
|
||||||
communityUuid: string | null
|
|
||||||
|
|
||||||
@Column({ name: 'authenticated_at', type: 'datetime', nullable: true })
|
|
||||||
authenticatedAt: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'name', type: 'varchar', length: 40, nullable: true })
|
|
||||||
name: string | null
|
|
||||||
|
|
||||||
@Column({ name: 'description', type: 'varchar', length: 255, nullable: true })
|
|
||||||
description: string | null
|
|
||||||
|
|
||||||
@CreateDateColumn({ name: 'creation_date', type: 'datetime', nullable: true })
|
|
||||||
creationDate: Date | null
|
|
||||||
|
|
||||||
@Column({ name: 'gms_api_key', type: 'varchar', length: 512, nullable: true, default: null })
|
|
||||||
gmsApiKey: string | null
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
name: 'location',
|
|
||||||
type: 'geometry',
|
|
||||||
default: null,
|
|
||||||
nullable: true,
|
|
||||||
transformer: GeometryTransformer,
|
|
||||||
})
|
|
||||||
location: Geometry | null
|
|
||||||
|
|
||||||
@CreateDateColumn({
|
|
||||||
name: 'created_at',
|
|
||||||
type: 'datetime',
|
|
||||||
default: () => 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: false,
|
|
||||||
})
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@UpdateDateColumn({
|
|
||||||
name: 'updated_at',
|
|
||||||
type: 'datetime',
|
|
||||||
onUpdate: 'CURRENT_TIMESTAMP(3)',
|
|
||||||
nullable: true,
|
|
||||||
})
|
|
||||||
updatedAt: Date | null
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => User,
|
|
||||||
(user) => user.community,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'community_uuid', referencedColumnName: 'communityUuid' })
|
|
||||||
users: User[]
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => FederatedCommunity,
|
|
||||||
(federatedCommunity) => federatedCommunity.community,
|
|
||||||
)
|
|
||||||
@JoinColumn({ name: 'public_key', referencedColumnName: 'publicKey' })
|
|
||||||
federatedCommunities?: FederatedCommunity[]
|
|
||||||
}
|
|
||||||
@ -1,28 +0,0 @@
|
|||||||
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
||||||
|
|
||||||
@Entity('project_brandings')
|
|
||||||
export class ProjectBranding extends BaseEntity {
|
|
||||||
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Column({ name: 'name', type: 'varchar', length: 255 })
|
|
||||||
name: string
|
|
||||||
|
|
||||||
@Column({ name: 'alias', type: 'varchar', length: 32 })
|
|
||||||
alias: string
|
|
||||||
|
|
||||||
@Column({ name: 'description', type: 'text', nullable: true, default: null })
|
|
||||||
description: string | null
|
|
||||||
|
|
||||||
@Column({ name: 'space_id', type: 'int', unsigned: true, nullable: true, default: null })
|
|
||||||
spaceId: number | null
|
|
||||||
|
|
||||||
@Column({ name: 'space_url', type: 'varchar', length: 255, nullable: true, default: null })
|
|
||||||
spaceUrl: string | null
|
|
||||||
|
|
||||||
@Column({ name: 'new_user_to_space', type: 'tinyint', width: 1, default: 0 })
|
|
||||||
newUserToSpace: boolean
|
|
||||||
|
|
||||||
@Column({ name: 'logo_url', type: 'varchar', length: 255, nullable: true, default: null })
|
|
||||||
logoUrl: string | null
|
|
||||||
}
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
import { BaseEntity, Column, CreateDateColumn, Entity, PrimaryColumn } from 'typeorm'
|
|
||||||
|
|
||||||
@Entity('openai_threads')
|
|
||||||
export class OpenaiThreads extends BaseEntity {
|
|
||||||
@PrimaryColumn({ type: 'char', length: 30 })
|
|
||||||
id: string
|
|
||||||
|
|
||||||
@CreateDateColumn({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
|
|
||||||
createdAt: Date
|
|
||||||
|
|
||||||
@Column({ name: 'user_id', type: 'int', unsigned: true })
|
|
||||||
userId: number
|
|
||||||
}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
export { AdminPendingCreation } from './0035-admin_pending_creations_decimal/AdminPendingCreation'
|
|
||||||
@ -1 +1,97 @@
|
|||||||
export { Community } from './0086-add_community_location/Community'
|
import {
|
||||||
|
BaseEntity,
|
||||||
|
Column,
|
||||||
|
CreateDateColumn,
|
||||||
|
Entity,
|
||||||
|
Geometry,
|
||||||
|
JoinColumn,
|
||||||
|
OneToMany,
|
||||||
|
PrimaryGeneratedColumn,
|
||||||
|
UpdateDateColumn,
|
||||||
|
} from 'typeorm'
|
||||||
|
import { GeometryTransformer } from '../src/typeorm/GeometryTransformer'
|
||||||
|
import { FederatedCommunity } from './FederatedCommunity'
|
||||||
|
import { User } from './User'
|
||||||
|
|
||||||
|
@Entity('communities')
|
||||||
|
export class Community extends BaseEntity {
|
||||||
|
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
||||||
|
id: number
|
||||||
|
|
||||||
|
@Column({ name: 'foreign', type: 'bool', nullable: false, default: true })
|
||||||
|
foreign: boolean
|
||||||
|
|
||||||
|
@Column({ name: 'url', type: 'varchar', length: 255, nullable: false })
|
||||||
|
url: string
|
||||||
|
|
||||||
|
@Column({ name: 'public_key', type: 'binary', length: 32, nullable: false })
|
||||||
|
publicKey: Buffer
|
||||||
|
|
||||||
|
@Column({ name: 'private_key', type: 'binary', length: 64, nullable: true })
|
||||||
|
privateKey: Buffer | null
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
name: 'community_uuid',
|
||||||
|
type: 'char',
|
||||||
|
length: 36,
|
||||||
|
nullable: true,
|
||||||
|
collation: 'utf8mb4_unicode_ci',
|
||||||
|
})
|
||||||
|
communityUuid: string | null
|
||||||
|
|
||||||
|
@Column({ name: 'authenticated_at', type: 'datetime', precision: 3, nullable: true })
|
||||||
|
authenticatedAt: Date | null
|
||||||
|
|
||||||
|
@Column({ name: 'name', type: 'varchar', length: 40, nullable: true })
|
||||||
|
name: string | null
|
||||||
|
|
||||||
|
@Column({ name: 'description', type: 'varchar', length: 255, nullable: true })
|
||||||
|
description: string | null
|
||||||
|
|
||||||
|
@CreateDateColumn({ name: 'creation_date', type: 'datetime', precision: 3, nullable: true })
|
||||||
|
creationDate: Date | null
|
||||||
|
|
||||||
|
@Column({ name: 'gms_api_key', type: 'varchar', length: 512, nullable: true, default: null })
|
||||||
|
gmsApiKey: string | null
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
name: 'location',
|
||||||
|
type: 'geometry',
|
||||||
|
default: null,
|
||||||
|
nullable: true,
|
||||||
|
transformer: GeometryTransformer,
|
||||||
|
})
|
||||||
|
location: Geometry | null
|
||||||
|
|
||||||
|
@CreateDateColumn({
|
||||||
|
name: 'created_at',
|
||||||
|
type: 'datetime',
|
||||||
|
precision: 3,
|
||||||
|
default: () => 'CURRENT_TIMESTAMP(3)',
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
createdAt: Date
|
||||||
|
|
||||||
|
@UpdateDateColumn({
|
||||||
|
name: 'updated_at',
|
||||||
|
type: 'datetime',
|
||||||
|
precision: 3,
|
||||||
|
onUpdate: 'CURRENT_TIMESTAMP(3)',
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
updatedAt: Date | null
|
||||||
|
|
||||||
|
@OneToMany(
|
||||||
|
() => User,
|
||||||
|
(user) => user.community,
|
||||||
|
)
|
||||||
|
@JoinColumn({ name: 'community_uuid', referencedColumnName: 'communityUuid' })
|
||||||
|
users: User[]
|
||||||
|
|
||||||
|
@OneToMany(
|
||||||
|
() => FederatedCommunity,
|
||||||
|
(federatedCommunity) => federatedCommunity.community,
|
||||||
|
)
|
||||||
|
@JoinColumn({ name: 'public_key', referencedColumnName: 'publicKey' })
|
||||||
|
federatedCommunities?: FederatedCommunity[]
|
||||||
|
}
|
||||||
|
|||||||
@ -1 +1,118 @@
|
|||||||
export { Contribution } from './0078-move_resubmission_date/Contribution'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
import {
|
||||||
|
BaseEntity,
|
||||||
|
Column,
|
||||||
|
DeleteDateColumn,
|
||||||
|
Entity,
|
||||||
|
JoinColumn,
|
||||||
|
ManyToOne,
|
||||||
|
OneToMany,
|
||||||
|
OneToOne,
|
||||||
|
PrimaryGeneratedColumn,
|
||||||
|
} from 'typeorm'
|
||||||
|
import { DecimalTransformer } from '../src/typeorm/DecimalTransformer'
|
||||||
|
import { ContributionMessage } from './ContributionMessage'
|
||||||
|
import { Transaction } from './Transaction'
|
||||||
|
import { User } from './User'
|
||||||
|
|
||||||
|
@Entity('contributions')
|
||||||
|
export class Contribution extends BaseEntity {
|
||||||
|
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
||||||
|
id: number
|
||||||
|
|
||||||
|
@Column({ type: 'bigint', unsigned: true, nullable: false, name: 'user_id' })
|
||||||
|
userId: number
|
||||||
|
|
||||||
|
@ManyToOne(
|
||||||
|
() => User,
|
||||||
|
(user) => user.contributions,
|
||||||
|
)
|
||||||
|
@JoinColumn({ name: 'user_id' })
|
||||||
|
user: User
|
||||||
|
|
||||||
|
@Column({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP', name: 'created_at' })
|
||||||
|
createdAt: Date
|
||||||
|
|
||||||
|
@Column({ type: 'datetime', name: 'resubmission_at', default: null, nullable: true })
|
||||||
|
resubmissionAt: Date | null
|
||||||
|
|
||||||
|
@Column({ type: 'datetime', nullable: false, name: 'contribution_date' })
|
||||||
|
contributionDate: Date
|
||||||
|
|
||||||
|
@Column({ type: 'varchar', length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
||||||
|
memo: string
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
type: 'decimal',
|
||||||
|
precision: 40,
|
||||||
|
scale: 20,
|
||||||
|
nullable: false,
|
||||||
|
transformer: DecimalTransformer,
|
||||||
|
})
|
||||||
|
amount: Decimal
|
||||||
|
|
||||||
|
@Column({ type: 'bigint', unsigned: true, nullable: true, name: 'moderator_id' })
|
||||||
|
moderatorId: number
|
||||||
|
|
||||||
|
@Column({ type: 'bigint', unsigned: true, nullable: true, name: 'contribution_link_id' })
|
||||||
|
contributionLinkId: number
|
||||||
|
|
||||||
|
@Column({ type: 'bigint', unsigned: true, nullable: true, name: 'confirmed_by' })
|
||||||
|
confirmedBy: number
|
||||||
|
|
||||||
|
@Column({ type: 'datetime', nullable: true, name: 'confirmed_at' })
|
||||||
|
confirmedAt: Date
|
||||||
|
|
||||||
|
@Column({ type: 'bigint', unsigned: true, nullable: true, name: 'denied_by' })
|
||||||
|
deniedBy: number
|
||||||
|
|
||||||
|
@Column({ type: 'datetime', nullable: true, name: 'denied_at' })
|
||||||
|
deniedAt: Date
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
name: 'contribution_type',
|
||||||
|
type: 'varchar',
|
||||||
|
length: 12,
|
||||||
|
nullable: false,
|
||||||
|
collation: 'utf8mb4_unicode_ci',
|
||||||
|
})
|
||||||
|
contributionType: string
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
name: 'contribution_status',
|
||||||
|
type: 'varchar',
|
||||||
|
length: 12,
|
||||||
|
nullable: false,
|
||||||
|
collation: 'utf8mb4_unicode_ci',
|
||||||
|
})
|
||||||
|
contributionStatus: string
|
||||||
|
|
||||||
|
@Column({ type: 'bigint', unsigned: true, nullable: true, name: 'transaction_id' })
|
||||||
|
transactionId: number
|
||||||
|
|
||||||
|
@Column({ type: 'datetime', nullable: true, name: 'updated_at' })
|
||||||
|
updatedAt: Date
|
||||||
|
|
||||||
|
@Column({ type: 'bigint', nullable: true, unsigned: true, name: 'updated_by' })
|
||||||
|
updatedBy: number | null
|
||||||
|
|
||||||
|
@DeleteDateColumn({ type: 'datetime', name: 'deleted_at' })
|
||||||
|
deletedAt: Date | null
|
||||||
|
|
||||||
|
@DeleteDateColumn({ type: 'bigint', unsigned: true, nullable: true, name: 'deleted_by' })
|
||||||
|
deletedBy: number
|
||||||
|
|
||||||
|
@OneToMany(
|
||||||
|
() => ContributionMessage,
|
||||||
|
(message) => message.contribution,
|
||||||
|
)
|
||||||
|
@JoinColumn({ name: 'contribution_id' })
|
||||||
|
messages?: ContributionMessage[]
|
||||||
|
|
||||||
|
@OneToOne(
|
||||||
|
() => Transaction,
|
||||||
|
(transaction) => transaction.contribution,
|
||||||
|
)
|
||||||
|
@JoinColumn({ name: 'transaction_id' })
|
||||||
|
transaction?: Transaction | null
|
||||||
|
}
|
||||||
|
|||||||
@ -1 +1,88 @@
|
|||||||
export { ContributionLink } from './0038-add_contribution_links_table/ContributionLink'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
import { BaseEntity, Column, DeleteDateColumn, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
||||||
|
import { DecimalTransformer } from '../src/typeorm/DecimalTransformer'
|
||||||
|
|
||||||
|
@Entity('contribution_links')
|
||||||
|
export class ContributionLink extends BaseEntity {
|
||||||
|
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
||||||
|
id: number
|
||||||
|
|
||||||
|
@Column({ type: 'varchar', length: 100, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
||||||
|
name: string
|
||||||
|
|
||||||
|
@Column({ type: 'varchar', length: 255, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
||||||
|
memo: string
|
||||||
|
|
||||||
|
@Column({ name: 'valid_from', type: 'datetime', nullable: false })
|
||||||
|
validFrom: Date
|
||||||
|
|
||||||
|
@Column({ name: 'valid_to', type: 'datetime', nullable: true, default: null })
|
||||||
|
validTo: Date | null
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
type: 'decimal',
|
||||||
|
precision: 40,
|
||||||
|
scale: 20,
|
||||||
|
nullable: false,
|
||||||
|
transformer: DecimalTransformer,
|
||||||
|
})
|
||||||
|
amount: Decimal
|
||||||
|
|
||||||
|
@Column({ type: 'varchar', length: 12, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
||||||
|
cycle: string
|
||||||
|
|
||||||
|
@Column({ name: 'max_per_cycle', type: 'int', unsigned: true, nullable: false, default: 1 })
|
||||||
|
maxPerCycle: number
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
name: 'max_amount_per_month',
|
||||||
|
type: 'decimal',
|
||||||
|
precision: 40,
|
||||||
|
scale: 20,
|
||||||
|
nullable: true,
|
||||||
|
default: null,
|
||||||
|
transformer: DecimalTransformer,
|
||||||
|
})
|
||||||
|
maxAmountPerMonth: Decimal | null
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
name: 'total_max_count_of_contribution',
|
||||||
|
type: 'int',
|
||||||
|
unsigned: true,
|
||||||
|
nullable: true,
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
totalMaxCountOfContribution: number | null
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
name: 'max_account_balance',
|
||||||
|
type: 'decimal',
|
||||||
|
precision: 40,
|
||||||
|
scale: 20,
|
||||||
|
nullable: true,
|
||||||
|
default: null,
|
||||||
|
transformer: DecimalTransformer,
|
||||||
|
})
|
||||||
|
maxAccountBalance: Decimal | null
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
name: 'min_gap_hours',
|
||||||
|
type: 'int',
|
||||||
|
unsigned: true,
|
||||||
|
nullable: true,
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
minGapHours: number | null
|
||||||
|
|
||||||
|
@Column({ name: 'created_at', type: 'datetime', default: () => 'CURRENT_TIMESTAMP' })
|
||||||
|
createdAt: Date
|
||||||
|
|
||||||
|
@DeleteDateColumn({ name: 'deleted_at', type: 'datetime' })
|
||||||
|
deletedAt: Date | null
|
||||||
|
|
||||||
|
@Column({ type: 'varchar', length: 24, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
||||||
|
code: string
|
||||||
|
|
||||||
|
@Column({ name: 'link_enabled', type: 'boolean', default: true })
|
||||||
|
linkEnabled: boolean
|
||||||
|
}
|
||||||
|
|||||||
@ -1 +1,66 @@
|
|||||||
export { ContributionMessage } from './0078-move_resubmission_date/ContributionMessage'
|
import {
|
||||||
|
BaseEntity,
|
||||||
|
Column,
|
||||||
|
CreateDateColumn,
|
||||||
|
DeleteDateColumn,
|
||||||
|
Entity,
|
||||||
|
Index,
|
||||||
|
JoinColumn,
|
||||||
|
ManyToOne,
|
||||||
|
PrimaryGeneratedColumn,
|
||||||
|
UpdateDateColumn,
|
||||||
|
} from 'typeorm'
|
||||||
|
import { Contribution } from './Contribution'
|
||||||
|
import { User } from './User'
|
||||||
|
|
||||||
|
@Entity('contribution_messages', {
|
||||||
|
engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci',
|
||||||
|
})
|
||||||
|
export class ContributionMessage extends BaseEntity {
|
||||||
|
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
||||||
|
id: number
|
||||||
|
|
||||||
|
@Index()
|
||||||
|
@Column({ name: 'contribution_id', type: 'bigint', unsigned: true, nullable: false })
|
||||||
|
contributionId: number
|
||||||
|
|
||||||
|
@ManyToOne(
|
||||||
|
() => Contribution,
|
||||||
|
(contribution) => contribution.messages,
|
||||||
|
)
|
||||||
|
@JoinColumn({ name: 'contribution_id' })
|
||||||
|
contribution: Contribution
|
||||||
|
|
||||||
|
@Column({ name: 'user_id', type: 'bigint', unsigned: true, nullable: false })
|
||||||
|
userId: number
|
||||||
|
|
||||||
|
@ManyToOne(
|
||||||
|
() => User,
|
||||||
|
(user) => user.messages,
|
||||||
|
)
|
||||||
|
@JoinColumn({ name: 'user_id' })
|
||||||
|
user: User
|
||||||
|
|
||||||
|
@Column({ type: 'varchar', length: 2000, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
||||||
|
message: string
|
||||||
|
|
||||||
|
@CreateDateColumn()
|
||||||
|
@Column({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP', name: 'created_at' })
|
||||||
|
createdAt: Date
|
||||||
|
|
||||||
|
@UpdateDateColumn()
|
||||||
|
@Column({ type: 'datetime', default: null, nullable: true, name: 'updated_at' })
|
||||||
|
updatedAt: Date
|
||||||
|
|
||||||
|
@DeleteDateColumn({ name: 'deleted_at' })
|
||||||
|
deletedAt: Date | null
|
||||||
|
|
||||||
|
@Column({ name: 'deleted_by', type: 'bigint', default: null, unsigned: true, nullable: true })
|
||||||
|
deletedBy: number
|
||||||
|
|
||||||
|
@Column({ type: 'varchar', length: 12, nullable: false, collation: 'utf8mb4_unicode_ci' })
|
||||||
|
type: string
|
||||||
|
|
||||||
|
@Column({ name: 'is_moderator', type: 'bool', nullable: false, default: false })
|
||||||
|
isModerator: boolean
|
||||||
|
}
|
||||||
|
|||||||
@ -1 +1,43 @@
|
|||||||
export { DltTransaction } from './0070-add_dlt_transactions_table/DltTransaction'
|
import { BaseEntity, Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } from 'typeorm'
|
||||||
|
import { Transaction } from './Transaction'
|
||||||
|
|
||||||
|
@Entity('dlt_transactions', { engine: 'InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci' })
|
||||||
|
export class DltTransaction extends BaseEntity {
|
||||||
|
@PrimaryGeneratedColumn('increment', { unsigned: true })
|
||||||
|
id: number
|
||||||
|
|
||||||
|
@Column({ name: 'transactions_id', type: 'int', unsigned: true, nullable: false })
|
||||||
|
transactionId: number
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
name: 'message_id',
|
||||||
|
type: 'varchar',
|
||||||
|
length: 64,
|
||||||
|
nullable: true,
|
||||||
|
default: null,
|
||||||
|
collation: 'utf8mb4_unicode_ci',
|
||||||
|
})
|
||||||
|
messageId: string
|
||||||
|
|
||||||
|
@Column({ name: 'verified', type: 'bool', nullable: false, default: false })
|
||||||
|
verified: boolean
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
name: 'created_at',
|
||||||
|
type: 'datetime',
|
||||||
|
precision: 3,
|
||||||
|
default: () => 'CURRENT_TIMESTAMP(3)',
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
createdAt: Date
|
||||||
|
|
||||||
|
@Column({ name: 'verified_at', type: 'datetime', precision: 3, nullable: true, default: null })
|
||||||
|
verifiedAt: Date | null
|
||||||
|
|
||||||
|
@OneToOne(
|
||||||
|
() => Transaction,
|
||||||
|
(transaction) => transaction.dltTransaction,
|
||||||
|
)
|
||||||
|
@JoinColumn({ name: 'transactions_id' })
|
||||||
|
transaction?: Transaction | null
|
||||||
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user