diff --git a/src/functions/customer/controllers/customer/create.ts b/src/functions/customer/controllers/customer/create.ts index 36c55a72..0855f8da 100644 --- a/src/functions/customer/controllers/customer/create.ts +++ b/src/functions/customer/controllers/customer/create.ts @@ -15,10 +15,6 @@ export const CustomerControllerCreateSchema = UserZodSchema.pick({ customerId: true, fullname: true, username: true, - professions: true, - aboutMe: true, - aboutMeHtml: true, - shortDescription: true, gender: true, speaks: true, }).strip(); diff --git a/src/functions/customer/services/customer/create.ts b/src/functions/customer/services/customer/create.ts index dba89878..200fbdcd 100644 --- a/src/functions/customer/services/customer/create.ts +++ b/src/functions/customer/services/customer/create.ts @@ -2,15 +2,7 @@ import { User, UserModel } from "~/functions/user"; export type CustomerServiceCreateBody = Pick< User, - | "customerId" - | "fullname" - | "username" - | "professions" - | "aboutMe" - | "aboutMeHtml" - | "shortDescription" - | "gender" - | "speaks" + "customerId" | "fullname" | "username" | "gender" | "speaks" >; export const CustomerServiceCreate = async ( diff --git a/src/functions/user/user.schema.ts b/src/functions/user/user.schema.ts index 5ded7000..1c8d9647 100644 --- a/src/functions/user/user.schema.ts +++ b/src/functions/user/user.schema.ts @@ -37,13 +37,13 @@ export const UserMongooseSchema = new mongoose.Schema< specialties: { type: [String], default: [], - index: true, }, yearsExperience: Number, username: { type: String, unique: true, index: true, + required: true, }, fullname: String, email: String, //will be updated by shopify webhook diff --git a/src/library/availability/generate-availability.spec.ts b/src/library/availability/generate-availability.spec.ts index 36a43f78..ea891a92 100644 --- a/src/library/availability/generate-availability.spec.ts +++ b/src/library/availability/generate-availability.spec.ts @@ -4,8 +4,8 @@ import { SlotWeekDays } from "~/functions/schedule"; import { UserModel } from "~/functions/user/user.model"; import { getProductObject } from "../jest/helpers/product"; import { - GenerateAvailabilityProps, generateAvailability, + GenerateAvailabilityProps, } from "./generate-availability"; require("~/library/jest/mongoose/mongodb.jest"); @@ -102,6 +102,7 @@ describe("generateAvailability", () => { UserModel.create({ customerId, fullname: "jamal soueidan", + username: "jamal", }) );