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

export enum PageType {
    PRIVACY_POLICY = 'PRIVACY_POLICY',
    TERMS_OF_SERVICE = 'TERMS_OF_SERVICE',
    ABOUT_US = 'ABOUT_US',
    FAQS = 'FAQS',
}

@Schema({
    timestamps: {
        createdAt: 'created_at',
        updatedAt: 'updated_at',
    },
})
export class Pages extends Document {

    @Prop({ type: String })
    question: string;
    
    @Prop({ type: String })
    answere: string;
    
    @Prop({ type: String })
    title: string;

    @Prop({ type: String })
    description: string;

    @Prop({ type: String, enum: PageType, default: PageType.PRIVACY_POLICY })
    page_type: string;

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

export const PagesSchema = SchemaFactory.createForClass(Pages);