Skip to content

Commit

Permalink
93533
Browse files Browse the repository at this point in the history
  • Loading branch information
remyvdwereld committed Sep 29, 2023
1 parent b6dff62 commit cbf2086
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
17 changes: 16 additions & 1 deletion app/apps/permits/api_queries_decos_join.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ def get_decos_entry_by_bag_id(self, bag_id, dt):
}
for v in decos_join_conf_object
]
# Initialize an empty list to hold new items
new_permits = []

response_decos_obj = self.get_decos_object_with_bag_id(bag_id)

Expand Down Expand Up @@ -340,7 +342,17 @@ def get_decos_entry_by_bag_id(self, bag_id, dt):

if is_next_permit_valid:
# Next permit is valid so this is the one users would like to see. Update permit data.
d.update(permit_serializer.data)
if is_current_permit_valid:
# Both current and next permits are valid.
# Show both permits so the Toezichthouder can decide.
# Add the next permit to the new_permits list for merging later.
new_permits.append(
permit_serializer.data
)
else:
# Only the next permit is valid, update the data.
d.update(permit_serializer.data)

elif not is_current_permit_valid:
# Current permit and next permit are not valid.
if next_permit_valid_from > now:
Expand Down Expand Up @@ -378,6 +390,9 @@ def get_decos_entry_by_bag_id(self, bag_id, dt):
"Config keys: %s" % decos_join_conf_object.get_book_keys()
)

# Extend the original permits list with new items
permits.extend(new_permits)

response.update(
{
"permits": permits,
Expand Down
1 change: 1 addition & 0 deletions app/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@
"text19": "HOLDER",
"subject1": "SUBJECT",
"text6": "ADDRESS",
"document_date": "REQUEST_DATE",
}
DECOS_JOIN_BOOK_UNKNOWN_BOOK = "B1FF791EA9FA44698D5ABBB1963B94EC"
DECOS_JOIN_BOOK_KNOWN_BAG_OBJECTS = "90642DCCC2DB46469657C3D0DF0B1ED7"
Expand Down

0 comments on commit cbf2086

Please sign in to comment.