You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
441 B

  1. from .repositories import BaseRepository
  2. from .writers import BaseWriter
  3. class ExportApplicationService:
  4. def __init__(self, repository: BaseRepository, writer: BaseWriter):
  5. self.repository = repository
  6. self.writer = writer
  7. def export(self, export_approved=False) -> str:
  8. records = self.repository.list(export_approved=export_approved)
  9. filepath = self.writer.write(records)
  10. return filepath