# Path: ratechecker/models.py
# class Product(models.Model):
#     """Loan Product."""
# 
#     FIXED = "FIXED"
#     ARM = "ARM"
# 
#     PAYMENT_TYPE_CHOICES = (
#         (FIXED, "Fixed Rate Mortgage"),
#         (ARM, "Adjustable Rate Mortgage"),
#     )
# 
#     JUMBO = "JUMBO"
#     CONF = "CONF"
#     AGENCY = "AGENCY"
#     FHA = "FHA"
#     VA = "VA"
#     VA_HB = "VA-HB"
#     FHA_HB = "FHA-HB"
# 
#     LOAN_TYPE_CHOICES = (
#         (JUMBO, "Jumbo Mortgage"),
#         (CONF, "Conforming Loan"),
#         (AGENCY, "Agency Loan"),
#         (FHA, "Federal Housing Administration Loan"),
#         (VA, "Veterans Affairs Loan"),
#         (VA_HB, "VA-HB Loan"),
#         (FHA_HB, "FHA-HB Loan"),
#     )
# 
#     REFI = "REFI"
#     PURCH = "PURCH"
# 
#     LOAN_PURPOSE_CHOICES = ((REFI, "Refinance"), (PURCH, "Purchase"))
# 
#     ARM_TYPES = ["3-1", "5-1", "7-1", "10-1"]
# 
#     plan_id = models.IntegerField(primary_key=True)
#     institution = models.CharField(max_length=16)
#     loan_purpose = models.CharField(
#         max_length=12, choices=LOAN_PURPOSE_CHOICES
#     )
#     pmt_type = models.CharField(
#         max_length=12, choices=PAYMENT_TYPE_CHOICES, default=FIXED
#     )
#     loan_type = models.CharField(max_length=12, choices=LOAN_TYPE_CHOICES)
#     loan_term = models.IntegerField()
#     int_adj_term = models.IntegerField(
#         null=True,
#         help_text="1st part of the ARM definition. E.g. 5 in 5/1 ARM",
#     )
#     adj_period = models.PositiveSmallIntegerField(null=True)
#     io = models.BooleanField()
#     arm_index = models.CharField(max_length=96, null=True)
# 
#     iac_help = "Max percentage points the rate can adjust at first adjustment."
#     int_adj_cap = models.IntegerField(null=True, help_text=iac_help)
# 
#     cap_text = "Max percentage points adjustable at each subsequent adjustment"
#     annual_cap = models.IntegerField(null=True, help_text=cap_text)
# 
#     loan_cap = models.IntegerField(
#         null=True,
#         help_text="Total lifetime maximum change that the ARM rate can have.",
#     )
#     arm_margin = models.DecimalField(max_digits=6, decimal_places=4, null=True)
#     ai_value = models.DecimalField(max_digits=6, decimal_places=4, null=True)
#     min_ltv = models.DecimalField(max_digits=6, decimal_places=3, null=True)
#     max_ltv = models.DecimalField(max_digits=6, decimal_places=3, null=True)
#     min_fico = models.IntegerField()
#     max_fico = models.IntegerField()
#     min_loan_amt = models.DecimalField(max_digits=12, decimal_places=2)
#     max_loan_amt = models.DecimalField(max_digits=12, decimal_places=2)
# 
#     # We're not really using the next three fields, but I'll leave them
#     # here for completeness
#     single_family = models.BooleanField(default=True)
#     condo = models.BooleanField(default=False)
#     coop = models.BooleanField(default=False)
#     data_timestamp = models.DateTimeField()


from decimal import Decimal
from localflavor.us.us_states import STATE_CHOICES
from rest_framework import serializers
from ratechecker.models import Product
        (ARM_TYPE_7_1, "7/1 ARM"),
        (ARM_TYPE_10_1, "10/1 ARM"),
    )

    # Default
    LOCK = 60
    LOCK_MIN = 46
    LOCK_MAX = 60
    POINTS = 0
    IO = 0
    PROPERTY_TYPE = PROPERTY_TYPE_SF
    LOAN_PURPOSE = Product.PURCH

    lock = serializers.IntegerField(default=LOCK)
    min_lock = serializers.IntegerField(default=LOCK_MIN)
    max_lock = serializers.IntegerField(default=LOCK_MAX)
    points = serializers.IntegerField(default=POINTS)
    property_type = serializers.ChoiceField(
        choices=PROPERTY_TYPE_CHOICES, default=PROPERTY_TYPE
    )
    loan_purpose = serializers.ChoiceField(
        choices=Product.LOAN_PURPOSE_CHOICES, default=LOAN_PURPOSE
    )
    io = serializers.IntegerField(default=IO)
    institution = serializers.CharField(max_length=20, required=False)
    loan_amount = serializers.DecimalField(max_digits=12, decimal_places=2)
    price = serializers.DecimalField(
        max_digits=12, decimal_places=2, required=False
    )
    state = serializers.ChoiceField(choices=STATE_CHOICES)

