Skip to main content
This page documents the data models, entities, and Data Transfer Objects (DTOs) used throughout the application.

Domain Models

BiddingParticipant

Represents participants in public procurement bidding processes. Namespace: model
Table: BiddingParticipants
Id
int
Primary key
Ref
Guid
Unique reference code for participant tracking
NaturalPerson
Boolean
true for individual, false for legal entity
Name
string
Full name or company name
IdentificationOrNit
string
National ID or Tax ID (NIT)
Phone
string
Landline phone number
Cellular
string
Mobile phone number
Address
string
Physical address
City
string
City of residence/operation
Email
string
Contact email address
DateCreate
DateTime
Registration timestamp
Proposals
string
Filename of uploaded proposal PDF
MasterId
int?
Foreign key to Master (announcement/convocatoria)
Master
Master
Navigation property to related announcement
Example:
var participant = new BiddingParticipant
{
    Ref = Guid.NewGuid(),
    NaturalPerson = true,
    Name = "María García López",
    IdentificationOrNit = "43123456",
    Phone = "6048211234",
    Cellular = "3101234567",
    Address = "Carrera 10 #15-20",
    City = "Santa Fe de Antioquia",
    Email = "[email protected]",
    DateCreate = DateTime.Now,
    Proposals = "propuesta-maria-garcia-2026.pdf",
    MasterId = 5
};

Category

Service categories for organizational offerings. Namespace: model
Table: Categories
Id
int
Primary key
NameCategory
string
Category display name
UrlCategory
string
URL-friendly slug
Description
string
HTML content describing the category
CoverPage
string
Cover image filename
Statud
bool
Active/inactive status
DateCreate
DateTime
Creation timestamp
DateUpdate
DateTime
Last modification timestamp
Attributes:
  • Description field marked with [AllowHtml] and [DataType(DataType.MultilineText)]
Example:
var category = new Category
{
    NameCategory = "Acueducto",
    UrlCategory = "acueducto",
    Description = "<p>Servicio de agua potable...</p>",
    CoverPage = "acueducto-cover.jpg",
    Statud = true,
    DateCreate = DateTime.Now
};

Document

Legal and official documents with file attachments. Namespace: model
Table: Documents
ID
int
Primary key
Name
string
Document title
UrlName
string
URL-friendly identifier
NameProyect
string
Associated project/announcement name
Description
string
HTML description of document
CreateDate
DateTime
Creation date
DateUpdate
DateTime
Last update date
MasterId
int?
Optional foreign key to Master
Masters
Master
Navigation property to Master
FileDocument
ICollection<FileDocument>
Collection of attached files
Example:
var document = new Document
{
    Name = "Estatutos de la Empresa",
    UrlName = "estatutos-de-la-empresa",
    NameProyect = "Documentos Institucionales",
    Description = "<p>Estatutos vigentes...</p>",
    CreateDate = DateTime.Now,
    FileDocument = new List<FileDocument>
    {
        new FileDocument { NameFile = "Estatutos", RouteFile = "estatutos-2026.pdf" }
    }
};

Product

Services and products offered by the organization. Namespace: model
Table: Products
ProductId
int
Primary key
Name
string
Product/service name
UrlProduct
string
URL-friendly slug
Icono
string
Icon filename or CSS class
Description
string
HTML description
DateCreate
DateTime
Creation timestamp
Example:
var product = new Product
{
    Name = "Instalación de Medidores",
    UrlProduct = "instalacion-de-medidores",
    Icono = "icon-meter.svg",
    Description = "<p>Servicio de instalación...</p>",
    DateCreate = DateTime.Now
};

PQRSD

Petitions, Complaints, Claims, Suggestions, and Congratulations. Namespace: model
Table: PQRSDs
PQRSDID
Guid
Primary key (unique identifier)
NamePerson
string
Name of submitter
Email
string
Contact email
PQRSDName
string
Subject/title of request
Description
string
Detailed description (HTML)
NameSotypeOfRequest
string
Type: Petición, Queja, Reclamo, Sugerencia, Felicitación
DateCreate
DateTime
Submission date
File
string
Optional attachment filename
Reply
string
Administrative response
IsAnswered
Boolean
Response status
AnswerDate
DateTime
Date of response
Example:
var pqrsd = new PQRSD
{
    PQRSDID = Guid.NewGuid(),
    NamePerson = "Carlos Ramírez",
    Email = "[email protected]",
    PQRSDName = "Solicitud de instalación",
    Description = "Requiero instalación de servicio...",
    NameSotypeOfRequest = "Petición",
    DateCreate = DateTime.Now,
    IsAnswered = false
};

Employee

