mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
39 lines
1.3 KiB
TypeScript
39 lines
1.3 KiB
TypeScript
import { CommunityHandshakeStateType } from '../enum'
|
|
import { BaseEntity, Column, CreateDateColumn, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'
|
|
import { FederatedCommunity } from './FederatedCommunity'
|
|
|
|
@Entity('community_handshake_states')
|
|
export class CommunityHandshakeState extends BaseEntity {
|
|
@PrimaryGeneratedColumn({ unsigned: true })
|
|
id: number
|
|
|
|
@Column({ name: 'handshake_id', type: 'int', unsigned: true })
|
|
handshakeId: number
|
|
|
|
@Column({ name: 'one_time_code', type: 'int', unsigned: true })
|
|
oneTimeCode: number
|
|
|
|
@Column({ name: 'public_key', type: 'binary', length: 32 })
|
|
publicKey: Buffer
|
|
|
|
@Column({
|
|
type: 'varchar',
|
|
length: 255,
|
|
default: CommunityHandshakeStateType.OPEN_CONNECTION,
|
|
nullable: false,
|
|
})
|
|
status: CommunityHandshakeStateType
|
|
|
|
@Column({ name: 'last_error', type: 'text', nullable: true })
|
|
lastError?: string
|
|
|
|
@CreateDateColumn({ name: 'created_at', type: 'datetime', precision: 3 })
|
|
createdAt: Date
|
|
|
|
@UpdateDateColumn({ name: 'updated_at', type: 'datetime', precision: 3 })
|
|
updatedAt: Date
|
|
|
|
@ManyToOne(() => FederatedCommunity, (federatedCommunity) => federatedCommunity.communityHandshakeStates)
|
|
@JoinColumn({ name: 'public_key', referencedColumnName: 'publicKey' })
|
|
federatedCommunity: FederatedCommunity
|
|
} |