# Path: ratechecker/models.py
# class Product(models.Model):
#     """Loan Product."""
# 
#     FIXED = "FIXED"
#     ARM = "ARM"
# 
#     PAYMENT_TYPE_CHOICES = (
#         (FIXED, "Fixed Rate Mortgage"),
#         (ARM, "Adjustable Rate Mortgage"),
#     )
# 
#     JUMBO = "JUMBO"
#     CONF = "CONF"
#     AGENCY = "AGENCY"
#     FHA = "FHA"
#     VA = "VA"
#     VA_HB = "VA-HB"
#     FHA_HB = "FHA-HB"
# 
#     LOAN_TYPE_CHOICES = (
#         (JUMBO, "Jumbo Mortgage"),
#         (CONF, "Conforming Loan"),
#         (AGENCY, "Agency Loan"),
#         (FHA, "Federal Housing Administration Loan"),
#         (VA, "Veterans Affairs Loan"),
#         (VA_HB, "VA-HB Loan"),
#         (FHA_HB, "FHA-HB Loan"),
#     )
# 
#     REFI = "REFI"
#     PURCH = "PURCH"
# 
#     LOAN_PURPOSE_CHOICES = ((REFI, "Refinance"), (PURCH, "Purchase"))
# 
#     ARM_TYPES = ["3-1", "5-1", "7-1", "10-1"]
# 
#     plan_id = models.IntegerField(primary_key=True)
#     institution = models.CharField(max_length=16)
#     loan_purpose = models.CharField(
#         max_length=12, choices=LOAN_PURPOSE_CHOICES
#     )
#     pmt_type = models.CharField(
#         max_length=12, choices=PAYMENT_TYPE_CHOICES, default=FIXED
#     )
#     loan_type = models.CharField(max_length=12, choices=LOAN_TYPE_CHOICES)
#     loan_term = models.IntegerField()
#     int_adj_term = models.IntegerField(
#         null=True,
#         help_text="1st part of the ARM definition. E.g. 5 in 5/1 ARM",
#     )
#     adj_period = models.PositiveSmallIntegerField(null=True)
#     io = models.BooleanField()
#     arm_index = models.CharField(max_length=96, null=True)
# 
#     iac_help = "Max percentage points the rate can adjust at first adjustment."
#     int_adj_cap = models.IntegerField(null=True, help_text=iac_help)
# 
#     cap_text = "Max percentage points adjustable at each subsequent adjustment"
#     annual_cap = models.IntegerField(null=True, help_text=cap_text)
# 
#     loan_cap = models.IntegerField(
#         null=True,
#         help_text="Total lifetime maximum change that the ARM rate can have.",
#     )
#     arm_margin = models.DecimalField(max_digits=6, decimal_places=4, null=True)
#     ai_value = models.DecimalField(max_digits=6, decimal_places=4, null=True)
#     min_ltv = models.DecimalField(max_digits=6, decimal_places=3, null=True)
#     max_ltv = models.DecimalField(max_digits=6, decimal_places=3, null=True)
#     min_fico = models.IntegerField()
#     max_fico = models.IntegerField()
#     min_loan_amt = models.DecimalField(max_digits=12, decimal_places=2)
#     max_loan_amt = models.DecimalField(max_digits=12, decimal_places=2)
# 
#     # We're not really using the next three fields, but I'll leave them
#     # here for completeness
#     single_family = models.BooleanField(default=True)
#     condo = models.BooleanField(default=False)
#     coop = models.BooleanField(default=False)
#     data_timestamp = models.DateTimeField()


# Path: ratechecker/ratechecker_parameters.py
from decimal import Decimal
from localflavor.us.us_states import STATE_CHOICES
from rest_framework import serializers
from ratechecker.models import Product

        (ARM_TYPE_7_1, "7/1 ARM"),
        (ARM_TYPE_10_1, "10/1 ARM"),
    )

    # Default
    LOCK = 60
    LOCK_MIN = 46
    LOCK_MAX = 60
    POINTS = 0
    IO = 0
    PROPERTY_TYPE = PROPERTY_TYPE_SF
    LOAN_PURPOSE = Product.PURCH

    lock = serializers.IntegerField(default=LOCK)
    min_lock = serializers.IntegerField(default=LOCK_MIN)
    max_lock = serializers.IntegerField(default=LOCK_MAX)
    points = serializers.IntegerField(default=POINTS)
    property_type = serializers.ChoiceField(
        choices=PROPERTY_TYPE_CHOICES, default=PROPERTY_TYPE
    )
    loan_purpose = serializers.ChoiceField(
        choices=Product.LOAN_PURPOSE_CHOICES, default=LOAN_PURPOSE
    )
    io = serializers.IntegerField(default=IO)
    institution = serializers.CharField(max_length=20, required=False)
    loan_amount = serializers.DecimalField(max_digits=12, decimal_places=2)
    price = serializers.DecimalField(
        max_digits=12, decimal_places=2, required=False
    )
    state = serializers.ChoiceField(choices=STATE_CHOICES)

    loan_type = serializers.ChoiceField(choices=Product.LOAN_TYPE_CHOICES)