Skip to content

Commit

Permalink
Merge pull request #1261 from Amsterdam/feature/101933-digital-surv-vv
Browse files Browse the repository at this point in the history
implement new visit and digital surv routes
  • Loading branch information
NvdLaan authored Sep 9, 2024
2 parents ebc3b3a + f04b8e8 commit e974bce
Show file tree
Hide file tree
Showing 16 changed files with 2,406 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_10wsqin" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.7.0" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="7.14.0">
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_10wsqin" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.7.0" modeler:executionPlatform="Camunda Platform">
<bpmn:collaboration id="Collaboration_0j54iub">
<bpmn:participant id="Participant_026qmxw" name="Process" processRef="digital_surveillance" />
</bpmn:collaboration>
Expand Down

Large diffs are not rendered by default.

1,032 changes: 1,032 additions & 0 deletions app/apps/workflow/bpmn_files/default/director/8.0.0/director.bpmn

Large diffs are not rendered by default.

581 changes: 581 additions & 0 deletions app/apps/workflow/bpmn_files/default/visit/8.0.0/visit.bpmn

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions app/apps/workflow/user_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,14 @@ class task_sub_workflow_terug_melding_bag(user_task):
"""Terug melding BAG"""


class task_bepalen_processtap_vv(user_task):
due_date = relativedelta(days=2)


class task_digitaal_rapport_th(user_task):
due_date = relativedelta(days=3)


class task_nakijken_informatiebrief(user_task):
"""task_nakijken_informatiebrief"""

