Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Product to the ZGW API registration #4803

Merged
merged 8 commits into from
Nov 20, 2024
15 changes: 15 additions & 0 deletions docker/docker-compose.rx-mission.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3.8'

name: rx-mission

services:
flask_app:
build: ./rx-mission
ports:
- "80:80"
volumes:
- ./rx-mission/:/app/

networks:
open-forms-dev:
name: open-forms-dev
183 changes: 175 additions & 8 deletions docker/open-zaak/fixtures/open_zaak_fixtures.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,18 @@
"secret": "test_secret_key"
}
},
{
"model": "config.featureflags",
"pk": 1,
"fields": {
"allow_unpublished_typen": true
}
},
{
"model": "catalogi.catalogus",
"pk": 1,
"fields": {
"_etag": "e1d589174bfd280d29dbce6ab0450e18",
"_etag": "ef26c6f8e32dd9cd50809442b635bb26",
"naam": "Test catalog",
"uuid": "bd58635c-793e-446d-a7e0-460d7b04829d",
"domein": "TEST",
Expand Down Expand Up @@ -108,6 +115,22 @@
"statustype": null
}
},
{
"model": "catalogi.eigenschap",
"pk": 4,
"fields": {
"_etag": "588430a1d4a69b9470231c498f96ea2a",
"datum_begin_geldigheid": null,
"datum_einde_geldigheid": null,
"uuid": "3a094e33-7a20-4018-bd60-3c15d06a1555",
"eigenschapnaam": "a property name",
"definitie": "a definition",
"specificatie_van_eigenschap": 1,
"toelichting": "",
"zaaktype": 5,
"statustype": null
}
},
{
"model": "catalogi.informatieobjecttype",
"pk": 1,
Expand Down Expand Up @@ -154,7 +177,7 @@
"model": "catalogi.informatieobjecttype",
"pk": 3,
"fields": {
"_etag": "9b92accfbfdb5c0d2c8d040a5825abfd",
"_etag": "6185cc7af26276b5562929eea87cb2cc",
"datum_begin_geldigheid": "2024-03-19",
"datum_einde_geldigheid": "2024-07-10",
"concept": false,
Expand Down Expand Up @@ -302,6 +325,19 @@
"statustype": null
}
},
{
"model": "catalogi.zaaktypeinformatieobjecttype",
"pk": 4,
"fields": {
"_etag": "ca748511ae63aec4a6bad264b394af3f",
"uuid": "eb78b6f6-0721-442d-b97a-074c66b5953c",
"zaaktype": 5,
"informatieobjecttype": 3,
"volgnummer": 1,
"richting": "inkomend",
"statustype": null
}
},
{
"model": "catalogi.resultaattype",
"pk": 1,
Expand Down Expand Up @@ -362,6 +398,36 @@
"zaakobjecttypen": []
}
},
{
"model": "catalogi.resultaattype",
"pk": 4,
"fields": {
"_etag": "61528e205cb91999e1fff62165c9e620",
"datum_begin_geldigheid": null,
"datum_einde_geldigheid": null,
"uuid": "e84e6028-c52a-420b-a098-d10897395c52",
"zaaktype": 5,
"omschrijving": "Geslaagd",
"resultaattypeomschrijving": "https://selectielijst.openzaak.nl/api/v1/resultaattypeomschrijvingen/43ac0469-e0c0-4985-a6ce-8ec285d2df47",
"omschrijving_generiek": "Vastgesteld",
"selectielijstklasse": "https://selectielijst.openzaak.nl/api/v1/resultaten/afa30940-855b-4a7e-aa21-9e15a8078814",
"archiefnominatie": "vernietigen",
"archiefactietermijn": "P10Y",
"brondatum_archiefprocedure_afleidingswijze": "afgehandeld",
"brondatum_archiefprocedure_datumkenmerk": "",
"brondatum_archiefprocedure_einddatum_bekend": false,
"brondatum_archiefprocedure_objecttype": "",
"brondatum_archiefprocedure_registratie": "",
"brondatum_archiefprocedure_procestermijn": "P0D",
"toelichting": "",
"procesobjectaard": "",
"indicatie_specifiek": null,
"procestermijn": null,
"informatieobjecttypen": [],
"besluittypen": [],
"zaakobjecttypen": []
}
},
{
"model": "catalogi.roltype",
"pk": 1,
Expand Down Expand Up @@ -414,6 +480,32 @@
"zaaktype": 3
}
},
{
"model": "catalogi.roltype",
"pk": 7,
"fields": {
"_etag": "becf13f6816136b448a03c8cc7484f80",
"datum_begin_geldigheid": null,
"datum_einde_geldigheid": null,
"uuid": "bd37e337-e0fd-4e11-a6ed-45a71e1c7aa8",
"omschrijving": "Initiator",
"omschrijving_generiek": "initiator",
"zaaktype": 5
}
},
{
"model": "catalogi.roltype",
"pk": 8,
"fields": {
"_etag": "c370045099a0d44ef4459a2596739ce0",
"datum_begin_geldigheid": null,
"datum_einde_geldigheid": null,
"uuid": "d44d68c2-1e06-461e-9657-adf174a922fb",
"omschrijving": "Baliemedewerker",
"omschrijving_generiek": "klantcontacter",
"zaaktype": 5
}
},
{
"model": "catalogi.statustype",
"pk": 1,
Expand All @@ -436,7 +528,7 @@
"model": "catalogi.statustype",
"pk": 2,
"fields": {
"_etag": "431dc899b7400782cfb86f5cc2fa0236",
"_etag": "360e002e252b85e8d064d9c28f2984a0",
"datum_begin_geldigheid": null,
"datum_einde_geldigheid": null,
"uuid": "1de05b57-a938-47e4-b808-f129c6406b60",
Expand Down Expand Up @@ -486,13 +578,49 @@
"toelichting": null
}
},
{
"model": "catalogi.statustype",
"pk": 7,
"fields": {
"_etag": "8a46302bb4a487f8abe164ccfbcd9052",
"datum_begin_geldigheid": null,
"datum_einde_geldigheid": null,
"uuid": "018ec0c2-50d0-4225-a5bb-5ad7c48d6f2b",
"zaaktype": 5,
"statustype_omschrijving": "Afgerond",
"statustype_omschrijving_generiek": "",
"statustypevolgnummer": 2,
"doorlooptijd": null,
"informeren": false,
"statustekst": "",
"toelichting": null
}
},
{
"model": "catalogi.statustype",
"pk": 8,
"fields": {
"_etag": "e34511d093b82feb1fde24f2da13d330",
"datum_begin_geldigheid": null,
"datum_einde_geldigheid": null,
"uuid": "2937ee1d-9ea1-4048-b642-5a4dfd51fb47",
"zaaktype": 5,
"statustype_omschrijving": "Ontvangen",
"statustype_omschrijving_generiek": "",
"statustypevolgnummer": 1,
"doorlooptijd": null,
"informeren": false,
"statustekst": "",
"toelichting": null
}
},
{
"model": "catalogi.zaaktype",
"pk": 1,
"fields": {
"_etag": "4b7814375796d28f29fea94ee27127b8",
"_etag": "49244222344d1a50479929320e8702ca",
"datum_begin_geldigheid": "2024-03-26",
"datum_einde_geldigheid": null,
"datum_einde_geldigheid": "2024-10-29",
"concept": false,
"uuid": "1f41885e-23fc-4462-bbc8-80be4ae484dc",
"identificatie": "ZT-001",
Expand Down Expand Up @@ -625,10 +753,49 @@
}
},
{
"model": "config.featureflags",
"pk": 1,
"model": "catalogi.zaaktype",
"pk": 5,
"fields": {
"allow_unpublished_typen": true
"_etag": "fde03886a89d769c02e66a24fb47e991",
"datum_begin_geldigheid": "2024-10-31",
"datum_einde_geldigheid": null,
"concept": false,
"uuid": "f609b6fe-449a-46dc-a0af-de55dc5f6774",
"identificatie": "ZT-001",
"zaaktype_omschrijving": "Test",
"zaaktype_omschrijving_generiek": "",
"vertrouwelijkheidaanduiding": "intern",
"doel": "testen",
"aanleiding": "integratietests",
"toelichting": "",
"indicatie_intern_of_extern": "intern",
"handeling_initiator": "Formulier indienen",
"onderwerp": "Testformulier",
"handeling_behandelaar": "Controleren",
"doorlooptijd_behandeling": "P1D",
"servicenorm_behandeling": "P0D",
"opschorting_en_aanhouding_mogelijk": false,
"verlenging_mogelijk": false,
"verlengingstermijn": null,
"trefwoorden": "[]",
"publicatie_indicatie": false,
"publicatietekst": "",
"verantwoordingsrelatie": "[]",
"versiedatum": "2024-10-31",
"verantwoordelijke": "Ontwikkelaar",
"producten_of_diensten": "[\"http://localhost/product/1234abcd-12ab-34cd-56ef-12345abcde10\"]",
"selectielijst_procestype": "https://selectielijst.openzaak.nl/api/v1/procestypen/aa8aa2fd-b9c6-4e34-9a6c-58a677f60ea0",
"selectielijst_procestype_jaar": 2020,
"referentieproces_naam": "Testen",
"referentieproces_link": "",
"broncatalogus_url": "",
"broncatalogus_domein": "",
"broncatalogus_rsin": "",
"bronzaaktype_url": "",
"bronzaaktype_identificatie": "",
"bronzaaktype_omschrijving": "",
"catalogus": 1,
"deelzaaktypen": []
}
}
]
17 changes: 17 additions & 0 deletions docker/rx-mission/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Use the official Python image from the Docker Hub
FROM python:3.12-slim

