import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document, Types, HydratedDocument } from 'mongoose';
import moment from 'moment';
import { Workspace } from './workspace.model';
@Schema()
export class UserWorkspaces extends Document {

    @Prop({ type: Types.ObjectId, ref: Workspace.name, default: null })
    workspace_id: string

    @Prop({ type: Types.ObjectId, ref: "users", default: null })
    vendor_id: Types.ObjectId = null

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

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

export const userWorkspacesSchema = SchemaFactory.createForClass(UserWorkspaces);