models:
  User:
    name: string
    email: string unique
    email_verified_at: timestamp nullable
    password: string
    remember_token: rememberToken

  CompanySetting:
    rif: string:15 nullable
    business_name: string
    trade_name: string nullable
    phone_primary: string:20 nullable
    phone_secondary: string:20 nullable
    email: string nullable
    address: text nullable
    city: string nullable
    state: string nullable
    zip_code: string:10 nullable
    currency_symbol: string:5 default:'$'
    currency_iso: string:3 default:'USD'
    exchange_rate: decimal:12,4 default:1.0000
    rate_updated_at: timestamp nullable
    tax_rate: decimal:5,2 default:16.00
    igtf_rate: decimal:5,2 default:3.00
    logo_path: string nullable
    favicon_path: string nullable
    logo_dark_path: string nullable
    license_key: text nullable
    trial_until: timestamp nullable
    trial_token: string nullable unique
    softDeletes: true

controllers:
  UserController:
    index:
      query: all
      render: users.index with:users
    create:
      render: users.create
    store:
      validate: name, email, password
      save: user
      redirect: users.index
    edit:
      render: users.edit with:user
    update:
      validate: name, email
      update: user
      redirect: users.index
    destroy:
      delete: user
      redirect: users.index

  CompanyController:
    edit:
      render: admin.company.index with:company
    update:
      validate: rif, business_name, email, phone_primary, address
      update: company
      redirect: company.edit


  RoleController:
    # Este controlador se especializará manualmente para Spatie
    index:
      render: roles.index
    create:
      render: roles.create
    store:
      validate: name
      redirect: roles.index
    edit:
      render: roles.edit
    update:
      validate: name
      redirect: roles.index
    destroy:
      redirect: roles.index
