import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document, Types, HydratedDocument } from 'mongoose';
import moment from 'moment';
import { Workspace } from './workspace.model';
import { Users } from './user.schema';

export enum white_label_status {
    SUBMITTED = 'SUBMITTED',
    IN_REVIEW = 'IN_REVIEW',
    RESSOLVED = 'RESSOLVED'
}

@Schema()
export class whiteLabels extends Document {

    @Prop({ type: Types.ObjectId, ref: Users.name, default: null })
    user: Types.ObjectId = null

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

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

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

    @Prop({ type: String,  default: null })
    country_code: string
    
    @Prop({ type: String,  default: null })
    phone_no: string

    @Prop({ type: String, default: white_label_status.SUBMITTED  , enum: white_label_status })
    status: string

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

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

export const whiteLabelsSchema = SchemaFactory.createForClass(whiteLabels);