from django.db import models

# Create your models here.
class approvals(models.Model):
	ApplicationType= (
		('Individu', 'Individu'),
		('Join', 'Join')
	)
	EmploymentLength = (
		('Old Employee', 'Old Employee'),
		('New Employee', 'New Employee')
	)
	HomeOwnership = (
		('MORTGAGE', 'MORTGAGE'),
		('OWN', 'OWN'),
		('RENT', 'RENT'),
		('ANY', 'ANY'),
		('OTHER', 'OTHER'),
		('NONE', 'NONE')

	)
	PURPOSE = (
		('debt_consolidation', 'debt_consolidation'),
		('business', 'business'),
		('asset', 'asset'),
		('educational', 'educational'),
		('medical', 'medical'),
		('wedding', 'wedding'),
		('vacation', 'vacation'),
		('moving', 'moving'),
		('other', 'other')
	)
	TERM = (
		('60 months', '60 months'),
		('36 months', '36 months')
	)
	firstname=models.CharField(max_length=15)
	lastname=models.CharField(max_length=15)
	annual_inc=models.IntegerField(default=0)
	application_type=models.CharField(max_length=15, choices=ApplicationType)
	dti=models.IntegerField(default=0)
	emp_length=models.CharField(max_length=24, choices=EmploymentLength)
	home_ownership=models.CharField(max_length=15, choices=HomeOwnership)
	installment=models.IntegerField(default=0)
	int_rate=models.IntegerField(default=0)
	last_pymnt_amnt=models.IntegerField(default=0)
	loan_amnt=models.IntegerField(default=0)
	purpose=models.CharField(max_length=24, choices=PURPOSE)
	term=models.CharField(max_length=24, choices=TERM)
	loan_difference=models.IntegerField(default=0)
	issue_d=models.DateField()
	loan_freq=models.IntegerField(default=0)



	def __str__(self):
		return '{}'.format(self.lastname, self.firstname)
