LemmaLegalConsulting / docassemble-GBLSLetters

Letter Suite for Greater Boston Legal Services.
https://www.gbls.org/
MIT License
0 stars 0 forks source link

Added CASLS retainer agreement #15

Closed h-mcguire closed 5 months ago

h-mcguire commented 7 months ago

This PR adds the docx and yml for the CASLS retainer agreement. It also makes necessary adjustments to attachment, objects, and bundles to produce document as output.

I also removed the attachment block from one of the yml for the plain_langauge_retainer per the Lemma Style Guide.

h-mcguire commented 6 months ago

I must have totally not tested this - sorry for committing broken code. I was trying to fix the ordering and gather problem (it's gathering the address's for attorney and client after signatures and without me asking for it in any code I wrote). I tried to do it by changing how complete_attribute for attorneys and clients was implemented. I used the [i] based on how the process was discussed in the documentation here.

I tried to just have complete_attribute defined only within the individual .yml but it didn't fix the gathering issue.

miabonardi commented 6 months ago

No worries!

You're working on an interview order block, and the link you sent is a question block (which is why they are working differently for you).

Check out how I've edited the example you're looking at to do something similar to what you're going for. You can run this in the playground by creating a new project, and naming the yml file.

objects:
  - location: |
      DAList.using(
        object_type=Address,
        there_are_any=True)
---
# main interview order
# only 1 mandatory True
mandatory: True
code: |
  location.gather()
  download
---
event: download
question: |
  The locations
subquestion: |
  % for loc in location:
  * ${ loc }
  % endfor
---
question: |
  What is the address of the
  ${ ordinal(i) } location?
fields:
  - Address: location[i].address
  - Unit: location[i].unit
    required: False
  - City: location[i].city
  - State: location[i].state
    code: |
      states_list()
  - Zip: location[i].zip
    required: False
---
question: |
  Would you like to add another location?
yesno: location.there_is_another

For troubleshooting why its asking for address even when the interview order and the template do not ask for it, on the page it asks for it, select developer information and scroll to the bottom and see why it's being called. A zip code might be required on download in AL, but we can figure it out if this is causing your issue.

h-mcguire commented 6 months ago

Thanks! I think it is about the download in AL. It calls CASLS_Retainer_Agreement['final'] and then looks for the clients address set that includes zip. For each variable in the set the interview would look for the object with "_label" after.

So it looked for clients[0].address.address and pulled up the question block that gathers that, then it looked for clients[0].address.address_label. Then it moved to another variable from the set doing the same thing, ending on clients[0].address.zip_label. Not sure if this is helpful or makes sense.

miabonardi commented 6 months ago

Can you commit the code that was getting this error?

h-mcguire commented 6 months ago

Just committed! The address gather problem also happens when you try to do other documents, see the no contact letter for a quick example.

In the CASLS Retainer there is also a problem where it seems like it is gathering legal_problems before clients[0].name.full despite it being after the name gather. Or more specifically, legal_problems use of ${ clients[0].name } is what triggers the name gather. If you click the dev mode when it gathers name it makes it seem like legal_problems is what triggers the question - not the main order block.

miabonardi commented 6 months ago

@nonprofittechy Is there a way to disable the collection of an address on download or preset it in AL?

nonprofittechy commented 6 months ago

Yes, look for the store_variable_snapshot line that is calling for users[0].address.zip

miabonardi commented 6 months ago

That's what I thought it was too, but couldn't find it when I looked. Will try again

nonprofittechy commented 6 months ago

That's what I thought it was too, but couldn't find it when I looked. Will try again

You can also use the icon in the playground to browse through mentions of any reference to users[0].address.address, and of course try the developer information button </> in the browser when you're running the interview.

image

miabonardi commented 6 months ago

I did that for store_variable_snapshot and found nothing. For users[0].address.address and users[0].address.zip only mentions are coming in from ql_baseline.yml. I wonder if something in the al_visual file could be causing this? Should this file be in this repo?

nonprofittechy commented 6 months ago

al_visual should be fine for this package. It definitely doesn't mention users[0].address.address

Possibly this could be coming from the work @tobyfey was doing on the legal server integration, but I can't think there's anything in the Assembly Line that would force the address to get gathered.

I think the court gathering used to trigger address, but I don't think it does for a year or more.

tobyfey commented 6 months ago

With GBLS, I also had users[0].address.address being called when it wasn't in the interview or the templates. It would be called during document production, so I assumed it was in the documents, and later realized it wasn't (after I added a code block that set it to GBLS main office).