6464class OperationService :
6565
6666 OPERATION_DEFAULT_START_DATE = datetime (2024 , 1 , 1 , tzinfo = ZoneInfo ("America/Vancouver" ))
67- MIN_REPORTING_YEAR = 2024
6867
6968 @classmethod
7069 def get_if_authorized (
@@ -770,6 +769,8 @@ def get_valid_operation_regulated_products(operation: Operation, reporting_year:
770769 return operation .regulated_products .filter (
771770 valid_from__lte = reporting_year_date , valid_to__gte = reporting_year_date
772771 )
772+
773+ @staticmethod
773774 def _is_reportable_operation_year (
774775 operation_year : tuple [UUID , int ],
775776 added_operation_years : set [tuple [UUID , int ]],
@@ -788,21 +789,6 @@ def _is_designated_to_user_operator(
788789 and designated_operator_timeline .operator .id == user_operator .operator_id
789790 )
790791
791- @classmethod
792- def _get_previous_reporting_years (cls ) -> QuerySet [ReportingYear ]:
793- """
794- Returns reporting years that are eligible for the Start Past Report workflow
795-
796- Only reporting years from MIN_REPORTING_YEAR up to (but not including) the current
797- reporting year are returned.
798- """
799- current_reporting_year = ReportingYearService .get_current_reporting_year ()
800-
801- return ReportingYear .objects .filter (
802- reporting_year__gte = cls .MIN_REPORTING_YEAR ,
803- reporting_year__lt = current_reporting_year .reporting_year ,
804- ).order_by ("-reporting_year" )
805-
806792 @staticmethod
807793 def _get_registration_purposes_for_operation_type (
808794 operation_type : str ,
@@ -887,7 +873,7 @@ def list_previous_reportable_operations(
887873
888874 user_operator = UserDataAccessService .get_user_operator_by_user (user_guid )
889875
890- reporting_years = cls . _get_previous_reporting_years ()
876+ reporting_years = ReportingYearService . get_previous_reporting_years ()
891877 year_values = {reporting_year .reporting_year for reporting_year in reporting_years }
892878
893879 timelines = list (
0 commit comments