Skip to main content
This page documents all API controllers in the ESP Santa Fe de Antioquia application. Controllers handle HTTP requests and coordinate between the presentation layer and service layer.

BiddingParticipantsController

Manages bidding participants and proposals for public procurement processes. Namespace: prjESPSantaFeAnt.Controllers
Route Prefix: /BiddingParticipants

Dependencies

_context
ApplicationDbContext
Database context for direct queries
_biddingParticipantService
IBiddingParticipantService
Service layer for bidding participant operations
_nacionLicitante
INacionLicitanteService
Service for managing bidding announcements

Actions

Index

Retrieves all bidding participants with their associated announcements.
authorization
string
required
Requires SuperAdmin or Admin role
return
IActionResult
View with collection of ModelViewBiddingParticipant
[Authorize(Roles = "SuperAdmin,Admin")]
public async Task<IActionResult> Index()

Details (by ID)

Retrieves detailed information about a specific bidding participant.
id
int?
required
Unique identifier of the bidding participant
return
IActionResult
View with ModelViewBiddingParticipant or NotFound
[Authorize(Roles = "SuperAdmin,Admin,UserApp")]
public async Task<IActionResult> Details(int? id)

Details (by Reference)

Retrieves participant details using a unique reference code.
reference
string
required
GUID reference code for the participant
route
string
/convocatorias/reference/{reference}
[Authorize(Roles = "SuperAdmin,Admin,UserApp")]
[Route("convocatorias/reference/{reference}")]
public async Task<IActionResult> Details(string reference)

Create (GET)

Displays the form to register a new bidding participant.
idConvocatoria
int
required
ID of the announcement/convocatoria
[Authorize(Roles = "SuperAdmin,Admin,UserApp")]
public async Task<IActionResult> Create(int idConvocatoria)

Create (POST)

Registers a new bidding participant with proposal document.
model
BiddingParticipantCreateDTO
required
Participant data including proposal PDF
validations
object
[HttpPost]
[ValidateAntiForgeryToken]
[Authorize(Roles = "SuperAdmin,Admin,UserApp")]
public async Task<IActionResult> Create(BiddingParticipantCreateDTO model)

Delete

Removes a bidding participant and their proposal file.
id
int
required
Participant ID to delete
authorization
string
Requires SuperAdmin or Admin role
[Authorize(Roles = "SuperAdmin,Admin")]
[HttpPost, ActionName("Delete")]
[ValidateAntiForgeryToken]
public async Task<IActionResult> DeleteConfirmed(int id)

BlogController

Manages blog posts and news articles. Namespace: prjESPSantaFeAnt.Controllers
Route Prefix: /Blog

Dependencies

_context
ApplicationDbContext
Database context
_blogService
IBlogService
Service layer for blog operations

Actions

Index

Lists all blog posts for admin management.
authorization
string
required
Requires SuperAdmin or Admin role
return
IActionResult
View with collection of ModelViewBlog
[Authorize(Roles = "SuperAdmin,Admin")]
public async Task<IActionResult> Index()

Notice

Public-facing paginated news listing.
page
int?
Page number for pagination (default: 1)
route
string
/noticias
pageSize
int
6 posts per page
[Route("noticias")]
[AllowAnonymous]
public async Task<IActionResult> Notice(int? page)

Details (by URL)

Displays a single blog post to public users.
urlBlog
string
required
URL-friendly slug of the blog post
route
string
/noticias/{urlBlog}
[Route("noticias/{urlBlog}")]
[AllowAnonymous]
public async Task<IActionResult> Details(string urlBlog)

Create

Creates a new blog post with cover image.
model
BlogCreateDto
required
Blog post data
validations
object
[HttpPost]
[ValidateAntiForgeryToken]
[Authorize(Roles = "SuperAdmin,Admin")]
public async Task<IActionResult> Create(BlogCreateDto model)

Edit

Updates an existing blog post.
id
int
required
Blog post ID
model
BlogEditDto
required
Updated blog data
note
string
Cover page update is optional; existing image retained if not provided
[HttpPost]
[ValidateAntiForgeryToken]
[Authorize(Roles = "SuperAdmin,Admin")]
public async Task<IActionResult> Edit(int id, BlogEditDto model)

CategoriesController

Manages service categories for the organization. Namespace: prjESPSantaFeAnt.Controllers
Route Prefix: /Categories

Dependencies

_categoryService
ICategoryService
Service layer for category operations

Actions

Index

Lists all categories.
authorization
string
required
Requires SuperAdmin role
[Authorize(Roles = "SuperAdmin")]
public async Task<IActionResult> Index()

Details (by Name)

