Browse Source

Added info & rules for automatically generated forms

pull/172/head
Michael Olund 5 years ago
parent
commit
d389a337e1
4 changed files with 105 additions and 31 deletions
  1. +4
    -1
      edivorce/apps/core/models.py
  2. +78
    -26
      edivorce/apps/core/utils/cso_filing.py
  3. +5
    -4
      edivorce/apps/core/views/main.py
  4. +18
    -0
      vue/src/utils/forms.js

+ 4
- 1
edivorce/apps/core/models.py View File

@ -136,7 +136,7 @@ class Document(models.Model):
""" Initial image height (before rotation) """
width = models.IntegerField(default=0)
""" Initial image width (before rotation) """
""" Initial image width (before rotation) """
bceid_user = models.ForeignKey(BceidUser, related_name='uploads', on_delete=models.CASCADE)
""" User who uploaded the attachment """
@ -152,8 +152,11 @@ class Document(models.Model):
'EFSS': "Electronic Filing Statement (F96)",
'MC': "Proof of Marriage",
'NCV': "Identification of Applicant (VSA 512)",
'NJF': "Notice of Joint Family Claim (F1)",
'OFI': "Draft Final Order Form (F52)",
'RCP': "Certificate of Pleadings Form (F36)",
'RDP': "Registration of Joint Divorce Proceedings (JUS280)",
'RFO': "Requisition Form (F35)"
}
class Meta:


+ 78
- 26
edivorce/apps/core/utils/cso_filing.py View File

