@jfln/marvin-db
Version:
biblioteca de objetos para normalizar o acesso a um banco mongo db
65 lines (52 loc) • 1.48 kB
text/typescript
import {Entity, Property, Enum} from '@mikro-orm/core'
import {BasicUserEntity} from './BasicUserEntity'
import {PunishmentTypes} from '../../types/Punishment.types'
export class UserPunishment extends BasicUserEntity {
enable: boolean
punishmentType: string
reason: string
userIdCreatedAt: string
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
}
}