reapit / foundations

Foundations platform mono repo
57 stars 22 forks source link

PropertyId empty for appointment #6342

Closed Filip5991 closed 2 years ago

Filip5991 commented 2 years ago

Hello,

We use the /appointments/ endpoint to get a list of appointments, and for each appointment we then get the property by using the PropertyId provided inside the appointment object.

It was recently reported by a client, that a lot of the appointments processed have no property ID. It's a bit controversial because the client mentioned: "We then create the appointment from within the property. We do not attach a property to an MA, we generate the MA from the property record."

If we ping the /appointments/{id} after some time with the ID of the appointment that failed, the property ID is there. An example for this would be customer JWW, 03.03.2022 19:00 appointment id 'DAR2200757' had no property id. If I ping it today, I can see that it's property ID is 'DAR220155'.

Does the property ID need some time to show in the appointment, or is there anything you can think of that could be causing this? Thank you in advance!

AshDeeming commented 2 years ago

Hi @Filip5991

I'm not sure I fully understand the issue, however it could be that the appointment has been amended/property added after confirmation. I hope the below may also help; If you have Developer Edition of AgencyCloud, you will see that when (https://developers.reapit.cloud/desktop) creating an appointment, the typeID shows what type of appointment it is i.e. Viewing, Meeting, MA etc (the ID's for these may vary so can be called via the Configuration/appointmentTypes Endpoint)

These appointments can be associated with a Property and/or an Applicant/Contact/Landlord etc

Filip5991 commented 2 years ago

Hi @AshDeeming, Thank you for your reply :)

At certain times of the day we ping the /appointments/ endpoint to get all the appointments created (in our case market appraisals) for a customer. So as I said, on 03.03 at 19:00 we pulled all the appointments for customer JWW. When we went through the list of appointments some of them for some reason did not have a property id. If we were to pull that exact list today (11.03) all of the appointments will have a property ID.

We asked the customer if they maybe created the appointment first, and then after some time added the property to it. The customer replied: **This does not match with how Reapit works…. The property ID is set from as soon as the property record is created and can’t be modified at all for the lifetime of the record.

We then create the appointment from within the property. We do not attach a property to an MA, we generate the MA from the property record.

Example Fern Avenue, appointment created 1 min after property record created (well created and pressed save). https://prnt.sc/F9RKwc3Ee2w7**

To summarize this, my question is why/how do some appointments (market appraisals) have no property ID at first, but then get it after some time, if we assume that appointments are created from properties instantly, as the customer claims?

github-actions[bot] commented 2 years ago

This issue has been updated and moved to our ‘Near Term’ column (typically completed within 1 - 4 months). We have assessed the effort required and outlined a technical specification - please take the time to review this detail. When we're ready to schedule the issue, it will be assigned to the relevant board where you can continue to track its progress to completion. For more information on our processes, please click here

plittlewood-rpt commented 2 years ago

Hi @Filip5991 - the behaviour you are describing is very odd indeed. It's worth noting that it is actually possible to remove the association to a property after the appointment has been created, but I don't expect that to be being done here. I'll see if our database team can find any logs for these entries that we can try and use to understand what happened here.

Filip5991 commented 2 years ago

Thank you @plittlewood-rpt . If needed I can supply more examples, I was just checking a market appraisal booked on the 21st of March that does not have the property ID in it.

plittlewood-rpt commented 2 years ago

Thanks - if this is happening right now please can you give me the appointment id?

Filip5991 commented 2 years ago

Unfortunately it is not happening right now, it was booked on 21/03/2022 15:46:39, and pinged through the /appointments/ endpoint on 21/03/2022 16:00. The property ID was empty back then, but it is not empty anymore In case useful the appointment id was LNL2200260

plittlewood-rpt commented 2 years ago

Hi @Filip5991 - was that a different customer of the same one?

Filip5991 commented 2 years ago

Hi @plittlewood-rpt , the last one I sent (LNL2200260) was a different customer - WEB (Webbers)

plittlewood-rpt commented 2 years ago

Hi @Filip5991 - I've asked our infra team to do the same log checks for the latest example to see if it's the same issue and will come back to you as soon as I can

Filip5991 commented 2 years ago

Hi @plittlewood-rpt , just letting you know that this is a similar, but not the same issue. The appointments are present in the endpoint in this case, but their property ID is empty...So I'm not sure if the entry type could be the problem here, but thanks for checking anyway!

plittlewood-rpt commented 2 years ago

Yep understood - a property can be added after the appointment is initially saved. The logs should hopefully clear up the events here.

plittlewood-rpt commented 2 years ago

Hi @Filip5991 - I'm afraid we don't have the logs that go far enough back for the examples on this ticket. Do you have any other recent examples we could look at?

Filip5991 commented 2 years ago

Hi @plittlewood-rpt , here's an example from yesterday (30.03) Customer GTH: MA ID: STL2200080 Property ID: empty Created: 30/03/2022 08:27:23 /appointments endpoint pinged at 11:00 (30.03) MA ID: SHE2200942 Property ID: empty Created: 30/03/2022 09:37:06 /appointments endpoint pinged at 11:00 (30.03) MA ID: SHE2200943 Property ID: empty Created: 30/03/2022 09:37:39 /appointments endpoint pinged at 11:00 (30.03) MA ID: DOR220846 Property ID: DOR220073 Created: 30/03/2022 09:45:58 /appointments endpoint pinged at 11:00 (30.03) 3 of the MA's (appointments) did not have a property id, and I'm adding 1 that had in case useful

And another example from today: (31.03) Customer BGR: MA ID: GRA2201221 Property ID: empty Created: 31/03/2022 12:05:14 /appointments endpoint pinged at 14:00 (31.03) MA ID: GRA2201222 Property ID: empty Created: 31/03/2022 12:05:38 /appointments endpoint pinged at 14:00 (31.03)

plittlewood-rpt commented 2 years ago

Thanks - can I just confirm the second customer id. We don't seem to have a customer using that code.

Filip5991 commented 2 years ago

Ops, apologies, my bad, should be BGR instead

Filip5991 commented 2 years ago

Hi @plittlewood-rpt , I was wondering if there was any update on this? I can see it being moved to B&S55, but not sure if that's this week? Thank you in advance :-)

plittlewood-rpt commented 2 years ago

Hi @Filip5991 - Im' just waiting on log data back from our internal infrastructure team. Once I have this I should be able to get further with this ticket.

plittlewood-rpt commented 2 years ago

Hi @Filip5991 - do you have any examples for BGR in the last 3 days? As our database servers are so busy the logs get purged regularly and I'm reliant on a different team getting hold of them. I've asked for logs for the last 3 days for this customer so I should have a good chance of catching another example

Filip5991 commented 2 years ago

Hi @plittlewood-rpt , unfortunately I don't. This only happens intermittently, and no appointments failed because of it in the last 4 days. If it helps, I can find examples from other customers...

plittlewood-rpt commented 2 years ago

Hi @Filip5991 - I've just managed to get hold of the logs for the BGR examples from 31/03 and can confirm that they were both added without a property id set. I've done some further digging into the first example (GRA2201221) and I think this is down to business processes at the various agents. The property attached to this appointment wasn't registered until 1st April so it looks like they are adding valuations to the diary but not actually setting up the property unless the appointment goes ahead. Only the customer could confirm that behaviour I'm afraid. I'm confident that the appointments API is doing what it should be, as all that does is read the property id from the appointment entity in the database which is either there or it's not - there's no in between as it's stored in the same record as the rest of the appointment data, which is being returned.