Purpose
The entity layer (InapescaWeb.Entidades namespace) provides Plain Old CLR Objects (POCOs) that serve as data transfer objects throughout the SMAF system. These entities represent the core business domain of expense and travel management in the Mexican Federal Public Administration.
Architecture
POCO Pattern
All entity classes follow the Plain Old CLR Object (POCO) pattern:- Simple C# classes with no framework dependencies
- Private fields with public property accessors
- Parameterless constructors for easy instantiation
- Serializable for data transfer and persistence
Data Transfer Objects
Entities function as DTOs to:- Transfer data between application layers
- Serialize/deserialize JSON and XML for web services
- Map to database records via data access layer
- Bind to UI controls in web forms
Core Entity Categories
Travel Management Entities
Comision
Travel assignment requests with approval workflow, transportation, lodging, and budget allocation
Itinerario
Flight itinerary details including airlines, flight numbers, dates, and passenger information
Expense Verification Entities
DatosComprobacion
Comprehensive expense verification data with totals for advance and accrued expenses
comprobacion
Individual expense proof records with dates, concepts, amounts, and observations
User and Organization Entities
Usuario
User authentication, profile information, roles, and organizational assignment
Ubicacion
Organizational unit details including address, contact information, and hierarchy
Resource Management Entities
Transporte
Vehicle and transportation resource catalog with classes, types, and availability status
ComisionDetalle
Detailed commission records with financial breakdowns by expense category
Field Naming Conventions
Hungarian Notation
Private fields use Hungarian notation prefixes:ls= Local String (e.g.,lsFolio,lsNombre)pd= Private Double (e.g.,pdTotalComprobado)_ls= Local String with underscore (e.g.,_lsUbicacion)
Property Naming
Public properties use descriptive Spanish names:Fecha_Solicitud= Request DateTotal_Viaticos= Total Per DiemUbicacion_Comisionado= Assignee LocationPartida_Presupuestal= Budget Line Item
Data Types
String-Based Architecture
Most properties usestring type for flexibility:
Numeric Properties
Financial calculations usedouble for precision:
Initialization Patterns
Default Constructors
Entities initialize fields to safe default values:Numeric Initialization
Financial entities initialize numeric fields to zero:Serialization Support
JSON Serialization
Entities serialize cleanly to JSON for REST APIs:XML Support
Specialized entities likecfdv33, cfdv4, cfdiv33, and cfdiv4 handle CFDI (Comprobante Fiscal Digital por Internet) XML invoice formats mandated by Mexican tax regulations.
Related Documentation
Data Access Layer
How entities map to database operations
Business Logic Layer
Entity validation and business rules
API Layer
Entity serialization in web services
Database Schema
Entity-to-table mappings