Expand Down
16 changes: 11 additions & 5 deletions app/apps/workflow/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,22 @@ def get_latest_version_from_config(
def get_major(v):
return int(v.split(".")[0])

version = sorted([v for v, k in config.get("versions").items()])

theme_versions = sorted([v for v, k in config.get("versions").items()])
if current_version:
version = [v for v in version if get_major(current_version) >= get_major(v)]
# Get the hightest version of a workflow, only if it's a lower version than the parent major version
# So a parent workflow with a major version of 6 will never start a sub workflow with version 7
theme_versions = [
theme_version
for theme_version in theme_versions
if get_major(current_version) >= get_major(theme_version)
]

if not version:
if not theme_versions:
raise Exception(
f"Workflow version for theme name '{theme_name}', with type '{workflow_type}', does not exist in this workflow_spec config"
)
return theme_name, version[-1]
highest_sub_version = theme_versions[-1]
return theme_name, highest_sub_version


def get_initial_data_from_config(
Expand Down
41 changes: 40 additions & 1 deletion app/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ def filter_traces(envelope):
LOCAL_DEVELOPMENT_AUTHENTICATION = (
os.getenv("LOCAL_DEVELOPMENT_AUTHENTICATION", False) == "True"
)

DATA_UPLOAD_MAX_MEMORY_SIZE = 5242880
DATA_UPLOAD_MAX_NUMBER_FIELDS = 6000

Expand Down Expand Up @@ -733,6 +732,7 @@ def get_redis_url():
},
"versions": {
"3.0.0": {},
"8.0.0": {},
},
},
"debrief": {
Expand Down Expand Up @@ -1066,6 +1066,44 @@ def get_redis_url():
},
},
},
"8.0.0": {
"messages": {
"main_process": {
"initial_data": {
"status_name": DEFAULT_SCHEDULE_ACTIONS[0],
"authorization": {"value": "No"},
"reason": {"value": "default"},
"theme": {"value": "default"},
"bepalen_processtap": {"value": "ja"},
"debrief_next_step": {"value": "default"},
"summon_next_step": {"value": "default"},
"visit_next_step": {"value": "default"},
"housing_corporation_next_step": {"value": "default"},
"monitoren_reactie_platform_duration": timedelta(
days=14
),
"leegstandsmelding_eigenaar": {"value": "default"},
},
},
"aanschrijving_toevoegen": {
"initial_data": {
"status_name": DEFAULT_SCHEDULE_ACTIONS[0],
"authorization": {"value": "No"},
"reason": {"value": "default"},
"theme": {"value": "default"},
"bepalen_processtap": {"value": "ja"},
"debrief_next_step": {"value": "default"},
"summon_next_step": {"value": "default"},
"visit_next_step": {"value": "default"},
"housing_corporation_next_step": {"value": "default"},
"monitoren_reactie_platform_duration": timedelta(
days=14
),
"leegstandsmelding_eigenaar": {"value": "default"},
},
},
},
},
},
},
"housing_corporation": {
Expand Down Expand Up @@ -1332,6 +1370,7 @@ def get_redis_url():
"0.4.0": {},
"0.5.0": {},
"0.6.0": {},
"8.0.0": {},
},
},
"citizen_report_feedback": {
Expand Down
8 changes: 3 additions & 5 deletions e2e-tests/api/tasks/visit.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from api.user_tasks import (
task_aanvragen_machtiging,
task_bepalen_processtap,
task_bepalen_processtap_standaard,
task_bepalen_processtap_vv,
task_doorgeven_status_top,
task_inplannen_status,
task_monitoren_binnenkomen_machtiging,
Expand All @@ -34,9 +34,7 @@ def get_steps():
return [__class__()]


class test_bepalen_processtap_standaard(
GenericUserTask, task_bepalen_processtap_standaard
):
class test_bepalen_processtap_vv(GenericUserTask, task_bepalen_processtap_vv):
def __init__(self, visit_next_step=VisitNextStep.VISIT_WITHOUT_AUTHORIZATION):
super().__init__(visit_next_step={"value": visit_next_step})

Expand Down Expand Up @@ -89,7 +87,7 @@ def __init__(
def get_steps():
# No preceiding step, case was just created
return [
*test_bepalen_processtap_standaard.get_steps(),
*test_bepalen_processtap_vv.get_steps(),
__class__(),
]

Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/flows/test_aanschrijving.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
test_verwerk_aanschrijving,
)
from api.tasks.visit import (
test_bepalen_processtap_standaard,
test_bepalen_processtap_vv,
test_doorgeven_status_top,
test_inplannen_status,
)
Expand All @@ -23,7 +23,7 @@
class TestViolationLegalizationLetter(DefaultAPITest):
def test(self):
self.get_case().run_steps(
test_bepalen_processtap_standaard(),
test_bepalen_processtap_vv(),
test_inplannen_status(),
test_doorgeven_status_top(),
test_create_debrief(violation=Violation.YES),
Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/flows/test_invalid_civilian_objection.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
test_verwerk_aanschrijving,
)
from api.tasks.visit import (
test_bepalen_processtap_standaard,
test_bepalen_processtap_vv,
test_doorgeven_status_top,
test_inplannen_status,
)
Expand All @@ -31,7 +31,7 @@
class TestInvalidCivilianObjection(DefaultAPITest):
def test(self):
self.get_case().run_steps(
test_bepalen_processtap_standaard(),
test_bepalen_processtap_vv(),
test_inplannen_status(),
test_doorgeven_status_top(),
test_create_debrief(violation=Violation.YES),
Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/flows/test_multiple_summons.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
test_afzien_concept_aanschrijving,
test_opstellen_concept_aanschrijving,
)
from api.tasks.visit import test_bepalen_processtap_standaard
from api.tasks.visit import test_bepalen_processtap_vv
from api.test import DefaultAPITest
from api.validators import ValidateOpenTasks

Expand All @@ -16,7 +16,7 @@ def test(self):
case.add_process(Process.HolidayRental.ADD_SUMMON),
case.run_steps(
ValidateOpenTasks(
test_bepalen_processtap_standaard, test_opstellen_concept_aanschrijving
test_bepalen_processtap_vv, test_opstellen_concept_aanschrijving
),
*test_opstellen_verkorte_rapportage_huisbezoek.get_steps(),
ValidateOpenTasks(test_opstellen_concept_aanschrijving),
Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/flows/test_no_civilian_objection.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
test_verwerk_aanschrijving,
)
from api.tasks.visit import (
test_bepalen_processtap_standaard,
test_bepalen_processtap_vv,
test_doorgeven_status_top,
test_inplannen_status,
)
Expand All @@ -26,7 +26,7 @@
class TestNoCivilianObjection(DefaultAPITest):
def test(self):
self.get_case().run_steps(
test_bepalen_processtap_standaard(),
test_bepalen_processtap_vv(),
test_inplannen_status(),
test_doorgeven_status_top(),
test_create_debrief(violation=Violation.YES),
Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/flows/test_no_violation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
test_terugkoppelen_melder_1,
)
from api.tasks.visit import (
test_bepalen_processtap_standaard,
test_bepalen_processtap_vv,
test_doorgeven_status_top,
test_inplannen_status,
)
Expand All @@ -17,7 +17,7 @@
class TestNoViolation(DefaultAPITest):
def test(self):
self.get_case().run_steps(
test_bepalen_processtap_standaard(),
test_bepalen_processtap_vv(),
test_inplannen_status(),
test_doorgeven_status_top(),
test_create_debrief(violation=Violation.NO),
Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/flows/test_sluiting.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
test_verwerk_aanschrijving,
)
from api.tasks.visit import (
test_bepalen_processtap_standaard,
test_bepalen_processtap_vv,
test_doorgeven_status_top,
test_inplannen_status,
)
Expand All @@ -34,7 +34,7 @@
class TestViolationClosure(DefaultAPITest):
def test_direct(self):
self.get_case().run_steps(
test_bepalen_processtap_standaard(),
test_bepalen_processtap_vv(),
test_inplannen_status(),
test_doorgeven_status_top(),
test_create_debrief(violation=Violation.YES),
Expand Down
8 changes: 4 additions & 4 deletions e2e-tests/flows/test_timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
test_terugkoppelen_melder_1,
)
from api.tasks.visit import (
test_bepalen_processtap_standaard,
test_bepalen_processtap_vv,
test_doorgeven_status_top,
test_inplannen_status,
)
Expand All @@ -18,7 +18,7 @@ class TestTimeline(DefaultAPITest):
def test_no_identification(self):
case = self.get_case()
case.run_steps(
test_bepalen_processtap_standaard(),
test_bepalen_processtap_vv(),
test_inplannen_status(),
ValidateOpenTasks(test_doorgeven_status_top),
)
Expand All @@ -28,7 +28,7 @@ def test_no_identification(self):

def test_home_visit_report(self):
self.get_case().run_steps(
test_bepalen_processtap_standaard(),
test_bepalen_processtap_vv(),
test_inplannen_status(),
test_doorgeven_status_top(),
test_create_debrief(violation=Violation.NO),
Expand All @@ -47,7 +47,7 @@ def get_case_data(self):
def test(self):
case = self.get_case()
case.run_steps(
test_bepalen_processtap_standaard(),
test_bepalen_processtap_vv(),
test_inplannen_status(),
ValidateOpenTasks(test_doorgeven_status_top),
)
Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/user_tasks/test_inplannen_status.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from api.tasks.visit import (
test_bepalen_processtap_standaard,
test_bepalen_processtap_vv,
test_doorgeven_status_top,
test_inplannen_status,
)
Expand All @@ -10,7 +10,7 @@
class task_inplannen_status_test(DefaultAPITest):
def test(self):
self.get_case().run_steps(
test_bepalen_processtap_standaard(),
test_bepalen_processtap_vv(),
test_inplannen_status(),
ValidateOpenTasks(test_doorgeven_status_top),
)

0 comments on commit e974bce

Please sign in to comment.