# core/forms.py
from django import forms
from .models import Branch


class BranchForm(forms.ModelForm):
    class Meta:
        model = Branch
        fields = ['name', 'code', 'address', 'phone', 'is_active']
        widgets = {
            'name': forms.TextInput(attrs={
                'class': 'form-control gradient-input',
                'placeholder': 'Branch name (e.g. Main Shop, Zaria Branch)'
            }),
            'code': forms.TextInput(attrs={
                'class': 'form-control gradient-input',
                'placeholder': 'Unique code (e.g. MAIN, KANO01)'
            }),
            'address': forms.Textarea(attrs={
                'class': 'form-control gradient-input',
                'rows': 2,
                'placeholder': 'Branch address'
            }),
            'phone': forms.TextInput(attrs={
                'class': 'form-control gradient-input',
                'placeholder': 'Branch phone'
            }),
            'is_active': forms.CheckboxInput(attrs={
                'class': 'form-check-input'
            }),
        }
