-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8df4a1f
commit 66d9a92
Showing
4 changed files
with
35 additions
and
15 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
flux_sdk/benefits_enrollments/capabilities/report_employee_enrollments/README
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
This capability is responsible for accepting data that describes the companies benefits the lines which employees are enrolled in and returning a formated file to be sent to the 3rd party according to the app configuration. | ||
|
||
|
||
An simple implementation might look like | ||
``` | ||
COLUMNS = [ | ||
# column strings | ||
] | ||
def format_employee_enrollment_data( | ||
companyEnrollmentInfo: CompanyEnrollmentInfo, | ||
employee: list[Employee] | ||
) -> File: | ||
csv_output = contextlib.closing(io.StringIO()) | ||
writer = csv.DictWriter(csv_output, fieldnames=COLUMNS) | ||
|
||
for employee_enrollment in companyEnrollmentInfo.employeeEnrollments: | ||
row = { | ||
# define data for each column here | ||
} | ||
writer.writerow(row) | ||
|
||
file = File() | ||
file.name = # your file name | ||
file.content = csv_output.getvalue().encode() | ||
return file | ||
``` |
5 changes: 0 additions & 5 deletions
5
flux_sdk/benefits_enrollments/capabilities/report_employee_enrollments/data_models.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters