I have a question did u make both? schema / interface for user?
import { HydratedDocument } from 'mongoose';
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
export type UserDocument = HydratedDocument<User>;
@Schema({
timestamps: true,
versionKey: false,
_id: false,
id: true,
autoIndex: true,
})
export class User {
@Prop({ required: true })
firstName: string;
@Prop({ required: true })
lastName: string;
@Prop({ required: true })
username: string;
@Prop({ required: true })
email: string;
@Prop({ required: true })
password: string;
}
export const UserSchema = SchemaFactory.createForClass(User);
``` did it is better when we make both? like user.interface.ts and user.schema.ts? while in the schema is not the createdAt and the updatedAt etc. to use typing later what other say here?