mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
37 lines
807 B
TypeScript
37 lines
807 B
TypeScript
import { ObjectType, Field, Int } from 'type-graphql'
|
|
import { Community as CommunityEntity } from '@entity/Community'
|
|
|
|
@ObjectType()
|
|
export class Community {
|
|
constructor(entity: CommunityEntity) {
|
|
this.id = entity.id
|
|
this.iotaTopic = entity.iotaTopic
|
|
if (entity.rootPubkey) {
|
|
this.rootPublicKeyHex = entity.rootPubkey?.toString('hex')
|
|
}
|
|
this.foreign = entity.foreign
|
|
this.createdAt = entity.createdAt.toString()
|
|
if (entity.confirmedAt) {
|
|
this.confirmedAt = entity.confirmedAt.toString()
|
|
}
|
|
}
|
|
|
|
@Field(() => Int)
|
|
id: number
|
|
|
|
@Field(() => String)
|
|
iotaTopic: string
|
|
|
|
@Field(() => String)
|
|
rootPublicKeyHex?: string
|
|
|
|
@Field(() => Boolean)
|
|
foreign: boolean
|
|
|
|
@Field(() => String)
|
|
createdAt: string
|
|
|
|
@Field(() => String)
|
|
confirmedAt?: string
|
|
}
|