Skip to content

[DRAFT] Checkout backend actions#56

Open
thomasballarddev wants to merge 2 commits intodevelopfrom
feature/49-backend-actions
Open

[DRAFT] Checkout backend actions#56
thomasballarddev wants to merge 2 commits intodevelopfrom
feature/49-backend-actions

Conversation

@thomasballarddev
Copy link
Copy Markdown

@thomasballarddev thomasballarddev commented Apr 18, 2026

Closes #49

Overview

{Summarize the goal of the ticket and the changes you made to reach that goal}

Testing

{Describe how you tested this feature. Manual testing and/or unit testing.}

Screenshots / Screencasts

{Screenshots or screen recording of your changes if this issue involves any frontend components or affects any frontend functionality.}

Checklist

  • Code is neat, readable, and works
  • Code is commented where appropriate and well-documented
  • Commit messages follow our guidelines
  • Issue number is linked
  • Branch is linked
  • Reviewers are assigned (one of your tech leads)

Tip: You can make the issue and then check them after the fact or replace [ ] with [x] to check it!

Notes

{Any issues/suggestions relating to the ticket, repo, assignments, TL duties; please mention here!}

…is branch (services enum, title, description, price, isactive, stripe product id, status). Added relationship of coach id to profile (will discuss). added stripeorderid to servicebookings. stripeorderid to coaching services.
@RenaudBernier RenaudBernier changed the base branch from main to dev April 19, 2026 15:01
@RenaudBernier RenaudBernier changed the title [DRAFT] Feature/49 backend actions [DRAFT] Checkout backend actions Apr 19, 2026
Comment thread app/checkout/actions.ts
Comment on lines +14 to +20
async function getDefaultPriceId(stripeProductId: string) {
const product = await stripe.products.retrieve(stripeProductId);
const defaultPrice = product.default_price;
if (typeof defaultPrice === "string") return defaultPrice;
return (defaultPrice as Stripe.Price | null)?.id ?? null;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should actions.ts only be for writes and maybe have a dedicated queries.ts for reads? also maybe we can use this instead?

https://github.com/hack4impact/mcld-project/pull/55/changes#diff-a1f48e30688a36b94c8e7eee51cc927f8e9ae87e7a37bf957a8db7bec0f672bbR196

Comment thread app/checkout/actions.ts
Comment on lines +62 to +64
const service = await db.query.services.findFirst({
where: eq(services.id, serviceId),
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread app/checkout/actions.ts
Comment on lines +123 to +125
const service = await db.query.services.findFirst({
where: eq(services.id, row.serviceId),
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as previous comment

@achneerov
Copy link
Copy Markdown

Honestly I would wait until this PR is merged #55, feels like life would be easier, then rebase onto dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants