Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/ticket actions #3532

Merged
merged 12 commits into from
Feb 7, 2025
Merged

Feat/ticket actions #3532

merged 12 commits into from
Feb 7, 2025

Conversation

dpanta94
Copy link
Member

@dpanta94 dpanta94 commented Feb 6, 2025

🎫 Ticket

ETP-975

🗒️ Description

Adds some Hooks for our tickets!

This feature is needed as part of the Waitlist feature. The reason is the waitlist will need to process waitlist subscribers exactly based on these hooks we are adding here.

A quick description about them:

Listening for stock changes is being done through the updated meta data. All of our tickets are using the meta key _stock for that. Since this is a SINGLE field that way is ideal. As long as the rest of our codebase keeps the field updated (it should happen already) the listener is working ok.

Listening for ticket date start and date end is a bit more complicated.

We want to avoid having to query all of our tickets every X amount of time to determine this. => Why ? Not required load and not reliable. e.g. a ticket goes on sale in the X meantime we didnt check.

Additionally, this is a personal opinion, but the whole WP ecosystem is event based. So i like going with events as well.

The functionality works as:

A single action is bound to the date time each ticket start date will be reached. The same happens for the ticket's end date. Whenever each one of those datetimes is updated the actions are updated as well.

That allows when the action fires, anyone who listens for it to take action.

The code has been fully tested for what is being added. Also performed a test to evaluate the performance of such a process.

🎥 Artifacts

✔️ Checklist

  • Ran npm run changelog to add changelog file(s). More info here
  • Code is covered by NEW wpunit or integration tests.
  • Code is covered by EXISTING wpunit or integration tests.
  • Are all the required tests passing?
  • Automated code review comments are addressed.
  • Have you added Artifacts?
  • Check the base branch for your PR.
  • Add your PR to the project board for the release.

@dpanta94 dpanta94 self-assigned this Feb 6, 2025
@dpanta94 dpanta94 added the code review Status: requires a code review. label Feb 6, 2025
@dpanta94 dpanta94 requested review from lucatume and bordoni February 7, 2025 00:12
@dpanta94 dpanta94 force-pushed the feat/ticket-actions branch from b4422a7 to ff539ea Compare February 7, 2025 01:13
Copy link
Contributor

@lucatume lucatume left a comment

Choose a reason for hiding this comment

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

The code is good, I've proposed some changes that would not horribly alter its nature.

@dpanta94 dpanta94 merged commit 448a2db into bucket/waitlists Feb 7, 2025
20 of 21 checks passed
@dpanta94 dpanta94 deleted the feat/ticket-actions branch February 7, 2025 12:22
@dpanta94 dpanta94 removed the code review Status: requires a code review. label Feb 12, 2025
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