-
-
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
dev/core#2486 Add in FinancialItem APIv4 Entity #20433
dev/core#2486 Add in FinancialItem APIv4 Entity #20433
Conversation
(Standard links)
|
@seamuslee001 did you check in search kit if this works in terms of it being able to discover the joins? I think that with the other financial entities I had to do some metadata fixes to make them bridgeable |
Since this isn't a bridge entity, it should work ok with joins... except... |
Agree that this is not a bridge entity. I think the entity_table field shouldn't be required to have pseudoconstant like LineItem.entity_table or EntityFinancialTrxn.entity_table . Here entity_table holds civicrm_line_item|civicrm_financial_trxn |
If there are only 2 possibilities for the value of |
I think it's fine to go with a callback but it would be nice to be able to just put options in the xml when there are only a couple |
Maybe, but IMO we already have too many ways to define a pseudoconstant list. |
Currently we are able to do joins on entity_table as in $financialItems = \Civi\Api4\FinancialItem::get()
->setJoin([
['LineItem AS line_item', 'INNER', NULL, ['line_item.id', '=', 'entity_id'], ['entity_table', '=', "'civicrm_line_item'"]],
])
->execute(); But I am thinking how to declare psueduconstant for field which can dynamically extend to entity_table fields. I didn't find any such pseudoconstant declaration in xmls. How about:
and there would be callback function to expose the two table options on JOIN , SELECT and WHERE entity_id |
@monishdeb I think @colemanw is suggesting we stick with the approach in EntityFinancialTrxn
Note search kit can figure out the join for that table based on the metadata - ie you can search for 'contributions with financial transactions' & it figures out the join based on the metadata |
Ah right, didn't knw that. I have submitted a PR #20464 which adds the pseudoconstant callback for LineItem and FinancialItem entity_table. |
ok - I'm good to merge this then - the other just needs a pair of eyes fresher than mine to take a look - ideally before we fork |
Overview
Does what it says on the tin
Before
No APIv4 entity
After
APIv4 Entity
ping @eileenmcnaughton @JoeMurray @monishdeb