Displays category details to public users.
nameCategory
string
required
URL-friendly category name
route
string
/servicios/{nameCategory}
[Route("servicios/{nameCategory}")]
public async Task<IActionResult> Details(string nameCategory)

Create

Creates a new service category.
model
CategoryCreateDto
required
Category data with cover image
validations
object
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Create(CategoryCreateDto model)

DocumentsController

Manages legal documents and file uploads. Namespace: prjESPSantaFeAnt.Controllers
Route Prefix: /Documents

Dependencies

_documentService
IDocumentService
Service layer for document operations
_context
ApplicationDbContext
Database context for dropdown population

Actions

Document

Public listing of all legal documents.
route
string
/documentos-legales
return
IActionResult
View with collection of documents including associated files
[Route("documentos-legales")]
public async Task<IActionResult> Document()

Details (by URL)

Displays document details with downloadable files.
urlName
string
required
URL-friendly document identifier
route
string
/documentos-legales/{urlName}
includes
array
Returns document with collection of FileDocument objects
[Route("documentos-legales/{urlName}")]
public async Task<IActionResult> Details(string urlName)

Create

Creates a new document with multiple file uploads.
model
DocumentCreateDTO
required
Document metadata and files
features
object
[Authorize(Roles = "SuperAdmin,Admin")]
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Create(DocumentCreateDTO model)

PublicDocuments

Serves PDF files for download.
routeFile
string
required
File path within filesDocuments directory
return
FileResult
PDF file with application/pdf content type
[AllowAnonymous]
[ActionName("documentos-publicos")]
public FileResult PublicDocuments(string routeFile)

ProductsController

Manages service products offered by the organization. Namespace: prjESPSantaFeAnt.Controllers

Actions

ListProducts

Public listing of all available services/products.
route
string
/servicios
[Route("servicios")]
public async Task<IActionResult> ListProducts()

Create

Adds a new product/service.
model
ProductCreateDto
required
Product data including icon and description
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Create(ProductCreateDto model)

PQRSDsController

Handles PQRSD (Petitions, Complaints, Claims, Suggestions, and Congratulations) requests. Namespace: prjESPSantaFeAnt.Controllers

Dependencies

_iPQSDService
IPQRSDService
Service layer for PQRSD operations

Actions

Index

Lists all PQRSD submissions for admin review.
authorization
string
required
Requires SuperAdmin or Admin role
return
IActionResult
Collection showing submission status and type
[Authorize(Roles = "SuperAdmin,Admin")]
public IActionResult Index()

Create

Public form for submitting PQRSD requests.
route
string
/formular-pqrsd
model
PQRSDCreateDto
required
Citizen request data
return
Guid
Returns unique reference code via TempData
[Route("formular-pqrsd")]
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Create(PQRSDCreateDto model)

Review

Administrative response to a PQRSD submission.
model
ReviewCreateDto
required
Admin response and resolution
updates
object
[HttpPost]
[ValidateAntiForgeryToken]
public IActionResult Review(ReviewCreateDto model)

Details

View full PQRSD details including response if available.
id
Guid?
required
Unique PQRSD identifier
return
ModelViewPQRSD
Complete request and response information
[Authorize(Roles = "SuperAdmin,Admin")]
public IActionResult Details(Guid? id)

Common Patterns

Authorization

Most controllers use role-based authorization:

Anti-Forgery Protection

All POST actions use [ValidateAntiForgeryToken] to prevent CSRF attacks.

Date Formatting

Dates are formatted using Spanish Colombian culture:
DateCreate.ToString("MMMM dd, yyyy", CultureInfo.CreateSpecificCulture("es-CO"))

File Handling

File uploads are processed through IUploadedFileIIS service with validation:
  • Images: JPG, JPEG, GIF, PNG (max 2MB)
  • PDFs: PDF format (max 10MB)

HomeController

Main landing page and public-facing content controller. Namespace: prjESPSantaFeAnt.Controllers
Route Prefix: /

Dependencies

_logger
ILogger<HomeController>
Logging service for error tracking
_blogService
IBlogService
Service to retrieve blog posts for homepage

Actions

Index

Displays the homepage with recent blog posts.
return
IActionResult
Main landing page view with 3 most recent blog posts
viewData
object
Populates ViewData["Blog"] with latest posts via LimitHome()
public async Task<IActionResult> Index()

About

Displays the “About Us” page.
public IActionResult About()

FunctionManual

Downloads the employee function manual PDF.
return
FileResult
PDF file stream for download
file
string
/files/manual-de-funciones.pdf
public FileResult FunctionManual()
Example:
// Downloads with friendly filename
return File("/files/manual-de-funciones.pdf", 
    "application/pdf", 
    "manual-de-funciones-empresa-de-servicios-publicos-de-santa-fe-de-antioquia.pdf");

