Skip to content

Commit

Permalink
Added active for types and products (#9)
Browse files Browse the repository at this point in the history
* Added active for types and products

* Added active for types and products

* Added openLmisAccessible flag to payloads
  • Loading branch information
dborowiecki authored Jun 25, 2024
1 parent 5b923c8 commit 57d692f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ def format_payload_f(self):
"type": {"id": facility_type},
"active": enabled,
"enabled": enabled,
"openLmisAccessible": enabled,
"supportedPrograms": [
{"id": program_id}
for program_id in json.loads(supported_programs).values()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _add_missing(self):
add_category_code_f = udf(lambda name: f"{unidecode.unidecode(name.lower())}")
format_payload_f = udf(
lambda name, code, display: json.dumps(
{"code": code, "name": name, "displayOrder": display}
{"code": code, "name": name, "displayOrder": display, "active": True}
)
)
reduced_df = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def _add_missing(self):

format_payload_f = udf(
lambda name, code: json.dumps(
{"code": code, "name": name, "description": name}
{"code": code, "name": name, "description": name, "active": True}
)
)
reduced_df = reduced_df.withColumn(
Expand Down

0 comments on commit 57d692f

Please sign in to comment.