@ -7,7 +7,7 @@ from edivorce.apps.core.utils.derived import get_derived_data
def file_documents(user, responses, initial=False):
forms = forms_to_file(responses, initial)
(forms, _) = forms_to_file(responses, initial)
missing_forms = []
for form in forms:
docs = Document.objects.filter(bceid_user=user, doc_type=form['doc_type'], party_code=form.get('party_code', 0))
@ -53,40 +53,92 @@ def _save_response(user, question, value):
def forms_to_file(responses_dict, initial=False):
forms = []
generated = []
uploaded = []
how_to_file = responses_dict.get('how_to_file')
how_to_sign = responses_dict.get('how_to_sign')
signing_location_both = responses_dict.get('signing_location') if how_to_sign == 'Together' else None
signing_location_you = responses_dict.get('signing_location_you') if how_to_sign == 'Separately' else None
signing_location_spouse = responses_dict.get('signing_location_spouse') if how_to_sign == 'Separately' else None
derived = responses_dict.get('derived', get_derived_data(responses_dict))
if initial:
forms.append({'doc_type': 'MC', 'party_code': 0})
how_to_sign = responses_dict.get('how_to_sign')
signing_location_both = responses_dict.get('signing_location') if how_to_sign == 'Together' else None
signing_location_you = responses_dict.get('signing_location_you') if how_to_sign == 'Separately' else None
signing_location_spouse = responses_dict.get('signing_location_spouse') if how_to_sign == 'Separately' else None
if initial:
generated.append({'doc_type': 'NJF', 'form_number': 1})
uploaded.append({'doc_type': 'MC', 'party_code': 0})
if signing_location_both == 'In-person' or signing_location_you == 'In-person':
forms.append({'doc_type': 'AFTL', 'party_code': 0})
forms.append({'doc_type': 'RDP', 'party_code': 0})
# at least one claimant is signing with a commissioner
uploaded.append({'doc_type': 'AFTL', 'party_code': 0})
uploaded.append({'doc_type': 'RDP', 'party_code': 0})
elif signing_location_you == 'Virtual' and signing_location_spouse == 'In-person':
forms.append({'doc_type': 'AFTL', 'party_code': 0})
forms.append({'doc_type': 'OFI', 'party_code': 0})
forms.append({'doc_type': 'EFSS', 'party_code': 1})
forms.append({'doc_type': 'RDP', 'party_code': 0})
# claimant 1 is signing virtually and claimant 2 is not
generated.append({'doc_type': 'RFO', 'form_number': 35})
generated.append({'doc_type': 'RCP', 'form_number': 36})
uploaded.append({'doc_type': 'AFTL', 'party_code': 0})
uploaded.append({'doc_type': 'OFI', 'party_code': 0})
uploaded.append({'doc_type': 'EFSS', 'party_code': 1})
uploaded.append({'doc_type': 'RDP', 'party_code': 0})
if derived['has_children_of_marriage']:
forms.append({'doc_type': 'AAI', 'party_code': 0})
uploaded.append({'doc_type': 'AAI', 'party_code': 0})
if derived['wants_other_orders'] and responses_dict.get('name_change_you') == 'YES':
forms.append({'doc_type': 'NCV', 'party_code': 1})
uploaded.append({'doc_type': 'NCV', 'party_code': 1})
elif signing_location_both == 'Virtual' or (signing_location_you == 'Virtual' and signing_location_spouse == 'Virtual'):
forms.append({'doc_type': 'AFTL', 'party_code': 0})
forms.append({'doc_type': 'OFI', 'party_code': 0})
forms.append({'doc_type': 'EFSS', 'party_code': 1})
forms.append({'doc_type': 'EFSS', 'party_code': 2})
forms.append({'doc_type': 'RDP', 'party_code': 0})
# both parties (either together or separately) are signing virtually
generated.append({'doc_type': 'RFO', 'form_number': 35})
generated.append({'doc_type': 'RCP', 'form_number': 36})
uploaded.append({'doc_type': 'AFTL', 'party_code': 0})
uploaded.append({'doc_type': 'OFI', 'party_code': 0})
uploaded.append({'doc_type': 'EFSS', 'party_code': 1})
uploaded.append({'doc_type': 'EFSS', 'party_code': 2})
uploaded.append({'doc_type': 'RDP', 'party_code': 0})
if derived['has_children_of_marriage']:
uploaded.append({'doc_type': 'AAI', 'party_code': 0})
if derived['wants_other_orders'] and responses_dict.get('name_change_you') == 'YES':
uploaded.append({'doc_type': 'NCV', 'party_code': 1})
if derived['wants_other_orders'] and responses_dict.get('name_change_spouse') == 'YES':
uploaded.append({'doc_type': 'NCV', 'party_code': 2})
else:
return ([], [])
else: # Final Filing
if signing_location_both == 'Virtual':
# if both parties have signed virtually and signing together
if derived['has_children_of_marriage']:
uploaded.append({'doc_type': 'CSA', 'party_code': 0})
uploaded.append({'doc_type': 'AFDO', 'party_code': 0})
elif signing_location_you == 'Virtual' and signing_location_spouse == 'Virtual':
# both parties have signed virtually and signing separately
if derived['has_children_of_marriage']:
forms.append({'doc_type': 'AAI', 'party_code': 0})
uploaded.append({'doc_type': 'CSA', 'party_code': 1})
uploaded.append({'doc_type': 'AFDO', 'party_code': 1})
if derived['has_children_of_marriage']:
uploaded.append({'doc_type': 'CSA', 'party_code': 2})
uploaded.append({'doc_type': 'AFDO', 'party_code': 2})
elif (signing_location_both == 'In-person' or signing_location_you == 'In-person' or signing_location_spouse == 'In-person') and how_to_file == 'Online':
# at least one party has signed with a commissioner and Filing Online
generated.append({'doc_type': 'RFO', 'form_number': 35})
generated.append({'doc_type': 'RCP', 'form_number': 36})
if derived['has_children_of_marriage']:
uploaded.append({'doc_type': 'CSA', 'party_code': 0})
uploaded.append({'doc_type': 'AFDO', 'party_code': 0})
uploaded.append({'doc_type': 'OFI', 'party_code': 0})
uploaded.append({'doc_type': 'EFSS', 'party_code': 1})
uploaded.append({'doc_type': 'EFSS', 'party_code': 2})
uploaded.append({'doc_type': 'AII', 'party_code': 0})
if derived['wants_other_orders'] and responses_dict.get('name_change_you') == 'YES':
forms.append({'doc_type': 'NCV', 'party_code': 1})
uploaded.append({'doc_type': 'NCV', 'party_code': 1})
if derived['wants_other_orders'] and responses_dict.get('name_change_spouse') == 'YES':
forms.append({'doc_type': 'NCV', 'party_code': 2})
uploaded.append({'doc_type': 'NCV', 'party_code': 2})
else:
return []
return forms
return ([], [])
return (uploaded, generated)