Privacy

Displays the privacy policy page.
public IActionResult Privacy()

Error

Global error handler with request tracing.
responseCache
attribute
No caching for error pages
return
ErrorViewModel
Error view with request ID for debugging
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()

AdminController

Administrative functions for SuperAdmin users including role management and homepage customization. Namespace: prjESPSantaFeAnt.Controllers
Route Prefix: /Admin

Dependencies

_roleManager
RoleManager<IdentityRole>
ASP.NET Identity role manager
_uploadedFileIIS
IUploadedFileIIS
File upload service for cover page management

Actions

Index

Lists all system roles.
authorization
string
required
Requires SuperAdmin role
return
IActionResult
View with collection of roles from AspNetRoles table
[Authorize(Roles = "SuperAdmin")]
public IActionResult Index()

Create (GET)

Displays role creation form.
[HttpGet]
[Authorize(Roles = "SuperAdmin")]
public IActionResult Create()

Create (POST)

Creates a new system role.
model
ModelViewRoles
required
Role data containing RoleName
process
object
[HttpPost]
[Authorize(Roles = "SuperAdmin")]
public async Task<IActionResult> Create(ModelViewRoles model)
Example:
var identityRole = new IdentityRole
{
    Name = "UserApp"
};
await _roleManager.CreateAsync(identityRole);

Profile

User profile management page.
authorization
string
required
Requires SuperAdmin, Admin, or UserApp role
[HttpGet]
[Authorize(Roles = "SuperAdmin,Admin,UserApp")]
public IActionResult Profile()

AddCoverpage (GET)

Displays form to upload homepage cover image.
authorization
string
required
Requires SuperAdmin or Admin role
[HttpGet]
[Authorize(Roles = "SuperAdmin,Admin")]
public IActionResult AddCoverpage()

AddCoverpage (POST)

Uploads a new homepage cover image.
model
ModelViewCoverage
required
Contains IFormFile for JPG image
validations
object
[HttpPost]
[Authorize(Roles = "SuperAdmin,Admin")]
public IActionResult AddCoverpage(ModelViewCoverage model)
Note: Uses UploadedFileImage("Coverpague", model.File, string.Empty, true) with replace flag.

TempleteCoverage

Downloads the cover page design template.
return
FileResult
RAR file containing design guidelines
file
string
guia_para_la_portada.rar
[HttpGet]
[Authorize(Roles = "SuperAdmin,Admin")]
public FileResult TempleteCoverage()

NacionLicitanteController

Manages public procurement announcements and bidding processes (Licitaciones). Namespace: prjESPSantaFeAnt.Controllers
Route Prefix: /NacionLicitante

Dependencies

_context
ApplicationDbContext
Database context for queries
_nacionLicitante
INacionLicitanteService
Service layer for announcement operations

Actions

Index

Administrative listing of all bidding announcements.
authorization
string
required
Requires SuperAdmin or Admin role
return
IActionResult
View with collection of ModelViewNacionLicitante including dates formatted in Spanish
[Authorize(Roles = "SuperAdmin,Admin")]
public async Task<IActionResult> Index()

Details (by URL)

Public view of a specific bidding announcement with attached documents.
nameNacionLicitante
string
required
URL-friendly announcement identifier
route
string
/convocatorias/{nameNacionLicitante}
includes
object
[Route("convocatorias/{nameNacionLicitante}")]
public async Task<IActionResult> Details(string nameNacionLicitante)
Status validation:
// Announcement is active if current date is between start and end dates
bool statud = ValidateActivo(_master);
// Checks: dateTime >= NacionLicitantegStartDate && dateTime <= NacionLicitanteEndDate

Create (GET)

Displays form to create new bidding announcement.
[Authorize(Roles = "SuperAdmin,Admin")]
public IActionResult Create()

Create (POST)

Creates a new bidding announcement with cover image and optional documents.
model
NacionLicitanteCreateDto
required
Announcement data including dates and files
validations
object
[Authorize(Roles = "SuperAdmin,Admin")]
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Create(NacionLicitanteCreateDto model)

Delete (GET)

Displays confirmation view for announcement deletion.
id
int?
required
Announcement ID
[Authorize(Roles = "SuperAdmin,Admin")]
public async Task<IActionResult> Delete(int? id)

DeleteConfirmed

Permanently removes announcement with all related files and documents.
id
int
required
Announcement ID to delete
cascade
object
[Authorize(Roles = "SuperAdmin,Admin")]
[HttpPost, ActionName("Delete")]
[ValidateAntiForgeryToken]
public async Task<IActionResult> DeleteConfirmed(int id)

