diff --git a/libs/users/infrastructure/mongoose/src/lib/user.schema.ts b/libs/users/infrastructure/mongoose/src/lib/user.schema.ts index 1cc6d43..c195bcb 100644 --- a/libs/users/infrastructure/mongoose/src/lib/user.schema.ts +++ b/libs/users/infrastructure/mongoose/src/lib/user.schema.ts @@ -4,12 +4,18 @@ import { Document } from 'mongoose'; @Schema() export class UserDocument extends Document { // refactor: move match regex to a shared lib - @Prop({ required: true, unique: true, match: /^[^\s@]+@[^\s@]+\.[^\s@]+$/ }) + @Prop({ + required: true, + unique: true, + match: /^[^\s@]+@[^\s@]+\.[^\s@]+$/, + maxlength: 100, + }) email!: string; - @Prop({ required: false}) + @Prop({ required: false, default: null, maxlength: 100 }) firstName!: string; - @Prop({ required: false }) + + @Prop({ required: false, default: null, maxlength: 100 }) lastName!: string; }