move-coop / parsons

A python library of connectors for the progressive community.
https://www.parsonsproject.org/
Other
257 stars 125 forks source link

[Bug] Error on apply_canvas_result() in VAN for lack of phone even though phone is provided #925

Closed retacg closed 6 months ago

retacg commented 7 months ago

The apply_canvas_result() method fails saying phone is needed even when phone is provided. It looks like there are many phone contacttypes that might require phone ever since VAN made the update to require phone numbers for phone contact types. There was a previous pr that only addressed the situation for a couple contacttypes - https://github.com/move-coop/parsons/issues/525 I am trying to load canvas results for contacttypeid = 19 (Auto Dial) and it is errorring saying that phone is now required.

I queried and looks like there are potentially a lot more contacttypes that we should include in the section of requiring phone but that are not documented in VAN's documentation as requiring phone...?

Screenshot 2023-11-22 at 10 19 38 AM

Detailed Description

When I try and load canvas results with the contacttypeid of 19, i get the error that

INFO The error was: HTTP error occurred (400): Bad Request, json: {'errors': [{'code': 'INVALID_PARAMETER', 'text': "'phone.phoneNumber' is required.", 'properties': ['canvassContext']}]}

To Reproduce

    van.apply_canvass_result(
        row['vanid'],
        result_code_id=row['resultid'], 
        date_canvassed=str(row['datecanvassed']),
        contact_type_id = 19,
        input_type_id=11,
        phone=str(row['phone'])
    )

Your Environment

Additional Context

Add any other context about the problem here.

Priority

medium/ high this is for a member that would like to be able to use a script using this parsons function!

mkrausse-ggtx commented 7 months ago

I have opened a PR that fixes this bug. #927

shaunagm commented 6 months ago

Closed by #927