# Set the working directory
WORKDIR /app

# Copy the current directory contents into the container at /app
COPY . /app

# Install the dependencies
RUN pip install Flask

# Make port 80 available to the world outside this container
EXPOSE 80

# Run app.py when the container launches
CMD ["python", "app.py"]
28 changes: 28 additions & 0 deletions docker/rx-mission/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# RX Mission

The `docker-compose.rx-mission.yml` compose file is available to run a mock services intended
to replicate some Roxit interfaces. Currently only containing a mock product detail endpoint.

The compose file takes some serious creative liberty, and doesn't represent a real Roxit environment.
At the moment we cannot use a real Roxit products environment,
so this mock service shall have to do for the development and testing of #4796.

The data returned from `/product/<product_uuid>` is a stripped example provided by Roxit,
and very loosely depicts real products.

When development of the Roxit products environment is completed, this docker environment must be updated.

## docker compose

Start an instance in your local environment from the parent directory:

```bash
docker compose -f docker-compose.rx-mission.yml up -d
```

This starts a flask application at http://localhost:80/product/<product_uuid>.
To recognized `uuid's` can be found in the `rx-mission/fixtures/rx-mission-products.json` file.

## Load fixtures

The flask app uses the fixtures in `rx-mission/fixtures` as a simple database.
23 changes: 23 additions & 0 deletions docker/rx-mission/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import json

from flask import Flask, jsonify

app = Flask(__name__)
products = {}


@app.route("/product/<string:product_uuid>", methods=["GET"])
def handle_request(product_uuid):
if product_uuid not in products:
return jsonify({"message": "Product not found"}), 404

product = products[product_uuid]
return jsonify(product)


if __name__ == "__main__":
with open("./fixtures/rx-mission-products.json", encoding="utf-8") as json_file:
parsed_json = json.load(json_file)
products = {product["id"]: product for product in parsed_json["products"]}

app.run(host="0.0.0.0", port=80, debug=True)
Loading
Loading