You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The EligibilityType model contains two properties used by different phases of the system:
EligibilityType.name is used in the eligibility phase as part of the API call to verify
EligibilityType.group_id is used in the enrollment phase as the group to enroll eligible users into
However, as noted and fixed in #89, we may have multiple EligiblityType with the same name and different group_id. For example, a senior type for each transit agency, each with a different group_id.
The fix in #89 was somewhat of a hack, as these concerns could (should?) be split out to allow reusing EligibilityType instances. Thinking of a refactor along the lines of:
Before
classEligibilityType(models.Model):
"""Currently used for both eligibility and enrollment"""name=models.TextField()
label=models.TextField()
group_id=models.TextField()
classTransitAgency(models.Model):
# other fields ...eligibility_types=models.ManyToManyField(EligibilityType)
After
classEligibilityType(models.Model):
"""Used for eligibility checks - reused across agencies"""name=models.TextField()
label=models.TextField()
classBenefitGroup(models.Model):
"""Used for enrollment - at least one per agency"""name=models.TextField()
group_id=models.TextField()
eligibility_type=models.ForeignKey(EligibilityType, on_delete=models.PROTECT)
classTransitAgency(models.Model):
# other fields ...benefit_groups=models.ManyToManyField(BenefitGroup)
The text was updated successfully, but these errors were encountered:
Closing for now. This data model / relationship hasn't been a blocker, and the issue is creating noise on the backlog. Revisit in the future if needed.
The
EligibilityType
model contains two properties used by different phases of the system:EligibilityType.name
is used in the eligibility phase as part of the API call to verifyEligibilityType.group_id
is used in the enrollment phase as the group to enroll eligible users intoHowever, as noted and fixed in #89, we may have multiple
EligiblityType
with the samename
and differentgroup_id
. For example, asenior
type for each transit agency, each with a differentgroup_id
.The fix in #89 was somewhat of a hack, as these concerns could (should?) be split out to allow reusing
EligibilityType
instances. Thinking of a refactor along the lines of:Before
After
The text was updated successfully, but these errors were encountered: