from django.db import models
from players.choices import POSITION_CHOICES

class League(models.Model):
    name = models.CharField(max_length=100)

    def __str__(self):
        return self.name

class ScoringSettings(models.Model):
    league = models.ForeignKey(League, on_delete=models.CASCADE)
    position = models.CharField(max_length=3, choices=POSITION_CHOICES)
    yards_per_point = models.FloatField()
    points_per_rushing_touchdown = models.FloatField()
    points_per_recieving_touchdown = models.FloatField()
    points_per_passing_touchdown = models.FloatField()
    points_per_reception = models.FloatField()
    points_per_passing_yard = models.FloatField()
    points_per_rushing_yard = models.FloatField()
    points_per_receiving_yard = models.FloatField()

    def __str__(self):
        return f"{self.league} - {self.position}"
