@@ -34,7 +34,9 @@ class SubsidyRequestStates:
3434
3535 CHOICES = COMMON_STATES + LC_REQUEST_STATES
3636
37-
37+ # DEPRECATED: This class was used to add 'reminded' to the list of possible
38+ # actions. Its functionality has been consolidated into the self-contained
39+ # `LearnerCreditRequestActionTypes` class.
3840class LearnerCreditAdditionalActionStates :
3941 """ Additional states specifically for LearnerCreditRequestActions. """
4042
@@ -43,8 +45,8 @@ class LearnerCreditAdditionalActionStates:
4345 (REMINDED , "Reminded" ),
4446 )
4547
46-
47- # Combined choices for LearnerCreditRequestAction model
48+ # DEPRECATED: This variable combined states from multiple classes in a way that
49+ # was confusing and brittle. Use `LearnerCreditRequestActionTypes.CHOICES` instead.
4850LearnerCreditRequestActionChoices = SubsidyRequestStates .CHOICES + LearnerCreditAdditionalActionStates .CHOICES
4951
5052
@@ -84,21 +86,59 @@ class SubsidyTypeChoices:
8486
8587SUBSIDY_REQUEST_BULK_OPERATION_BATCH_SIZE = 100
8688
89+ class LearnerCreditRequestActionTypes :
90+ """
91+ Defines the set of possible values for the `recent_action` field on the
92+ `LearnerCreditRequestActions` model. This represents the specific event
93+ or operation that occurred (e.g., an approval, a reminder).
94+ """
95+ REQUESTED = 'requested'
96+ APPROVED = 'approved'
97+ DECLINED = 'declined'
98+ ERROR = 'error'
99+ ACCEPTED = 'accepted'
100+ CANCELLED = 'cancelled'
101+ EXPIRED = 'expired'
102+ REVERSED = 'reversed'
103+ REMINDED = 'reminded'
104+
105+ CHOICES = (
106+ (REQUESTED , "Requested" ),
107+ (APPROVED , "Approved" ),
108+ (DECLINED , "Declined" ),
109+ (ERROR , "Error" ),
110+ (ACCEPTED , "Accepted" ),
111+ (CANCELLED , "Cancelled" ),
112+ (EXPIRED , "Expired" ),
113+ (REVERSED , "Reversed" ),
114+ (REMINDED , "Reminded" ),
115+ )
116+
87117
88118class LearnerCreditRequestUserMessages :
89119 """
90- User-facing messages for LearnerCreditRequestActions status field.
91- Reusing the state keys from SubsidyRequestStates but with different display messages.
120+ Defines the set of possible values for the `status` field on the
121+ `LearnerCreditRequestActions` model. This represents the user-facing
122+ status label that is displayed in the UI as a result of an action.
92123 """
124+ REQUESTED = 'requested'
125+ REMINDED = 'reminded'
126+ APPROVED = 'approved'
127+ ACCEPTED = 'accepted'
128+ DECLINED = 'declined'
129+ REVERSED = 'reversed'
130+ CANCELLED = 'cancelled'
131+ EXPIRED = 'expired'
132+
93133 CHOICES = (
94- (SubsidyRequestStates . REQUESTED , "Requested" ),
95- (LearnerCreditAdditionalActionStates . REMINDED , "Waiting For Learner" ),
96- (SubsidyRequestStates . APPROVED , "Waiting For Learner" ),
97- (SubsidyRequestStates . ACCEPTED , "Redeemed By Learner" ),
98- (SubsidyRequestStates . DECLINED , "Declined" ),
99- (SubsidyRequestStates . REVERSED , "Refunded" ),
100- (SubsidyRequestStates . CANCELLED , "Cancelled" ),
101- (SubsidyRequestStates . EXPIRED , "Expired" ),
134+ (REQUESTED , "Requested" ),
135+ (REMINDED , "Waiting For Learner" ),
136+ (APPROVED , "Waiting For Learner" ),
137+ (ACCEPTED , "Redeemed By Learner" ),
138+ (DECLINED , "Declined" ),
139+ (REVERSED , "Refunded" ),
140+ (CANCELLED , "Cancelled" ),
141+ (EXPIRED , "Expired" ),
102142 )
103143
104144
0 commit comments