"""Interface to the ows-notifications microservice.""" from oto import response from owsrequest import request from collaborator.constants import error, service_name from collaborator.utils import owsrequest def trigger_closed_period_notifications(items: list) -> response.Response: """Trigger closed period notifications in bulk. active_collaborator_ids (list): list of collaborator IDs with activity on this period. statement_period (dict): the statement_period period object. Returns: oto.response.Response """ path = "/collaborators/bulk-statement-period-closed-email" res = request.post( service_name.OWS_NOTIFICATIONS, path, json={"items": items}, ) return owsrequest.unwrap_data_or_error(res, error.ERROR_CODE_OWS_NOTIFICATIONS)