-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor data model & associated changes
Refactor the clerk data model to better reflect how the data is used. Changes made where in three major parts: 1. Migrate fields to a different model or add model fields: - Migrate tenancy foreign key field from client to issue model - Migrate weekly_rent field from client to issue model - Migrate weekly_income field from client to issue model - Migrate employment_status field from client to case model - Migrate rental_circumstances field from client to tenancy model - Migrate referrer & referrer_type fields from client to case model - Add preferred_name field to client model - Add pronouns field to client model 2. Update field choices: - Update issue model referrer_type field options - Update issue model employment_status field options - Update client model requires_interpreter field options - Update client model is_aboriginal_or_torres_strait_islander field options This might require data migration if, for example, the change is from a boolean to a char field type. 3. Update the business logic, tests etc. due to the model changes: - Update intake form submission - Update django admin interface - Update model serializers & factories - Update clerk frontend - Update tests
- Loading branch information
Showing
55 changed files
with
1,758 additions
and
508 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{% extends "case/_base.html" %} | ||
{% block title %}Tenancy{% endblock %} | ||
|
||
{% block content %} | ||
|
||
<div class="ui container"> | ||
<h1 class="ui header"> | ||
Tenancy | ||
<div class="sub header"> | ||
Created {{ tenancy.created_at|date:"jS M 'y" }}, updated {{ tenancy.modified_at|date:"jS M 'y" }} | ||
</div> | ||
</h1> | ||
|
||
<h2 class="ui header">Property details</h2> | ||
{{ forms.form }} | ||
|
||
<h2 class="ui header">Property people</h2> | ||
<table class="ui definition table small"> | ||
<tbody> | ||
<tr> | ||
<td class="three wide">Client</td> | ||
<td> | ||
<a href="{% url 'client-detail' client.pk %}"> | ||
{{ client.get_full_name|title }} | ||
</a> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td class="three wide">Agent</td> | ||
<td> | ||
{% if tenancy.agent %} | ||
<a href="{% url 'person-detail' tenancy.agent.pk %}"> | ||
{{ tenancy.agent.full_name|title }} | ||
</a> | ||
{% else %} | ||
No agent | ||
{% endif %} | ||
</td> | ||
</tr> | ||
<tr> | ||
<td class="three wide">Landlord</td> | ||
<td> | ||
{% if tenancy.landlord %} | ||
<a href="{% url 'person-detail' tenancy.landlord.pk %}"> | ||
{{ tenancy.landlord.full_name|title }} | ||
</a> | ||
{% else %} | ||
No landlord | ||
{% endif %} | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.0.10 on 2023-11-23 04:41 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('core', '0054_remove_issueevent_event_types_alter_issue_topic_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='client', | ||
name='preferred_name', | ||
field=models.CharField(blank=True, max_length=150, null=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.0.10 on 2023-11-24 01:19 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('core', '0055_client_preferred_name'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='client', | ||
name='pronouns', | ||
field=models.CharField(blank=True, max_length=32), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Generated by Django 4.0.10 on 2023-11-27 02:45 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("core", "0056_client_pronouns"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="issue", | ||
name="tenancy", | ||
field=models.ForeignKey( | ||
null=True, | ||
on_delete=django.db.models.deletion.PROTECT, | ||
to="core.tenancy", | ||
), | ||
), | ||
] |
Oops, something went wrong.