Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ttpullima/RomsoftBackEnd2021_v2/llms.txt

Use this file to discover all available pages before exploring further.

In Gestión Clínica’s accounting module, a contact (CON_CONTACTO) is any external legal or natural person that participates in the clinic’s financial transactions — insurance companies (EPS/IAFAS), pharmaceutical suppliers, medical equipment vendors, guarantors, and contracted third parties. Each contact carries identifying information aligned with SUNAT requirements (RUC / document code) as well as operational metadata such as credit days, telephone numbers, and electronic billing email. Contacts are typed via CON_TIPO_CONTACTO, which provides the controlled vocabulary of contact categories used in purchase orders, accounts payable, and insurance billing workflows. Together, these two entities form the foundational directory that underpins all CON_* accounting transactions.
All endpoints are HTTP POST and require an Authorization: Bearer {token} header. Responses are wrapped in the standard JsonResponse envelope (Success, Warning, Message, Data).

CON_CONTACTO Endpoints

POST /api/CON_CONTACTO/Add

Creates a new accounting contact. Before inserting, the controller calls CON_CONTACTOBL.Instancia.Exists() to check for a duplicate; if the contact already exists, the operation is rejected with Warning: true and Message: "Ya existe el registro".
id_contacto
int
Pass 0 to create a new contact; the database assigns the real ID.
id_tipo_contacto
int
required
Foreign key → CON_TIPO_CONTACTO. Classifies the contact (supplier, insurer, client, etc.).
c_codigo
string
required
Internal contact code assigned by the accounting department.
c_codigo_sunat
string
required
SUNAT-issued identifier: RUC (11 digits for companies) or DNI/CE for natural persons. Used for electronic invoicing (comprobante electrónico).
t_apellidos
string
Surnames — applicable when the contact is a natural person.
t_nombres
string
Given names — applicable when the contact is a natural person.
t_razon_social
string
Legal business name (razón social) as registered with SUNAT. Required for companies.
t_razon_comercial
string
Trading / commercial name (nombre comercial) if different from the legal name.
t_observacion
string
Free-text notes about the contact.
t_direccion
string
Registered address of the contact.
t_contacto
string
Name of the primary liaison person at the external organisation.
t_actividad_economica
string
Economic activity description as declared to SUNAT.
c_telefono1
string
Primary telephone number.
c_telefono2
string
Secondary telephone number.
t_email_ffee
string
E-mail address used to receive electronic invoices (Factura Electrónica / FFEE).
n_dias_credito
int
Credit term in days for accounts-payable scheduling.
n_flag_garante
int
Guarantor flag. 1 = this contact can act as a financial guarantor; 0 = no.
n_flag_contratante
int
Contracting-party flag. 1 = this contact is a contracting party (e.g., insurance company); 0 = no.
n_flag_proveedor
int
Supplier flag. 1 = this contact is a supplier; 0 = no. A contact may have multiple flags set simultaneously.
n_flag_habido
int
SUNAT “habido” status flag. 1 = SUNAT has confirmed the entity as active and locatable; 0 = not habido.
f_estado
int
required
Active/inactive status. 1 = active; 0 = inactive.
id_user_registro
int
required
ID of the authenticated user creating the record (for audit).
UsuarioCreacion
string
required
Username string of the creator — used in the audit log entry.
Response (success)
{
  "Success": true,
  "Warning": false,
  "Message": "Registro satisfactorio",
  "Data": null
}
If the contact already exists (Exists() check passes), the response will have Success: true but Warning: true and Message: "Ya existe el registro". Always inspect both fields.
curl example
curl -s -X POST https://{host}/api/CON_CONTACTO/Add \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "id_contacto": 0,
    "id_tipo_contacto": 2,
    "c_codigo": "PROV-001",
    "c_codigo_sunat": "20100070970",
    "t_apellidos": "",
    "t_nombres": "",
    "t_razon_social": "LABORATORIOS FARMINDUSTRIA S.A.",
    "t_razon_comercial": "FARMINDUSTRIA",
    "t_observacion": "Proveedor principal de medicamentos genéricos",
    "t_direccion": "Av. Venezuela 2210, Lima",
    "t_contacto": "Juan Pérez",
    "t_actividad_economica": "FABRICACION DE PRODUCTOS FARMACEUTICOS",
    "c_telefono1": "01-3620500",
    "c_telefono2": "",
    "t_email_ffee": "[email protected]",
    "n_dias_credito": 30,
    "n_flag_garante": 0,
    "n_flag_contratante": 0,
    "n_flag_proveedor": 1,
    "n_flag_habido": 1,
    "f_estado": 1,
    "id_user_registro": 3,
    "UsuarioCreacion": "jlopez"
  }'

