from django.db import models
from django.utils.translation import gettext_lazy as _

from core.http.models import User


class AdditionalCost(models.Model):
    user = models.ForeignKey(
        to=User,
        verbose_name=_("User"),
        on_delete=models.CASCADE,
        null=True,
        blank=True,
    )
    reason = models.TextField(_("Name"))
    price = models.DecimalField(_("Price"), max_digits=10, decimal_places=2)
    created_at = models.DateTimeField(_("Created at"), auto_now_add=True)
    updated_at = models.DateTimeField(_("Updated at"), auto_now=True)

    class Meta:
        verbose_name = _("Additional cost")
        verbose_name_plural = _("Additional costs")

    def __str__(self):
        return self.reason
