# -*- coding: utf-8 -*-

from odoo import api, fields, models, _


class EquipmentType(models.Model):
    _name = 'fusion.equipment.type'
    _description = 'Equipment Type'
    _order = 'sequence, id'

    name = fields.Char(string='Name', required=True,
        help='e.g. "Manual Wheelchair", "Stair Lift", "Porch Lift"')
    code = fields.Char(string='Code', required=True, index=True,
        help='Technical code used in Selection fields, e.g. "manual_wheelchair", "stair_lift"')
    icon = fields.Char(string='Icon', default='fa-cog',
        help='FontAwesome icon class, e.g. "fa-wheelchair", "fa-arrow-up"')
    description = fields.Text(string='Description')
    sequence = fields.Integer(string='Sequence', default=10)
    active = fields.Boolean(string='Active', default=True)

    _sql_constraints = [
        ('code_unique', 'unique(code)', 'Equipment type code must be unique.'),
    ]
