Skip to content

Commit

Permalink
Merge pull request #172 from jamalsoueidan/create-user-with-minimal-info
Browse files Browse the repository at this point in the history
Remove customer profile fields from creation schema and service
  • Loading branch information
jamalsoueidan authored Jul 3, 2024
2 parents 148a0f5 + 7aacc79 commit 3b05a86
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 15 deletions.
4 changes: 0 additions & 4 deletions src/functions/customer/controllers/customer/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
10 changes: 1 addition & 9 deletions src/functions/customer/services/customer/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion src/functions/user/user.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/library/availability/generate-availability.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -102,6 +102,7 @@ describe("generateAvailability", () => {
UserModel.create({
customerId,
fullname: "jamal soueidan",
username: "jamal",
})
);

Expand Down

0 comments on commit 3b05a86

Please sign in to comment.