Skip to content

Commit

Permalink
🚚 [#4787] Rename several fields on Objects API config model
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbal committed Dec 3, 2024
1 parent d9478d3 commit 0d16714
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 24 deletions.
10 changes: 5 additions & 5 deletions docker/setup_configuration/data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ objects_api:
identifier: config-1
objects_service_identifier: objecten-test
objecttypes_service_identifier: objecttypen-test
drc_service_identifier: documenten-test
documenten_service_identifier: documenten-test
catalogi_service_identifier: catalogi-test
catalogue_domain: TEST
catalogue_rsin: "000000000"
organisatie_rsin: "000000000"
iot_submission_report: PDF Informatieobjecttype
iot_submission_csv: CSV Informatieobjecttype
iot_attachment: Attachment Informatieobjecttype
document_type_submission_report: PDF Informatieobjecttype
document_type_submission_csv: CSV Informatieobjecttype
document_type_attachment: Attachment Informatieobjecttype
- name: Config 2
identifier: config-2
objects_service_identifier: objecten-test
objecttypes_service_identifier: objecttypen-test
drc_service_identifier: documenten-test
documenten_service_identifier: documenten-test
catalogi_service_identifier: catalogi-test
catalogue_domain: OTHER
catalogue_rsin: "000000000"
Expand Down
19 changes: 15 additions & 4 deletions src/openforms/contrib/objects_api/setup_configuration/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,27 @@ class SingleObjectsAPIGroupConfigModel(ConfigurationModel):
objecttypes_service_identifier: str = DjangoModelRef(
ObjectsAPIGroupConfig, "objecttypes_service"
)
drc_service_identifier: str = DjangoModelRef(
documenten_service_identifier: str = DjangoModelRef(
ObjectsAPIGroupConfig, "drc_service", default=""
)
catalogi_service_identifier: str = DjangoModelRef(
ObjectsAPIGroupConfig, "catalogi_service", default=""
)

# Renamed to be more descriptive
document_type_submission_report: str = DjangoModelRef(
ObjectsAPIGroupConfig,
"iot_submission_report",
)
document_type_submission_csv: str = DjangoModelRef(
ObjectsAPIGroupConfig,
"iot_submission_csv",
)
document_type_attachment: str = DjangoModelRef(
ObjectsAPIGroupConfig,
"iot_attachment",
)

class Meta:
django_model_refs = {
ObjectsAPIGroupConfig: [
Expand All @@ -27,9 +41,6 @@ class Meta:
"catalogue_domain",
"catalogue_rsin",
"organisatie_rsin",
"iot_submission_report",
"iot_submission_csv",
"iot_attachment",
]
}

Expand Down
12 changes: 7 additions & 5 deletions src/openforms/contrib/objects_api/setup_configuration/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ def execute(self, model: ObjectsAPIGroupConfigModel):
"catalogue_domain": config.catalogue_domain,
"catalogue_rsin": config.catalogue_rsin,
"organisatie_rsin": config.organisatie_rsin,
"iot_submission_report": config.iot_submission_report,
"iot_submission_csv": config.iot_submission_csv,
"iot_attachment": config.iot_attachment,
"iot_submission_report": config.document_type_submission_report,
"iot_submission_csv": config.document_type_submission_csv,
"iot_attachment": config.document_type_attachment,
}
if config.drc_service_identifier:
defaults["drc_service"] = get_service(config.drc_service_identifier)
if config.documenten_service_identifier:
defaults["drc_service"] = get_service(
config.documenten_service_identifier
)
if config.catalogi_service_identifier:
defaults["catalogi_service"] = get_service(
config.catalogi_service_identifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ objects_api:
identifier: config-1
objects_service_identifier: objecten-test
objecttypes_service_identifier: objecttypen-test
drc_service_identifier: documenten-test
documenten_service_identifier: documenten-test
catalogi_service_identifier: catalogi-test
catalogue_domain: TEST
catalogue_rsin: "000000000"
organisatie_rsin: "000000000"
iot_submission_report: PDF Informatieobjecttype
iot_submission_csv: CSV Informatieobjecttype
iot_attachment: Attachment Informatieobjecttype
document_type_submission_report: PDF Informatieobjecttype
document_type_submission_csv: CSV Informatieobjecttype
document_type_attachment: Attachment Informatieobjecttype
- name: Config 2
identifier: config-2
objects_service_identifier: objecten-test
objecttypes_service_identifier: objecttypen-test
drc_service_identifier: documenten-test
documenten_service_identifier: documenten-test
catalogi_service_identifier: catalogi-test
catalogue_domain: OTHER
catalogue_rsin: "000000000"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ objects_api:
identifier: config-1
objects_service_identifier: objecten-test
objecttypes_service_identifier: objecttypen-test
drc_service_identifier: documenten-test
documenten_service_identifier: documenten-test
catalogi_service_identifier: catalogi-test
catalogue_domain: TEST
catalogue_rsin: "000000000"
organisatie_rsin: "000000000"
iot_submission_report: PDF Informatieobjecttype
iot_submission_csv: CSV Informatieobjecttype
iot_attachment: Attachment Informatieobjecttype
document_type_submission_report: PDF Informatieobjecttype
document_type_submission_csv: CSV Informatieobjecttype
document_type_attachment: Attachment Informatieobjecttype
2 changes: 1 addition & 1 deletion src/openforms/contrib/objects_api/tests/test_migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from openforms.utils.tests.test_migrations import TestMigrations


class MigrateFeatureFlagsTests(TestMigrations):
class AddObjectsAPIGroupIdentifierTests(TestMigrations):
app = "objects_api"
migrate_from = "0001_initial"
migrate_to = "0002_objectsapigroupconfig_identifier"
Expand Down

0 comments on commit 0d16714

Please sign in to comment.