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

@Schema()
export class Documents extends Document {
  @Prop({ type: String, default: 'PDF' })
  type: string = null;

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

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

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

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

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

export const documentSchema = SchemaFactory.createForClass(Documents);