Organizational employees and staff members. Namespace: model
Table: Employees
EmployeeId
int
Primary key
Name
string
Full name of employee
CoverPage
string
Employee photo filename
Occupation
string
Job title or position
DateCreate
DateTime
Record creation timestamp (auto-set in constructor)
Constructor behavior:
public Employee() 
{
    DateCreate = DateTime.Now;
}
Example:
var employee = new Employee
{
    Name = "María García López",
    Occupation = "Gerente General",
    CoverPage = "maria-garcia.jpg"
    // DateCreate automatically set to DateTime.Now
};

Master

Multi-purpose polymorphic entity used for three distinct content types: blog posts, brigade events, and bidding announcements. The entity type is determined by Boolean flags. Namespace: model
Table: Masters
Id
int
Primary key
NameMaster
string
Title/name of the entry
UrlMaster
string
URL-friendly slug generated from NameMaster
Description
string
HTML content body (marked with [AllowHtml] and [DataType(DataType.MultilineText)])
CoverPage
string
Cover image filename (stored in different folders based on type)
Statud
Boolean
Active/inactive status for display

Blog Post Properties

Blog
Boolean
Set to true for blog posts/news articles
Author
string
Author name for blog posts

Brigade Event Properties

Brigade
Boolean
Set to true for brigade/health campaign events
DateBrigade
DateTime
Scheduled date of the brigade event

Bidding Announcement Properties

NacionLicitante
Boolean
Set to true for public procurement announcements
NacionLicitantegStartDate
DateTime
Bidding period start date
NacionLicitanteEndDate
DateTime
Bidding period end date

Audit Properties

DateCreate
DateTime
Record creation timestamp
DateUpdate
DateTime
Last modification timestamp
BiddingParticipants
IList<BiddingParticipant>
Related bidding participants (when NacionLicitante = true)
FileDocument
ICollection<FileDocument>
File attachments directly linked to this Master entry
Documents
ICollection<Document>
Related Document entities (additional documentation)

Entity Type Patterns

The Master table uses a Single Table Inheritance pattern where Boolean flags determine the entity type:

Design Notes

polymorphism
note
The Master entity consolidates three content types into a single table. Only one of the Boolean flags (Blog, Brigade, NacionLicitante) should be true per record.
storage
note
Cover images are stored in different folders based on entity type:
  • Blog: /images/blog/
  • Brigade: /images/brigade/
  • NacionLicitante: /images/nacionLicitante/
cascading
note
Deleting a Master entry cascades to:
  • BiddingParticipants (for announcements)
  • FileDocument (direct attachments)
  • Documents (related documentation)

FileDocument

File attachment entity for linking PDF and other documents to Master entries or Document records. Supports multiple file attachments per parent entity. Namespace: model
Table: FileDocuments
ID
int
Primary key
NameFile
string
Display name or title of the file
RouteFile
string
Physical filename stored on server (URL-friendly slug)

Optional Foreign Keys

DocumentoId
int?
Foreign key to Document entity (nullable)
Document
Document
Navigation property to parent Document
MasterId
int?
Foreign key to Master entity (nullable)
Masters
Master
Navigation property to parent Master

Relationship Rules

A FileDocument can be attached to either a Document or a Master, but not both:

Common Usage Scenarios

announcement-files
scenario
Bidding Announcement Files - Technical specifications, terms of reference, and annexes are attached to Master entries where NacionLicitante = true
Legal Document Files - Statutes, resolutions, and official documents are attached to Document entities
multi-file
scenario
Multiple Attachments - A single Document or Master can have multiple FileDocument entries, each representing a separate PDF

File Processing Flow

When creating FileDocument entries, the system:
  1. Extracts the original filename from IFormFile
  2. Formats the filename to URL-friendly slug (removes spaces, special characters)
  3. Uploads the physical file to /images/filesDocuments/ folder
  4. Creates FileDocument record with:
    • NameFile: Original or display name
    • RouteFile: Formatted filename on disk
    • Foreign key to parent entity
Example from NacionLicitanteService:
foreach (var item in model.NacionLicitantegFile)
{
    string _nameFile = Path.GetFileNameWithoutExtension(item.FileName);
    string _nameFileFormat = _formatStringUrl.FormatString(_nameFile);
    
    var _urlNameFile = _formatStringUrl.FormatString(_nameFileFormat);
    var _file = _uploadedFileIIS.UploadedFileImage(item, _urlNameFile, "filesDocuments");
    
    var _fileDocuments = new FileDocument
    {
        NameFile = model.NameMaster,
        RouteFile = _file,
        MasterId = _master.Id
    };
    
    await _context.AddAsync(_fileDocuments);
}

Deletion Cascade

