Skip to content

Commit

Permalink
chore(models): add help_text for EnrollmentFlow fields
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman committed Aug 12, 2024
1 parent 95f6737 commit 30cb969
Show file tree
Hide file tree
Showing 2 changed files with 193 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Generated by Django 5.0.7 on 2024-08-07 21:22

from django.db import migrations
import benefits.core.models
import benefits.secrets
import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):
Expand All @@ -23,4 +26,127 @@ class Migration(migrations.Migration):
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."
),
),
]
85 changes: 66 additions & 19 deletions benefits/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,27 +160,18 @@ class EnrollmentFlow(models.Model):
"""Represents a user journey through the Benefits app for a single eligibility type."""

id = models.AutoField(primary_key=True)
name = models.TextField()
name = models.TextField(
help_text="Primary internal system name for this EnrollmentFlow instance, e.g. in analytics and Eligibility API requests." # noqa: 501
)
display_order = models.PositiveSmallIntegerField(default=0, blank=False, null=False)
eligibility_api_url = models.TextField(null=True, blank=True)
eligibility_api_auth_header = models.TextField(null=True, blank=True)
eligibility_api_auth_key_secret_name = SecretNameField(null=True, blank=True)
eligibility_type = models.ForeignKey(EligibilityType, on_delete=models.PROTECT)
# public key is used to encrypt Eligibility API requests and to verify signed Eligibility API responses
eligibility_api_public_key = models.ForeignKey(PemData, related_name="+", on_delete=models.PROTECT, null=True, blank=True)
# The JWE-compatible Content Encryption Key (CEK) key-length and mode
eligibility_api_jwe_cek_enc = models.TextField(null=True, blank=True)
# The JWE-compatible encryption algorithm
eligibility_api_jwe_encryption_alg = models.TextField(null=True, blank=True)
# The JWS-compatible signing algorithm
eligibility_api_jws_signing_alg = models.TextField(null=True, blank=True)
claims_provider = models.ForeignKey(ClaimsProvider, on_delete=models.PROTECT, null=True, blank=True)
selection_label_template = models.TextField()
eligibility_start_template = models.TextField(default="eligibility/start.html")
# reference to a form class used by this flow, e.g. benefits.eligibility.forms.FormClass
eligibility_form_class = models.TextField(null=True, blank=True)
eligibility_unverified_template = models.TextField(default="eligibility/unverified.html")
help_template = models.TextField(null=True, blank=True)
claims_provider = models.ForeignKey(
ClaimsProvider,
on_delete=models.PROTECT,
null=True,
blank=True,
help_text="An entity that provides claims for eligibility verification for this flow.",
)
claims_scope = models.TextField(
null=True,
blank=True,
Expand All @@ -196,6 +187,62 @@ class EnrollmentFlow(models.Model):
blank=True,
verbose_name="Claims scheme",
)
eligibility_api_url = models.TextField(
null=True, blank=True, help_text="Fully qualified URL for an Eligibility API server used by this flow."
)
eligibility_api_auth_header = models.TextField(
null=True,
blank=True,
help_text="The auth header to send in Eligibility API requests for this flow.",
)
eligibility_api_auth_key_secret_name = SecretNameField(
null=True,
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: 501
)
eligibility_api_public_key = models.ForeignKey(
PemData,
related_name="+",
on_delete=models.PROTECT,
null=True,
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
)
eligibility_api_jwe_cek_enc = models.TextField(
null=True,
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
)
eligibility_api_jwe_encryption_alg = models.TextField(
null=True,
blank=True,
help_text="The JWE-compatible encryption algorithm to use in Eligibility API requests for this flow.",
)
eligibility_api_jws_signing_alg = models.TextField(
null=True,
blank=True,
help_text="The JWS-compatible signing algorithm to use in Eligibility API requests for this flow.",
)
selection_label_template = models.TextField(
help_text="Path to a Django template that defines the end-user UI for selecting this flow among other options."
)
eligibility_start_template = models.TextField(
default="eligibility/start.html", help_text="Path to a Django template for the informational page of this flow."
)
eligibility_form_class = models.TextField(
null=True,
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
)
eligibility_unverified_template = 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.",
)
help_template = models.TextField(
null=True,
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
)

class Meta:
ordering = ["display_order"]
Expand Down

0 comments on commit 30cb969

Please sign in to comment.