diff --git a/src/open_inwoner/cms/cases/tests/test_contactform.py b/src/open_inwoner/cms/cases/tests/test_contactform.py index 7a0425375d..c9e6d4e139 100644 --- a/src/open_inwoner/cms/cases/tests/test_contactform.py +++ b/src/open_inwoner/cms/cases/tests/test_contactform.py @@ -113,6 +113,18 @@ def setUp(self): vertrouwelijkheidaanduiding=VertrouwelijkheidsAanduidingen.openbaar, indicatieInternOfExtern="extern", ) + # + # statuses + # + self.status_new = generate_oas_component( + "zrc", + "schemas/Status", + url=f"{ZAKEN_ROOT}statussen/3da81560-c7fc-476a-ad13-beu760sle929", + zaak=self.zaak["url"], + statustype=f"{CATALOGI_ROOT}statustypen/e3798107-ab27-4c3c-977d-777yu878km09", + datumStatusGezet="2021-01-12", + statustoelichting="", + ) self.status_finish = generate_oas_component( "zrc", "schemas/Status", @@ -122,6 +134,21 @@ def setUp(self): datumStatusGezet="2021-03-12", statustoelichting="", ) + # + # status types + # + self.status_type_new = generate_oas_component( + "ztc", + "schemas/StatusType", + url=self.status_new["statustype"], + zaaktype=self.zaaktype["url"], + catalogus=f"{CATALOGI_ROOT}catalogussen/1b643db-81bb-d71bd5a2317a", + omschrijving="Initial request", + omschrijvingGeneriek="Nieuw", + statustekst="", + volgnummer=1, + isEindstatus=False, + ) self.status_type_finish = generate_oas_component( "ztc", "schemas/StatusType", @@ -129,7 +156,10 @@ def setUp(self): zaaktype=self.zaaktype["url"], catalogus=f"{CATALOGI_ROOT}catalogussen/1b643db-81bb-d71bd5a2317a", omschrijving="Finish", - omschrijvingGeneriek="some content", + omschrijvingGeneriek="Afgehandeld", + statustekst="", + volgnummer=1, + isEindstatus=True, ) self.result = generate_oas_component( "zrc", @@ -181,6 +211,12 @@ def _setUpMocks(self, m): ]: self.matchers.append(m.get(resource["url"], json=resource)) + # mock `fetch_status_types_no_cache` + m.get( + f"{CATALOGI_ROOT}statustypen?zaaktype={self.zaak['zaaktype']}", + json=paginated_response([self.status_type_new, self.status_type_finish]), + ) + self.matchers += [ m.get( f"{ZAKEN_ROOT}rollen?zaak={self.zaak['url']}", diff --git a/src/open_inwoner/cms/cases/tests/test_htmx.py b/src/open_inwoner/cms/cases/tests/test_htmx.py index f8d41b789e..e7502953d3 100644 --- a/src/open_inwoner/cms/cases/tests/test_htmx.py +++ b/src/open_inwoner/cms/cases/tests/test_htmx.py @@ -122,6 +122,18 @@ def setUp(self) -> None: vertrouwelijkheidaanduiding=VertrouwelijkheidsAanduidingen.openbaar, indicatieInternOfExtern="extern", ) + # + # statuses + # + self.status_new = generate_oas_component( + "zrc", + "schemas/Status", + url=f"{ZAKEN_ROOT}statussen/3da81560-c7fc-476a-ad13-beu760sle929", + zaak=self.zaak["url"], + statustype=f"{CATALOGI_ROOT}statustypen/e3798107-ab27-4c3c-977d-777yu878km09", + datumStatusGezet="2021-01-12", + statustoelichting="", + ) self.status_finish = generate_oas_component( "zrc", "schemas/Status", @@ -131,6 +143,21 @@ def setUp(self) -> None: datumStatusGezet="2021-03-12", statustoelichting="", ) + # + # status types + # + self.status_type_new = generate_oas_component( + "ztc", + "schemas/StatusType", + url=self.status_new["statustype"], + zaaktype=self.zaaktype["url"], + catalogus=f"{CATALOGI_ROOT}catalogussen/1b643db-81bb-d71bd5a2317a", + omschrijving="Initial request", + omschrijvingGeneriek="Nieuw", + statustekst="", + volgnummer=1, + isEindstatus=False, + ) self.status_type_finish = generate_oas_component( "ztc", "schemas/StatusType", @@ -138,7 +165,10 @@ def setUp(self) -> None: zaaktype=self.zaaktype["url"], catalogus=f"{CATALOGI_ROOT}catalogussen/1b643db-81bb-d71bd5a2317a", omschrijving="Finish", - omschrijvingGeneriek="some content", + omschrijvingGeneriek="Afgehandeld", + statustekst="", + volgnummer=1, + isEindstatus=True, ) self.user_role = generate_oas_component( "zrc", @@ -285,6 +315,12 @@ def _setUpMocks(self, m): ]: self.matchers.append(m.get(resource["url"], json=resource)) + # mock `fetch_status_types_no_cache` + m.get( + f"{CATALOGI_ROOT}statustypen?zaaktype={self.zaak['zaaktype']}", + json=paginated_response([self.status_type_new, self.status_type_finish]), + ) + self.matchers += [ m.get( f"{ZAKEN_ROOT}zaken?rol__betrokkeneIdentificatie__natuurlijkPersoon__inpBsn={self.user.bsn}&maximaleVertrouwelijkheidaanduiding=beperkt_openbaar", diff --git a/src/open_inwoner/openzaak/migrations/0027_auto_20231101_1641.py b/src/open_inwoner/openzaak/migrations/0027_auto_20231101_1641.py new file mode 100644 index 0000000000..f2780b7476 --- /dev/null +++ b/src/open_inwoner/openzaak/migrations/0027_auto_20231101_1641.py @@ -0,0 +1,48 @@ +# Generated by Django 3.2.20 on 2023-11-01 15:41 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("openzaak", "0026_zaaktypestatustypeconfig_document_upload_description"), + ] + + operations = [ + migrations.AlterField( + model_name="openzaakconfig", + name="title_text", + field=models.TextField( + default="Hier vindt u een overzicht van al uw lopende en afgeronde aanvragen.", + help_text="The title/introductory text shown on the list view of 'Mijn aanvragen'.", + verbose_name="Title text", + ), + ), + migrations.AlterField( + model_name="zaaktypestatustypeconfig", + name="status_indicator", + field=models.CharField( + blank=True, + choices=[ + ("info", "Info"), + ("warning", "Warning"), + ("failure", "Failure"), + ("success", "Success"), + ], + help_text="Determines what color will be shown to the user if a case is set to this status", + max_length=32, + verbose_name="Statustype indicator", + ), + ), + migrations.AlterField( + model_name="zaaktypestatustypeconfig", + name="status_indicator_text", + field=models.TextField( + blank=True, + default="", + help_text="Determines the text that will be shown to the user if a case is set to this status", + verbose_name="Statustype indicator text", + ), + ), + ] diff --git a/src/open_inwoner/openzaak/migrations/0027_zaaktype_resultaattype_config.py b/src/open_inwoner/openzaak/migrations/0027_zaaktype_resultaattype_config.py new file mode 100644 index 0000000000..840666039f --- /dev/null +++ b/src/open_inwoner/openzaak/migrations/0027_zaaktype_resultaattype_config.py @@ -0,0 +1,72 @@ +# Generated by Django 3.2.20 on 2023-10-26 10:05 + +import django.db.models.deletion +from django.db import migrations, models + +import django_better_admin_arrayfield.models.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ("openzaak", "0026_zaaktypestatustypeconfig_document_upload_description"), + ] + + operations = [ + migrations.CreateModel( + name="ZaakTypeResultaatTypeConfig", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "resultaattype_url", + models.URLField(max_length=1000, verbose_name="Resultaattype URL"), + ), + ( + "omschrijving", + models.CharField(max_length=20, verbose_name="Omschrijving"), + ), + ( + "zaaktype_uuids", + django_better_admin_arrayfield.models.fields.ArrayField( + base_field=models.UUIDField(verbose_name="Zaaktype UUID"), + default=list, + size=None, + ), + ), + ( + "description", + models.TextField( + blank=True, + default="", + help_text="Determines the text that will be shown to the user if a case is set to this result", + verbose_name="Frontend description", + ), + ), + ( + "zaaktype_config", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="openzaak.zaaktypeconfig", + ), + ), + ], + options={ + "verbose_name": "Zaaktype Resultaattype Configuration", + }, + ), + migrations.AddConstraint( + model_name="zaaktyperesultaattypeconfig", + constraint=models.UniqueConstraint( + fields=("zaaktype_config", "resultaattype_url"), + name="unique_zaaktype_config_resultaattype_url", + ), + ), + ] diff --git a/src/open_inwoner/openzaak/migrations/0028_merge_20231101_1705.py b/src/open_inwoner/openzaak/migrations/0028_merge_20231101_1705.py new file mode 100644 index 0000000000..bbf3c5cc47 --- /dev/null +++ b/src/open_inwoner/openzaak/migrations/0028_merge_20231101_1705.py @@ -0,0 +1,13 @@ +# Generated by Django 3.2.20 on 2023-11-01 16:05 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("openzaak", "0027_auto_20231101_1641"), + ("openzaak", "0027_zaaktype_resultaattype_config"), + ] + + operations = []