import { Model, Parent, Property, Unique } from "../../utils/decorators"
import { ApiModel } from "../api.entity"
import { User } from "./user.entity"

@Model({createTable: false})
@Unique('userId', 'comment')
export class Comment extends ApiModel {
    @Parent({ type: () => User, output: true })
    userId: string

    @Property({ nullable: false, output: true, validate: 'asString' })
    comment: string
}