-
Notifications
You must be signed in to change notification settings - Fork 42
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
Feat/ticket actions #3532
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b4422a7
to
ff539ea
Compare
lucatume
requested changes
Feb 7, 2025
There was a problem hiding this 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.
Co-authored-by: theAverageDev (Luca Tumedei) <[email protected]>
lucatume
approved these changes
Feb 7, 2025
8 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎫 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
npm run changelog
to add changelog file(s). More info herewpunit
orintegration
tests.wpunit
orintegration
tests.