+ 5
- 4
edivorce/apps/core/views/main.py View File

@ -69,7 +69,7 @@ def success(request):
if request.user.is_authenticated:
return redirect(reverse('overview'))
else:
return render(request, 'success.html', context={'register_url': settings.REGISTER_BCEID_URL,'register_sc_url': settings.REGISTER_BCSC_URL})
return render(request, 'success.html', context={'register_url': settings.REGISTER_BCEID_URL, 'register_sc_url': settings.REGISTER_BCSC_URL})
return redirect(reverse('incomplete'))
@ -102,6 +102,7 @@ def register(request):
request.session['went_to_register'] = True
return redirect(settings.REGISTER_BCEID_URL)
def register_sc(request):
"""
Sets a session variable and redirects users to register for BC Services Card
@ -112,12 +113,13 @@ def register_sc(request):
request.session['went_to_register'] = True
return redirect(settings.REGISTER_BCSC_URL)
def signin(request):
if not request.user.is_authenticated:
return render(request, '407.html')
## I think Django might be doing this automatically now that we have switched to mozilla-django-oidc?
#if timezone.now() - request.user.last_login > datetime.timedelta(minutes=1):
# I think Django might be doing this automatically now that we have switched to mozilla-django-oidc?
# if timezone.now() - request.user.last_login > datetime.timedelta(minutes=1):
# request.user.last_login = timezone.now()
# request.user.save()
@ -313,4 +315,3 @@ def intercept_page(request):
responses_dict['intercepted'] = True
return render(request, template_name=template, context=responses_dict)

+ 18
- 0
vue/src/utils/forms.js View File

@ -41,16 +41,34 @@ export default {
help:
"This form is used by the Court to notify Vital Statistics of court-ordered legal changes of name. - Does not require signatures.",
},
NJF: {
name: "Notice of Joint Family Claim (F1)",
preText: "auto",
help:
"This form starts your divorce proceeding. It gives the court details about you and your spouse, your marriage and separation, and what you're asking the court for. - Does not require signatures when filed online.",
},
OFI: {
name: "Draft Final Order Form (F52)",
preText: "Upload the signed and scanned",
help:
"This will be your divorce order once the judge has signed it. It sets out the court order. - Requires signature by both you and your spouse (but not a signature in front of a commissioner)",
},
RCP: {
name: "Certificate of Pleadings Form (F36)",
preText: "auto",
help:
"This form is completed by registry staff after your application has been reviewed by them. It shows the judge that your application has been checked and is complete. - Does not require signatures of you or your spouse.",
},
RDP: {
name: "Registration of Joint Divorce Proceedings (JUS280)",
preText: "Complete, scan and upload the",
help:
"This form is for a central divorce registry in Ottawa. They use the form to check to make sure there is no other divorce proceeding pending in Canada. They also keep track of all divorces in Canada. - Does not require signatures.",
},
RFO: {
name: "Requisition Form (F35)",
preText: "auto",
help:
"This form is a request to the Court for your application for divorce. It tells the court that you want a divorce and outlines all the documents you are filing in support of your application. - Does not require signatures when filed online.",
},
};

Loading…
Cancel
Save