import { Exclude } from 'class-transformer'
import { ChatRole } from '../../chat-role/entities/chat-role.entity'
import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn } from 'typeorm'

@Entity()
export class Moments {
    @PrimaryGeneratedColumn()
    id: number

    @Column()
    userId: number

    @Column()
    messageId: string

    @Column()
    title: string

    @Column({ type: 'text' })
    content: string

    @Column({ default: 0 })
    commentNum: number

    @Column({ default: 0 })
    momentsLikeCount: number

    @Column({ default: false })
    isDel: boolean

    @Column({ default: true })
    isPush: boolean

    @CreateDateColumn()
    createdAt: Date

    @Exclude()
    chatRole: ChatRole

    @Exclude()
    isLiked: boolean = false

}