Saltar al contenido principal

ADR-018 — Naming Convention (Hybrid Option C)

Status: Approved | Date: 2026-06 | Scope: All plugins

Context

FacturaScripts uses its own naming style — lowercase Spanish column names (codcliente, idempresa), abbreviated PascalCase PHP classes (FacturaCliente, EditCliente). The early obeliOmed plugins mixed camelCase columns (idPatient, appointmentDate) with FS conventions, creating inconsistency at every join boundary.

Decision

Adopt a hybrid convention (Option C) that is internally consistent within obeliOmed while accepting the FS naming as-is at join points.

ElementConventionExample
obeliOmed tablesobelio_<plugin>_<entity> snake_case English singularobelio_scheduling_appointment
obeliOmed columnssnake_case Englishappointment_date, id_patient
PHP classesPascalCase EnglishAppointment, AppointmentRoom
PHP methodscamelCase EnglishgetNextAppointment()
PHP variablescamelCase$patientName
ConstantsSCREAMING_SNAKESTATUS_IN_WAITING_ROOM
PHP filesMatch class nameAppointment.php
XML viewsMatch FS patternEditAppointment.xml, ListAppointment.xml
CSS classesobelio- prefix kebab-case.obelio-appt-card
TranslationsEnglish phrase as key"Appointment date": "Fecha de cita"
Code commentsEnglish (mandatory)See ADR-030
FS core joinsAccept FS naming as-isJOIN clientes ON clientes.codcliente = ...

Legacy oft_* tables are renamed to obelio_* in planned refactor migrations (see ADR-025).

Consequences

  • Internal consistency across all obeliOmed plugin code
  • Clear visual boundary between obeliOmed tables (obelio_*) and FS core tables (clientes, etc.)
  • Developers from modern PHP backgrounds find the code readable
  • FS community developers see slight divergence from FS conventions in plugin-specific code