@arsendoman/book-publisher-store
Version:
A Nest.js package for book publishing and storing
39 lines (29 loc) • 840 B
text/typescript
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import mongoose from 'mongoose';
import { Role } from './roles.schema';
import { BaseSchema } from './base.schema';
import { BookCategoryEnum } from '../../../core/enums/book.category.enum';
export type ProfileDocumnent = Profile & Document;
()
export class Profile extends BaseSchema {
()
username: string;
()
email: string;
()
password: string;
({ default: '' })
bio: string;
({ default: '' })
image: string;
({ type: mongoose.Schema.Types.ObjectId, ref: 'Role' })
role: Role;
({
type: [String],
enum: Object.values(BookCategoryEnum),
default: '',
required: true,
})
favoriteCategories: BookCategoryEnum[];
}
export const ProfileSchema = SchemaFactory.createForClass(Profile);