from django import forms
from django.core.validators import MinValueValidator

from .. import container


class StripeDonationForm(forms.Form):
    recurring = forms.BooleanField(required=False)
    amount = forms.IntegerField(
        required=True,
        validators=[
            MinValueValidator(container.civi().minimum_donation_sync()),  # type: ignore
        ],
    )
    first_name = forms.CharField(required=True)
    last_name = forms.CharField(required=True)
    email = forms.EmailField(required=True)
    country = forms.CharField(required=True)
    street_address = forms.CharField(required=True)
    apartment_number = forms.CharField(required=False)
    city = forms.CharField(required=True)
    state = forms.CharField(required=False)
    postal_code = forms.CharField(required=True)