When parent entities are deleted, FileDocument entries are removed along with physical files:
// From DocumentService.DeleteConfirmed
foreach (var _deleteFiles in _deleteFileDocument)
{
    _uploadedFileIIS.DeleteConfirmed(_deleteFiles.RouteFile, "filesDocuments");
    _context.Remove(new FileDocument { ID = _deleteFiles.ID });
}

Data Transfer Objects (DTOs)

BiddingParticipantCreateDTO

DTO for creating new bidding participants. Namespace: modelDTOs
NaturalPerson
Boolean
required
Person type selection
Name
string
required
Max 150 characters
IdentificationOrNit
string
required
Max 20 characters
Phone
string
required
Landline number
Cellular
string
required
Max 10 characters
Address
string
required
Max 150 characters
City
string
required
Max 50 characters
Email
string
required
Must be valid email format
Proposals
IFormFile
required
PDF file, max 10MB
MasterId
int?
Associated announcement ID
Validations:
  • [PdfSizes] - Max 10MB
  • [ValidateExtensionPDF] - Must be .pdf
  • [EmailAddress] - Valid email format
  • [Required] and [MaxLength] attributes on fields
Usage:
var dto = new BiddingParticipantCreateDTO
{
    NaturalPerson = true,
    Name = "Juan Pérez",
    IdentificationOrNit = "1234567890",
    Phone = "6041234567",
    Cellular = "3001234567",
    Address = "Calle 10 #20-30",
    City = "Medellín",
    Email = "[email protected]",
    Proposals = pdfFile,
    MasterId = 5
};

CategoryCreateDto

DTO for creating service categories. Namespace: modelDTOs
NameCategory
string
required
Max 150 characters, no special characters
Description
string
HTML content (multiline)
CoverPage
IFormFile
Image file (JPG, JPEG, GIF, PNG), max 2MB
Statud
bool
Active status
Validations:
  • [RegularExpression(@"^[-a-zA-Z0-9ñÑáéíóúáéíóúÁÉÍÓÚ ]{1,150}$")] - No special characters
  • [ValidateExtensionImg] - Image formats only
  • [ImageSizes] - Max 2MB
Usage:
var dto = new CategoryCreateDto
{
    NameCategory = "Acueducto",
    Description = "<p>Servicio de agua potable</p>",
    CoverPage = imageFile,
    Statud = true
};

CategoryEditDto

DTO for updating categories. Namespace: modelDTOs
Id
int
required
Category ID
NameCategory
string
Display name (read-only in edit)
Description
string
Updated HTML content
CoverPage
IFormFile
New image (optional, keeps existing if null)
Statud
bool
Active status

BlogCreateDto

DTO for creating blog posts. Namespace: modelDTOs
NameBlog
string
required
Blog post title
Description
string
required
HTML content
Author
string
required
Author name
CoverPage
IFormFile
Cover image (max 2MB)
Similar to CategoryCreateDto validations

DocumentCreateDTO

DTO for creating documents with multiple files. Namespace: modelDTOs
Name
string
required
Document title
Description
string
HTML description
MasterId
int?
Optional project association
RouteFile
List<IFormFile>
Collection of PDF files to attach
Usage:
var dto = new DocumentCreateDTO
{
    Name = "Plan de Desarrollo",
    Description = "<p>Plan oficial...</p>",
    MasterId = 8,
    RouteFile = new List<IFormFile> { file1, file2 }
};

Custom Validation Attributes

ImageSizes

Validates image file size. Location: modelDTOs.CustomValidations
Max Size: 2MB (2,097,152 bytes)

PdfSizes

Validates PDF file size. Location: modelDTOs.CustomValidations
Max Size: 10MB (10,485,760 bytes)

ValidateExtensionImg

Validates image file extensions. Allowed: .jpg, .jpeg, .gif, .png

ValidateExtensionPDF

Validates PDF file extension. Allowed: .pdf

Relationships

One-to-Many

Master → BiddingParticipants
1:N
One announcement can have multiple participants
Document → FileDocument
1:N
One document can have multiple file attachments
Master → FileDocument
1:N
One master entry can have multiple files
Master → Documents
1:N
One master can be associated with multiple documents

Foreign Keys

BiddingParticipant.MasterIdMaster.Id
Document.MasterIdMaster.Id
FileDocument.DocumentoIdDocument.ID

Database Configuration

Entity configurations are located in src/persistenDatabase/Config/:
  • BiddingParticipantConfig.cs
  • CategoryConfig.cs
  • DocumentConfig.cs
  • EmployeeConfig.cs
  • FileDocumentConfig.cs
  • MasterConfig.cs
  • PQRSDConfig.cs
  • ProductConfig.cs
These use Fluent API to configure:
  • Primary keys
  • Foreign key relationships
  • Column types and constraints
  • Index definitions
  • Default values

Build docs developers (and LLMs) love