import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import moment from 'moment';
import { Document } from 'mongoose';

export enum type {
    ABOUT_US = 'ABOUT_US',
    TERM_AND_CONDITION = 'TERM_AND_CONDITION',
    PRIVACY_POLICY = 'PRIVACY_POLICY',
    HELP_AND_SUPPORT = 'HELP_AND_SUPPORT'
}

@Schema()
export class Contents extends Document {

    @Prop({ default: null })
    image_url: string;

    @Prop({ type: String, enum: type, default: null })
    page_type: string;

    @Prop({ type: String, default: null })
    title: string;

    @Prop({ type: String, default: null })
    name: string;

    @Prop({ default: null })
    description: string;

    @Prop({ default: null })
    page_url: string;

    @Prop({ default: false })
    is_deleted: boolean;

    @Prop({ default: moment().utc().valueOf() })
    created_at: number;

    @Prop({ default: 0 })
    updated_at: number;
}

export const ContentsSchema = SchemaFactory.createForClass(Contents);