Skip to content

Commit

Permalink
feat: introduced new field signUpMedium, signUpCampaign in member
Browse files Browse the repository at this point in the history
  • Loading branch information
navneethkrish committed Dec 4, 2024
1 parent d505948 commit 8b32942
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions apps/web-api/prisma/fixtures/members.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ const membersFactory = Factory.define<Omit<Member, 'id'>>(
updatedAt: faker.date.recent(),
locationUid: '',
signUpSource: faker.company.name(),
signUpCampaign: faker.company.name(),
signUpMedium: faker.company.name(),
isVerified: faker.datatype.boolean(),
isUserConsent: faker.datatype.boolean(),
isSubscribedToNewsletter: faker.datatype.boolean(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ ADD COLUMN "isVerified" BOOLEAN DEFAULT false,
ADD COLUMN "signUpSource" TEXT,
ADD COLUMN "isSubscribedToNewsletter" BOOLEAN DEFAULT false,
ADD COLUMN "isUserConsent" BOOLEAN DEFAULT false,
ADD COLUMN "teamOrProjectURL" TEXT;
ADD COLUMN "teamOrProjectURL" TEXT,
ADD COLUMN "signUpCampaign" TEXT,
ADD COLUMN "signUpMedium" TEXT;

-- Modify the "plnFriend" column to drop NOT NULL constraint
ALTER TABLE "Member"
Expand Down
2 changes: 2 additions & 0 deletions apps/web-api/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ model Member {
isFeatured Boolean? @default(false)
isVerified Boolean? @default(false)
signUpSource String?
signUpMedium String?
signUpCampaign String?
isUserConsent Boolean? @default(false)
isSubscribedToNewsletter Boolean? @default(false)
teamOrProjectURL String?
Expand Down
4 changes: 2 additions & 2 deletions apps/web-api/src/members/members.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,8 @@ export class MembersService {
'name', 'email', 'githubHandler', 'discordHandler', 'bio',
'twitterHandler', 'linkedinHandler', 'telegramHandler',
'officeHours', 'moreDetails', 'plnStartDate', 'openToWork',
'isVerified', 'signUpSource', 'isUserConsent', 'isSubscribedToNewsletter',
'teamOrProjectURL'
'isVerified', 'signUpSource', 'signUpMedium', 'signUpCampaign',
'isUserConsent', 'isSubscribedToNewsletter', 'teamOrProjectURL',
];
copyObj(memberData, member, directFields);
member.email = member.email.toLowerCase().trim();
Expand Down
2 changes: 2 additions & 0 deletions libs/contracts/src/schema/member.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ export const MemberSchema = z.object({
plnFriend: z.boolean().nullish(),
bio: z.string().nullish(),
signUpSource: z.string().nullish(),
signUpMedium: z.string().nullish(),
signUpCampaign: z.string().nullish(),
isFeatured: z.boolean().nullish(),
createdAt: z.string(),
updatedAt: z.string(),
Expand Down
2 changes: 2 additions & 0 deletions libs/contracts/src/schema/participants-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ const newDataMemberSchema = z.object({
projectContributions: z.array(ProjectContributionSchema as any).optional(),
bio: z.string().nullish(),
signUpSource: z.string().nullish(),
signUpMedium: z.string().nullish(),
signUpCampaign: z.string().nullish(),
isFeatured: z.boolean().nullish(),
locationUid: z.string().nullish(),
openToWork: z.boolean().nullish(),
Expand Down

0 comments on commit 8b32942

Please sign in to comment.