reapit / foundations

Foundations platform mono repo
57 stars 21 forks source link

Journal Entries does not support client custom journal entries #9726

Closed raymond2323 closed 1 year ago

raymond2323 commented 1 year ago

Trying to create Journal Entries for YOM-GNHM via the API endpoint.

We are told that the client has Journal Entries of the following type TA and OF created in the system, however, when we create a journal entry we get the following error:

{"errors":[{"field":"typeId","message":"Unsupported typeId. The following typeIds can be used when creating a new journal entry: AL,LE,MA,MI,NQ,ON,TR,WO; Unsupported typeId. The following typeIds can be used when creating a new journal entry: AL,LE,MA,MI,NQ,ON,TR,WO"}],"statusCode":422,"dateTime":"2023-08-31T10:49:52.6278817Z","description":"One or more validation failures have occurred. Please refer to Errors list for details"},

Specification

github-actions[bot] commented 1 year ago

Thank you for taking the time to report a bug. We prioritise bugs depending on the severity and implications, so please ensure that you have provided as much information as possible. If you haven’t already, it really helps us to investigate the bug you have reported if you provide ‘Steps to Replicate’ and any associated screenshots. Please ensure any personal information from the production database is obscured when submitting screenshots. This issue will be reviewed in our weekly refinement sessions and assigned to a specific project board. We may also update the ticket to request additional information, if required. For more information on our processes, please click here

AshDeeming commented 1 year ago

Hi @raymond2323

Please confirm that you are using the below endpoint for each client as this will surface which types are available per client image

raymond2323 commented 1 year ago

Our expectation/understanding from the client is that those Journal Types are present in their Reapit system as they are also automatically triggered from Reapit Desktop currently and we are trying to replicate the same behaviour through API. Let me copy you in an email directly with the client so you can provide some clarity.

raymond2323 commented 1 year ago

@AshDeeming can you check the email I sent yesterday?

plittlewood-rpt commented 1 year ago

Hi @raymond2323. A number of the journal entries are system generated, and as such it's deliberate that you cannot POST a journal entry with certain types. The error message returned contains the list of type ids you can post with, but you may well have use cases where you need to write additional entry types (OF I think is Offer Note, which would be a good example here). If you can give us some more clarity around your use case it may be that we just need to update the allow list. For reference we are also actively working on improving the system generated entries.

raymond2323 commented 1 year ago

@plittlewood-rpt

It feels like we are going in circles here. I hope you can help with some resolution from your end.

The issue we have with all franchises from this agent is that these specific journal entries dictate company-level reporting, which is critical for this agent. When creating Tenancies via the Desktop app (i.e. not API) the reapit system creates custom Journal entries at various states. When creating Tenancies via the API with the relevant states, the journal entries are not being created. As such, we were told by your team that the API won't trigger these journal entries and we will have to replicate them via the POST journal entry endpoint. Now we have done that but your system doesn't accept it. How can those journal entries get created if they are not (a) automatically triggered by our POST Tenancy call with the correct state or (b) if we manually replicate them?

plittlewood-rpt commented 1 year ago

HI @raymond2323 totally understand the impact this has on reporting. We have to be careful about which journal entry types we open up on the API because of the same reason. If we add the system generated events, which we are starting to do now as part of #9572 - which is building the foundations for this which will then be rolled out more widely - and also then allow third parties to manually create entries that should be system generated, you'll end up in a situation where there are duplicate reporting entries which has it's own obvious ramifications.

If you can advise which specific types you are needing to write, we can review your specific use case and decide on the best course of action. I think my note about the OF type id was incorrect above, so I'd need to check what that is (offer fallthrough possibly)

Thanks Pete

raymond2323 commented 1 year ago

@plittlewood-rpt

these are the two triggers that are currently needed, but I expect there might be a few more that the Agent requests.

Let me know if the below makes sense.

Journal Entry Triggers:

Trigger 1:

1.When does it Trigger?

When we create a Tenancy record in Reapit with status “offerPending”

2.The journal entry should will have the following wording:

New Tenancy offer of £ for by ; Status: Pending Offer

  1. The Journal entry type is:

‘OF’

Trigger 2:

1.When does it Trigger?

The status of the Tenancy is changed from offerPending to ArrangingTenancy

2.Journal should have the following wording:

Status of tenancy changed from Pending Offer to Arranging Tenancy with for

3.The Journal Entry type is:

“TA”

plittlewood-rpt commented 1 year ago

@raymond2323 thanks for this. We should be able to prioritise adding these system generated events, so please leave this with us.

raymond2323 commented 1 year ago

@plittlewood-rpt Okay would this mean that these journal types would automatically trigger so no requirement for us to do POST journal request?

Do you have a rough timeline for this, so I can let the agent know?

plittlewood-rpt commented 1 year ago

Yes that's correct - I will try to get this into the sprint starting next week, but if not we'll be able to get this into the following sprint, so a max of 4 weeks

plittlewood-rpt commented 1 year ago

Hi @raymond2323 this functionality is now available and system generated TA/OF entries will now be created at the appropriate points in the lifetime of a tenancy/lettings offer.

github-actions[bot] commented 1 year ago

It looks like you have commented on a closed issue. If your comment relates to a bug or feature request, please open a new issue, and include this issue number/url for reference. For more information on our processes, please click here