OfficialLicitante

Serves PDF documents for download.
routeFile
string
required
Filename within filesDocuments directory
route
string
Action name: Documento-Oficial-de-la-convocatoria
[Authorize(Roles = "UserApp")]
[AllowAnonymous]
[ActionName("Documento-Oficial-de-la-convocatoria")]
public FileResult OfficialLicitante(string routeFile)

ListGetAll

Public listing of all active announcements.
route
string
/convocatorias
filter
string
Only displays announcements where Statud == true
[Route("convocatorias")]
public async Task<IActionResult> ListGetAll()

BrigadesController

Manages community brigade events and health campaigns. Namespace: prjESPSantaFeAnt.Controllers
Route Prefix: /Brigades

Dependencies

_brigadeService
IBrigadeService
Service layer for brigade operations

Actions

Index

Administrative listing of all brigade events.
authorization
string
required
Requires SuperAdmin or Admin role
return
IActionResult
Collection of brigades with formatted dates (Spanish locale)
[Authorize(Roles = "SuperAdmin,Admin")]
public async Task<IActionResult> Index()

Details (by ID)

Administrative view of brigade details.
id
int?
required
Brigade ID
[Authorize(Roles = "SuperAdmin,Admin")]
public async Task<IActionResult> Details(int? id)

Details (by URL)

Public view of brigade event details.
nameBrigade
string
required
URL-friendly brigade identifier
route
string
/brigadas/{nameBrigade}
[Route("brigadas/{nameBrigade}")]
public async Task<IActionResult> Details(string nameBrigade)
Example:
// URL: /brigadas/jornada-salud-barrio-centro
// Displays brigade event with:
// - Name, description, cover image
// - Event date formatted in Spanish
// - Author/organizer information

Create (GET)

Displays form to create new brigade event.
[Authorize(Roles = "SuperAdmin,Admin")]
public IActionResult Create()

Create (POST)

Creates a new brigade event.
model
BrigadeCreateDto
required
Brigade data including event date and cover image
validations
object
[Authorize(Roles = "SuperAdmin,Admin")]
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Create(BrigadeCreateDto model)

Delete (GET)

Displays confirmation for brigade deletion.
[Authorize(Roles = "SuperAdmin,Admin")]
public async Task<IActionResult> Delete(int? id)

DeleteConfirmed

Removes brigade event and cover image.
id
int
required
Brigade ID
[Authorize(Roles = "SuperAdmin,Admin")]
[HttpPost, ActionName("Delete")]
[ValidateAntiForgeryToken]
public async Task<IActionResult> DeleteConfirmed(int id)

BrigadesGetAll

Public listing of all brigade events.
route
string
/brigadas
[Route("brigadas")]
public async Task<IActionResult> BrigadesGetAll()

EmployeesController

Manages organization employees and staff directory. Namespace: prjESPSantaFeAnt.Controllers
Route Prefix: /Employees

Dependencies

_employeeService
IEmployeeService
Service layer for employee operations

Actions

Index

Administrative listing of all employees.
authorization
string
required
Requires SuperAdmin or Admin role
return
IActionResult
Collection of employees with ID, name, occupation, and photo
[Authorize(Roles = "SuperAdmin,Admin")]
public async Task<IActionResult> Index()

Create (GET)

Displays employee registration form.
[Authorize(Roles = "SuperAdmin,Admin")]
public IActionResult Create()

Create (POST)

Registers a new employee.
model
EmployeeCreateDto
required
Employee data including name, occupation, and photo
process
object
[HttpPost]
[ValidateAntiForgeryToken]
[Authorize(Roles = "SuperAdmin,Admin")]
public async Task<IActionResult> Create(EmployeeCreateDto model)

Delete (GET)

Displays confirmation for employee deletion.
id
int?
required
Employee ID
[Authorize(Roles = "SuperAdmin,Admin")]
public async Task<IActionResult> Delete(int? id)

DeleteConfirmed

Removes employee record and photo.
id
int
required
Employee ID
[HttpPost, ActionName("Delete")]
[ValidateAntiForgeryToken]
[Authorize(Roles = "SuperAdmin,Admin")]
public async Task<IActionResult> DeleteConfirmed(int id)

ListEmployees

Public staff directory page.
route
string
/funcionarios
access
string
Anonymous access allowed
[Route("funcionarios")]
[AllowAnonymous]
public async Task<IActionResult> ListEmployees()
Example:
// Public URL: /funcionarios
// Displays all employees:
// - Name: "Juan Pérez"
// - Occupation: "Gerente General"
// - Photo: employee-photo.jpg

Build docs developers (and LLMs) love