Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ramiAbdou committed Sep 27, 2024
1 parent 2162728 commit 98166dc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
1 change: 0 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"./resumes/ui": "./src/modules/resume/resume.ui.tsx",
"./scholarships": "./src/modules/scholarship/scholarship.core.ts",
"./scholarships/ui": "./src/modules/scholarship/scholarship.ui.tsx",
"./shopify": "./src/modules/shopify.ts",
"./slack/server": "./src/modules/slack/index.server.ts"
},
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/modules/member/events/member-activated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import { job } from '@/infrastructure/bull/use-cases/job';
export async function onMemberActivated({
studentId,
}: GetBullJobData<'student.activated'>) {
const member = await db
const student = await db
.selectFrom('students')
.select(['email', 'firstName', 'id', 'lastName'])
.select(['email', 'firstName', 'id'])
.where('id', '=', studentId)
.executeTakeFirstOrThrow();

job('gamification.activity.completed', {
studentId: member.id,
studentId: student.id,
type: 'get_activated',
});
}
9 changes: 9 additions & 0 deletions packages/core/src/modules/shopify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ async function getOrCreateCustomer(

type GetCustomerByEmailResult = Result<{ id: number } | null>;

/**
* Retrieves a Shopify customer by email. This uses the underlying "search"
* endpoint w/ a custom query based on email.
*
* @param email - The email of the customer to retrieve.
* @returns A result object with the customer's ID, if found.
*
* @see https://shopify.dev/docs/api/admin-rest/2024-07/resources/customer#get-customers-search
*/
async function getCustomerByEmail(
email: string
): Promise<GetCustomerByEmailResult> {
Expand Down

0 comments on commit 98166dc

Please sign in to comment.