-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
Allow overriding participant_status_id in Order API #18096
Conversation
(Standard links)
|
@mattwire can we restrict this down to 'any pending status' I have a feeling is would be better to have other params like 'is_approved' and have the status calculated in-function. But we can consider that when we develop the apiv4 Order.api |
@eileenmcnaughton I'm not sure it makes sense to restrict the status. If you don't set it it will be one of two pending states and event cart requires another. However, I can see plenty of valid scenarios for creating participants as part of an order in various other states (eg. "On waitlist" or "Awaiting approval"). Or a scenario where you are adding a set of participant registrations, some free and some paid. The free ones you might set directly to "Registered" while the paid ones would be a pending state. The majority of participant parameters can currently pass through Order API without modification, it is only this one that was hardcoded. |
@mattwire so it looks like should accept 'Pending' or 'Waiting' statuses With regards to the scenario where there are multiple registrations - so you have a use case or is it hypothetical. I'd rather be stricter about Pending & open it up when we have a use case & a unit test so we can be sure the whole Order->create->payment->create flow works than to find it's hard to support later & have to block it later on (like we did with the top level Pending status for Order). |
Although I guess attended makes sense - I'd still rather wait until we have a use case before fully opening up because the whole Pending->completed flow is already fraught & I'd want to have the whole flow under tests before we broaden what we support. |
d397cef
to
13acdb1
Compare
13acdb1
to
0c5decd
Compare
@mattwire I guess the question is really how many tests you want to write as part of extending what we support in this api - we need to think about tests covering the whole flow - ie Order.create + Payment.create and checking
I'm comfortable that we have test cover for creating orders with a status of 'Pending from Pay later' and 'Pending from incomplete transaction' across the above. I don't think we have test cover for a mix of statuses and I don't really know what expectation we have for the flow where it is 'pending from waitlist'. I think I feel like we could treat 'Pending in cart' and 'Pending from approval' as synonyms for 'Pending from Incomplete transaction' and to support those 2 I think the only things that need to be done to the test for that are
If we add in other statuses / a mix of status types I'd want to make sure we clarify what we expect for those scenarios & look at tests covering the financial items as well as the above. |
6994bf4
to
bdf4404
Compare
@eileenmcnaughton Ok, I've restricted to pending - my main concern is it adds quite a bit of code to do this. We don't have pseudoconstant or API4 support for participantstatustype either and I'm well out of budget for looking at that (this came out of funding for the event cart work). I suggest you review the first commit first as that is a refactor only. |
@mattwire testAddOrderForParticipant relates - I'll take a look on Friday if that is sorted |
bdf4404
to
be5e3e1
Compare
Hmm, Test are passing locally |
I was gonna look at this today but CRM_Activity_Form_SearchTest.testSearch |
be5e3e1
to
b3bb427
Compare
I'm running PHP7.4 locally so have to use a patch for money_format.. which I accidently pushed up here. |
Ok - if this is passing tests tomorrow I'll review it & if I'm able to merge it I'll move on to look at your next 'has-test' PR |
Still failing - well I guess it's weekend for you. I'll move on to one of my other queues & check in on this on Friday |
@eileenmcnaughton I've separated the first (refactor) bit into #18306. Please review that first. Can you run the test in this PR locally and confirm if it passes or fails for you? I cannot get it to fail locally but it's failing every time when run on jenkins. The only difference I have is my PHP version at 7.4 |
Ok I'll try on Friday |
|
@mattwire The error message seems to be added in the same PR https://github.com/civicrm/civicrm-core/pull/18096/files#diff-844812cc11951c93d83a9779b5802b61R97
I think enabling this status on |
4c5506a
to
738c133
Compare
@eileenmcnaughton Tests now passing @jitendrapurohit Thanks for identifying the problem! |
@mattwire OK - I'll take a look once we've finished the completeOrder cleanup (my current definition of 'done' is the related open PRs closed & the weird wranglling for the no longer used variables out of the IPN classes so we don't have to figure that out all over again next time) |
test this please |
738c133
to
44b9a78
Compare
@seamuslee001 could you review the spec and scope and design first, then do a code and run review? |
@mattwire I'm happy for you to merge this if you squish the commits first |
44b9a78
to
62afd69
Compare
Thanks @eileenmcnaughton squashed and flagged merge on pass |
Overview
Allow overriding/specifying
participant_status_id
in Order API.Before
participant_status_id
is hardcoded.After
participant_status_id
can be specified in params to order API. Otherwise it will follow existing logic.Technical Details
Currently used by #17886 to specify "Pending in cart" as initial participant status.
Comments