POST /api/CON_CONTACTO/Update

Updates an existing contact record. The request body is identical to Add; populate id_contacto with the target record’s ID. Response (success)
{
  "Success": true,
  "Warning": false,
  "Message": "Actualización satisfactoria",
  "Data": null
}

POST /api/CON_CONTACTO/Delete

Soft-deletes (or logically deactivates) a contact record. The body must include at minimum id_contacto and UsuarioModificacion for audit logging.
id_contacto
int
required
Primary key of the contact to delete.
UsuarioModificacion
string
required
Username string of the user performing the deletion (for audit).
Response (success)
{
  "Success": true,
  "Warning": false,
  "Message": "Eliminación satisfactoria",
  "Data": null
}
curl example
curl -s -X POST https://{host}/api/CON_CONTACTO/Delete \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "id_contacto": 42,
    "UsuarioModificacion": "jlopez"
  }'

POST /api/CON_CONTACTO/GetById

Retrieves a specific contact by its primary key. The request body is a CON_CONTACTODTO with id_contacto set; the response Data is an array of matching CON_CONTACTODTO objects.
id_contacto
int
required
Primary key of the contact to retrieve.
Response — array of CON_CONTACTODTO curl example
curl -s -X POST https://{host}/api/CON_CONTACTO/GetById \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{ "id_contacto": 42 }'

POST /api/CON_CONTACTO/GetAllFilters

Performs a filtered search across all contacts. Pass any combination of CON_CONTACTODTO fields as filter criteria; the business layer builds the WHERE clause accordingly. Empty or null fields are ignored. Request body — any subset of CON_CONTACTODTO fields used as filter predicates. curl example
curl -s -X POST https://{host}/api/CON_CONTACTO/GetAllFilters \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "id_tipo_contacto": 2,
    "n_flag_proveedor": 1,
    "f_estado": 1
  }'

POST /api/CON_CONTACTO/GetAllActives

Returns all active contacts regardless of type. Useful for populating full contact directories or supplier dropdowns. Request body — none required. curl example
curl -s -X POST https://{host}/api/CON_CONTACTO/GetAllActives \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json"

CON_TIPO_CONTACTO Endpoints

CON_TIPO_CONTACTO is the reference table that classifies contacts into named categories (e.g., Proveedor, Aseguradora, Cliente, Laboratorio). Its single endpoint feeds the type-selector in the contact registration form.

POST /api/CON_TIPO_CONTACTO/GetAllActives

Returns all active contact type records. Request body — none required. Response — array of CON_TIPO_CONTACTODTO Sample response
{
  "Success": true,
  "Message": null,
  "Data": [
    { "id_tipo_contacto": 1, "t_descripcion": "CLIENTE",      "tabla": "CON_TIPO_CONTACTO" },
    { "id_tipo_contacto": 2, "t_descripcion": "PROVEEDOR",    "tabla": "CON_TIPO_CONTACTO" },
    { "id_tipo_contacto": 3, "t_descripcion": "ASEGURADORA",  "tabla": "CON_TIPO_CONTACTO" },
    { "id_tipo_contacto": 4, "t_descripcion": "LABORATORIO",  "tabla": "CON_TIPO_CONTACTO" }
  ]
}
curl example
curl -s -X POST https://{host}/api/CON_TIPO_CONTACTO/GetAllActives \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json"

Audit Fields (EntityAuditableDTO)

CON_CONTACTODTO and CON_TIPO_CONTACTODTO extend EntityAuditableDTO, which injects the following fields on every response:
FieldTypeDescription
FechaCreaciondatetimeWhen the record was created.
FechaModificaciondatetimeWhen the record was last modified.
UsuarioCreacionstringUsername of the creator.
UsuarioModificacionstringUsername of the last modifier.
IdUsuarioActualintID of the currently acting user.
id_usuarioCreacionintNumeric ID of the creator.
id_usuarioModificaintNumeric ID of the last modifier.
Always call GetAllActives on CON_TIPO_CONTACTO before rendering the contact creation form to populate the type dropdown dynamically.

Build docs developers (and LLMs) love