Skip to content

Commit

Permalink
Merge pull request cfpb#8499 from cfpb/tccp/apr-no-score
Browse files Browse the repository at this point in the history
TCCP: Dataset format updates
  • Loading branch information
chosak authored Jul 9, 2024
2 parents a0c0ead + 149699b commit e6fc558
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cfgov/tccp/filterset.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class CardSurveyDataFilterSet(filters.FilterSet):
widget=forms.MultipleHiddenInput,
)
small_institution = CheckboxFilter(
"top_25_institution", label="Small institution", exclude=True
"issued_by_top_25_institution", label="Small institution", exclude=True
)
no_account_fee = CheckboxFilter(
"periodic_fee_type",
Expand Down
2 changes: 1 addition & 1 deletion cfgov/tccp/jinja2/tccp/card.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ <h2>Review details with the company before applying</h2>
</p>
{{ render_contact_info(card) }}

{% if not card.top_25_institution %}
{% if not card.issued_by_top_25_institution %}
<div class="u-mt30">
{{ speed_bump( {
'content': (
Expand Down
37 changes: 37 additions & 0 deletions cfgov/tccp/migrations/0013_dataset_updates.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Generated by Django 4.2.11 on 2024-07-08 17:51

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("tccp", "0012_cardsurveydata_institution_type"),
]

operations = [
migrations.RenameField(
model_name="cardsurveydata",
old_name="top_25_institution",
new_name="issued_by_top_25_institution",
),
migrations.AddField(
model_name="cardsurveydata",
name="advance_apr_no_score",
field=models.FloatField(blank=True, db_index=True, null=True),
),
migrations.AddField(
model_name="cardsurveydata",
name="intro_apr_no_score",
field=models.FloatField(blank=True, db_index=True, null=True),
),
migrations.AddField(
model_name="cardsurveydata",
name="purchase_apr_no_score",
field=models.FloatField(blank=True, db_index=True, null=True),
),
migrations.AddField(
model_name="cardsurveydata",
name="transfer_apr_no_score",
field=models.FloatField(blank=True, db_index=True, null=True),
),
]
19 changes: 15 additions & 4 deletions cfgov/tccp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,9 @@ class CardSurveyData(models.Model):
choices=enums.IndexTypeChoices, null=True, blank=True
)
purchase_apr_vary_by_credit_tier = YesNoBooleanField(null=True, blank=True)
purchase_apr_no_score = models.FloatField(
null=True, blank=True, db_index=True
)
purchase_apr_poor = models.FloatField(null=True, blank=True, db_index=True)
purchase_apr_good = models.FloatField(null=True, blank=True, db_index=True)
purchase_apr_great = models.FloatField(
Expand All @@ -524,6 +527,9 @@ class CardSurveyData(models.Model):
introductory_apr_vary_by_credit_tier = YesNoBooleanField(
null=True, blank=True
)
intro_apr_no_score = models.FloatField(
null=True, blank=True, db_index=True
)
intro_apr_poor = models.FloatField(null=True, blank=True, db_index=True)
intro_apr_good = models.FloatField(null=True, blank=True, db_index=True)
intro_apr_great = models.FloatField(null=True, blank=True, db_index=True)
Expand All @@ -537,6 +543,9 @@ class CardSurveyData(models.Model):
balance_transfer_apr_vary_by_credit_tier = YesNoBooleanField(
null=True, blank=True
)
transfer_apr_no_score = models.FloatField(
null=True, blank=True, db_index=True
)
transfer_apr_poor = models.FloatField(null=True, blank=True, db_index=True)
transfer_apr_good = models.FloatField(null=True, blank=True, db_index=True)
transfer_apr_great = models.FloatField(
Expand All @@ -553,6 +562,9 @@ class CardSurveyData(models.Model):
cash_advance_apr_vary_by_credit_tier = YesNoBooleanField(
null=True, blank=True
)
advance_apr_no_score = models.FloatField(
null=True, blank=True, db_index=True
)
advance_apr_poor = models.FloatField(null=True, blank=True, db_index=True)
advance_apr_good = models.FloatField(null=True, blank=True, db_index=True)
advance_apr_great = models.FloatField(null=True, blank=True, db_index=True)
Expand Down Expand Up @@ -691,10 +703,9 @@ class CardSurveyData(models.Model):
website_for_consumer = models.TextField(null=True, blank=True)
telephone_number_for_consumers = models.TextField(null=True, blank=True)

# This field doesn't currently exist in the TCCP dataset.
# See tccp.management.commands.patch_tccp.
# Once this is added to the dataset, the default=False can be removed.
top_25_institution = YesNoBooleanField(default=False, db_index=True)
issued_by_top_25_institution = YesNoBooleanField(
default=False, db_index=True
)

class Meta:
indexes = [
Expand Down
2 changes: 1 addition & 1 deletion cfgov/tccp/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ class Meta(CardSurveyDataSerializer.Meta):
"annual_fee_estimated",
"institution_name",
"issued_by_credit_union",
"issued_by_top_25_institution",
"periodic_fee_type",
"product_name",
"purchase_apr_for_tier_max",
"purchase_apr_for_tier_min",
"purchase_apr_for_tier_rating",
"requirements_for_opening",
"rewards",
"top_25_institution",
"transfer_apr_for_tier_max",
"transfer_apr_for_tier_min",
"url",
Expand Down

0 comments on commit e6fc558

Please sign in to comment.