UNPKG

@jfln/marvin-db

Version:

biblioteca de objetos para normalizar o acesso a um banco mongo db

64 lines (51 loc) 1.32 kB
import {Entity, Property} from '@mikro-orm/core' import {BasicUserEntity} from './BasicUserEntity' @Entity({tableName: 'users-challenges'}) export class UserChallenge extends BasicUserEntity { @Property() acceptedData: Date @Property() challengeId: string @Property() fullfiled: boolean @Property() fullfiledDate: Date @Property() token: string public setAcceptedData(acceptedData: Date): UserChallenge { this.acceptedData = acceptedData return this } public setChallengeId(challengeId: string): UserChallenge { this.challengeId = challengeId return this } public setFullfiled(fullfiled: boolean): UserChallenge { this.fullfiled = fullfiled return this } public setFullfiledDate(fullfiledDate: Date): UserChallenge { this.fullfiledDate = fullfiledDate return this } public setToken(token: string): UserChallenge { this.token = token return this } constructor( guildId: string, userId: string, acceptedData: Date, challengeId: string, fullfiled: boolean, fullfiledDate: Date, token: string, ) { super(guildId, userId) this.acceptedData = acceptedData this.challengeId = challengeId this.fullfiled = fullfiled this.fullfiledDate = fullfiledDate this.token = token } }