UNPKG

@jfln/marvin-db

Version:

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

65 lines (52 loc) 1.48 kB
import {Entity, Property, Enum} from '@mikro-orm/core' import {BasicUserEntity} from './BasicUserEntity' import {PunishmentTypes} from '../../types/Punishment.types' @Entity({tableName: 'users-punishment'}) export class UserPunishment extends BasicUserEntity { @Property() enable: boolean @Enum(() => PunishmentTypes) punishmentType: string @Property() reason: string @Property() userIdCreatedAt: string @Property() userIdUpdatedAt: string public setEnable(enable: boolean): UserPunishment { this.enable = enable return this } public setPunishmentType(punishmentType: PunishmentTypes): UserPunishment { this.punishmentType = punishmentType return this } public setReason(reason: string): UserPunishment { this.reason = reason return this } public setUserIdCreatedAt(userIdCreatedAt: string): UserPunishment { this.userIdCreatedAt = userIdCreatedAt return this } public setUserIdUpdatedAt(userIdUpdatedAt: string): UserPunishment { this.userIdUpdatedAt = userIdUpdatedAt return this } constructor( guildId: string, userId: string, enable: boolean, punishmentType: PunishmentTypes, reason: string, userIdCreatedAt: string, userIdUpdatedAt: string, ) { super(guildId, userId) this.enable = enable this.punishmentType = punishmentType this.reason = reason this.userIdCreatedAt = userIdCreatedAt this.userIdUpdatedAt = userIdUpdatedAt } }