# plugins/plant/growlog/forms.py

from flask_wtf import FlaskForm
from wtforms import SelectField, StringField, TextAreaField, BooleanField, SubmitField
from wtforms.validators import DataRequired, Length

class GrowLogForm(FlaskForm):
    plant_uuid = SelectField(
        'Plant',
        choices=[],       # injected in view
        validators=[DataRequired()]
    )

    event_type = SelectField(
        'Event Type',
        choices=[
            ('water',      'Watered'),
            ('fertilizer', 'Fertilized'),
            ('repot',      'Repotted'),
            ('note',       'Note'),
            ('pest',       'Pest Observed'),
        ],
        validators=[DataRequired()]
    )

    title     = StringField('Title',   validators=[Length(max=255)])
    notes     = TextAreaField('Notes', validators=[Length(max=1000)])
    is_public = BooleanField('Public?')
    submit    = SubmitField('Save Log')
