-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor: rename EligibilityVerifier
to EnrollmentFlow
#2293
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
456b055
refactor(models): rename EligibilityVerifier to EnrollmentFlow
thekaveman 0b4c3bf
refactor(models): remove active flag from EnrollmentFlow
thekaveman 0720ffb
refactor(session): rename verifier -> flow
thekaveman fb091f8
refactor(eligibility): use EnrollmentFlow model
thekaveman ae44bd9
docs: verifier renamed to flow
thekaveman 79eeeee
chore(models): add help_text for EnrollmentFlow fields
thekaveman 7e85dca
chore(admin): update permission names for EnrollmentFlow
thekaveman bbf7ff8
refactor(migrations): centralize permissions helper
thekaveman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
9 changes: 1 addition & 8 deletions
9
benefits/core/migrations/0016_refactor_paymentprocessor_transitprocessor.py
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
9 changes: 1 addition & 8 deletions
9
benefits/core/migrations/0017_refactor_authprovider_claimsprovider.py
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
174 changes: 174 additions & 0 deletions
174
benefits/core/migrations/0021_rename_eligibilityverifier_enrollmentflow.py
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,174 @@ | ||
# Generated by Django 5.0.7 on 2024-08-07 21:22 | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
import benefits.core.models | ||
import benefits.secrets | ||
from benefits.core.migrations import create_all_permissions | ||
|
||
|
||
def update_permissions(apps, schema_editor): | ||
Group = apps.get_model("auth", "Group") | ||
staff_group = Group.objects.get(name="Cal-ITP") | ||
|
||
Permission = apps.get_model("auth", "Permission") | ||
|
||
remove_permissions = ["Can view", "Can change", "Can add", "Can delete"] | ||
for remove_permission in remove_permissions: | ||
current_permission = Permission.objects.get(name=f"{remove_permission} eligibility verifier") | ||
staff_group.permissions.remove(current_permission) | ||
current_permission.delete() | ||
|
||
add_permissions = ["Can view", "Can change"] | ||
for add_permission in add_permissions: | ||
new_permission = Permission.objects.get(name=f"{add_permission} enrollment flow") | ||
staff_group.permissions.add(new_permission) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("core", "0020_refactor_idg_config_eligibilityverifier"), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameModel( | ||
old_name="EligibilityVerifier", | ||
new_name="EnrollmentFlow", | ||
), | ||
migrations.RenameField( | ||
model_name="transitagency", | ||
old_name="eligibility_verifiers", | ||
new_name="enrollment_flows", | ||
), | ||
migrations.RemoveField( | ||
model_name="enrollmentflow", | ||
name="active", | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="claims_provider", | ||
field=models.ForeignKey( | ||
blank=True, | ||
help_text="An entity that provides claims for eligibility verification for this flow.", | ||
null=True, | ||
on_delete=django.db.models.deletion.PROTECT, | ||
to="core.claimsprovider", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="eligibility_api_auth_header", | ||
field=models.TextField( | ||
blank=True, help_text="The auth header to send in Eligibility API requests for this flow.", null=True | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="eligibility_api_auth_key_secret_name", | ||
field=benefits.core.models.SecretNameField( | ||
blank=True, | ||
help_text="The name of a secret containing the value of the auth header to send in Eligibility API requests for this flow.", # noqa: E501 | ||
max_length=127, | ||
null=True, | ||
validators=[benefits.secrets.SecretNameValidator()], | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="eligibility_api_jwe_cek_enc", | ||
field=models.TextField( | ||
blank=True, | ||
help_text="The JWE-compatible Content Encryption Key (CEK) key-length and mode to use in Eligibility API requests for this flow.", # noqa: E501 | ||
null=True, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="eligibility_api_jwe_encryption_alg", | ||
field=models.TextField( | ||
blank=True, | ||
help_text="The JWE-compatible encryption algorithm to use in Eligibility API requests for this flow.", | ||
null=True, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="eligibility_api_jws_signing_alg", | ||
field=models.TextField( | ||
blank=True, | ||
help_text="The JWS-compatible signing algorithm to use in Eligibility API requests for this flow.", | ||
null=True, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="eligibility_api_public_key", | ||
field=models.ForeignKey( | ||
blank=True, | ||
help_text="The public key used to encrypt Eligibility API requests and to verify signed Eligibility API responses for this flow.", # noqa: E501 | ||
null=True, | ||
on_delete=django.db.models.deletion.PROTECT, | ||
related_name="+", | ||
to="core.pemdata", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="eligibility_api_url", | ||
field=models.TextField( | ||
blank=True, help_text="Fully qualified URL for an Eligibility API server used by this flow.", null=True | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="eligibility_form_class", | ||
field=models.TextField( | ||
blank=True, | ||
help_text="The fully qualified Python path of a form class used by this flow, e.g. benefits.eligibility.forms.FormClass", # noqa: E501 | ||
null=True, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="eligibility_start_template", | ||
field=models.TextField( | ||
default="eligibility/start.html", | ||
help_text="Path to a Django template for the informational page of this flow.", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="eligibility_unverified_template", | ||
field=models.TextField( | ||
default="eligibility/unverified.html", | ||
help_text="Path to a Django template that defines the page when a user fails eligibility verification for this flow.", # noqa: E501 | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="help_template", | ||
field=models.TextField( | ||
blank=True, | ||
help_text="Path to a Django template that defines the help text for this enrollment flow, used in building the dynamic help page for an agency", # noqa: E501 | ||
null=True, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="name", | ||
field=models.TextField( | ||
help_text="Primary internal system name for this EnrollmentFlow instance, e.g. in analytics and Eligibility API requests." # noqa: E501 | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="selection_label_template", | ||
field=models.TextField( | ||
help_text="Path to a Django template that defines the end-user UI for selecting this flow among other options." | ||
), | ||
), | ||
migrations.RunPython(create_all_permissions), | ||
migrations.RunPython(update_permissions), | ||
] |
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,8 @@ | ||
from django.contrib.auth.management import create_permissions | ||
|
||
|
||
def create_all_permissions(apps, schema_editor): | ||
for app_config in apps.get_app_configs(): | ||
app_config.models_module = True | ||
create_permissions(app_config, apps=apps, verbosity=0) | ||
app_config.models_module = None |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would we want to use
flow_name
instead ofverifier_name
? Or maybe we decided to use this name since the analytics will still sendeligibility_verifier
/verifier_name
key/values inupdate_event_properties
andupdate_user_properties
. It doesn't affect any functionality but I was wondering about this line.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think it needs to stay
verifier_name
so that existing analytics charts still work and then #2248 will take care of updating it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, purposefully ignored the analytics code in this PR, to wait for #2248