Agregada rama DEV-CuentasCobrar de TPAtesa oficial
This commit is contained in:
parent
7095ebe60e
commit
b1cd3aaf0e
4555 changed files with 1171826 additions and 0 deletions
Binary file not shown.
1142
TPAtesa_CuentasCobrar/CXC_ATESA_Pruebas_Bancos.side
Normal file
1142
TPAtesa_CuentasCobrar/CXC_ATESA_Pruebas_Bancos.side
Normal file
File diff suppressed because it is too large
Load diff
1317
TPAtesa_CuentasCobrar/CXC_ATESA_Pruebas_Clientes.side
Normal file
1317
TPAtesa_CuentasCobrar/CXC_ATESA_Pruebas_Clientes.side
Normal file
File diff suppressed because it is too large
Load diff
1337
TPAtesa_CuentasCobrar/CXC_ATESA_Pruebas_Facturas.side
Normal file
1337
TPAtesa_CuentasCobrar/CXC_ATESA_Pruebas_Facturas.side
Normal file
File diff suppressed because it is too large
Load diff
1134
TPAtesa_CuentasCobrar/CXC_ATESA_Pruebas_Monedas.side
Normal file
1134
TPAtesa_CuentasCobrar/CXC_ATESA_Pruebas_Monedas.side
Normal file
File diff suppressed because it is too large
Load diff
1226
TPAtesa_CuentasCobrar/CXC_ATESA_Pruebas_Paises.side
Normal file
1226
TPAtesa_CuentasCobrar/CXC_ATESA_Pruebas_Paises.side
Normal file
File diff suppressed because it is too large
Load diff
503
TPAtesa_CuentasCobrar/CXC_ATESA_Pruebas_Roles.side
Normal file
503
TPAtesa_CuentasCobrar/CXC_ATESA_Pruebas_Roles.side
Normal file
|
|
@ -0,0 +1,503 @@
|
||||||
|
{
|
||||||
|
"id": "ada3772a-db47-406f-a282-f82bdfcebeb3",
|
||||||
|
"version": "2.0",
|
||||||
|
"name": "CXC_ATESA_Pruebas_Bancos",
|
||||||
|
"url": "https://localhost:5134",
|
||||||
|
"tests": [{
|
||||||
|
"id": "140c937c-dbf8-4955-84f6-4f4b6d9c5f8e",
|
||||||
|
"name": "Agregar_Rol_Correcto",
|
||||||
|
"commands": [{
|
||||||
|
"id": "b1109d0f-94c1-4a0a-b991-ab575c904230",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "b76576c6-97bb-4574-9b65-fa64bd8432c1",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "715x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "35251fd0-0dec-42a8-9b50-e1ae8d3d1bb0",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link",
|
||||||
|
"targets": [
|
||||||
|
["css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '#')]", "xpath:href"],
|
||||||
|
["xpath=//a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "b2f69faa-3132-4e0d-b143-3bcecf7522ea",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Seguridad",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Seguridad", "linkText"],
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(2) > .nav-link", "css:finder"],
|
||||||
|
["xpath=(//a[contains(@href, '#')])[5]", "xpath:href"],
|
||||||
|
["xpath=//aside/div/nav/ul/li[2]/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "3aa3c1b5-2ab6-4e40-baf8-bc275c25a8c6",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Roles",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Roles", "linkText"],
|
||||||
|
["css=.menu-is-opening .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '/Rol')]", "xpath:href"],
|
||||||
|
["xpath=//li[2]/ul/li/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "076823e7-d653-49fa-87e5-a61ecc927dc8",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.fa-plus",
|
||||||
|
"targets": [
|
||||||
|
["css=.fa-plus", "css:finder"],
|
||||||
|
["xpath=//div/a/i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "779b0afd-cc4b-48f9-8eda-370df8265833",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "32af3878-fcc5-4668-bdaf-35cf728be257",
|
||||||
|
"comment": "",
|
||||||
|
"command": "type",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "AAA rol Agregar"
|
||||||
|
}, {
|
||||||
|
"id": "20a4e86b-ada6-43a6-898e-c9327c82bc5c",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "456af4ab-a224-4bb7-88c2-4f6bf9c72804",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "css=tr:nth-child(1) > td:nth-child(2)",
|
||||||
|
"targets": [
|
||||||
|
["css=tr:nth-child(1) > td:nth-child(2)", "css:finder"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]", "xpath:position"],
|
||||||
|
["xpath=//td[contains(.,'ADMINISTRADOR')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": "AAA rol Agregar"
|
||||||
|
}, {
|
||||||
|
"id": "b8c96541-16e0-43fb-a602-4b0841fcefc1",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "3e1d3f47-b658-4697-91a7-2d0e3e1a04d7",
|
||||||
|
"name": "Agregar_Rol_Incorrecto_Req",
|
||||||
|
"commands": [{
|
||||||
|
"id": "881b374a-8db6-41c4-9fb2-ca50d6d7464f",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "b2c55e22-6e63-4935-83b2-1a4accd04d76",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "772x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "6d71e97f-968e-4acf-9872-7d0e86bb2ff3",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link",
|
||||||
|
"targets": [
|
||||||
|
["css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '#')]", "xpath:href"],
|
||||||
|
["xpath=//a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "265900eb-0f38-49a4-a4fe-8291d3bf603e",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-pills > .nav-item:nth-child(2) > .nav-link > p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(2) > .nav-link > p", "css:finder"],
|
||||||
|
["xpath=//nav/ul/li[2]/a/p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Seguridad')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "66a4c585-f513-4fef-8846-dbf061dda080",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.menu-is-opening .nav-item:nth-child(1) p",
|
||||||
|
"targets": [
|
||||||
|
["css=.menu-is-opening .nav-item:nth-child(1) p", "css:finder"],
|
||||||
|
["xpath=//li[2]/ul/li/a/p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Roles')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "813e9c81-fb26-46e8-995b-56151229652a",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Agregar",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Agregar", "linkText"],
|
||||||
|
["css=.btn-success", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '/Rol/Agregar')]", "xpath:href"],
|
||||||
|
["xpath=//div/div/div/div/div/a", "xpath:position"],
|
||||||
|
["xpath=//a[contains(.,' Agregar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "5827055e-7a39-4934-9dc8-d221e22f697e",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "8fa6dbf1-f515-468a-9828-76cf49984e6c",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "id=Descripcion-error",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion-error", "id"],
|
||||||
|
["css=#Descripcion-error", "css:finder"],
|
||||||
|
["xpath=//span[@id='Descripcion-error']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/div/span/span", "xpath:idRelative"],
|
||||||
|
["xpath=//span/span", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "Este campo es requerido."
|
||||||
|
}, {
|
||||||
|
"id": "a1f20da5-be09-4ca8-9db9-9a6dbbe5f6a6",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "28c0ef57-31f3-4273-abdf-a2d038a42dc7",
|
||||||
|
"name": "Agregar_Rol_Incorrecto_Texto",
|
||||||
|
"commands": [{
|
||||||
|
"id": "566cc3f6-d622-429f-ab3a-07ffbed4da1a",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "5ff8ba9a-b3de-4848-8826-ecd2c410232f",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "723x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "1eaf5ec1-5fae-4007-848c-6463a2c9e8e9",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.fa-bars",
|
||||||
|
"targets": [
|
||||||
|
["css=.fa-bars", "css:finder"],
|
||||||
|
["xpath=//i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "28830d58-0d84-48b7-8b13-d482066ea637",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-pills > .nav-item:nth-child(2) > .nav-link > p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(2) > .nav-link > p", "css:finder"],
|
||||||
|
["xpath=//nav/ul/li[2]/a/p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Seguridad')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "8241a52a-711b-465c-b98e-7ace1cb5917f",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Roles",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Roles", "linkText"],
|
||||||
|
["css=.menu-is-opening .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '/Rol')]", "xpath:href"],
|
||||||
|
["xpath=//li[2]/ul/li/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "6a46d5e5-2def-4b6c-8095-8877ffe1c56e",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Agregar",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Agregar", "linkText"],
|
||||||
|
["css=.btn-success", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '/Rol/Agregar')]", "xpath:href"],
|
||||||
|
["xpath=//div/div/div/div/div/a", "xpath:position"],
|
||||||
|
["xpath=//a[contains(.,' Agregar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "5fac1467-c4bc-45d9-b26a-8645d5fc4029",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "a716055a-7383-45c5-852e-411395b9948f",
|
||||||
|
"comment": "",
|
||||||
|
"command": "type",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "rol8888"
|
||||||
|
}, {
|
||||||
|
"id": "f916b161-6f45-42bf-888d-21a0dce3032b",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "befdabe6-1051-4a7f-ab06-7ec7f6684c22",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "id=Descripcion-error",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion-error", "id"],
|
||||||
|
["css=#Descripcion-error", "css:finder"],
|
||||||
|
["xpath=//span[@id='Descripcion-error']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/div/span/span", "xpath:idRelative"],
|
||||||
|
["xpath=//span/span", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "Este campo solo admite texto."
|
||||||
|
}, {
|
||||||
|
"id": "8c249f5e-11dd-4537-807f-c0adb5db414c",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "710b1403-d03f-4871-8ad0-042401e15ecf",
|
||||||
|
"name": "Editar_Rol_Correcto",
|
||||||
|
"commands": [{
|
||||||
|
"id": "5a7315bb-3d28-4cbb-b54f-1dbebae3b505",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/Rol",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "6e2f8b29-2652-43b0-8327-14588af9543d",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "823x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "fc451fd9-1b80-4921-9895-2575c4a8da73",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=tr:nth-child(1) .fa",
|
||||||
|
"targets": [
|
||||||
|
["css=tr:nth-child(1) .fa", "css:finder"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/a/i", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/a/i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "6253a9e9-8729-4123-8914-5ae13de09c21",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "id=Habilitado",
|
||||||
|
"targets": [
|
||||||
|
["id=Habilitado", "id"],
|
||||||
|
["name=Habilitado", "name"],
|
||||||
|
["css=#Habilitado", "css:finder"],
|
||||||
|
["xpath=//select[@id='Habilitado']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[3]/select", "xpath:idRelative"],
|
||||||
|
["xpath=//select", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "04e8ea56-bc5a-4fc7-a838-864ee779b6a6",
|
||||||
|
"comment": "",
|
||||||
|
"command": "select",
|
||||||
|
"target": "id=Habilitado",
|
||||||
|
"targets": [],
|
||||||
|
"value": "label=Inactivo"
|
||||||
|
}, {
|
||||||
|
"id": "16585bab-18c2-48d5-b001-19d991f2d1db",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "f2f88cca-960d-429a-9557-8da7e23fc0cb",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "cd28493a-591b-46b2-9faf-0373301798b3",
|
||||||
|
"name": "Consultar_Rol",
|
||||||
|
"commands": [{
|
||||||
|
"id": "7c3ca686-4e57-41d0-a9fc-4d8ced85f297",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "acc9a7d9-3e99-4f38-a1cc-f712778262d8",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "740x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "99fe0363-c772-4dc9-9e5b-efe4d2cd9d08",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link",
|
||||||
|
"targets": [
|
||||||
|
["css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '#')]", "xpath:href"],
|
||||||
|
["xpath=//a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "2c781eca-a16a-4b22-9816-53e23c7f9039",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Seguridad",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Seguridad", "linkText"],
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(2) > .nav-link", "css:finder"],
|
||||||
|
["xpath=(//a[contains(@href, '#')])[5]", "xpath:href"],
|
||||||
|
["xpath=//aside/div/nav/ul/li[2]/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "fabfe816-fdb7-4200-a5ec-3a8dd5fa0d97",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Roles",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Roles", "linkText"],
|
||||||
|
["css=.menu-is-opening .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '/Rol')]", "xpath:href"],
|
||||||
|
["xpath=//li[2]/ul/li/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "9bfa8243-f24a-491d-a7bb-c76cbfbcb2b5",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "css=.m-0",
|
||||||
|
"targets": [
|
||||||
|
["css=.m-0", "css:finder"],
|
||||||
|
["xpath=//h1", "xpath:position"],
|
||||||
|
["xpath=//h1[contains(.,'Roles')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": "Roles"
|
||||||
|
}, {
|
||||||
|
"id": "c6f411f6-f963-4d14-8e93-c797f7f3c965",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}],
|
||||||
|
"suites": [{
|
||||||
|
"id": "84b5a135-d635-42d7-90b4-290f8f69e2af",
|
||||||
|
"name": "Default Suite",
|
||||||
|
"persistSession": false,
|
||||||
|
"parallel": false,
|
||||||
|
"timeout": 300,
|
||||||
|
"tests": []
|
||||||
|
}],
|
||||||
|
"urls": ["https://localhost:5134/"],
|
||||||
|
"plugins": []
|
||||||
|
}
|
||||||
60
TPAtesa_CuentasCobrar/CXC_ATESA_Pruebas_Sesiones.side
Normal file
60
TPAtesa_CuentasCobrar/CXC_ATESA_Pruebas_Sesiones.side
Normal file
|
|
@ -0,0 +1,60 @@
|
||||||
|
{
|
||||||
|
"id": "641c417c-c50d-49e4-88c2-e6a2412febb8",
|
||||||
|
"version": "2.0",
|
||||||
|
"name": "CXC_ATESA_Sesiones",
|
||||||
|
"url": "https://localhost:5134",
|
||||||
|
"tests": [{
|
||||||
|
"id": "33b40cc2-2e24-4858-b326-9cb32bb4d93b",
|
||||||
|
"name": "Cerrar_Sesion",
|
||||||
|
"commands": [{
|
||||||
|
"id": "439b39df-f010-459b-9b41-7d51307aeabf",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "e32ec2da-6523-452b-97f3-10ac51223993",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "1050x708",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "6ca537a8-9266-4ebf-ba51-c341cd6a4669",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Cerrar sesión",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Cerrar sesión", "linkText"],
|
||||||
|
["css=.text-dark", "css:finder"],
|
||||||
|
["xpath=//a[contains(text(),'Cerrar sesión')]", "xpath:link"],
|
||||||
|
["xpath=//a[contains(@href, '/MicrosoftIdentity/Account/SignOut')]", "xpath:href"],
|
||||||
|
["xpath=//ul[2]/ul/li/a", "xpath:position"],
|
||||||
|
["xpath=//a[contains(.,'Cerrar sesión')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "2e75517b-68d3-4fd3-b483-589f6c41ed42",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.table-cell > div:nth-child(1)",
|
||||||
|
"targets": [
|
||||||
|
["css=.table-cell > div:nth-child(1)", "css:finder"],
|
||||||
|
["xpath=//div[@id='tilesHolder']/div/div/div/div/div[2]/div", "xpath:idRelative"],
|
||||||
|
["xpath=//div[3]/div/div/div/div/div/div/div[2]/div", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}],
|
||||||
|
"suites": [{
|
||||||
|
"id": "6fee0c63-34ec-4b5d-a055-4841e1c7cc7f",
|
||||||
|
"name": "Default Suite",
|
||||||
|
"persistSession": false,
|
||||||
|
"parallel": false,
|
||||||
|
"timeout": 300,
|
||||||
|
"tests": ["33b40cc2-2e24-4858-b326-9cb32bb4d93b"]
|
||||||
|
}],
|
||||||
|
"urls": ["https://localhost:5134/"],
|
||||||
|
"plugins": []
|
||||||
|
}
|
||||||
895
TPAtesa_CuentasCobrar/CXC_ATESA_Pruebas_TiposDocumento.side
Normal file
895
TPAtesa_CuentasCobrar/CXC_ATESA_Pruebas_TiposDocumento.side
Normal file
|
|
@ -0,0 +1,895 @@
|
||||||
|
{
|
||||||
|
"id": "ada3772a-db47-406f-a282-f82bdfcebeb3",
|
||||||
|
"version": "2.0",
|
||||||
|
"name": "CXC_ATESA_Pruebas_Bancos",
|
||||||
|
"url": "https://localhost:5134",
|
||||||
|
"tests": [{
|
||||||
|
"id": "140c937c-dbf8-4955-84f6-4f4b6d9c5f8e",
|
||||||
|
"name": "Agregar_TiposDocumento_Correcto",
|
||||||
|
"commands": [{
|
||||||
|
"id": "59718f40-ea80-46b2-8da4-59dd7dcc7203",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "5db82740-5d4b-4033-811d-2c07dd225aec",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "774x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "c36e0473-2db5-4f61-b4f3-fe1ab05f9460",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link",
|
||||||
|
"targets": [
|
||||||
|
["css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '#')]", "xpath:href"],
|
||||||
|
["xpath=//a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "f3054823-d7f3-4498-bd7f-3093686e1749",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p", "css:finder"],
|
||||||
|
["xpath=//p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Mantenimientos')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "1387f4c3-c436-4852-b454-ce948a64e557",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-item:nth-child(4) p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-item:nth-child(4) p", "css:finder"],
|
||||||
|
["xpath=//li[4]/a/p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Tipos de Documento')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "c60b4aba-336f-410f-9ef2-fd3054b2a82a",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Agregar",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Agregar", "linkText"],
|
||||||
|
["css=.btn-success", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '/TipoDocumento/Agregar')]", "xpath:href"],
|
||||||
|
["xpath=//div/div/div/div/div/a", "xpath:position"],
|
||||||
|
["xpath=//a[contains(.,' Agregar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "05d0378a-78c9-4f90-8266-6863b7066e53",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "02b4521f-1275-47da-8b1a-bd380110659a",
|
||||||
|
"comment": "",
|
||||||
|
"command": "type",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "AAA tipo Agregar "
|
||||||
|
}, {
|
||||||
|
"id": "d30520d8-7979-47cd-b90e-0cd9233180ff",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "941b71e2-7290-41e1-b90d-a693d5ce0372",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "css=.odd:nth-child(1) > td:nth-child(2)",
|
||||||
|
"targets": [
|
||||||
|
["css=.odd:nth-child(1) > td:nth-child(2)", "css:finder"],
|
||||||
|
["xpath=//table[@id='tablasMT']/tbody/tr/td[2]", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]", "xpath:position"],
|
||||||
|
["xpath=//td[contains(.,'Factura')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": "AAA tipo Agregar"
|
||||||
|
}, {
|
||||||
|
"id": "c8905cb6-bede-4309-98c1-99291b80f035",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "3e1d3f47-b658-4697-91a7-2d0e3e1a04d7",
|
||||||
|
"name": "Agregar_TiposDocumento_Incorrecto_Req",
|
||||||
|
"commands": [{
|
||||||
|
"id": "19c1bfdd-5379-494b-b13c-738aedd588d1",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "98972230-b42f-4db4-9e98-807fcf3359f6",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "762x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "2fc15f5a-fcca-40d7-93ea-12f55ee5fb89",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.fa-bars",
|
||||||
|
"targets": [
|
||||||
|
["css=.fa-bars", "css:finder"],
|
||||||
|
["xpath=//i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "bd70dd11-1eba-42d9-b428-95c6a3460fe2",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Mantenimientos",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Mantenimientos", "linkText"],
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=(//a[contains(@href, '#')])[4]", "xpath:href"],
|
||||||
|
["xpath=//aside/div/nav/ul/li/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "da4f3eb3-fd33-468b-b27b-ebe4e840b7f5",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-item:nth-child(4) p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-item:nth-child(4) p", "css:finder"],
|
||||||
|
["xpath=//li[4]/a/p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Tipos de Documento')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "ffcee4a5-97ed-4a8e-80fa-5bacfd9e7802",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.fa-plus",
|
||||||
|
"targets": [
|
||||||
|
["css=.fa-plus", "css:finder"],
|
||||||
|
["xpath=//div/a/i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "728dc4ab-f98e-4422-bc77-e3e2a1e3ff29",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "7d6b091b-8da6-4047-b8fb-9f9da03271fd",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "id=Descripcion-error",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion-error", "id"],
|
||||||
|
["css=#Descripcion-error", "css:finder"],
|
||||||
|
["xpath=//span[@id='Descripcion-error']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/div/span/span", "xpath:idRelative"],
|
||||||
|
["xpath=//span/span", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "Este campo es requerido."
|
||||||
|
}, {
|
||||||
|
"id": "2c202079-69ea-49f3-bb77-99f98235fe32",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "28c0ef57-31f3-4273-abdf-a2d038a42dc7",
|
||||||
|
"name": "Agregar_TiposDocumento_Incorrecto_Texto",
|
||||||
|
"commands": [{
|
||||||
|
"id": "683a2a71-df70-4731-b55c-fe4624817140",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "784c1624-d538-446c-bcf6-cb03e2778ed4",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "727x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "89935106-7339-493a-95ec-3d0edfe1abb8",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link",
|
||||||
|
"targets": [
|
||||||
|
["css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '#')]", "xpath:href"],
|
||||||
|
["xpath=//a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "3507a615-9816-4a9e-a030-70a1dc99932e",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Mantenimientos",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Mantenimientos", "linkText"],
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=(//a[contains(@href, '#')])[4]", "xpath:href"],
|
||||||
|
["xpath=//aside/div/nav/ul/li/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "c9e8161d-78ad-4883-9830-44f860503923",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-item:nth-child(4) p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-item:nth-child(4) p", "css:finder"],
|
||||||
|
["xpath=//li[4]/a/p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Tipos de Documento')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "b4e4223e-3975-4a7c-b4cf-60eff53699e8",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.fa-plus",
|
||||||
|
"targets": [
|
||||||
|
["css=.fa-plus", "css:finder"],
|
||||||
|
["xpath=//div/a/i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "b6cd1023-bfb7-4780-a0eb-999c04487f6e",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "3e605875-81ab-4d79-8e3e-e6b753c4cd50",
|
||||||
|
"comment": "",
|
||||||
|
"command": "type",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "tipo45"
|
||||||
|
}, {
|
||||||
|
"id": "ea2b76b4-3c4f-4050-af39-6bd99cb85f18",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "7df65c8f-a79f-4e6a-9c66-2fd3c2173f31",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "id=Descripcion-error",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion-error", "id"],
|
||||||
|
["css=#Descripcion-error", "css:finder"],
|
||||||
|
["xpath=//span[@id='Descripcion-error']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/div/span/span", "xpath:idRelative"],
|
||||||
|
["xpath=//span/span", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "Este campo solo admite texto."
|
||||||
|
}, {
|
||||||
|
"id": "dc4fcddd-3372-4ee2-8b11-2222599ec4c4",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "710b1403-d03f-4871-8ad0-042401e15ecf",
|
||||||
|
"name": "Editar_TiposDocumento_Correcto",
|
||||||
|
"commands": [{
|
||||||
|
"id": "184fca61-d621-4d3a-886f-1f8e3a548d37",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "93208160-8338-4ee5-b778-58d9b48cd2e3",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "775x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "faaafbaf-9811-41a8-9e71-d5511a856af9",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link",
|
||||||
|
"targets": [
|
||||||
|
["css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '#')]", "xpath:href"],
|
||||||
|
["xpath=//a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "2d28c94a-3a5f-4db3-b7b0-ae8e4d3c672d",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p", "css:finder"],
|
||||||
|
["xpath=//p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Mantenimientos')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "672acca7-ec5a-432e-846d-622dc88c7963",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Tipos de Documento",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Tipos de Documento", "linkText"],
|
||||||
|
["css=.nav-item:nth-child(4) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '/TipoDocumento')]", "xpath:href"],
|
||||||
|
["xpath=//li[4]/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "2bee8f5e-183a-4957-a5d4-96321f6c7536",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.odd:nth-child(1) .btn-primary",
|
||||||
|
"targets": [
|
||||||
|
["css=.odd:nth-child(1) .btn-primary", "css:finder"],
|
||||||
|
["xpath=//table[@id='tablasMT']/tbody/tr/td[4]/a", "xpath:idRelative"],
|
||||||
|
["xpath=//a[contains(@href, '/TipoDocumento/Editar/5')]", "xpath:href"],
|
||||||
|
["xpath=//td[4]/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "6f752f95-a2bb-47d4-a5b1-0b7d8698d17b",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.col-sm-12",
|
||||||
|
"targets": [
|
||||||
|
["css=.col-sm-12", "css:finder"],
|
||||||
|
["xpath=//div/div/div/div[2]/div", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "eab823a9-39f5-4153-8e94-af6c7b650bb0",
|
||||||
|
"comment": "",
|
||||||
|
"command": "type",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "AAA Tipo Editar"
|
||||||
|
}, {
|
||||||
|
"id": "393262c0-be6b-4ae0-8f54-f4981952e42d",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "2fdcac50-9953-4a6e-8d65-e894ac633e86",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "css=.odd:nth-child(1) > td:nth-child(2)",
|
||||||
|
"targets": [
|
||||||
|
["css=.odd:nth-child(1) > td:nth-child(2)", "css:finder"],
|
||||||
|
["xpath=//table[@id='tablasMT']/tbody/tr/td[2]", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]", "xpath:position"],
|
||||||
|
["xpath=//td[contains(.,'Factura')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": "AAA Tipo Editar"
|
||||||
|
}, {
|
||||||
|
"id": "9d8eac5e-e28f-4865-ba44-429ae8f8bfcc",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "ffe68de8-097e-481a-bb90-52b488d46e62",
|
||||||
|
"name": "Editar_TiposDocumento_Incorrecto_Req",
|
||||||
|
"commands": [{
|
||||||
|
"id": "9ba8f84a-02ab-43f4-a4a9-5871c6a709b8",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "b80dbf91-b166-436f-82b3-d1c87fad3243",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "781x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "45a84e93-0d75-481a-9534-1aba81c0e62b",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.fa-bars",
|
||||||
|
"targets": [
|
||||||
|
["css=.fa-bars", "css:finder"],
|
||||||
|
["xpath=//i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "c2fc6be2-eca7-462e-8f1a-6c62e47a24b1",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Mantenimientos",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Mantenimientos", "linkText"],
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=(//a[contains(@href, '#')])[4]", "xpath:href"],
|
||||||
|
["xpath=//aside/div/nav/ul/li/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "872f84f0-4c3c-47fc-be8b-020daa4433ee",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-item:nth-child(4) p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-item:nth-child(4) p", "css:finder"],
|
||||||
|
["xpath=//li[4]/a/p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Tipos de Documento')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "ccfa7ba4-3189-4d1d-8313-94dea82f994c",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.odd:nth-child(1) .btn-primary > .fa",
|
||||||
|
"targets": [
|
||||||
|
["css=.odd:nth-child(1) .btn-primary > .fa", "css:finder"],
|
||||||
|
["xpath=//table[@id='tablasMT']/tbody/tr/td[4]/a/i", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/a/i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "0d92bea7-0366-4ca2-84c5-868c88e190aa",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.card-body",
|
||||||
|
"targets": [
|
||||||
|
["css=.card-body", "css:finder"],
|
||||||
|
["xpath=//div[2]/div/div/div/div/div", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "584f2c8c-aab7-4e90-993e-68bb3a0783b2",
|
||||||
|
"comment": "",
|
||||||
|
"command": "type",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "4c1b8898-efae-4a26-8d2d-f04b2befe3c2",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "a3459f8d-5fcd-4edc-9faf-631b583e4739",
|
||||||
|
"comment": "",
|
||||||
|
"command": "mouseOver",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "d28bdf15-05e3-4d04-95af-471a1ade491e",
|
||||||
|
"comment": "",
|
||||||
|
"command": "mouseOut",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "d9bcd01a-d007-430c-aa31-7bda848ba5f6",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "id=Descripcion-error",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion-error", "id"],
|
||||||
|
["css=#Descripcion-error", "css:finder"],
|
||||||
|
["xpath=//span[@id='Descripcion-error']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/div/span/span", "xpath:idRelative"],
|
||||||
|
["xpath=//span/span", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "Este campo es requerido."
|
||||||
|
}, {
|
||||||
|
"id": "41376296-a4cf-4cf0-be3d-47d6bf78ac62",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "778fe5dd-d9b4-4c13-8a95-af3e33130bed",
|
||||||
|
"name": "Editar_TiposDocumento_Incorrecto_Texto",
|
||||||
|
"commands": [{
|
||||||
|
"id": "014ba706-d77e-49d9-a147-7bb6521067b2",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "40c0cc3d-3b76-41a0-8959-f4cf55bf9478",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "795x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "1bb8a811-5e20-4181-a11a-490b3e6bc4cc",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link",
|
||||||
|
"targets": [
|
||||||
|
["css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '#')]", "xpath:href"],
|
||||||
|
["xpath=//a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "e00cca43-f910-473d-b21b-d87f19eebf1f",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p", "css:finder"],
|
||||||
|
["xpath=//p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Mantenimientos')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "dc823319-3c1f-4bab-a404-5a83135cf42d",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Tipos de Documento",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Tipos de Documento", "linkText"],
|
||||||
|
["css=.nav-item:nth-child(4) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '/TipoDocumento')]", "xpath:href"],
|
||||||
|
["xpath=//li[4]/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "19c32a54-8f5c-47f3-809e-f3aa8cbefa2b",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.odd:nth-child(1) .btn-primary > .fa",
|
||||||
|
"targets": [
|
||||||
|
["css=.odd:nth-child(1) .btn-primary > .fa", "css:finder"],
|
||||||
|
["xpath=//table[@id='tablasMT']/tbody/tr/td[4]/a/i", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/a/i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "294976de-a91f-403c-9a4e-0b405263a6de",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=tbody > tr:nth-child(1)",
|
||||||
|
"targets": [
|
||||||
|
["css=tbody > tr:nth-child(1)", "css:finder"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr", "xpath:idRelative"],
|
||||||
|
["xpath=//tbody/tr", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "2e7910fc-9454-4248-a213-98301f04c7ac",
|
||||||
|
"comment": "",
|
||||||
|
"command": "type",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "AAA51"
|
||||||
|
}, {
|
||||||
|
"id": "56b2abcb-2174-402b-932f-ccb59375e60d",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "4bdc4162-cd4e-4f2a-92a0-2e27ac8a6a80",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "id=Descripcion-error",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion-error", "id"],
|
||||||
|
["css=#Descripcion-error", "css:finder"],
|
||||||
|
["xpath=//span[@id='Descripcion-error']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/div/span/span", "xpath:idRelative"],
|
||||||
|
["xpath=//span/span", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "Este campo solo admite texto."
|
||||||
|
}, {
|
||||||
|
"id": "3c6449de-ff06-4aee-89a7-5e48046ef73f",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "159b739e-e967-4124-921a-b74608208e00",
|
||||||
|
"name": "Eliminar_TiposDocumento",
|
||||||
|
"commands": [{
|
||||||
|
"id": "8cf6eaa1-30c5-4978-b5d9-c704c141d72e",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "6087d311-9def-42ad-aaa4-7654f27f78de",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "818x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "62f879f4-aaa2-495a-a274-15b5ea5b27d2",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link",
|
||||||
|
"targets": [
|
||||||
|
["css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '#')]", "xpath:href"],
|
||||||
|
["xpath=//a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "9388a90d-aea0-48b2-8c25-3f914bce2e29",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p", "css:finder"],
|
||||||
|
["xpath=//p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Mantenimientos')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "6f322071-d580-4b38-ad3e-5db075fc03ac",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-item:nth-child(4) p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-item:nth-child(4) p", "css:finder"],
|
||||||
|
["xpath=//li[4]/a/p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Tipos de Documento')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "d43d4fa4-8979-42c1-9ccb-669bfe1e5b3f",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.odd:nth-child(1) .btn-danger",
|
||||||
|
"targets": [
|
||||||
|
["css=.odd:nth-child(1) .btn-danger", "css:finder"],
|
||||||
|
["xpath=//a[@onclick=\"Eliminar('5')\"]", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tablasMT']/tbody/tr/td[4]/a[2]", "xpath:idRelative"],
|
||||||
|
["xpath=//a[2]", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "d47a031a-8a74-45d2-9c25-defbc1ec1ee9",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.swal2-confirm",
|
||||||
|
"targets": [
|
||||||
|
["css=.swal2-confirm", "css:finder"],
|
||||||
|
["xpath=(//button[@type='button'])[2]", "xpath:attributes"],
|
||||||
|
["xpath=//div[6]/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Eliminar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "7de4c683-97d0-46fc-88a0-a57bda98399b",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "cd28493a-591b-46b2-9faf-0373301798b3",
|
||||||
|
"name": "Consultar_TiposDocumento",
|
||||||
|
"commands": [{
|
||||||
|
"id": "1d755cb7-b14f-43b4-a7f2-c1edb0d0c77e",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "443858ba-4383-47fd-9e51-e14c70318688",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "805x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "1a9b2612-0c4d-41bc-918b-31c7c7f9edcd",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.fa-bars",
|
||||||
|
"targets": [
|
||||||
|
["css=.fa-bars", "css:finder"],
|
||||||
|
["xpath=//i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "6d7256ef-1d84-4cd3-8fe8-0c8b38ced890",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Mantenimientos",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Mantenimientos", "linkText"],
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=(//a[contains(@href, '#')])[4]", "xpath:href"],
|
||||||
|
["xpath=//aside/div/nav/ul/li/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "6a57487e-5c1a-4d0e-86eb-67239fc5078b",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-item:nth-child(4) p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-item:nth-child(4) p", "css:finder"],
|
||||||
|
["xpath=//li[4]/a/p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Tipos de Documento')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "f64c03c5-2bec-4d6a-9344-a141317a8236",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "css=.m-0",
|
||||||
|
"targets": [
|
||||||
|
["css=.m-0", "css:finder"],
|
||||||
|
["xpath=//h1", "xpath:position"],
|
||||||
|
["xpath=//h1[contains(.,'Tipos de Documento')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": "Tipos de Documento"
|
||||||
|
}, {
|
||||||
|
"id": "764dbffc-d2db-4f68-a442-2d5b2074f43b",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}],
|
||||||
|
"suites": [{
|
||||||
|
"id": "84b5a135-d635-42d7-90b4-290f8f69e2af",
|
||||||
|
"name": "Default Suite",
|
||||||
|
"persistSession": false,
|
||||||
|
"parallel": false,
|
||||||
|
"timeout": 300,
|
||||||
|
"tests": []
|
||||||
|
}],
|
||||||
|
"urls": ["https://localhost:5134/"],
|
||||||
|
"plugins": []
|
||||||
|
}
|
||||||
883
TPAtesa_CuentasCobrar/CXC_ATESA_Pruebas_TiposIdentificacion.side
Normal file
883
TPAtesa_CuentasCobrar/CXC_ATESA_Pruebas_TiposIdentificacion.side
Normal file
|
|
@ -0,0 +1,883 @@
|
||||||
|
{
|
||||||
|
"id": "ada3772a-db47-406f-a282-f82bdfcebeb3",
|
||||||
|
"version": "2.0",
|
||||||
|
"name": "CXC_ATESA_Pruebas_Bancos",
|
||||||
|
"url": "https://localhost:5134",
|
||||||
|
"tests": [{
|
||||||
|
"id": "140c937c-dbf8-4955-84f6-4f4b6d9c5f8e",
|
||||||
|
"name": "Agregar_TiposIdentificacion_Correcto",
|
||||||
|
"commands": [{
|
||||||
|
"id": "29b0a899-051e-42e7-935b-2f0cb6590f9d",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "51773130-e964-4183-bc3b-d299592e1374",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "773x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "ec6f3b10-b4fa-42bb-bb59-5fa08884f001",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.fa-bars",
|
||||||
|
"targets": [
|
||||||
|
["css=.fa-bars", "css:finder"],
|
||||||
|
["xpath=//i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "cb2e2afe-f1cd-484f-8394-0ec6b937b4c3",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p", "css:finder"],
|
||||||
|
["xpath=//p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Mantenimientos')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "b31f423f-4ea6-465f-801e-8894053adb75",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-item:nth-child(6) p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-item:nth-child(6) p", "css:finder"],
|
||||||
|
["xpath=//li[6]/a/p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Tipos de Identificación')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "4604f9c9-da65-4671-85e8-f4111d03dd45",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Agregar",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Agregar", "linkText"],
|
||||||
|
["css=.btn-success", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '/TipoIdentificacion/Agregar')]", "xpath:href"],
|
||||||
|
["xpath=//div/div/div/div/div/a", "xpath:position"],
|
||||||
|
["xpath=//a[contains(.,' Agregar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "19f95ebc-24a9-4df0-841e-4aa8eafa4df1",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "0d61d580-21d5-4e0e-9a02-a552d185946d",
|
||||||
|
"comment": "",
|
||||||
|
"command": "type",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "AAA tipo Agregar "
|
||||||
|
}, {
|
||||||
|
"id": "84d22fcc-1880-459d-b42b-a4574224634b",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "b03e4104-152f-4188-aa86-2e13033eab45",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "css=.odd:nth-child(1) > td:nth-child(2)",
|
||||||
|
"targets": [
|
||||||
|
["css=.odd:nth-child(1) > td:nth-child(2)", "css:finder"],
|
||||||
|
["xpath=//table[@id='tablasMT']/tbody/tr/td[2]", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]", "xpath:position"],
|
||||||
|
["xpath=//td[contains(.,'CEDULA FISICA')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": "AAA tipo Agregar"
|
||||||
|
}, {
|
||||||
|
"id": "a10ece53-a58c-4db7-affb-0c43b9e50c03",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "3e1d3f47-b658-4697-91a7-2d0e3e1a04d7",
|
||||||
|
"name": "Agregar_TiposIdentificacion_Incorrecto_Req",
|
||||||
|
"commands": [{
|
||||||
|
"id": "e1554210-b719-4323-961f-e74001deb073",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "305d0c2c-4b6c-4110-bf4d-01bbb8b0c24c",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "755x711",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "0a3f854c-4c6f-466c-91d7-59addad8e0b6",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link",
|
||||||
|
"targets": [
|
||||||
|
["css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '#')]", "xpath:href"],
|
||||||
|
["xpath=//a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "645bbf16-9f24-4662-a045-ba788ef0ebb9",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p", "css:finder"],
|
||||||
|
["xpath=//p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Mantenimientos')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "22948780-0402-434a-9555-9e070b2d48b5",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-item:nth-child(6) p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-item:nth-child(6) p", "css:finder"],
|
||||||
|
["xpath=//li[6]/a/p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Tipos de Identificación')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "fc173640-1859-4cdb-8212-7bacaa87628f",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Agregar",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Agregar", "linkText"],
|
||||||
|
["css=.btn-success", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '/TipoIdentificacion/Agregar')]", "xpath:href"],
|
||||||
|
["xpath=//div/div/div/div/div/a", "xpath:position"],
|
||||||
|
["xpath=//a[contains(.,' Agregar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "aaaa2918-b642-4e13-bc70-fec18b514c70",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "e6014892-c2f3-4787-be6d-9484fc2d2552",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "id=Descripcion-error",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion-error", "id"],
|
||||||
|
["css=#Descripcion-error", "css:finder"],
|
||||||
|
["xpath=//span[@id='Descripcion-error']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/div/span/span", "xpath:idRelative"],
|
||||||
|
["xpath=//span/span", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "Este campo es requerido."
|
||||||
|
}, {
|
||||||
|
"id": "2c620928-73bc-4206-b72e-e6b996b7b587",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "28c0ef57-31f3-4273-abdf-a2d038a42dc7",
|
||||||
|
"name": "Agregar_TiposIdentificacion_Incorrecto_Texto",
|
||||||
|
"commands": [{
|
||||||
|
"id": "0a925166-d0a7-44b4-a3e3-ee81ecaf628d",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "9c8a6e0d-0b2f-4f03-8f0e-50b1ce55ced1",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "783x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "7ab8b9f5-3c6b-41f6-abef-cb80c7d3063b",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link",
|
||||||
|
"targets": [
|
||||||
|
["css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '#')]", "xpath:href"],
|
||||||
|
["xpath=//a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "aebc2cbf-3fa4-4700-82df-be5bc4ba70e9",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p", "css:finder"],
|
||||||
|
["xpath=//p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Mantenimientos')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "a3d9552a-69bf-40a9-91f6-5d54083a365f",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-item:nth-child(6) p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-item:nth-child(6) p", "css:finder"],
|
||||||
|
["xpath=//li[6]/a/p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Tipos de Identificación')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "94c5705c-447f-4e14-bd21-4e630546ac46",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Agregar",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Agregar", "linkText"],
|
||||||
|
["css=.btn-success", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '/TipoIdentificacion/Agregar')]", "xpath:href"],
|
||||||
|
["xpath=//div/div/div/div/div/a", "xpath:position"],
|
||||||
|
["xpath=//a[contains(.,' Agregar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "41f3ae59-23e9-49ac-92c4-4dd6d091ad59",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "1b4a455e-6063-4abc-b39b-129a26ce5ea4",
|
||||||
|
"comment": "",
|
||||||
|
"command": "type",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "tipoIdent31"
|
||||||
|
}, {
|
||||||
|
"id": "4c755081-b4dd-411a-9460-6e55179573ba",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "102a71d8-45ca-4f3c-b9ec-9d8eb2c6df68",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "id=Descripcion-error",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion-error", "id"],
|
||||||
|
["css=#Descripcion-error", "css:finder"],
|
||||||
|
["xpath=//span[@id='Descripcion-error']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/div/span/span", "xpath:idRelative"],
|
||||||
|
["xpath=//span/span", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "Este campo solo admite texto."
|
||||||
|
}, {
|
||||||
|
"id": "93fe7d32-5a26-4620-88b2-448d60ac5b21",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "710b1403-d03f-4871-8ad0-042401e15ecf",
|
||||||
|
"name": "Editar_TiposIdentificacion_Correcto",
|
||||||
|
"commands": [{
|
||||||
|
"id": "44fe0711-e6d1-4434-804c-710b0a02fcd1",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "4019cf9a-6392-4f01-8a4d-32b3e40088e0",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "858x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "64bf41a8-0ed6-4160-9656-9796b01909f6",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link",
|
||||||
|
"targets": [
|
||||||
|
["css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '#')]", "xpath:href"],
|
||||||
|
["xpath=//a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "815f5308-6f85-42f8-bcc7-3d590d75425c",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Mantenimientos",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Mantenimientos", "linkText"],
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=(//a[contains(@href, '#')])[4]", "xpath:href"],
|
||||||
|
["xpath=//aside/div/nav/ul/li/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "0e9344b0-eb7b-4cb6-8ef8-97d900f02d8e",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Tipos de Identificación",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Tipos de Identificación", "linkText"],
|
||||||
|
["css=.nav-item:nth-child(6) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '/TipoIdentificacion')]", "xpath:href"],
|
||||||
|
["xpath=//li[6]/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "2702ba9d-bdc2-479c-b323-9acb7fbbe8e8",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.odd:nth-child(1) .btn-primary > .fa",
|
||||||
|
"targets": [
|
||||||
|
["css=.odd:nth-child(1) .btn-primary > .fa", "css:finder"],
|
||||||
|
["xpath=//table[@id='tablasMT']/tbody/tr/td[4]/a/i", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/a/i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "a75e188a-8a3e-4292-a98e-39166577a4e3",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=html",
|
||||||
|
"targets": [
|
||||||
|
["css=html", "css:finder"],
|
||||||
|
["xpath=//html", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "ead689a9-f992-42ae-b28e-a3058813a797",
|
||||||
|
"comment": "",
|
||||||
|
"command": "type",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "AAA Tipo Editar"
|
||||||
|
}, {
|
||||||
|
"id": "a21c4f59-3172-44a2-8b1e-f4f29538c6e8",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "b9599845-93b2-4792-acda-4918a178b8af",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "css=.odd:nth-child(1) > td:nth-child(2)",
|
||||||
|
"targets": [
|
||||||
|
["css=.odd:nth-child(1) > td:nth-child(2)", "css:finder"],
|
||||||
|
["xpath=//table[@id='tablasMT']/tbody/tr/td[2]", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]", "xpath:position"],
|
||||||
|
["xpath=//td[contains(.,'CEDULA FISICA')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": "AAA Tipo Editar"
|
||||||
|
}, {
|
||||||
|
"id": "45ad6a4d-deef-47cf-9984-3bdac484d4f9",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "ffe68de8-097e-481a-bb90-52b488d46e62",
|
||||||
|
"name": "Editar_TiposIdentificacion_Incorrecto_Req",
|
||||||
|
"commands": [{
|
||||||
|
"id": "15606b25-c351-4535-91f2-f85394db339f",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "eb06fe4c-9c6f-4d64-9947-e4f668308f93",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "640x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "759a34f8-54b4-4a29-99ac-21cf5e846f89",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.fa-bars",
|
||||||
|
"targets": [
|
||||||
|
["css=.fa-bars", "css:finder"],
|
||||||
|
["xpath=//i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "b2380a42-f6c1-49fc-aa0f-047408f316f6",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p", "css:finder"],
|
||||||
|
["xpath=//p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Mantenimientos')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "82f36a37-4995-4bc1-9adc-168073fcbea6",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Tipos de Identificación",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Tipos de Identificación", "linkText"],
|
||||||
|
["css=.nav-item:nth-child(6) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '/TipoIdentificacion')]", "xpath:href"],
|
||||||
|
["xpath=//li[6]/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "7d87e73d-1808-4af4-957d-baa9617b4abe",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.odd:nth-child(1) .btn-primary",
|
||||||
|
"targets": [
|
||||||
|
["css=.odd:nth-child(1) .btn-primary", "css:finder"],
|
||||||
|
["xpath=//table[@id='tablasMT']/tbody/tr/td[4]/a", "xpath:idRelative"],
|
||||||
|
["xpath=//a[contains(@href, '/TipoIdentificacion/Editar/5')]", "xpath:href"],
|
||||||
|
["xpath=//td[4]/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "07b2dc49-fc39-4c9f-a2fe-06ba551f1f45",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=tbody > tr:nth-child(1)",
|
||||||
|
"targets": [
|
||||||
|
["css=tbody > tr:nth-child(1)", "css:finder"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr", "xpath:idRelative"],
|
||||||
|
["xpath=//tbody/tr", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "5fdee818-7211-4390-9ba8-c8b59022dcf2",
|
||||||
|
"comment": "",
|
||||||
|
"command": "type",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "2e0da041-025a-4e59-8154-2edca8753cae",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "5ebc769c-019f-4fd4-83f2-d90801913c78",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "id=Descripcion-error",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion-error", "id"],
|
||||||
|
["css=#Descripcion-error", "css:finder"],
|
||||||
|
["xpath=//span[@id='Descripcion-error']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/div/span/span", "xpath:idRelative"],
|
||||||
|
["xpath=//span/span", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "Este campo es requerido."
|
||||||
|
}, {
|
||||||
|
"id": "3b77fd48-a86e-48c1-a58f-fe3fdedd6db6",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "778fe5dd-d9b4-4c13-8a95-af3e33130bed",
|
||||||
|
"name": "Editar_TiposIdentificacion_Incorrecto_Texto",
|
||||||
|
"commands": [{
|
||||||
|
"id": "1682477e-8ede-41bb-ba71-1a44c9933daf",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "4a14eea3-bc28-4f7d-bca2-0ab2e084e61d",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "848x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "a554f498-5a29-4ab3-a6aa-4860d367f55b",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.fa-bars",
|
||||||
|
"targets": [
|
||||||
|
["css=.fa-bars", "css:finder"],
|
||||||
|
["xpath=//i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "05c526e6-aa77-475d-bbf7-5107d1b8d6bc",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p", "css:finder"],
|
||||||
|
["xpath=//p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Mantenimientos')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "4a33f648-8316-4e35-8d48-59e4ef8b1ef4",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Tipos de Identificación",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Tipos de Identificación", "linkText"],
|
||||||
|
["css=.nav-item:nth-child(6) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '/TipoIdentificacion')]", "xpath:href"],
|
||||||
|
["xpath=//li[6]/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "fb01e677-ece8-495a-8bae-370261c44b1d",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.odd:nth-child(1) .btn-primary > .fa",
|
||||||
|
"targets": [
|
||||||
|
["css=.odd:nth-child(1) .btn-primary > .fa", "css:finder"],
|
||||||
|
["xpath=//table[@id='tablasMT']/tbody/tr/td[4]/a/i", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/a/i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "84967335-7898-4d8e-b04c-dd1149127422",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.content",
|
||||||
|
"targets": [
|
||||||
|
["css=.content", "css:finder"],
|
||||||
|
["xpath=//body/div/div/div[2]", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "e7013ed6-f5d4-4ace-abfe-f40bf8a027d5",
|
||||||
|
"comment": "",
|
||||||
|
"command": "type",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "AAA51"
|
||||||
|
}, {
|
||||||
|
"id": "bbea4230-84e7-42ac-b628-09f1a553155a",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "9fcf685e-7e35-493d-a699-9c769e3cc8d0",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "id=Descripcion-error",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion-error", "id"],
|
||||||
|
["css=#Descripcion-error", "css:finder"],
|
||||||
|
["xpath=//span[@id='Descripcion-error']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/div/span/span", "xpath:idRelative"],
|
||||||
|
["xpath=//span/span", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "Este campo solo admite texto."
|
||||||
|
}, {
|
||||||
|
"id": "62fda8f1-66a4-46df-8633-0da9153c4537",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "159b739e-e967-4124-921a-b74608208e00",
|
||||||
|
"name": "Eliminar_TiposIdentificacion",
|
||||||
|
"commands": [{
|
||||||
|
"id": "98b43ce9-1b11-449e-86c1-2abaa49cf1c2",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "3cdf80de-4d6a-4dc3-aec2-ac794fb981a1",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "719x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "7bccf33c-3654-4bda-9c6c-e2617037a3dd",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.fa-bars",
|
||||||
|
"targets": [
|
||||||
|
["css=.fa-bars", "css:finder"],
|
||||||
|
["xpath=//i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "e36a4f11-c95a-4a3d-b878-95349f2c3830",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p", "css:finder"],
|
||||||
|
["xpath=//p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Mantenimientos')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "76c2cc55-1b81-403b-b21c-6c0efc74c52c",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-item:nth-child(6) p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-item:nth-child(6) p", "css:finder"],
|
||||||
|
["xpath=//li[6]/a/p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Tipos de Identificación')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "c90c34ff-f53c-49f4-85c8-57cbc9493faa",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.odd:nth-child(1) .btn-danger > .fa",
|
||||||
|
"targets": [
|
||||||
|
["css=.odd:nth-child(1) .btn-danger > .fa", "css:finder"],
|
||||||
|
["xpath=//table[@id='tablasMT']/tbody/tr/td[4]/a[2]/i", "xpath:idRelative"],
|
||||||
|
["xpath=//a[2]/i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "c8e7829b-506a-4d5e-8048-131d1effa5f8",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.swal2-confirm",
|
||||||
|
"targets": [
|
||||||
|
["css=.swal2-confirm", "css:finder"],
|
||||||
|
["xpath=(//button[@type='button'])[2]", "xpath:attributes"],
|
||||||
|
["xpath=//div[6]/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Eliminar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "4ca63bd0-76be-4f62-bf8a-35f6dc351dd9",
|
||||||
|
"comment": "",
|
||||||
|
"command": "mouseOver",
|
||||||
|
"target": "css=.swal2-confirm",
|
||||||
|
"targets": [
|
||||||
|
["css=.swal2-confirm", "css:finder"],
|
||||||
|
["xpath=(//button[@type='button'])[2]", "xpath:attributes"],
|
||||||
|
["xpath=//div[6]/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Eliminar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "9d84646f-3a6a-4935-bb9b-73921517516c",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "cd28493a-591b-46b2-9faf-0373301798b3",
|
||||||
|
"name": "Consultar_TiposIdentificacion",
|
||||||
|
"commands": [{
|
||||||
|
"id": "e500be7c-dd44-4656-8da9-abeab90a62d8",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "b8a361d4-a8fb-4166-bfaf-7deb78a8c12b",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "779x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "ebe247c2-b7b0-4f27-b49d-4ea3d1f69fba",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link",
|
||||||
|
"targets": [
|
||||||
|
["css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '#')]", "xpath:href"],
|
||||||
|
["xpath=//a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "4f59ba2b-7767-41e6-9368-61f4cbd7e099",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p", "css:finder"],
|
||||||
|
["xpath=//p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Mantenimientos')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "faab6872-460d-4030-aa40-78faeae28063",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-item:nth-child(6) p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-item:nth-child(6) p", "css:finder"],
|
||||||
|
["xpath=//li[6]/a/p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Tipos de Identificación')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "2b2fa817-8afa-42a9-b42e-0401652e864b",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "css=.m-0",
|
||||||
|
"targets": [
|
||||||
|
["css=.m-0", "css:finder"],
|
||||||
|
["xpath=//h1", "xpath:position"],
|
||||||
|
["xpath=//h1[contains(.,'Tipos de Identificación')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": "Tipos de Identificación"
|
||||||
|
}, {
|
||||||
|
"id": "fc1f1a6c-fd8f-429d-b34f-ab900240f28d",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}],
|
||||||
|
"suites": [{
|
||||||
|
"id": "84b5a135-d635-42d7-90b4-290f8f69e2af",
|
||||||
|
"name": "Default Suite",
|
||||||
|
"persistSession": false,
|
||||||
|
"parallel": false,
|
||||||
|
"timeout": 300,
|
||||||
|
"tests": []
|
||||||
|
}],
|
||||||
|
"urls": ["https://localhost:5134/"],
|
||||||
|
"plugins": []
|
||||||
|
}
|
||||||
893
TPAtesa_CuentasCobrar/CXC_ATESA_Pruebas_TiposPago.side
Normal file
893
TPAtesa_CuentasCobrar/CXC_ATESA_Pruebas_TiposPago.side
Normal file
|
|
@ -0,0 +1,893 @@
|
||||||
|
{
|
||||||
|
"id": "ada3772a-db47-406f-a282-f82bdfcebeb3",
|
||||||
|
"version": "2.0",
|
||||||
|
"name": "CXC_ATESA_Pruebas_Bancos",
|
||||||
|
"url": "https://localhost:5134",
|
||||||
|
"tests": [{
|
||||||
|
"id": "140c937c-dbf8-4955-84f6-4f4b6d9c5f8e",
|
||||||
|
"name": "Agregar_TiposPago_Correcto",
|
||||||
|
"commands": [{
|
||||||
|
"id": "a7d707c8-c8d9-4039-af5d-b9016b4bca5c",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "42f99f9b-84ac-49d8-9755-388c5afe3511",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "836x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "9fc6f766-547f-404d-9c52-b171180d7a3e",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.fa-bars",
|
||||||
|
"targets": [
|
||||||
|
["css=.fa-bars", "css:finder"],
|
||||||
|
["xpath=//i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "2eab0e2f-ac0d-4e8d-b2d5-2bc1ffca524f",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Mantenimientos",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Mantenimientos", "linkText"],
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=(//a[contains(@href, '#')])[4]", "xpath:href"],
|
||||||
|
["xpath=//aside/div/nav/ul/li/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "786c0d16-d097-4684-bc97-886ef991793c",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-item:nth-child(5) p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-item:nth-child(5) p", "css:finder"],
|
||||||
|
["xpath=//li[5]/a/p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Tipos de Pago')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "5ab7473b-f944-40ca-9358-2331a3c122cb",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.fa-plus",
|
||||||
|
"targets": [
|
||||||
|
["css=.fa-plus", "css:finder"],
|
||||||
|
["xpath=//div/a/i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "9019aea9-2386-4546-a8aa-9e7dfc7aa3da",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "fffaf204-3638-43f5-95ef-eb4d4819908f",
|
||||||
|
"comment": "",
|
||||||
|
"command": "type",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "AAA tipo pago Agregar "
|
||||||
|
}, {
|
||||||
|
"id": "140647b8-a7d2-45f8-8eed-57df2f4bbaa5",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "838dc9d8-3d83-4f7d-9df1-1ede4ce5093c",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "css=.odd:nth-child(1) > td:nth-child(2)",
|
||||||
|
"targets": [
|
||||||
|
["css=.odd:nth-child(1) > td:nth-child(2)", "css:finder"],
|
||||||
|
["xpath=//table[@id='tablasMT']/tbody/tr/td[2]", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]", "xpath:position"],
|
||||||
|
["xpath=//td[contains(.,'CHEQUE')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": "AAA tipo pago Agregar"
|
||||||
|
}, {
|
||||||
|
"id": "d7bb4420-954e-425f-96e2-31d871f6c193",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "3e1d3f47-b658-4697-91a7-2d0e3e1a04d7",
|
||||||
|
"name": "Agregar_TiposPago_Incorrecto_Req",
|
||||||
|
"commands": [{
|
||||||
|
"id": "95808d1e-2060-4157-acd5-2cce5c3259d5",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "31b7a737-0c02-4210-a63d-8b09da1e03f5",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "839x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "feb4e926-36e3-4f0d-8922-da43dc43c1bf",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.fa-bars",
|
||||||
|
"targets": [
|
||||||
|
["css=.fa-bars", "css:finder"],
|
||||||
|
["xpath=//i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "d0ed2d39-f93e-47ce-b343-d3a5de611c08",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p", "css:finder"],
|
||||||
|
["xpath=//p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Mantenimientos')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "ce76b5ba-84d1-4642-91e8-13816c28e75a",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-item:nth-child(5) p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-item:nth-child(5) p", "css:finder"],
|
||||||
|
["xpath=//li[5]/a/p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Tipos de Pago')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "9d463dae-9c46-41e4-8524-8e33d65b2889",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Agregar",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Agregar", "linkText"],
|
||||||
|
["css=.btn-success", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '/TipoPago/Agregar')]", "xpath:href"],
|
||||||
|
["xpath=//div/div/div/div/div/a", "xpath:position"],
|
||||||
|
["xpath=//a[contains(.,' Agregar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "509548be-e203-46cc-b4f3-f81a04cde9fa",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "53515d60-efdb-4db6-ada6-701aab1e1b24",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "id=Descripcion-error",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion-error", "id"],
|
||||||
|
["css=#Descripcion-error", "css:finder"],
|
||||||
|
["xpath=//span[@id='Descripcion-error']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/div/span/span", "xpath:idRelative"],
|
||||||
|
["xpath=//span/span", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "Este campo es requerido."
|
||||||
|
}, {
|
||||||
|
"id": "1ec13159-b147-4d95-8986-a8816c4919ac",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "28c0ef57-31f3-4273-abdf-a2d038a42dc7",
|
||||||
|
"name": "Agregar_TiposPago_Incorrecto_Texto",
|
||||||
|
"commands": [{
|
||||||
|
"id": "815b0cda-06f9-4a57-b5d8-ad0566567044",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "b38f9e30-812e-4ffd-bca6-0549662af71f",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "775x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "df7b3c6f-8d5d-47ea-bbc0-56c8248b98ce",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.fa-bars",
|
||||||
|
"targets": [
|
||||||
|
["css=.fa-bars", "css:finder"],
|
||||||
|
["xpath=//i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "b5fef24e-efc5-4e6a-ba24-01013af3e8ec",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p", "css:finder"],
|
||||||
|
["xpath=//p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Mantenimientos')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "d68936dd-2ffa-4649-9b5e-4f25f46851fa",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-item:nth-child(5) p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-item:nth-child(5) p", "css:finder"],
|
||||||
|
["xpath=//li[5]/a/p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Tipos de Pago')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "72b7fe6f-4e45-454d-9538-dfab362f6841",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.px-2",
|
||||||
|
"targets": [
|
||||||
|
["css=.px-2", "css:finder"],
|
||||||
|
["xpath=//div[2]/div/div/div/div/div/div", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "c4257565-4cab-4941-a9db-fda23c9c650d",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Agregar",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Agregar", "linkText"],
|
||||||
|
["css=.btn-success", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '/TipoPago/Agregar')]", "xpath:href"],
|
||||||
|
["xpath=//div/div/div/div/div/a", "xpath:position"],
|
||||||
|
["xpath=//a[contains(.,' Agregar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "53849a5d-4ea9-404c-8b0a-01b4a5ac5355",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "32da13a3-c082-44e2-9887-f2e723e34c9e",
|
||||||
|
"comment": "",
|
||||||
|
"command": "type",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "tipo pago8888"
|
||||||
|
}, {
|
||||||
|
"id": "78c1d9b0-30f7-4cce-981b-42560a58082c",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "b2165865-f5f0-4c06-90ca-acff6b621b3c",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "id=Descripcion-error",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion-error", "id"],
|
||||||
|
["css=#Descripcion-error", "css:finder"],
|
||||||
|
["xpath=//span[@id='Descripcion-error']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/div/span/span", "xpath:idRelative"],
|
||||||
|
["xpath=//span/span", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "Este campo solo admite texto."
|
||||||
|
}, {
|
||||||
|
"id": "a60abedd-ccc1-46fa-88f1-7152f27cf2e5",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "710b1403-d03f-4871-8ad0-042401e15ecf",
|
||||||
|
"name": "Editar_TiposPago_Correcto",
|
||||||
|
"commands": [{
|
||||||
|
"id": "1e7e5f8a-38a2-4f61-8239-d371c89387a9",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "c490ba9d-c931-4b67-9a35-9602d1ba52a5",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "826x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "96dcca02-6750-4caf-972a-db7d4d5dde59",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.fa-bars",
|
||||||
|
"targets": [
|
||||||
|
["css=.fa-bars", "css:finder"],
|
||||||
|
["xpath=//i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "8618791f-99ad-4694-8f4e-3dd2d30ea692",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p", "css:finder"],
|
||||||
|
["xpath=//p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Mantenimientos')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "7636e5af-b8ac-4c25-b935-3e3c07519c27",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Tipos de Pago",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Tipos de Pago", "linkText"],
|
||||||
|
["css=.nav-item:nth-child(5) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '/TipoPago')]", "xpath:href"],
|
||||||
|
["xpath=//li[5]/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "34b2ff4c-1b7c-4fb1-8cd5-35d1c3d53a66",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.odd:nth-child(1) .btn-primary > .fa",
|
||||||
|
"targets": [
|
||||||
|
["css=.odd:nth-child(1) .btn-primary > .fa", "css:finder"],
|
||||||
|
["xpath=//table[@id='tablasMT']/tbody/tr/td[4]/a/i", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/a/i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "4b20fb21-560c-47e7-a900-6a46f1fd0438",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "a3d7aec5-8662-4739-aa10-1a82144bf64c",
|
||||||
|
"comment": "",
|
||||||
|
"command": "type",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "AAA Tipo pago Editar"
|
||||||
|
}, {
|
||||||
|
"id": "bb43bf29-b406-49a8-be45-34727b77c1f3",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "603f2150-c17b-4ec4-8468-c07c7d3edd73",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "css=.odd:nth-child(1) > td:nth-child(2)",
|
||||||
|
"targets": [
|
||||||
|
["css=.odd:nth-child(1) > td:nth-child(2)", "css:finder"],
|
||||||
|
["xpath=//table[@id='tablasMT']/tbody/tr/td[2]", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]", "xpath:position"],
|
||||||
|
["xpath=//td[contains(.,'CHEQUE')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": "AAA Tipo pago Editar"
|
||||||
|
}, {
|
||||||
|
"id": "ae378752-3386-46d0-bc77-59f42a49e1bc",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "ffe68de8-097e-481a-bb90-52b488d46e62",
|
||||||
|
"name": "Editar_TiposPago_Incorrecto_Req",
|
||||||
|
"commands": [{
|
||||||
|
"id": "ddbd691d-e814-4de1-b373-a9f9f3b883d1",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "3d14b4af-b206-44e1-aaaa-edda86b0455f",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "842x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "9852fe2c-1e5a-4777-964f-0495d34d9840",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link",
|
||||||
|
"targets": [
|
||||||
|
["css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '#')]", "xpath:href"],
|
||||||
|
["xpath=//a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "db861438-3239-4893-8f32-e99cf723e7aa",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p", "css:finder"],
|
||||||
|
["xpath=//p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Mantenimientos')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "1a110847-2cbc-424c-87f7-996b81033f9c",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-item:nth-child(5) p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-item:nth-child(5) p", "css:finder"],
|
||||||
|
["xpath=//li[5]/a/p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Tipos de Pago')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "49a036fa-a10d-4075-8aa3-c25e20a5c646",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.odd:nth-child(1) .btn-primary",
|
||||||
|
"targets": [
|
||||||
|
["css=.odd:nth-child(1) .btn-primary", "css:finder"],
|
||||||
|
["xpath=//table[@id='tablasMT']/tbody/tr/td[4]/a", "xpath:idRelative"],
|
||||||
|
["xpath=//a[contains(@href, '/TipoPago/Editar/5')]", "xpath:href"],
|
||||||
|
["xpath=//td[4]/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "1fb5022f-5906-4acc-8f33-be34ecdd113d",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=tbody",
|
||||||
|
"targets": [
|
||||||
|
["css=tbody", "css:finder"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody", "xpath:idRelative"],
|
||||||
|
["xpath=//tbody", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "4a8e9118-969f-4330-adfc-d9d6e15e4a77",
|
||||||
|
"comment": "",
|
||||||
|
"command": "type",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "5d48ea55-4e59-4331-997b-a8d7f163ecf4",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "bcffa311-da82-4603-b9d9-58820c2f1111",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "id=Descripcion-error",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion-error", "id"],
|
||||||
|
["css=#Descripcion-error", "css:finder"],
|
||||||
|
["xpath=//span[@id='Descripcion-error']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/div/span/span", "xpath:idRelative"],
|
||||||
|
["xpath=//span/span", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "Este campo es requerido."
|
||||||
|
}, {
|
||||||
|
"id": "f17e08a3-fe92-4890-91bf-c5d39ae3a045",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "778fe5dd-d9b4-4c13-8a95-af3e33130bed",
|
||||||
|
"name": "Editar_TiposPago_Incorrecto_Texto",
|
||||||
|
"commands": [{
|
||||||
|
"id": "394878b4-cc3c-4167-aeba-8947b7eae0ac",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "97fe640b-00fb-404e-a626-439775d7cf64",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "834x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "02769910-930e-4fe9-ab25-a02ac4c554fc",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.fa-bars",
|
||||||
|
"targets": [
|
||||||
|
["css=.fa-bars", "css:finder"],
|
||||||
|
["xpath=//i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "14fb1b34-4d36-4381-9d8a-2e9b886f4d40",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Mantenimientos",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Mantenimientos", "linkText"],
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=(//a[contains(@href, '#')])[4]", "xpath:href"],
|
||||||
|
["xpath=//aside/div/nav/ul/li/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "2fec932c-6147-4756-b13b-6dbd08643539",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Tipos de Pago",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Tipos de Pago", "linkText"],
|
||||||
|
["css=.nav-item:nth-child(5) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '/TipoPago')]", "xpath:href"],
|
||||||
|
["xpath=//li[5]/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "f943ff86-8f7d-4491-918c-3d95f1d2f21a",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.odd:nth-child(1) .btn-primary > .fa",
|
||||||
|
"targets": [
|
||||||
|
["css=.odd:nth-child(1) .btn-primary > .fa", "css:finder"],
|
||||||
|
["xpath=//table[@id='tablasMT']/tbody/tr/td[4]/a/i", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/a/i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "bbe30459-30c0-4681-8359-0d798fb7d895",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=tbody > tr:nth-child(1)",
|
||||||
|
"targets": [
|
||||||
|
["css=tbody > tr:nth-child(1)", "css:finder"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr", "xpath:idRelative"],
|
||||||
|
["xpath=//tbody/tr", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "19bacd52-f1b3-4ce3-aa9d-ea3faefbe89a",
|
||||||
|
"comment": "",
|
||||||
|
"command": "type",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "AAgg 777"
|
||||||
|
}, {
|
||||||
|
"id": "ffd38442-8151-4ee6-a1bc-d8067587714f",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "6149033d-3eb3-4a11-91c9-5ca4ca22563e",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "id=Descripcion-error",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion-error", "id"],
|
||||||
|
["css=#Descripcion-error", "css:finder"],
|
||||||
|
["xpath=//span[@id='Descripcion-error']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/div/span/span", "xpath:idRelative"],
|
||||||
|
["xpath=//span/span", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "Este campo solo admite texto."
|
||||||
|
}, {
|
||||||
|
"id": "21abfc99-c66c-41bd-a3bb-4b0d4ce2bf70",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "159b739e-e967-4124-921a-b74608208e00",
|
||||||
|
"name": "Eliminar_TiposPago",
|
||||||
|
"commands": [{
|
||||||
|
"id": "c85531b1-bed1-49ec-a582-410c5cc682f7",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "26fa21e9-93b2-42fe-ac91-9a7cf08b4312",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "826x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "a91e9c8e-a61f-4bbb-9679-179ea536c7fd",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.fa-bars",
|
||||||
|
"targets": [
|
||||||
|
["css=.fa-bars", "css:finder"],
|
||||||
|
["xpath=//i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "7fffce3a-afde-4af1-a78a-488dee01706e",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p", "css:finder"],
|
||||||
|
["xpath=//p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Mantenimientos')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "1d1b9337-ecfc-4e69-8884-241f8457f182",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Tipos de Pago",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Tipos de Pago", "linkText"],
|
||||||
|
["css=.nav-item:nth-child(5) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '/TipoPago')]", "xpath:href"],
|
||||||
|
["xpath=//li[5]/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "3f86f183-b03a-451f-b2fc-bc426fc6ce04",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.odd:nth-child(1) .btn-danger > .fa",
|
||||||
|
"targets": [
|
||||||
|
["css=.odd:nth-child(1) .btn-danger > .fa", "css:finder"],
|
||||||
|
["xpath=//table[@id='tablasMT']/tbody/tr/td[4]/a[2]/i", "xpath:idRelative"],
|
||||||
|
["xpath=//a[2]/i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "b92abe56-3481-4a6e-9350-56def11be195",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.swal2-confirm",
|
||||||
|
"targets": [
|
||||||
|
["css=.swal2-confirm", "css:finder"],
|
||||||
|
["xpath=(//button[@type='button'])[2]", "xpath:attributes"],
|
||||||
|
["xpath=//div[6]/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Eliminar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "7ef5a2a4-01dc-4382-8427-71b9141c9c66",
|
||||||
|
"comment": "",
|
||||||
|
"command": "mouseOver",
|
||||||
|
"target": "css=.swal2-confirm",
|
||||||
|
"targets": [
|
||||||
|
["css=.swal2-confirm", "css:finder"],
|
||||||
|
["xpath=(//button[@type='button'])[2]", "xpath:attributes"],
|
||||||
|
["xpath=//div[6]/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Eliminar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "29a30d02-7b2d-4312-ad55-e9dc96d48b82",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "cd28493a-591b-46b2-9faf-0373301798b3",
|
||||||
|
"name": "Consultar_TiposPago",
|
||||||
|
"commands": [{
|
||||||
|
"id": "7867c6e3-021b-488c-aec9-2c28746107a9",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "b6218c8b-2bbc-4a91-85c1-5f5410793011",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "833x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "f456b3ca-49c6-4f4a-ad4e-cd5c3ccb3dbe",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.fa-bars",
|
||||||
|
"targets": [
|
||||||
|
["css=.fa-bars", "css:finder"],
|
||||||
|
["xpath=//i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "100eb989-1edc-429a-8f6b-adfe83df7012",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p", "css:finder"],
|
||||||
|
["xpath=//p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Mantenimientos')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "0869956f-0a8c-4902-b837-43d6a0f3c745",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-item:nth-child(5) p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-item:nth-child(5) p", "css:finder"],
|
||||||
|
["xpath=//li[5]/a/p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Tipos de Pago')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "a2252645-8fc3-49cd-99ac-07d332c48cec",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "css=.m-0",
|
||||||
|
"targets": [
|
||||||
|
["css=.m-0", "css:finder"],
|
||||||
|
["xpath=//h1", "xpath:position"],
|
||||||
|
["xpath=//h1[contains(.,'Tipos de pago')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": "Tipos de pago"
|
||||||
|
}, {
|
||||||
|
"id": "5ca48264-8d3b-4455-880c-0e7322e648d7",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}],
|
||||||
|
"suites": [{
|
||||||
|
"id": "84b5a135-d635-42d7-90b4-290f8f69e2af",
|
||||||
|
"name": "Default Suite",
|
||||||
|
"persistSession": false,
|
||||||
|
"parallel": false,
|
||||||
|
"timeout": 300,
|
||||||
|
"tests": []
|
||||||
|
}],
|
||||||
|
"urls": ["https://localhost:5134/"],
|
||||||
|
"plugins": []
|
||||||
|
}
|
||||||
883
TPAtesa_CuentasCobrar/CXC_ATESA_Pruebas_TiposTelefono.side
Normal file
883
TPAtesa_CuentasCobrar/CXC_ATESA_Pruebas_TiposTelefono.side
Normal file
|
|
@ -0,0 +1,883 @@
|
||||||
|
{
|
||||||
|
"id": "ada3772a-db47-406f-a282-f82bdfcebeb3",
|
||||||
|
"version": "2.0",
|
||||||
|
"name": "CXC_ATESA_Pruebas_Bancos",
|
||||||
|
"url": "https://localhost:5134",
|
||||||
|
"tests": [{
|
||||||
|
"id": "140c937c-dbf8-4955-84f6-4f4b6d9c5f8e",
|
||||||
|
"name": "Agregar_TiposTelefono_Correcto",
|
||||||
|
"commands": [{
|
||||||
|
"id": "014d3a69-f9aa-4e74-a741-619c7341eabf",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "f72e8a70-dc4d-485f-8cc7-978459bd993a",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "853x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "e68c7f2d-e017-4210-a719-b8b422be0db3",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link",
|
||||||
|
"targets": [
|
||||||
|
["css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '#')]", "xpath:href"],
|
||||||
|
["xpath=//a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "ba85d806-0efd-4fac-bb25-66b3a1a50deb",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-pills > .nav-item:nth-child(1)",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1)", "css:finder"],
|
||||||
|
["xpath=//aside/div/nav/ul/li", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "5b5fbe86-0635-4cef-8a3e-aa928f004bfb",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p", "css:finder"],
|
||||||
|
["xpath=//p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Mantenimientos')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "c042fab6-f28a-43db-8709-82dae73c0aa8",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Tipos de Teléfono",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Tipos de Teléfono", "linkText"],
|
||||||
|
["css=.nav-item:nth-child(7) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '/TipoTelefono')]", "xpath:href"],
|
||||||
|
["xpath=//li[7]/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "1396667c-105f-4dfe-ab9e-04ebdd47bbba",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Agregar",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Agregar", "linkText"],
|
||||||
|
["css=.btn-success", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '/TipoTelefono/Agregar')]", "xpath:href"],
|
||||||
|
["xpath=//div/div/div/div/div/a", "xpath:position"],
|
||||||
|
["xpath=//a[contains(.,' Agregar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "55c3908a-4572-4fa3-b863-944a12049094",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "0ef777d6-d610-4919-bdfa-c22e82b64d56",
|
||||||
|
"comment": "",
|
||||||
|
"command": "type",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "AAA tipo teléfono Agregar"
|
||||||
|
}, {
|
||||||
|
"id": "40cb4655-9288-4ec2-ae4d-890a12e50195",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "6bb12a23-b8a3-4d62-88cb-aa982a75afc6",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "css=.odd:nth-child(1) > td:nth-child(2)",
|
||||||
|
"targets": [
|
||||||
|
["css=.odd:nth-child(1) > td:nth-child(2)", "css:finder"],
|
||||||
|
["xpath=//table[@id='tablasMT']/tbody/tr/td[2]", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]", "xpath:position"],
|
||||||
|
["xpath=//td[contains(.,'CASA')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": "AAA tipo teléfono Agregar"
|
||||||
|
}, {
|
||||||
|
"id": "780da984-9a25-4754-b091-83589be486fd",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "3e1d3f47-b658-4697-91a7-2d0e3e1a04d7",
|
||||||
|
"name": "Agregar_TiposTelefono_Incorrecto_Req",
|
||||||
|
"commands": [{
|
||||||
|
"id": "ca2e2428-d793-4c07-b327-5a23252ce409",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "f3c412ff-bca8-41e6-ac80-6bc1926b3db2",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "805x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "7ef3f78b-3d78-4cc2-a301-feac132f9173",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.fa-bars",
|
||||||
|
"targets": [
|
||||||
|
["css=.fa-bars", "css:finder"],
|
||||||
|
["xpath=//i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "f009d79b-6c2b-4c5b-b858-9a4813da3657",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p", "css:finder"],
|
||||||
|
["xpath=//p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Mantenimientos')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "ca4b24b4-cfd5-49a0-863a-bccf9dbb3c4b",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-item:nth-child(7) p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-item:nth-child(7) p", "css:finder"],
|
||||||
|
["xpath=//li[7]/a/p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Tipos de Teléfono')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "ac5e166a-6e84-476d-a6f3-97820bd0bb35",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Agregar",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Agregar", "linkText"],
|
||||||
|
["css=.btn-success", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '/TipoTelefono/Agregar')]", "xpath:href"],
|
||||||
|
["xpath=//div/div/div/div/div/a", "xpath:position"],
|
||||||
|
["xpath=//a[contains(.,' Agregar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "c0a8944b-42ea-419d-9f11-774b60716c1f",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "4a94d76d-645f-4128-8dc1-f5b9c0a6cfbc",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "id=Descripcion-error",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion-error", "id"],
|
||||||
|
["css=#Descripcion-error", "css:finder"],
|
||||||
|
["xpath=//span[@id='Descripcion-error']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/div/span/span", "xpath:idRelative"],
|
||||||
|
["xpath=//span/span", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "Este campo es requerido."
|
||||||
|
}, {
|
||||||
|
"id": "b49fe7ea-40ae-4ca6-9e31-245bad95e6e2",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "28c0ef57-31f3-4273-abdf-a2d038a42dc7",
|
||||||
|
"name": "Agregar_TiposTelefono_Incorrecto_Texto",
|
||||||
|
"commands": [{
|
||||||
|
"id": "ba5fca76-2c25-456f-8347-1945aa20178f",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "bdd15779-38a0-4e5f-b479-2f7e728cf4b4",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "730x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "07468089-e949-4ca3-8e5b-4cc16ee70a5b",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.fa-bars",
|
||||||
|
"targets": [
|
||||||
|
["css=.fa-bars", "css:finder"],
|
||||||
|
["xpath=//i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "6d203407-f050-4a40-838e-0c6cd77aed4a",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p", "css:finder"],
|
||||||
|
["xpath=//p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Mantenimientos')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "76c7ea9c-8e27-4602-ad0e-98d768ba50e2",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Tipos de Teléfono",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Tipos de Teléfono", "linkText"],
|
||||||
|
["css=.nav-item:nth-child(7) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '/TipoTelefono')]", "xpath:href"],
|
||||||
|
["xpath=//li[7]/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "a3ce0ad9-7fea-45fd-995a-1194ab775447",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Agregar",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Agregar", "linkText"],
|
||||||
|
["css=.btn-success", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '/TipoTelefono/Agregar')]", "xpath:href"],
|
||||||
|
["xpath=//div/div/div/div/div/a", "xpath:position"],
|
||||||
|
["xpath=//a[contains(.,' Agregar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "d7d1f6a4-3ee0-465b-9347-8b090984b348",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "d2effdf9-000e-4ad3-9aa9-0d510841b3e0",
|
||||||
|
"comment": "",
|
||||||
|
"command": "type",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "tipo telefono45"
|
||||||
|
}, {
|
||||||
|
"id": "575a18e0-87a7-4165-97b5-a90b567ee5e2",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "c0dbe993-54e0-49d3-85d0-60cf2e5856f8",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "id=Descripcion-error",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion-error", "id"],
|
||||||
|
["css=#Descripcion-error", "css:finder"],
|
||||||
|
["xpath=//span[@id='Descripcion-error']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/div/span/span", "xpath:idRelative"],
|
||||||
|
["xpath=//span/span", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "Este campo solo admite texto."
|
||||||
|
}, {
|
||||||
|
"id": "70aa1bfb-67e1-484f-a1c8-f583faecab07",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "710b1403-d03f-4871-8ad0-042401e15ecf",
|
||||||
|
"name": "Editar_TiposTelefono_Correcto",
|
||||||
|
"commands": [{
|
||||||
|
"id": "9c42ae89-aa68-4c4d-ae16-8f2a5bd07bbc",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "312c0ba7-1e52-4a5d-bf07-517d16a9e604",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "650x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "35f2c8f7-ab2d-43cc-ba1d-b704b4a8f7ed",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.fa-bars",
|
||||||
|
"targets": [
|
||||||
|
["css=.fa-bars", "css:finder"],
|
||||||
|
["xpath=//i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "22039f08-96f2-4b29-a2a8-20e9726b0cf5",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p", "css:finder"],
|
||||||
|
["xpath=//p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Mantenimientos')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "5f671205-f1ea-46dd-802c-b74bdddd36ee",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-item:nth-child(7) p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-item:nth-child(7) p", "css:finder"],
|
||||||
|
["xpath=//li[7]/a/p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Tipos de Teléfono')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "402e2284-b181-45d5-8099-e681019e257a",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.odd:nth-child(1) .btn-primary",
|
||||||
|
"targets": [
|
||||||
|
["css=.odd:nth-child(1) .btn-primary", "css:finder"],
|
||||||
|
["xpath=//table[@id='tablasMT']/tbody/tr/td[4]/a", "xpath:idRelative"],
|
||||||
|
["xpath=//a[contains(@href, '/TipoTelefono/Editar/5')]", "xpath:href"],
|
||||||
|
["xpath=//td[4]/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "be40b3bf-ba84-4a61-9b42-6faaa5cd2e83",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=html",
|
||||||
|
"targets": [
|
||||||
|
["css=html", "css:finder"],
|
||||||
|
["xpath=//html", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "79bede28-d570-464d-80ee-c104a78ef510",
|
||||||
|
"comment": "",
|
||||||
|
"command": "type",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "AAA Tipo Teléfono Editar"
|
||||||
|
}, {
|
||||||
|
"id": "24fae1cc-28a4-44a6-911f-7a74f8252bfe",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "ab23fe29-876e-4124-a59e-80ce70f66d3c",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "css=.odd:nth-child(1) > td:nth-child(2)",
|
||||||
|
"targets": [
|
||||||
|
["css=.odd:nth-child(1) > td:nth-child(2)", "css:finder"],
|
||||||
|
["xpath=//table[@id='tablasMT']/tbody/tr/td[2]", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]", "xpath:position"],
|
||||||
|
["xpath=//td[contains(.,'CASA')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": "AAA Tipo Teléfono Editar"
|
||||||
|
}, {
|
||||||
|
"id": "1f21d5cd-b87d-43b5-8707-370082b532b5",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "ffe68de8-097e-481a-bb90-52b488d46e62",
|
||||||
|
"name": "Editar_TiposTelefono_Incorrecto_Req",
|
||||||
|
"commands": [{
|
||||||
|
"id": "0e8cc21a-fa8c-4ea0-a02a-3fb3c223b74b",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "0ffda2bd-3f68-4afd-bec6-6bc4aeef200a",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "716x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "0ebb8e20-c0bf-4e51-9e3a-5e25b14345e4",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link",
|
||||||
|
"targets": [
|
||||||
|
["css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '#')]", "xpath:href"],
|
||||||
|
["xpath=//a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "0592a5f6-9a82-46c0-a8f9-e8067a6024a1",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Mantenimientos",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Mantenimientos", "linkText"],
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=(//a[contains(@href, '#')])[4]", "xpath:href"],
|
||||||
|
["xpath=//aside/div/nav/ul/li/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "c5b493cc-90d0-4b44-bee0-ca169bd73577",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-item:nth-child(7) p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-item:nth-child(7) p", "css:finder"],
|
||||||
|
["xpath=//li[7]/a/p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Tipos de Teléfono')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "3d391c1a-ce7c-4edd-97bb-807db1afc575",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.odd:nth-child(1) .btn-primary",
|
||||||
|
"targets": [
|
||||||
|
["css=.odd:nth-child(1) .btn-primary", "css:finder"],
|
||||||
|
["xpath=//table[@id='tablasMT']/tbody/tr/td[4]/a", "xpath:idRelative"],
|
||||||
|
["xpath=//a[contains(@href, '/TipoTelefono/Editar/5')]", "xpath:href"],
|
||||||
|
["xpath=//td[4]/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "ec0610d8-8bd7-46b6-8d58-1949c805d461",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.col-sm-12",
|
||||||
|
"targets": [
|
||||||
|
["css=.col-sm-12", "css:finder"],
|
||||||
|
["xpath=//div/div/div/div[2]/div", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "2666d567-e63b-4f76-b419-fdacd3acd890",
|
||||||
|
"comment": "",
|
||||||
|
"command": "type",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "bc0c9de0-a4bc-4fdf-a6b4-f309e16f8d91",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "05b312a5-1d31-425b-af44-b9f4b52b33e1",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "id=Descripcion-error",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion-error", "id"],
|
||||||
|
["css=#Descripcion-error", "css:finder"],
|
||||||
|
["xpath=//span[@id='Descripcion-error']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/div/span/span", "xpath:idRelative"],
|
||||||
|
["xpath=//span/span", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "Este campo es requerido."
|
||||||
|
}, {
|
||||||
|
"id": "599fb08a-2e89-4c62-a15e-95fe7a8db873",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "778fe5dd-d9b4-4c13-8a95-af3e33130bed",
|
||||||
|
"name": "Editar_TiposTelefono_Incorrecto_Texto",
|
||||||
|
"commands": [{
|
||||||
|
"id": "9742b4a8-356b-4662-97ab-8abd43e3fc85",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "c7c27a63-a3ac-4985-a59d-cd448009834e",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "791x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "7c366de7-f857-42af-b2f3-431da0ba3434",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link",
|
||||||
|
"targets": [
|
||||||
|
["css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '#')]", "xpath:href"],
|
||||||
|
["xpath=//a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "ebba172d-8ccf-488d-9232-c2fe40ebe63b",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p", "css:finder"],
|
||||||
|
["xpath=//p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Mantenimientos')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "c019f068-1e74-4d75-949a-4b832ec03b9f",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Tipos de Teléfono",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Tipos de Teléfono", "linkText"],
|
||||||
|
["css=.nav-item:nth-child(7) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '/TipoTelefono')]", "xpath:href"],
|
||||||
|
["xpath=//li[7]/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "8073cb16-a2ed-4662-bb28-b5006c880875",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.odd:nth-child(1) .btn-primary",
|
||||||
|
"targets": [
|
||||||
|
["css=.odd:nth-child(1) .btn-primary", "css:finder"],
|
||||||
|
["xpath=//table[@id='tablasMT']/tbody/tr/td[4]/a", "xpath:idRelative"],
|
||||||
|
["xpath=//a[contains(@href, '/TipoTelefono/Editar/5')]", "xpath:href"],
|
||||||
|
["xpath=//td[4]/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "412cb50e-14d1-4781-9fb6-70a6ff331300",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.content",
|
||||||
|
"targets": [
|
||||||
|
["css=.content", "css:finder"],
|
||||||
|
["xpath=//body/div/div/div[2]", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "0cc8c649-4886-4538-9bfa-ceb0b2f35526",
|
||||||
|
"comment": "",
|
||||||
|
"command": "type",
|
||||||
|
"target": "id=Descripcion",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion", "id"],
|
||||||
|
["name=Descripcion", "name"],
|
||||||
|
["css=#Descripcion", "css:finder"],
|
||||||
|
["xpath=//input[@id='Descripcion']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/input", "xpath:idRelative"],
|
||||||
|
["xpath=//td[2]/div/div/input", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "AAgg 3351"
|
||||||
|
}, {
|
||||||
|
"id": "a7d45a93-5023-4d0f-bd20-04b360edd00e",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.d-flex > .btn-success",
|
||||||
|
"targets": [
|
||||||
|
["css=.d-flex > .btn-success", "css:finder"],
|
||||||
|
["xpath=//button[@type='submit']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[4]/div/button", "xpath:idRelative"],
|
||||||
|
["xpath=//td[4]/div/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Guardar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "85e97f57-62d5-4bbf-8a1e-f5a88659358a",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "id=Descripcion-error",
|
||||||
|
"targets": [
|
||||||
|
["id=Descripcion-error", "id"],
|
||||||
|
["css=#Descripcion-error", "css:finder"],
|
||||||
|
["xpath=//span[@id='Descripcion-error']", "xpath:attributes"],
|
||||||
|
["xpath=//table[@id='tblEmpleados']/tbody/tr/td[2]/div/div/div/span/span", "xpath:idRelative"],
|
||||||
|
["xpath=//span/span", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": "Este campo solo admite texto."
|
||||||
|
}, {
|
||||||
|
"id": "0c3cd342-4695-42a1-b515-3a1e354608c1",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "159b739e-e967-4124-921a-b74608208e00",
|
||||||
|
"name": "Eliminar_TiposTelefono",
|
||||||
|
"commands": [{
|
||||||
|
"id": "44ae27c0-26db-4aed-90eb-1c9fb8be66c0",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "7cab305e-62bf-4824-b863-4e50ac3337fe",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "671x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "580c2fa6-eb80-4219-a461-34d86a0aacf6",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.fa-bars",
|
||||||
|
"targets": [
|
||||||
|
["css=.fa-bars", "css:finder"],
|
||||||
|
["xpath=//i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "32d6c1f9-14f4-40bb-bb20-effe754d7dfc",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link > p", "css:finder"],
|
||||||
|
["xpath=//p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Mantenimientos')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "fb230f3d-5c90-46e5-af09-b941da4c3054",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-item:nth-child(7) p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-item:nth-child(7) p", "css:finder"],
|
||||||
|
["xpath=//li[7]/a/p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Tipos de Teléfono')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "90fb2765-5b9f-4957-a66f-b266ff3a9054",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.odd:nth-child(1) .btn-danger > .fa",
|
||||||
|
"targets": [
|
||||||
|
["css=.odd:nth-child(1) .btn-danger > .fa", "css:finder"],
|
||||||
|
["xpath=//table[@id='tablasMT']/tbody/tr/td[4]/a[2]/i", "xpath:idRelative"],
|
||||||
|
["xpath=//a[2]/i", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "b94e00af-9b50-4a54-ba54-ba3b887f9c52",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.swal2-confirm",
|
||||||
|
"targets": [
|
||||||
|
["css=.swal2-confirm", "css:finder"],
|
||||||
|
["xpath=(//button[@type='button'])[2]", "xpath:attributes"],
|
||||||
|
["xpath=//div[6]/button", "xpath:position"],
|
||||||
|
["xpath=//button[contains(.,'Eliminar')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "69a62bcc-b514-4a2d-a35d-25767b6d93cb",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}, {
|
||||||
|
"id": "cd28493a-591b-46b2-9faf-0373301798b3",
|
||||||
|
"name": "Consultar_TiposTelefono",
|
||||||
|
"commands": [{
|
||||||
|
"id": "874ea0a3-7284-467e-8bc8-d437af4e3fea",
|
||||||
|
"comment": "",
|
||||||
|
"command": "open",
|
||||||
|
"target": "/",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "2f3a09c1-1748-4b91-96ca-57543df41ca5",
|
||||||
|
"comment": "",
|
||||||
|
"command": "setWindowSize",
|
||||||
|
"target": "694x735",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "556f8701-ccbf-494e-b67c-fff487f2f52c",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link",
|
||||||
|
"targets": [
|
||||||
|
["css=.main-header > .navbar-nav > .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=//a[contains(@href, '#')]", "xpath:href"],
|
||||||
|
["xpath=//a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "344c5a94-7ea4-4c86-aaa7-5214e28a617d",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "linkText=Mantenimientos",
|
||||||
|
"targets": [
|
||||||
|
["linkText=Mantenimientos", "linkText"],
|
||||||
|
["css=.nav-pills > .nav-item:nth-child(1) > .nav-link", "css:finder"],
|
||||||
|
["xpath=(//a[contains(@href, '#')])[4]", "xpath:href"],
|
||||||
|
["xpath=//aside/div/nav/ul/li/a", "xpath:position"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "e0f0a3a9-2f7a-4031-b69f-67a3ec06fd89",
|
||||||
|
"comment": "",
|
||||||
|
"command": "click",
|
||||||
|
"target": "css=.nav-item:nth-child(7) p",
|
||||||
|
"targets": [
|
||||||
|
["css=.nav-item:nth-child(7) p", "css:finder"],
|
||||||
|
["xpath=//li[7]/a/p", "xpath:position"],
|
||||||
|
["xpath=//p[contains(.,'Tipos de Teléfono')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": ""
|
||||||
|
}, {
|
||||||
|
"id": "cb17dbf6-93ee-49d3-819e-886a41042efe",
|
||||||
|
"comment": "",
|
||||||
|
"command": "assertText",
|
||||||
|
"target": "css=.m-0",
|
||||||
|
"targets": [
|
||||||
|
["css=.m-0", "css:finder"],
|
||||||
|
["xpath=//h1", "xpath:position"],
|
||||||
|
["xpath=//h1[contains(.,'Tipos de Teléfono')]", "xpath:innerText"]
|
||||||
|
],
|
||||||
|
"value": "Tipos de Teléfono"
|
||||||
|
}, {
|
||||||
|
"id": "947a1788-2fdc-4f34-bd5f-74ff040a8b7a",
|
||||||
|
"comment": "",
|
||||||
|
"command": "close",
|
||||||
|
"target": "",
|
||||||
|
"targets": [],
|
||||||
|
"value": ""
|
||||||
|
}]
|
||||||
|
}],
|
||||||
|
"suites": [{
|
||||||
|
"id": "84b5a135-d635-42d7-90b4-290f8f69e2af",
|
||||||
|
"name": "Default Suite",
|
||||||
|
"persistSession": false,
|
||||||
|
"parallel": false,
|
||||||
|
"timeout": 300,
|
||||||
|
"tests": []
|
||||||
|
}],
|
||||||
|
"urls": ["https://localhost:5134/"],
|
||||||
|
"plugins": []
|
||||||
|
}
|
||||||
1677
TPAtesa_CuentasCobrar/CXC_ATESA_Pruebas_Usuarios.side
Normal file
1677
TPAtesa_CuentasCobrar/CXC_ATESA_Pruebas_Usuarios.side
Normal file
File diff suppressed because it is too large
Load diff
52
TPAtesa_CuentasCobrar/CuentasCobrar.API.sln
Normal file
52
TPAtesa_CuentasCobrar/CuentasCobrar.API.sln
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.4.33213.308
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CuentasCobrar.API", "CuentasCobrar.API\CuentasCobrar.API.csproj", "{21F4A5C0-68CF-4E1F-8AB0-A737C6EE5508}"
|
||||||
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CuentasCobrar.CORE", "CuentasCobrar.CORE\CuentasCobrar.CORE.csproj", "{19C34145-9D9F-4611-A75D-FEF486BDA11D}"
|
||||||
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CuentasCobrar.INFRASTRUCTURE", "CuentasCobrar.INFRASTRUCTURE\CuentasCobrar.INFRASTRUCTURE.csproj", "{2907CA49-BB6F-4F4B-A255-92DDAEC500DA}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{21F4A5C0-68CF-4E1F-8AB0-A737C6EE5508}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{21F4A5C0-68CF-4E1F-8AB0-A737C6EE5508}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{21F4A5C0-68CF-4E1F-8AB0-A737C6EE5508}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{21F4A5C0-68CF-4E1F-8AB0-A737C6EE5508}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{19C34145-9D9F-4611-A75D-FEF486BDA11D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{19C34145-9D9F-4611-A75D-FEF486BDA11D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{19C34145-9D9F-4611-A75D-FEF486BDA11D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{19C34145-9D9F-4611-A75D-FEF486BDA11D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{2907CA49-BB6F-4F4B-A255-92DDAEC500DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{2907CA49-BB6F-4F4B-A255-92DDAEC500DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{2907CA49-BB6F-4F4B-A255-92DDAEC500DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{2907CA49-BB6F-4F4B-A255-92DDAEC500DA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {5BA56273-A132-4488-89AB-30DB64F82CB1}
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(TeamFoundationVersionControl) = preSolution
|
||||||
|
SccNumberOfProjects = 4
|
||||||
|
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
|
||||||
|
SccTeamFoundationServer = http://192.168.1.10:8080/tfs/tpatesa
|
||||||
|
SccLocalPath0 = .
|
||||||
|
SccProjectUniqueName1 = CuentasCobrar.API\\CuentasCobrar.API.csproj
|
||||||
|
SccProjectName1 = CuentasCobrar.API
|
||||||
|
SccLocalPath1 = CuentasCobrar.API
|
||||||
|
SccProjectUniqueName2 = CuentasCobrar.CORE\\CuentasCobrar.CORE.csproj
|
||||||
|
SccProjectName2 = CuentasCobrar.CORE
|
||||||
|
SccLocalPath2 = CuentasCobrar.CORE
|
||||||
|
SccProjectUniqueName3 = CuentasCobrar.INFRASTRUCTURE\\CuentasCobrar.INFRASTRUCTURE.csproj
|
||||||
|
SccProjectName3 = CuentasCobrar.INFRASTRUCTURE
|
||||||
|
SccLocalPath3 = CuentasCobrar.INFRASTRUCTURE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
|
|
@ -0,0 +1,268 @@
|
||||||
|
using AutoMapper;
|
||||||
|
using CuentasCobrar.CORE.DTOs;
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
using CuentasCobrar.CORE.Exceptions;
|
||||||
|
using CuentasCobrar.CORE.Interfaces;
|
||||||
|
using CuentasCobrar.CORE.QueryFilters;
|
||||||
|
using CuentasCobrar.CORE.ResponseObjects;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.API.Controllers
|
||||||
|
{
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[Produces("application/json")]
|
||||||
|
[ApiController]
|
||||||
|
public class BancoController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly IBancoRepo _BancoRepo;
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
private readonly IConfiguration _configuration;
|
||||||
|
|
||||||
|
public BancoController(IBancoRepo bancoRepo, IMapper mapper, IConfiguration configuration)
|
||||||
|
{
|
||||||
|
_BancoRepo = bancoRepo;
|
||||||
|
_mapper = mapper;
|
||||||
|
_configuration = configuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene todos los bancos
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Retorna todos las bancos de la base de datos
|
||||||
|
/// </returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<BancoDTO>))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet("obtenerTodos/"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var bancos = await _BancoRepo.Get();
|
||||||
|
if (bancos == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al obtener los bancos");
|
||||||
|
}
|
||||||
|
var bancosDto = _mapper.Map<IEnumerable<BancoDTO>>(bancos);
|
||||||
|
return Ok(bancosDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene los bancos aplicando los filtros de paginación
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Retorna las bancos de la base de datos paginados
|
||||||
|
/// </returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<BancoDTO>))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet, Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get([FromQuery] PaginacionQueryFilter filters)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int NumeroDePagina = _configuration.GetValue<int>("PaginationDefaultConfig:NumeroDePagina");
|
||||||
|
int RegistrosPorPagina = _configuration.GetValue<int>("PaginationDefaultConfig:RegistrosPorPagina");
|
||||||
|
|
||||||
|
filters.NumeroDePagina = filters.NumeroDePagina == 0 ? NumeroDePagina : filters.NumeroDePagina;
|
||||||
|
filters.RegistrosPorPagina = filters.RegistrosPorPagina == 0 ? RegistrosPorPagina : filters.RegistrosPorPagina;
|
||||||
|
|
||||||
|
var bancos = await _BancoRepo.Get(filters);
|
||||||
|
if (bancos == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al obtener los bancos");
|
||||||
|
}
|
||||||
|
var bancosDto = _mapper.Map<IEnumerable<BancoDTO>>(bancos);
|
||||||
|
|
||||||
|
var metadata = new
|
||||||
|
{
|
||||||
|
bancos.NumeroDePagina,
|
||||||
|
bancos.RegistrosTotales,
|
||||||
|
bancos.RegistrosPorPagina,
|
||||||
|
bancos.PaginasTotales,
|
||||||
|
bancos.HayPaginaSiguiente,
|
||||||
|
bancos.HayPaginaAnterior,
|
||||||
|
bancos.NumeroPaginaSiguiente,
|
||||||
|
bancos.NumeroPaginaAnterior
|
||||||
|
};
|
||||||
|
|
||||||
|
Response.Headers.Add("Pagination-Info", JsonConvert.SerializeObject(metadata));
|
||||||
|
|
||||||
|
return Ok(bancosDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene el banco especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idBanco"></param>
|
||||||
|
/// <returns>Retorna los datos del banco específicado</returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(BancoDTO))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet("{idBanco}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get(int idBanco)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var banco = await _BancoRepo.Get(idBanco);
|
||||||
|
if (banco == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El banco no existe");
|
||||||
|
}
|
||||||
|
var BancoDto = _mapper.Map<BancoDTO>(banco);
|
||||||
|
return Ok(BancoDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Agrega un banco
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="bancoDto"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPost, Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Post(BancoDTO bancoDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var banco = _mapper.Map<Banco>(bancoDto);
|
||||||
|
bool agregado = await _BancoRepo.Post(banco);
|
||||||
|
if (agregado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al agregar el banco");
|
||||||
|
}
|
||||||
|
return Ok(agregado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Actualiza el banco especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idBanco"></param>
|
||||||
|
/// <param name="bancoDto"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPut("{idBanco}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Put(int idBanco, BancoDTO bancoDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var bancoTemp = await _BancoRepo.Get(idBanco);
|
||||||
|
if (bancoTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El banco a modificar no existe");
|
||||||
|
}
|
||||||
|
var banco = _mapper.Map<Banco>(bancoDto);
|
||||||
|
banco.IdBanco = idBanco;
|
||||||
|
bool modificado = await _BancoRepo.Put(banco);
|
||||||
|
|
||||||
|
if (modificado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al modificar el banco");
|
||||||
|
}
|
||||||
|
return Ok(modificado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elimina el banco especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idBanco"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpDelete("{idBanco}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Delete(int idBanco)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var bancoTemp = await _BancoRepo.Get(idBanco);
|
||||||
|
if (bancoTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El banco a eliminar no existe");
|
||||||
|
}
|
||||||
|
bool eliminado = await _BancoRepo.Delete(idBanco);
|
||||||
|
if (eliminado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al eliminar el banco");
|
||||||
|
}
|
||||||
|
return Ok(eliminado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,269 @@
|
||||||
|
using AutoMapper;
|
||||||
|
using CuentasCobrar.CORE.DTOs;
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
using CuentasCobrar.CORE.Exceptions;
|
||||||
|
using CuentasCobrar.CORE.Interfaces;
|
||||||
|
using CuentasCobrar.CORE.QueryFilters;
|
||||||
|
using CuentasCobrar.CORE.ResponseObjects;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.API.Controllers
|
||||||
|
{
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[Produces("application/json")]
|
||||||
|
[ApiController]
|
||||||
|
public class ClienteController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly IClienteRepo _clienteRepo;
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
private readonly IConfiguration _configuration;
|
||||||
|
|
||||||
|
public ClienteController(IClienteRepo clienteRepo, IMapper mapper, IConfiguration configuration)
|
||||||
|
{
|
||||||
|
_clienteRepo = clienteRepo;
|
||||||
|
_mapper = mapper;
|
||||||
|
_configuration = configuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene todos los clientes
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Retorna todos las clientes de la base de datos
|
||||||
|
/// </returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<ClienteDTO>))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet("obtenerTodos/"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var clientes = await _clienteRepo.Get();
|
||||||
|
if (clientes == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al obtener los clientes");
|
||||||
|
}
|
||||||
|
var ClientesDto = _mapper.Map<IEnumerable<ClienteDTO>>(clientes);
|
||||||
|
return Ok(ClientesDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene los clientes aplicando los filtros de paginación y de cliente
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Retorna las clientes de la base de datos paginados
|
||||||
|
/// </returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<ClienteDTO>))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet, Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get([FromQuery] ClienteQueryFilter filters)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int NumeroDePagina = _configuration.GetValue<int>("PaginationDefaultConfig:NumeroDePagina");
|
||||||
|
int RegistrosPorPagina = _configuration.GetValue<int>("PaginationDefaultConfig:RegistrosPorPagina");
|
||||||
|
filters.NumeroDePagina = filters.NumeroDePagina == 0 ? NumeroDePagina : filters.NumeroDePagina;
|
||||||
|
filters.RegistrosPorPagina = filters.RegistrosPorPagina == 0 ? RegistrosPorPagina : filters.RegistrosPorPagina;
|
||||||
|
|
||||||
|
var clientes = await _clienteRepo.Get(filters);
|
||||||
|
if (clientes == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al obtener los clientes");
|
||||||
|
}
|
||||||
|
var clientesDto = _mapper.Map<IEnumerable<ClienteDTO>>(clientes);
|
||||||
|
|
||||||
|
var metadata = new
|
||||||
|
{
|
||||||
|
clientes.NumeroDePagina,
|
||||||
|
clientes.RegistrosTotales,
|
||||||
|
clientes.RegistrosPorPagina,
|
||||||
|
clientes.PaginasTotales,
|
||||||
|
clientes.HayPaginaSiguiente,
|
||||||
|
clientes.HayPaginaAnterior,
|
||||||
|
clientes.NumeroPaginaSiguiente,
|
||||||
|
clientes.NumeroPaginaAnterior
|
||||||
|
};
|
||||||
|
|
||||||
|
Response.Headers.Add("Pagination-Info", JsonConvert.SerializeObject(metadata));
|
||||||
|
|
||||||
|
return Ok(clientesDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene el cliente especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="noIdentificacion"></param>
|
||||||
|
/// <returns>Retorna los datos del banco específicado</returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(ClienteDTO))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet("{noIdentificacion}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get(string noIdentificacion)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var cliente = await _clienteRepo.Get(noIdentificacion);
|
||||||
|
if (cliente == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El cliente no existe");
|
||||||
|
}
|
||||||
|
var clienteDto = _mapper.Map<ClienteDTO>(cliente);
|
||||||
|
return Ok(clienteDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Agrega un cliente
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="clienteDto"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPost, Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Post(ClienteDTO clienteDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var cliente = _mapper.Map<Cliente>(clienteDto);
|
||||||
|
var clienteTemp = await _clienteRepo.Get(cliente.NoIdentificacion);
|
||||||
|
if (clienteTemp != null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El cliente ingresado ya existe");
|
||||||
|
}
|
||||||
|
var agregado = await _clienteRepo.Post(cliente);
|
||||||
|
if (agregado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al agregar el cliente");
|
||||||
|
}
|
||||||
|
return Ok(agregado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Actualiza el cliente especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="noIdentificacion"></param>
|
||||||
|
/// <param name="clienteDto"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPut("{noIdentificacion}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Put(string noIdentificacion, ClienteDTO clienteDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var clienteTemp = await _clienteRepo.Get(noIdentificacion);
|
||||||
|
if (clienteTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El cliente a modificar no existe");
|
||||||
|
}
|
||||||
|
var cliente = _mapper.Map<Cliente>(clienteDto);
|
||||||
|
bool modificado = await _clienteRepo.Put(noIdentificacion, cliente);
|
||||||
|
if (modificado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al modificar el cliente");
|
||||||
|
}
|
||||||
|
return Ok(modificado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elimina el cliente especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="noIdentificacion"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpDelete("{noIdentificacion}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Delete(string noIdentificacion)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var clienteTemp = await _clienteRepo.Get(noIdentificacion);
|
||||||
|
if (clienteTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El cliente a eliminar no existe");
|
||||||
|
}
|
||||||
|
bool eliminado = await _clienteRepo.Delete(noIdentificacion);
|
||||||
|
if (eliminado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al eliminar el cliente");
|
||||||
|
}
|
||||||
|
return Ok(eliminado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,313 @@
|
||||||
|
using AutoMapper;
|
||||||
|
using CuentasCobrar.CORE.DTOs;
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
using CuentasCobrar.CORE.Exceptions;
|
||||||
|
using CuentasCobrar.CORE.Interfaces;
|
||||||
|
using CuentasCobrar.CORE.QueryFilters;
|
||||||
|
using CuentasCobrar.CORE.ResponseObjects;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
|
|
||||||
|
namespace CuentasCobrar.API.Controllers
|
||||||
|
{
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[Produces("application/json")]
|
||||||
|
[ApiController]
|
||||||
|
public class FacturaController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly IFacturaRepo _FacturaRepo;
|
||||||
|
private readonly IPagoContieneFacturaRepo _PagoContieneFacturaRepo;
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
private readonly IConfiguration _configuration;
|
||||||
|
public FacturaController(IFacturaRepo facturaRepo, IPagoContieneFacturaRepo pagoContieneFacturaRepo, IMapper mapper, IConfiguration configuration)
|
||||||
|
{
|
||||||
|
_FacturaRepo = facturaRepo;
|
||||||
|
_PagoContieneFacturaRepo = pagoContieneFacturaRepo;
|
||||||
|
_mapper = mapper;
|
||||||
|
_configuration = configuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene todas las facturas
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Retorna todas las facturas de la base de datos
|
||||||
|
/// </returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<FacturaDTO>))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet("obtenerTodos/"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var facturas = await _FacturaRepo.Get();
|
||||||
|
if (facturas == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al obtener las facturas");
|
||||||
|
}
|
||||||
|
var facturasDto = _mapper.Map<IEnumerable<FacturaDTO>>(facturas);
|
||||||
|
return Ok(facturasDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene las facturas aplicando los filtros de paginación
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Retorna las facturas de la base de datos paginadas
|
||||||
|
/// </returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<FacturaDTO>))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet, Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get([FromQuery] FacturaQueryFilter filters)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int NumeroDePagina = _configuration.GetValue<int>("PaginationDefaultConfig:NumeroDePagina");
|
||||||
|
int RegistrosPorPagina = _configuration.GetValue<int>("PaginationDefaultConfig:RegistrosPorPagina");
|
||||||
|
filters.NumeroDePagina = filters.NumeroDePagina == 0 ? NumeroDePagina : filters.NumeroDePagina;
|
||||||
|
filters.RegistrosPorPagina = filters.RegistrosPorPagina == 0 ? RegistrosPorPagina : filters.RegistrosPorPagina;
|
||||||
|
|
||||||
|
var facturas = await _FacturaRepo.Get(filters);
|
||||||
|
if (facturas == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al obtener los países");
|
||||||
|
}
|
||||||
|
var FacturasDto = _mapper.Map<IEnumerable<FacturaDTO>>(facturas);
|
||||||
|
|
||||||
|
var metadata = new
|
||||||
|
{
|
||||||
|
facturas.NumeroDePagina,
|
||||||
|
facturas.RegistrosTotales,
|
||||||
|
facturas.RegistrosPorPagina,
|
||||||
|
facturas.PaginasTotales,
|
||||||
|
facturas.HayPaginaSiguiente,
|
||||||
|
facturas.HayPaginaAnterior,
|
||||||
|
facturas.NumeroPaginaSiguiente,
|
||||||
|
facturas.NumeroPaginaAnterior
|
||||||
|
};
|
||||||
|
|
||||||
|
Response.Headers.Add("Pagination-Info", JsonConvert.SerializeObject(metadata));
|
||||||
|
return Ok(FacturasDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene la factura especificada por su consecutivo
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="consecutivoFactura"></param>
|
||||||
|
/// <returns>Retorna los datos de la factura especificada</returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(FacturaDTO))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet("{consecutivoFactura}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get(string consecutivoFactura)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var factura = await _FacturaRepo.Get(consecutivoFactura);
|
||||||
|
if (factura == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("La factura no existe");
|
||||||
|
}
|
||||||
|
var FacturaDto = _mapper.Map<FacturaDTO>(factura);
|
||||||
|
return Ok(FacturaDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Agrega una factura
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="facturaDto"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPost, Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Post(FacturaDTO facturaDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var factura = _mapper.Map<Factura>(facturaDto);
|
||||||
|
bool agregado = await _FacturaRepo.Post(factura);
|
||||||
|
if (agregado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al agregar la factura");
|
||||||
|
}
|
||||||
|
return Ok(agregado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Actualiza la factura especificada por su consecutivo
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="facturaDto">Factura</param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPut, Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Put(FacturaDTO facturaDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var facturaTemp = await _FacturaRepo.Get(facturaDto.Consecutivo);
|
||||||
|
if (facturaTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("La factura a modificar no existe");
|
||||||
|
}
|
||||||
|
var factura = _mapper.Map<Factura>(facturaDto);
|
||||||
|
bool modificado = await _FacturaRepo.Put(factura);
|
||||||
|
|
||||||
|
if (modificado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al modificar la factura");
|
||||||
|
}
|
||||||
|
return Ok(modificado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elimina la factura especificada por su consecutivo
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="consecutivoFactura"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpDelete("{consecutivoFactura}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Delete(string consecutivoFactura)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var facturaTemp = await _FacturaRepo.Get(consecutivoFactura);
|
||||||
|
if (facturaTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("La factura a eliminar no existe");
|
||||||
|
}
|
||||||
|
|
||||||
|
List<PagoContieneFactura> facturaConPago = await _PagoContieneFacturaRepo.Get();
|
||||||
|
facturaConPago = facturaConPago.FindAll(x => x.ConsecutivoFactura == consecutivoFactura);
|
||||||
|
if (facturaConPago != null && facturaConPago.Count > 0)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("La factura no se puede eliminar porque está asociada a un pago");
|
||||||
|
}
|
||||||
|
|
||||||
|
bool eliminado = await _FacturaRepo.Delete(consecutivoFactura);
|
||||||
|
if (eliminado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al eliminar la factura");
|
||||||
|
}
|
||||||
|
return Ok(eliminado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Genera una nota de crédito
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="notaCredito"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPost("GenerarNotaCredito/"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> GenerarNotaCredito(FacturaDTO notaCreditoDTO)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var facturaTemp = await _FacturaRepo.Get(notaCreditoDTO.ConsecutivoNotaReferencia);
|
||||||
|
if (facturaTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("La factura no existe");
|
||||||
|
}
|
||||||
|
var notaCredito = _mapper.Map<Factura>(notaCreditoDTO);
|
||||||
|
bool generada = await _FacturaRepo.GenerarNotaCredito(facturaTemp, notaCredito);
|
||||||
|
if (generada == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al generar la nota de crédito");
|
||||||
|
}
|
||||||
|
return Ok(generada);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,206 @@
|
||||||
|
using AutoMapper;
|
||||||
|
using CuentasCobrar.CORE.DTOs;
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
using CuentasCobrar.CORE.Exceptions;
|
||||||
|
using CuentasCobrar.CORE.Interfaces;
|
||||||
|
using CuentasCobrar.CORE.ResponseObjects;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.API.Controllers
|
||||||
|
{
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[Produces("application/json")]
|
||||||
|
[ApiController]
|
||||||
|
public class MonedaController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly IMonedaRepo _MonedaRepo;
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
public MonedaController(IMonedaRepo monedaRepo, IMapper mapper)
|
||||||
|
{
|
||||||
|
_MonedaRepo = monedaRepo;
|
||||||
|
_mapper = mapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene todas las monedas
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Retorna todas las monedas de la base de datos
|
||||||
|
/// </returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<MonedaDTO>))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet, Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var monedas = await _MonedaRepo.Get();
|
||||||
|
if (monedas == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al obtener las monedas");
|
||||||
|
}
|
||||||
|
var rolesDto = _mapper.Map<IEnumerable<MonedaDTO>>(monedas);
|
||||||
|
return Ok(rolesDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene la moneda especificada por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idMoneda"></param>
|
||||||
|
/// <returns>Retorna los datos de la moneda especificado</returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(MonedaDTO))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet("{idMoneda}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get(int idMoneda)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var moneda = await _MonedaRepo.Get(idMoneda);
|
||||||
|
if (moneda == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("La moneda no existe");
|
||||||
|
}
|
||||||
|
var rolDto = _mapper.Map<MonedaDTO>(moneda);
|
||||||
|
return Ok(rolDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Agrega una moneda
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="rolDto"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPost, Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Post(MonedaDTO rolDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var moneda = _mapper.Map<Moneda>(rolDto);
|
||||||
|
bool agregado = await _MonedaRepo.Post(moneda);
|
||||||
|
if (agregado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al agregar la moneda");
|
||||||
|
}
|
||||||
|
return Ok(agregado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Actualiza la moneda especificada por id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idMoneda"></param>
|
||||||
|
/// <param name="rolDto">Accion</param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPut("{idMoneda}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Put(int idMoneda, MonedaDTO rolDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var rolTemp = await _MonedaRepo.Get(idMoneda);
|
||||||
|
if (rolTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("La moneda a modificar no existe");
|
||||||
|
}
|
||||||
|
var moneda = _mapper.Map<Moneda>(rolDto);
|
||||||
|
moneda.IdMoneda = idMoneda;
|
||||||
|
bool modificado = await _MonedaRepo.Put(moneda);
|
||||||
|
|
||||||
|
if (modificado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al modificar la moneda");
|
||||||
|
}
|
||||||
|
return Ok(modificado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elimina la moneda especificada por id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idMoneda"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpDelete("{idMoneda}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Delete(int idMoneda)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var rolTemp = await _MonedaRepo.Get(idMoneda);
|
||||||
|
if (rolTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("La moneda a eliminar no existe");
|
||||||
|
}
|
||||||
|
bool eliminado = await _MonedaRepo.Delete(idMoneda);
|
||||||
|
if (eliminado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al eliminar la moneda");
|
||||||
|
}
|
||||||
|
return Ok(eliminado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,190 @@
|
||||||
|
using AutoMapper;
|
||||||
|
using CuentasCobrar.CORE.DTOs;
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
using CuentasCobrar.CORE.Exceptions;
|
||||||
|
using CuentasCobrar.CORE.Interfaces;
|
||||||
|
using CuentasCobrar.CORE.QueryFilters;
|
||||||
|
using CuentasCobrar.CORE.ResponseObjects;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.API.Controllers
|
||||||
|
{
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[Produces("application/json")]
|
||||||
|
[ApiController]
|
||||||
|
public class PagoContieneFacturaController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly IPagoContieneFacturaRepo _PagoContieneFacturaRepo;
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
private readonly IConfiguration _configuration;
|
||||||
|
|
||||||
|
public PagoContieneFacturaController(IPagoContieneFacturaRepo pagoContieneFacturaRepo, IMapper mapper, IConfiguration configuration)
|
||||||
|
{
|
||||||
|
_PagoContieneFacturaRepo = pagoContieneFacturaRepo;
|
||||||
|
_mapper = mapper;
|
||||||
|
_configuration = configuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene todos los pagoContieneFacturas
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Retorna todos las pagoContieneFacturas de la base de datos
|
||||||
|
/// </returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<PagoContieneFacturaDTO>))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet("obtenerTodos/"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var pagoContieneFacturas = await _PagoContieneFacturaRepo.Get();
|
||||||
|
if (pagoContieneFacturas == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al obtener los pagos relacionados con facturas");
|
||||||
|
}
|
||||||
|
var PagoContieneFacturaesDto = _mapper.Map<IEnumerable<PagoContieneFacturaDTO>>(pagoContieneFacturas);
|
||||||
|
return Ok(PagoContieneFacturaesDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene todas las facturas de un pago dado
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Retorna todas las facturas de un pago dado de la base de datos
|
||||||
|
/// </returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<FacturaDTO>))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet("FacturasDePago/{noRecibo}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get(int noRecibo)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var facturasDePago = await _PagoContieneFacturaRepo.GetFacturasDePago(noRecibo);
|
||||||
|
if (facturasDePago == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al obtener los pagos relacionados con facturas");
|
||||||
|
}
|
||||||
|
var facturasDePagoDto = _mapper.Map<IEnumerable<Factura>>(facturasDePago);
|
||||||
|
return Ok(facturasDePagoDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene los pagoContieneFacturas aplicando los filtros de paginación
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Retorna las pagoContieneFacturas de la base de datos paginados
|
||||||
|
/// </returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<PagoContieneFacturaDTO>))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet, Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get([FromQuery] PaginacionQueryFilter filters)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int NumeroDePagina = _configuration.GetValue<int>("PaginationDefaultConfig:NumeroDePagina");
|
||||||
|
int RegistrosPorPagina = _configuration.GetValue<int>("PaginationDefaultConfig:RegistrosPorPagina");
|
||||||
|
filters.NumeroDePagina = filters.NumeroDePagina == 0 ? NumeroDePagina : filters.NumeroDePagina;
|
||||||
|
filters.RegistrosPorPagina = filters.RegistrosPorPagina == 0 ? RegistrosPorPagina : filters.RegistrosPorPagina;
|
||||||
|
|
||||||
|
var pagoContieneFacturas = await _PagoContieneFacturaRepo.Get(filters);
|
||||||
|
if (pagoContieneFacturas == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al obtener los pagos relacionados con facturas");
|
||||||
|
}
|
||||||
|
var PagoContieneFacturasDto = _mapper.Map<IEnumerable<PagoContieneFacturaDTO>>(pagoContieneFacturas);
|
||||||
|
|
||||||
|
var metadata = new
|
||||||
|
{
|
||||||
|
pagoContieneFacturas.NumeroDePagina,
|
||||||
|
pagoContieneFacturas.RegistrosTotales,
|
||||||
|
pagoContieneFacturas.RegistrosPorPagina,
|
||||||
|
pagoContieneFacturas.PaginasTotales,
|
||||||
|
pagoContieneFacturas.HayPaginaSiguiente,
|
||||||
|
pagoContieneFacturas.HayPaginaAnterior,
|
||||||
|
pagoContieneFacturas.NumeroPaginaSiguiente,
|
||||||
|
pagoContieneFacturas.NumeroPaginaAnterior
|
||||||
|
};
|
||||||
|
|
||||||
|
Response.Headers.Add("Pagination-Info", JsonConvert.SerializeObject(metadata));
|
||||||
|
return Ok(PagoContieneFacturasDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Agrega un pagoContieneFactura
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pagoContieneFacturaDto"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPost, Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Post(PagoContieneFacturaDTO pagoContieneFacturaDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var pagoContieneFactura = _mapper.Map<PagoContieneFactura>(pagoContieneFacturaDto);
|
||||||
|
bool agregado = await _PagoContieneFacturaRepo.Post(pagoContieneFactura);
|
||||||
|
if (agregado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al agregar el pago relacionado a factura");
|
||||||
|
}
|
||||||
|
return Ok(agregado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,266 @@
|
||||||
|
using AutoMapper;
|
||||||
|
using CuentasCobrar.CORE.DTOs;
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
using CuentasCobrar.CORE.Exceptions;
|
||||||
|
using CuentasCobrar.CORE.Interfaces;
|
||||||
|
using CuentasCobrar.CORE.QueryFilters;
|
||||||
|
using CuentasCobrar.CORE.ResponseObjects;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.API.Controllers
|
||||||
|
{
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[Produces("application/json")]
|
||||||
|
[ApiController]
|
||||||
|
public class PagoController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly IPagoRepo _PagoRepo;
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
private readonly IConfiguration _configuration;
|
||||||
|
|
||||||
|
public PagoController(IPagoRepo pagoRepo, IMapper mapper, IConfiguration configuration)
|
||||||
|
{
|
||||||
|
_PagoRepo = pagoRepo;
|
||||||
|
_mapper = mapper;
|
||||||
|
_configuration = configuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene todos los pagos
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Retorna todos las pagos de la base de datos
|
||||||
|
/// </returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<PagoDTO>))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet("obtenerTodos/"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var pagoes = await _PagoRepo.Get();
|
||||||
|
if (pagoes == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al obtener los pagos");
|
||||||
|
}
|
||||||
|
var PagoesDto = _mapper.Map<IEnumerable<PagoDTO>>(pagoes);
|
||||||
|
return Ok(PagoesDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene los pagos aplicando los filtros de paginación
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Retorna las pagos de la base de datos paginados
|
||||||
|
/// </returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<PagoDTO>))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet, Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get([FromQuery] PagoQueryFilter filters)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int NumeroDePagina = _configuration.GetValue<int>("PaginationDefaultConfig:NumeroDePagina");
|
||||||
|
int RegistrosPorPagina = _configuration.GetValue<int>("PaginationDefaultConfig:RegistrosPorPagina");
|
||||||
|
filters.NumeroDePagina = filters.NumeroDePagina == 0 ? NumeroDePagina : filters.NumeroDePagina;
|
||||||
|
filters.RegistrosPorPagina = filters.RegistrosPorPagina == 0 ? RegistrosPorPagina : filters.RegistrosPorPagina;
|
||||||
|
|
||||||
|
var pagoes = await _PagoRepo.Get(filters);
|
||||||
|
if (pagoes == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al obtener los pagos");
|
||||||
|
}
|
||||||
|
var PagoesDto = _mapper.Map<IEnumerable<PagoDTO>>(pagoes);
|
||||||
|
|
||||||
|
var metadata = new
|
||||||
|
{
|
||||||
|
pagoes.NumeroDePagina,
|
||||||
|
pagoes.RegistrosTotales,
|
||||||
|
pagoes.RegistrosPorPagina,
|
||||||
|
pagoes.PaginasTotales,
|
||||||
|
pagoes.HayPaginaSiguiente,
|
||||||
|
pagoes.HayPaginaAnterior,
|
||||||
|
pagoes.NumeroPaginaSiguiente,
|
||||||
|
pagoes.NumeroPaginaAnterior
|
||||||
|
};
|
||||||
|
|
||||||
|
Response.Headers.Add("Pagination-Info", JsonConvert.SerializeObject(metadata));
|
||||||
|
return Ok(PagoesDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene el pago especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="noRecibo"></param>
|
||||||
|
/// <returns>Retorna los datos del banco específicado</returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(PagoDTO))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet("{noRecibo}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get(int noRecibo)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var pago = await _PagoRepo.Get(noRecibo);
|
||||||
|
if (pago == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El pago no existe");
|
||||||
|
}
|
||||||
|
var PagoDto = _mapper.Map<PagoDTO>(pago);
|
||||||
|
return Ok(PagoDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Agrega un pago
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pagoDto"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPost, Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Post(PagoDTO pagoDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var pago = _mapper.Map<Pago>(pagoDto);
|
||||||
|
var facturas = _mapper.Map<IEnumerable<Factura>>(pagoDto.Facturas).ToList();
|
||||||
|
bool agregado = await _PagoRepo.Post(pago, facturas);
|
||||||
|
if (agregado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al agregar el pago");
|
||||||
|
}
|
||||||
|
return Ok(agregado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//return Ok(pagoDto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Actualiza el pago especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="noRecibo"></param>
|
||||||
|
/// <param name="pagoDto"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPut("{noRecibo}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Put(int noRecibo, PagoDTO pagoDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var pagoTemp = await _PagoRepo.Get(noRecibo);
|
||||||
|
if (pagoTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El pago a modificar no existe");
|
||||||
|
}
|
||||||
|
var pago = _mapper.Map<Pago>(pagoDto);
|
||||||
|
pago.NoRecibo = noRecibo;
|
||||||
|
bool modificado = await _PagoRepo.Put(pago);
|
||||||
|
if (modificado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al modificar el pago");
|
||||||
|
}
|
||||||
|
return Ok(modificado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elimina el pago especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="noRecibo"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpDelete("{noRecibo}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Delete(int noRecibo)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var pagoTemp = await _PagoRepo.Get(noRecibo);
|
||||||
|
if (pagoTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El pago a eliminar no existe");
|
||||||
|
}
|
||||||
|
bool eliminado = await _PagoRepo.Delete(noRecibo);
|
||||||
|
if (eliminado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al eliminar el pago");
|
||||||
|
}
|
||||||
|
return Ok(eliminado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,264 @@
|
||||||
|
using AutoMapper;
|
||||||
|
using CuentasCobrar.CORE.DTOs;
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
using CuentasCobrar.CORE.Exceptions;
|
||||||
|
using CuentasCobrar.CORE.Interfaces;
|
||||||
|
using CuentasCobrar.CORE.QueryFilters;
|
||||||
|
using CuentasCobrar.CORE.ResponseObjects;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.API.Controllers
|
||||||
|
{
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[Produces("application/json")]
|
||||||
|
[ApiController]
|
||||||
|
public class PaisController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly IPaisRepo _PaisRepo;
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
private readonly IConfiguration _configuration;
|
||||||
|
|
||||||
|
public PaisController(IPaisRepo paisRepo, IMapper mapper, IConfiguration configuration)
|
||||||
|
{
|
||||||
|
_PaisRepo = paisRepo;
|
||||||
|
_mapper = mapper;
|
||||||
|
_configuration = configuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene todos los países
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Retorna todos las países de la base de datos
|
||||||
|
/// </returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<PaisDTO>))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet("obtenerTodos/"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var paises = await _PaisRepo.Get();
|
||||||
|
if (paises == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al obtener los paises");
|
||||||
|
}
|
||||||
|
var PaisesDto = _mapper.Map<IEnumerable<PaisDTO>>(paises);
|
||||||
|
return Ok(PaisesDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene los países aplicando los filtros de paginación
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Retorna las países de la base de datos paginados
|
||||||
|
/// </returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<PaisDTO>))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet, Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get([FromQuery] PaginacionQueryFilter filters)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int NumeroDePagina = _configuration.GetValue<int>("PaginationDefaultConfig:NumeroDePagina");
|
||||||
|
int RegistrosPorPagina = _configuration.GetValue<int>("PaginationDefaultConfig:RegistrosPorPagina");
|
||||||
|
filters.NumeroDePagina = filters.NumeroDePagina == 0 ? NumeroDePagina : filters.NumeroDePagina;
|
||||||
|
filters.RegistrosPorPagina = filters.RegistrosPorPagina == 0 ? RegistrosPorPagina : filters.RegistrosPorPagina;
|
||||||
|
|
||||||
|
var paises = await _PaisRepo.Get(filters);
|
||||||
|
if (paises == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al obtener los países");
|
||||||
|
}
|
||||||
|
var PaisesDto = _mapper.Map<IEnumerable<PaisDTO>>(paises);
|
||||||
|
|
||||||
|
var metadata = new
|
||||||
|
{
|
||||||
|
paises.NumeroDePagina,
|
||||||
|
paises.RegistrosTotales,
|
||||||
|
paises.RegistrosPorPagina,
|
||||||
|
paises.PaginasTotales,
|
||||||
|
paises.HayPaginaSiguiente,
|
||||||
|
paises.HayPaginaAnterior,
|
||||||
|
paises.NumeroPaginaSiguiente,
|
||||||
|
paises.NumeroPaginaAnterior
|
||||||
|
};
|
||||||
|
|
||||||
|
Response.Headers.Add("Pagination-Info", JsonConvert.SerializeObject(metadata));
|
||||||
|
return Ok(PaisesDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene el país especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idPais"></param>
|
||||||
|
/// <returns>Retorna los datos del banco específicado</returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(PaisDTO))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet("{idPais}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get(int idPais)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var pais = await _PaisRepo.Get(idPais);
|
||||||
|
if (pais == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El país no existe");
|
||||||
|
}
|
||||||
|
var PaisDto = _mapper.Map<PaisDTO>(pais);
|
||||||
|
return Ok(PaisDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Agrega un país
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="paisDto"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPost, Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Post(PaisDTO paisDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var pais = _mapper.Map<Pais>(paisDto);
|
||||||
|
bool agregado = await _PaisRepo.Post(pais);
|
||||||
|
if (agregado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al agregar el país");
|
||||||
|
}
|
||||||
|
return Ok(agregado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Actualiza el país especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idPais"></param>
|
||||||
|
/// <param name="paisDto"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPut("{idPais}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Put(int idPais, PaisDTO paisDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var paisTemp = await _PaisRepo.Get(idPais);
|
||||||
|
if (paisTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El país a modificar no existe");
|
||||||
|
}
|
||||||
|
var pais = _mapper.Map<Pais>(paisDto);
|
||||||
|
pais.IdPais = idPais;
|
||||||
|
bool modificado = await _PaisRepo.Put(pais);
|
||||||
|
if (modificado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al modificar el país");
|
||||||
|
}
|
||||||
|
return Ok(modificado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elimina el país especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idPais"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpDelete("{idPais}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Delete(int idPais)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var paisTemp = await _PaisRepo.Get(idPais);
|
||||||
|
if (paisTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El pais a eliminar no existe");
|
||||||
|
}
|
||||||
|
bool eliminado = await _PaisRepo.Delete(idPais);
|
||||||
|
if (eliminado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al eliminar el país");
|
||||||
|
}
|
||||||
|
return Ok(eliminado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,206 @@
|
||||||
|
using AutoMapper;
|
||||||
|
using CuentasCobrar.CORE.DTOs;
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
using CuentasCobrar.CORE.Exceptions;
|
||||||
|
using CuentasCobrar.CORE.Interfaces;
|
||||||
|
using CuentasCobrar.CORE.ResponseObjects;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.API.Controllers
|
||||||
|
{
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[Produces("application/json")]
|
||||||
|
[ApiController]
|
||||||
|
public class RolController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly IRolRepo _RolRepo;
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
public RolController(IRolRepo rolRepo, IMapper mapper)
|
||||||
|
{
|
||||||
|
_RolRepo = rolRepo;
|
||||||
|
_mapper = mapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene todos los roles
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Retorna todos los roles de la base de datos
|
||||||
|
/// </returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<RolDTO>))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet, Authorize(Roles = "ADMINISTRADOR")]
|
||||||
|
public async Task<IActionResult> Get()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var roles = await _RolRepo.Get();
|
||||||
|
if (roles == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al obtener los roles");
|
||||||
|
}
|
||||||
|
var rolesDto = _mapper.Map<IEnumerable<RolDTO>>(roles);
|
||||||
|
return Ok(rolesDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene el rol especificada por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idRol"></param>
|
||||||
|
/// <returns>Retorna los datos del rol especificado</returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(RolDTO))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet("{idRol}"), Authorize(Roles = "ADMINISTRADOR")]
|
||||||
|
public async Task<IActionResult> Get(int idRol)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var rol = await _RolRepo.Get(idRol);
|
||||||
|
if (rol == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El rol no existe");
|
||||||
|
}
|
||||||
|
var rolDto = _mapper.Map<RolDTO>(rol);
|
||||||
|
return Ok(rolDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Agrega un rol
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="rolDto"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPost, Authorize(Roles = "ADMINISTRADOR")]
|
||||||
|
public async Task<IActionResult> Post(RolDTO rolDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var rol = _mapper.Map<Rol>(rolDto);
|
||||||
|
bool agregado = await _RolRepo.Post(rol);
|
||||||
|
if (agregado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al agregar el rol");
|
||||||
|
}
|
||||||
|
return Ok(agregado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Actualiza el rol especificado por id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idRol"></param>
|
||||||
|
/// <param name="rolDto">Accion</param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPut("{idRol}"), Authorize(Roles = "ADMINISTRADOR")]
|
||||||
|
public async Task<IActionResult> Put(int idRol, RolDTO rolDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var rolTemp = await _RolRepo.Get(idRol);
|
||||||
|
if (rolTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El rol a modificar no existe");
|
||||||
|
}
|
||||||
|
var rol = _mapper.Map<Rol>(rolDto);
|
||||||
|
rol.IdRol = idRol;
|
||||||
|
bool modificado = await _RolRepo.Put(rol);
|
||||||
|
|
||||||
|
if (modificado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al modificar el rol");
|
||||||
|
}
|
||||||
|
return Ok(modificado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elimina el rol especificado por id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idRol"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpDelete("{idRol}"), Authorize(Roles = "ADMINISTRADOR")]
|
||||||
|
public async Task<IActionResult> Delete(int idRol)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var rolTemp = await _RolRepo.Get(idRol);
|
||||||
|
if (rolTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El rol a eliminar no existe");
|
||||||
|
}
|
||||||
|
bool eliminado = await _RolRepo.Delete(idRol);
|
||||||
|
if (eliminado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al eliminar el rol");
|
||||||
|
}
|
||||||
|
return Ok(eliminado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,172 @@
|
||||||
|
using AutoMapper;
|
||||||
|
using CuentasCobrar.CORE.DTOs;
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
using CuentasCobrar.CORE.Exceptions;
|
||||||
|
using CuentasCobrar.CORE.Interfaces;
|
||||||
|
using CuentasCobrar.CORE.ResponseObjects;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.API.Controllers
|
||||||
|
{
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[Produces("application/json")]
|
||||||
|
[ApiController]
|
||||||
|
public class RolDeUsuarioController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly IRolDeUsuarioRepo _rolDeUsuarioRepo;
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
public RolDeUsuarioController(IRolDeUsuarioRepo rolDeUsuarioRepo, IMapper mapper)
|
||||||
|
{
|
||||||
|
_rolDeUsuarioRepo = rolDeUsuarioRepo;
|
||||||
|
_mapper = mapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene todos las roles vinculados a un usuario
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Retorna todos roles vinculados a un usuario de la base de datos
|
||||||
|
/// </returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<RolDeUsuarioDTO>))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet("{idUsuario}"), Authorize(Roles = "ADMINISTRADOR")]
|
||||||
|
public async Task<IActionResult> Get(string idUsuario)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var rolDeUsuario = await _rolDeUsuarioRepo.Get(idUsuario);
|
||||||
|
if (rolDeUsuario == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al obtener los roles de usuario");
|
||||||
|
}
|
||||||
|
var rolDeUsuarioDto = _mapper.Map<IEnumerable<RolDeUsuarioDTO>>(rolDeUsuario);
|
||||||
|
return Ok(rolDeUsuarioDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene el rol de un usuario especificados por id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idUsuario"></param>
|
||||||
|
/// <param name="idRol"></param>
|
||||||
|
/// <returns>Retorna los datos del rol de usuario específicado</returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(RolDeUsuarioDTO))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet("{idUsuario}/{idRol}"), Authorize(Roles = "ADMINISTRADOR")]
|
||||||
|
public async Task<IActionResult> Get(string idUsuario, int idRol)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var rolDeUsuario = await _rolDeUsuarioRepo.Get(idUsuario, idRol);
|
||||||
|
if (rolDeUsuario == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El usuario no se ecuentra asociada a dicho rol");
|
||||||
|
}
|
||||||
|
var rolDeUsuarioDto = _mapper.Map<RolDeUsuarioDTO>(rolDeUsuario);
|
||||||
|
return Ok(rolDeUsuarioDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Agrega un rol vinculado a un usuario
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="rolDeUsuarioDto"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPost, Authorize(Roles = "ADMINISTRADOR")]
|
||||||
|
public async Task<IActionResult> Post(RolDeUsuarioDTO rolDeUsuarioDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var rolDeUsuario = _mapper.Map<RolDeUsuario>(rolDeUsuarioDto);
|
||||||
|
var rolDeUsuarioTemp = await _rolDeUsuarioRepo.Get(rolDeUsuario.IdUsuario, rolDeUsuario.IdRol);
|
||||||
|
if (rolDeUsuarioTemp != null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El rol de usuario ya existe");
|
||||||
|
}
|
||||||
|
bool agregado = await _rolDeUsuarioRepo.Post(rolDeUsuario);
|
||||||
|
if (agregado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al agregar el rol de usuario");
|
||||||
|
}
|
||||||
|
return Ok(agregado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elimina el rol vinculado a un usuario especificados por id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idUsuario"></param>
|
||||||
|
/// <param name="idRol"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpDelete("{idUsuario}/{idRol}"), Authorize(Roles = "ADMINISTRADOR")]
|
||||||
|
public async Task<IActionResult> Delete(string idUsuario, int idRol)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var rolDeUsuarioTemp = await _rolDeUsuarioRepo.Get(idUsuario, idRol);
|
||||||
|
if (rolDeUsuarioTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El rol de usuario a eliminar no existe");
|
||||||
|
}
|
||||||
|
bool eliminado = await _rolDeUsuarioRepo.Delete(idUsuario, idRol);
|
||||||
|
if (eliminado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al eliminar el rol de usuario");
|
||||||
|
}
|
||||||
|
return Ok(eliminado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,206 @@
|
||||||
|
using AutoMapper;
|
||||||
|
using CuentasCobrar.CORE.DTOs;
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
using CuentasCobrar.CORE.Exceptions;
|
||||||
|
using CuentasCobrar.CORE.Interfaces;
|
||||||
|
using CuentasCobrar.CORE.ResponseObjects;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.API.Controllers
|
||||||
|
{
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[Produces("application/json")]
|
||||||
|
[ApiController]
|
||||||
|
public class TelefonoController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly ITelefonoRepo _TelefonoRepo;
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
public TelefonoController(ITelefonoRepo telefonoRepo, IMapper mapper)
|
||||||
|
{
|
||||||
|
_TelefonoRepo = telefonoRepo;
|
||||||
|
_mapper = mapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene todos los telefono
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Retorna todos los telefono de la base de datos
|
||||||
|
/// </returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<TelefonoDTO>))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet, Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var telefonos = await _TelefonoRepo.Get();
|
||||||
|
if (telefonos == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al obtener los teléfonos");
|
||||||
|
}
|
||||||
|
var TelefonosDto = _mapper.Map<IEnumerable<TelefonoDTO>>(telefonos);
|
||||||
|
return Ok(TelefonosDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene el telefono especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idTelefono"></param>
|
||||||
|
/// <returns>Retorna los datos del telefono especificado</returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(TelefonoDTO))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet("{idTelefono}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get(int idTelefono)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var telefono = await _TelefonoRepo.Get(idTelefono);
|
||||||
|
if (telefono == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El teléfono no existe");
|
||||||
|
}
|
||||||
|
var TelefonoDto = _mapper.Map<TelefonoDTO>(telefono);
|
||||||
|
return Ok(TelefonoDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Agrega un telefono
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="telefonoDto"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPost, Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Post(TelefonoDTO telefonoDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var telefono = _mapper.Map<Telefono>(telefonoDto);
|
||||||
|
bool agregado = await _TelefonoRepo.Post(telefono);
|
||||||
|
if (agregado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al agregar el teléfono");
|
||||||
|
}
|
||||||
|
return Ok(agregado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Actualiza el telefono especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idTelefono"></param>
|
||||||
|
/// <param name="telefonoDto"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPut("{idTelefono}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Put(int idTelefono, TelefonoDTO telefonoDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var telefonoTemp = await _TelefonoRepo.Get(idTelefono);
|
||||||
|
if (telefonoTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El teléfono a modificar no existe");
|
||||||
|
}
|
||||||
|
var telefono = _mapper.Map<Telefono>(telefonoDto);
|
||||||
|
telefono.IdTelefono = idTelefono;
|
||||||
|
bool modificado = await _TelefonoRepo.Put(telefono);
|
||||||
|
|
||||||
|
if (modificado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al modificar el teléfono");
|
||||||
|
}
|
||||||
|
return Ok(modificado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elimina el telefono especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idTelefono"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpDelete("{idTelefono}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Delete(int idTelefono)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var accionTemp = await _TelefonoRepo.Get(idTelefono);
|
||||||
|
if (accionTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El teléfono a eliminar no existe");
|
||||||
|
}
|
||||||
|
bool eliminado = await _TelefonoRepo.Delete(idTelefono);
|
||||||
|
if (eliminado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al eliminar el teléfono");
|
||||||
|
}
|
||||||
|
return Ok(eliminado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,206 @@
|
||||||
|
using AutoMapper;
|
||||||
|
using CuentasCobrar.CORE.DTOs;
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
using CuentasCobrar.CORE.Exceptions;
|
||||||
|
using CuentasCobrar.CORE.Interfaces;
|
||||||
|
using CuentasCobrar.CORE.ResponseObjects;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.API.Controllers
|
||||||
|
{
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[Produces("application/json")]
|
||||||
|
[ApiController]
|
||||||
|
public class TipoDocumentoController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly ITipoDocumentoRepo _TipoDocumentoRepo;
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
public TipoDocumentoController(ITipoDocumentoRepo tipoDocumentoRepo, IMapper mapper)
|
||||||
|
{
|
||||||
|
_TipoDocumentoRepo = tipoDocumentoRepo;
|
||||||
|
_mapper = mapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene todos los tipos de documento
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Retorna todos los tipos de documento de la base de datos
|
||||||
|
/// </returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<TipoDocumentoDTO>))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet, Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var tiposDocumento = await _TipoDocumentoRepo.Get();
|
||||||
|
if (tiposDocumento == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al obtener los tipos de documento");
|
||||||
|
}
|
||||||
|
var tiposDocumentoDto = _mapper.Map<IEnumerable<TipoDocumentoDTO>>(tiposDocumento);
|
||||||
|
return Ok(tiposDocumentoDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene el tipo de documento especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idTipoDocumento"></param>
|
||||||
|
/// <returns>Retorna los datos del tipo de documento especificado</returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(TipoDocumentoDTO))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet("{idTipoDocumento}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get(int idTipoDocumento)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var tipoDocumento = await _TipoDocumentoRepo.Get(idTipoDocumento);
|
||||||
|
if (tipoDocumento == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El tipo de documento no existe");
|
||||||
|
}
|
||||||
|
var tipoDocumentoDto = _mapper.Map<TipoDocumentoDTO>(tipoDocumento);
|
||||||
|
return Ok(tipoDocumentoDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Agrega un tipo de documento
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tipoDocumentoDto"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPost, Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Post(TipoDocumentoDTO tipoDocumentoDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var tipoDocumento = _mapper.Map<TipoDocumento>(tipoDocumentoDto);
|
||||||
|
bool agregado = await _TipoDocumentoRepo.Post(tipoDocumento);
|
||||||
|
if (agregado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al agregar el tipo de documento");
|
||||||
|
}
|
||||||
|
return Ok(agregado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Actualiza el tipo de documento especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idTipoDocumento"></param>
|
||||||
|
/// <param name="tipoDocumentoDto">TipoDocumento</param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPut("{idTipoDocumento}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Put(int idTipoDocumento, TipoDocumentoDTO tipoDocumentoDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var tipoDocumentoTemp = await _TipoDocumentoRepo.Get(idTipoDocumento);
|
||||||
|
if (tipoDocumentoTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El tipo de documento a modificar no existe");
|
||||||
|
}
|
||||||
|
var tipoDocumento = _mapper.Map<TipoDocumento>(tipoDocumentoDto);
|
||||||
|
tipoDocumento.IdTipoDocumento = idTipoDocumento;
|
||||||
|
bool modificado = await _TipoDocumentoRepo.Put(tipoDocumento);
|
||||||
|
|
||||||
|
if (modificado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al modificar el tipo de documento");
|
||||||
|
}
|
||||||
|
return Ok(modificado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elimina el tipo de documento especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idTipoDocumento"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpDelete("{idTipoDocumento}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Delete(int idTipoDocumento)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var idTipoDocumentoTemp = await _TipoDocumentoRepo.Get(idTipoDocumento);
|
||||||
|
if (idTipoDocumentoTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El tipo de documento a eliminar no existe");
|
||||||
|
}
|
||||||
|
bool eliminado = await _TipoDocumentoRepo.Delete(idTipoDocumento);
|
||||||
|
if (eliminado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al eliminar el tipo de documento");
|
||||||
|
}
|
||||||
|
return Ok(eliminado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,206 @@
|
||||||
|
using AutoMapper;
|
||||||
|
using CuentasCobrar.CORE.DTOs;
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
using CuentasCobrar.CORE.Exceptions;
|
||||||
|
using CuentasCobrar.CORE.Interfaces;
|
||||||
|
using CuentasCobrar.CORE.ResponseObjects;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.API.Controllers
|
||||||
|
{
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[Produces("application/json")]
|
||||||
|
[ApiController]
|
||||||
|
public class TipoIdentificacionController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly ITipoIdentificacionRepo _TipoIdentificacionRepo;
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
public TipoIdentificacionController(ITipoIdentificacionRepo tipoIdentificacionRepo, IMapper mapper)
|
||||||
|
{
|
||||||
|
_TipoIdentificacionRepo = tipoIdentificacionRepo;
|
||||||
|
_mapper = mapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene todos los tipos de identificacion
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Retorna todos los tipos de identificacion de la base de datos
|
||||||
|
/// </returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<TipoIdentificacionDTO>))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet, Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var tiposIdentificacion = await _TipoIdentificacionRepo.Get();
|
||||||
|
if (tiposIdentificacion == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al obtener los tipos de identificación");
|
||||||
|
}
|
||||||
|
var TiposIdentificacionDto = _mapper.Map<IEnumerable<TipoIdentificacionDTO>>(tiposIdentificacion);
|
||||||
|
return Ok(TiposIdentificacionDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene el tipo de identificacion especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idTipoIdentificacion"></param>
|
||||||
|
/// <returns>Retorna los datos del banco específicado</returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(TipoIdentificacionDTO))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet("{idTipoIdentificacion}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get(int idTipoIdentificacion)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var tipoIdentificacion = await _TipoIdentificacionRepo.Get(idTipoIdentificacion);
|
||||||
|
if (tipoIdentificacion == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El tipo de identificación no existe");
|
||||||
|
}
|
||||||
|
var TipoIdentificacionDto = _mapper.Map<TipoIdentificacionDTO>(tipoIdentificacion);
|
||||||
|
return Ok(TipoIdentificacionDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Agrega un tipo de identificacion
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tipoIdentificacionDto"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPost, Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Post(TipoIdentificacionDTO tipoIdentificacionDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var tipoIdentificacion = _mapper.Map<TipoIdentificacion>(tipoIdentificacionDto);
|
||||||
|
bool agregado = await _TipoIdentificacionRepo.Post(tipoIdentificacion);
|
||||||
|
if (agregado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al agregar el tipo de identificación");
|
||||||
|
}
|
||||||
|
return Ok(agregado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Actualiza el tipo de identificacion especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idTipoIdentificacion"></param>
|
||||||
|
/// <param name="tipoIdentificacionDto"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPut("{idTipoIdentificacion}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Put(int idTipoIdentificacion, TipoIdentificacionDTO tipoIdentificacionDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var tipoIdentificacionTemp = await _TipoIdentificacionRepo.Get(idTipoIdentificacion);
|
||||||
|
if (tipoIdentificacionTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El tipo de identificación a modificar no existe");
|
||||||
|
}
|
||||||
|
var tipoIdentificacion = _mapper.Map<TipoIdentificacion>(tipoIdentificacionDto);
|
||||||
|
tipoIdentificacion.IdTipoIdentificacion = idTipoIdentificacion;
|
||||||
|
bool modificado = await _TipoIdentificacionRepo.Put(tipoIdentificacion);
|
||||||
|
|
||||||
|
if (modificado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al modificar el tipo de identificación");
|
||||||
|
}
|
||||||
|
return Ok(modificado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elimina el tipo de identificacion especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idTipoIdentificacion"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpDelete("{idTipoIdentificacion}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Delete(int idTipoIdentificacion)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var tipoIdentificacionTemp = await _TipoIdentificacionRepo.Get(idTipoIdentificacion);
|
||||||
|
if (tipoIdentificacionTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El tipo de identificación a eliminar no existe");
|
||||||
|
}
|
||||||
|
bool eliminado = await _TipoIdentificacionRepo.Delete(idTipoIdentificacion);
|
||||||
|
if (eliminado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al eliminar el tipo de identificación");
|
||||||
|
}
|
||||||
|
return Ok(eliminado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,206 @@
|
||||||
|
using AutoMapper;
|
||||||
|
using CuentasCobrar.CORE.DTOs;
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
using CuentasCobrar.CORE.Exceptions;
|
||||||
|
using CuentasCobrar.CORE.Interfaces;
|
||||||
|
using CuentasCobrar.CORE.ResponseObjects;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.API.Controllers
|
||||||
|
{
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[Produces("application/json")]
|
||||||
|
[ApiController]
|
||||||
|
public class TipoPagoController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly ITipoPagoRepo _TipoPagoRepo;
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
public TipoPagoController(ITipoPagoRepo tipoPagoRepo, IMapper mapper)
|
||||||
|
{
|
||||||
|
_TipoPagoRepo = tipoPagoRepo;
|
||||||
|
_mapper = mapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene todos los tipos de pago
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Retorna todos los tipos de pago de la base de datos
|
||||||
|
/// </returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<TipoPagoDTO>))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet, Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var tiposPago = await _TipoPagoRepo.Get();
|
||||||
|
if (tiposPago == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al obtener los tipos de pago");
|
||||||
|
}
|
||||||
|
var tiposPagoDto = _mapper.Map<IEnumerable<TipoPagoDTO>>(tiposPago);
|
||||||
|
return Ok(tiposPagoDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene el tipos de pago especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idTipoPago"></param>
|
||||||
|
/// <returns>Retorna los datos del tipo de pago especificado</returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(TipoPagoDTO))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet("{idTipoPago}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get(int idTipoPago)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var tipoPago = await _TipoPagoRepo.Get(idTipoPago);
|
||||||
|
if (tipoPago == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El tipo de pago no existe");
|
||||||
|
}
|
||||||
|
var TipoPagoDto = _mapper.Map<TipoPagoDTO>(tipoPago);
|
||||||
|
return Ok(TipoPagoDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Agrega un tipo de pago
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tipoPagoDto"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPost, Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Post(TipoPagoDTO tipoPagoDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var tipoPago = _mapper.Map<TipoPago>(tipoPagoDto);
|
||||||
|
bool agregado = await _TipoPagoRepo.Post(tipoPago);
|
||||||
|
if (agregado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al agregar el tipo de pago");
|
||||||
|
}
|
||||||
|
return Ok(agregado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Actualiza el tipo de pago especificada por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idTipoPago"></param>
|
||||||
|
/// <param name="tipoPagoDto">TipoPago</param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPut("{idTipoPago}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Put(int idTipoPago, TipoPagoDTO tipoPagoDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var tipoPagoTemp = await _TipoPagoRepo.Get(idTipoPago);
|
||||||
|
if (tipoPagoTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El tipo de pago a modificar no existe");
|
||||||
|
}
|
||||||
|
var tipoPago = _mapper.Map<TipoPago>(tipoPagoDto);
|
||||||
|
tipoPago.IdTipoPago = idTipoPago;
|
||||||
|
bool modificado = await _TipoPagoRepo.Put(tipoPago);
|
||||||
|
|
||||||
|
if (modificado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al modificar el tipo de pago");
|
||||||
|
}
|
||||||
|
return Ok(modificado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elimina el tipo de pago especificada por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idTipoPago"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpDelete("{idTipoPago}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Delete(int idTipoPago)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var tipoPagoTemp = await _TipoPagoRepo.Get(idTipoPago);
|
||||||
|
if (tipoPagoTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El tipo de pago a eliminar no existe");
|
||||||
|
}
|
||||||
|
bool eliminado = await _TipoPagoRepo.Delete(idTipoPago);
|
||||||
|
if (eliminado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al eliminar el tipo de pago");
|
||||||
|
}
|
||||||
|
return Ok(eliminado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,206 @@
|
||||||
|
using AutoMapper;
|
||||||
|
using CuentasCobrar.CORE.DTOs;
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
using CuentasCobrar.CORE.Exceptions;
|
||||||
|
using CuentasCobrar.CORE.Interfaces;
|
||||||
|
using CuentasCobrar.CORE.ResponseObjects;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.API.Controllers
|
||||||
|
{
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[Produces("application/json")]
|
||||||
|
[ApiController]
|
||||||
|
public class TipoTelefonoController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly ITipoTelefonoRepo _TipoTelefonoRepo;
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
public TipoTelefonoController(ITipoTelefonoRepo tipoTelefonoRepo, IMapper mapper)
|
||||||
|
{
|
||||||
|
_TipoTelefonoRepo = tipoTelefonoRepo;
|
||||||
|
_mapper = mapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene todos los tipos de telefono
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Retorna todos los tipos de telefono de la base de datos
|
||||||
|
/// </returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<TipoTelefonoDTO>))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet, Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var tiposTelefono = await _TipoTelefonoRepo.Get();
|
||||||
|
if (tiposTelefono == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al obtener los tipos de teléfono");
|
||||||
|
}
|
||||||
|
var TiposTelefonoDto = _mapper.Map<IEnumerable<TipoTelefonoDTO>>(tiposTelefono);
|
||||||
|
return Ok(TiposTelefonoDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene el tipo de telefono especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idTipoTelefono"></param>
|
||||||
|
/// <returns>Retorna los datos del tipo de telefono especificado</returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(TipoTelefonoDTO))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet("{idTipoTelefono}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO,CONTADOR")]
|
||||||
|
public async Task<IActionResult> Get(int idTipoTelefono)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var tipoTelefono = await _TipoTelefonoRepo.Get(idTipoTelefono);
|
||||||
|
if (tipoTelefono == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El tipo de teléfono no existe");
|
||||||
|
}
|
||||||
|
var TipoTelefonoDto = _mapper.Map<TipoTelefonoDTO>(tipoTelefono);
|
||||||
|
return Ok(TipoTelefonoDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Agrega un tipo de telefono
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tipoTelefonoDto"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPost, Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Post(TipoTelefonoDTO tipoTelefonoDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var tipoTelefono = _mapper.Map<TipoTelefono>(tipoTelefonoDto);
|
||||||
|
bool agregado = await _TipoTelefonoRepo.Post(tipoTelefono);
|
||||||
|
if (agregado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al agregar el tipo de teléfono");
|
||||||
|
}
|
||||||
|
return Ok(agregado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Actualiza el tipo de telefono especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idTipoTelefono"></param>
|
||||||
|
/// <param name="tipoTelefonoDto"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPut("{idTipoTelefono}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Put(int idTipoTelefono, TipoTelefonoDTO tipoTelefonoDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var tipoTelefonoTemp = await _TipoTelefonoRepo.Get(idTipoTelefono);
|
||||||
|
if (tipoTelefonoTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El tipo de teléfono a modificar no existe");
|
||||||
|
}
|
||||||
|
var tipoTelefono = _mapper.Map<TipoTelefono>(tipoTelefonoDto);
|
||||||
|
tipoTelefono.IdTipoTelefono = idTipoTelefono;
|
||||||
|
bool modificado = await _TipoTelefonoRepo.Put(tipoTelefono);
|
||||||
|
|
||||||
|
if (modificado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al modificar el tipo de teléfono");
|
||||||
|
}
|
||||||
|
return Ok(modificado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elimina el tipo de telefono especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idTipoTelefono"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpDelete("{idTipoTelefono}"), Authorize(Roles = "ADMINISTRADOR,OPERATIVO")]
|
||||||
|
public async Task<IActionResult> Delete(int idTipoTelefono)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var tipoTelefonoTemp = await _TipoTelefonoRepo.Get(idTipoTelefono);
|
||||||
|
if (tipoTelefonoTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El tipo de teléfono a eliminar no existe");
|
||||||
|
}
|
||||||
|
bool eliminado = await _TipoTelefonoRepo.Delete(idTipoTelefono);
|
||||||
|
if (eliminado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al eliminar el tipo de teléfono");
|
||||||
|
}
|
||||||
|
return Ok(eliminado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,364 @@
|
||||||
|
using AutoMapper;
|
||||||
|
using CuentasCobrar.CORE.DTOs;
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
using CuentasCobrar.CORE.Exceptions;
|
||||||
|
using CuentasCobrar.CORE.Interfaces;
|
||||||
|
using CuentasCobrar.CORE.QueryFilters;
|
||||||
|
using CuentasCobrar.CORE.ResponseObjects;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.IdentityModel.Tokens;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System.IdentityModel.Tokens.Jwt;
|
||||||
|
using System.Net;
|
||||||
|
using System.Security.Claims;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.API.Controllers
|
||||||
|
{
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[Produces("application/json")]
|
||||||
|
[ApiController]
|
||||||
|
public class UsuarioController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly IUsuarioRepo _UsuarioRepo;
|
||||||
|
private readonly IRolDeUsuarioRepo _rolDeUsuarioRepo;
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
private readonly IConfiguration _configuration;
|
||||||
|
public UsuarioController(IUsuarioRepo usuarioRepo, IRolDeUsuarioRepo rolDeUsuarioRepo, IMapper mapper, IConfiguration configuration)
|
||||||
|
{
|
||||||
|
_UsuarioRepo = usuarioRepo;
|
||||||
|
_rolDeUsuarioRepo = rolDeUsuarioRepo;
|
||||||
|
_mapper = mapper;
|
||||||
|
_configuration = configuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene todos los usuarios
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Retorna todos los usuarios de la base de datos
|
||||||
|
/// </returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<UsuarioDTO>))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet("obtenerTodos/"), Authorize(Roles = "ADMINISTRADOR")]
|
||||||
|
public async Task<IActionResult> Get()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var usuarios = await _UsuarioRepo.Get();
|
||||||
|
if (usuarios == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al obtener los usuarios");
|
||||||
|
}
|
||||||
|
var UsuariosDto = _mapper.Map<IEnumerable<UsuarioDTO>>(usuarios);
|
||||||
|
return Ok(UsuariosDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene los usuarios aplicando los filtros de paginación
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Retorna los usuarios de la base de datos paginados
|
||||||
|
/// </returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<UsuarioDTO>))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet, Authorize(Roles = "ADMINISTRADOR")]
|
||||||
|
public async Task<IActionResult> Get([FromQuery] PaginacionQueryFilter filters)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int NumeroDePagina = _configuration.GetValue<int>("PaginationDefaultConfig:NumeroDePagina");
|
||||||
|
int RegistrosPorPagina = _configuration.GetValue<int>("PaginationDefaultConfig:RegistrosPorPagina");
|
||||||
|
filters.NumeroDePagina = filters.NumeroDePagina == 0 ? NumeroDePagina : filters.NumeroDePagina;
|
||||||
|
filters.RegistrosPorPagina = filters.RegistrosPorPagina == 0 ? RegistrosPorPagina : filters.RegistrosPorPagina;
|
||||||
|
|
||||||
|
var usuarios = await _UsuarioRepo.Get(filters);
|
||||||
|
if (usuarios == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al obtener los usuarios");
|
||||||
|
}
|
||||||
|
var usuariosDto = _mapper.Map<IEnumerable<UsuarioDTO>>(usuarios);
|
||||||
|
|
||||||
|
var metadata = new
|
||||||
|
{
|
||||||
|
usuarios.NumeroDePagina,
|
||||||
|
usuarios.RegistrosTotales,
|
||||||
|
usuarios.RegistrosPorPagina,
|
||||||
|
usuarios.PaginasTotales,
|
||||||
|
usuarios.HayPaginaSiguiente,
|
||||||
|
usuarios.HayPaginaAnterior,
|
||||||
|
usuarios.NumeroPaginaSiguiente,
|
||||||
|
usuarios.NumeroPaginaAnterior
|
||||||
|
};
|
||||||
|
|
||||||
|
Response.Headers.Add("Pagination-Info", JsonConvert.SerializeObject(metadata));
|
||||||
|
return Ok(usuariosDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtiene el usuario especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idUsuario"></param>
|
||||||
|
/// <returns>Retorna los datos del usuario especificado</returns>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(UsuarioDTO))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet("{idUsuario}"), Authorize(Roles = "ADMINISTRADOR")]
|
||||||
|
public async Task<IActionResult> Get(string idUsuario)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var usuario = await _UsuarioRepo.Get(idUsuario);
|
||||||
|
if (usuario == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El usuario no existe");
|
||||||
|
}
|
||||||
|
var UsuarioDto = _mapper.Map<UsuarioDTO>(usuario);
|
||||||
|
return Ok(UsuarioDto);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Agrega el usuario especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="usuarioDto"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPost, Authorize(Roles = "ADMINISTRADOR")]
|
||||||
|
public async Task<IActionResult> Post(UsuarioDTO usuarioDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var usuario = _mapper.Map<Usuario>(usuarioDto);
|
||||||
|
Usuario? usuarioExistenteId = await _UsuarioRepo.Get(usuario.IdUsuario);
|
||||||
|
Usuario? usuarioExistenteCorreo = await _UsuarioRepo.GetUsuarioPorCorreo(usuario.Correo);
|
||||||
|
|
||||||
|
if (usuarioExistenteId != null || usuarioExistenteCorreo != null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El usuario ingresado ya existe");
|
||||||
|
}
|
||||||
|
|
||||||
|
bool agregado = await _UsuarioRepo.Post(usuario);
|
||||||
|
|
||||||
|
if (agregado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al agregar el usuario");
|
||||||
|
}
|
||||||
|
return Ok(agregado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Actualiza el usuario especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idUsuario"></param>
|
||||||
|
/// <param name="usuarioDto"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpPut("{idUsuario}"), Authorize(Roles = "ADMINISTRADOR")]
|
||||||
|
public async Task<IActionResult> Put(string idUsuario, UsuarioDTO usuarioDto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var usuarioTemp = await _UsuarioRepo.Get(idUsuario);
|
||||||
|
if (usuarioTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El usuario a modificar no existe");
|
||||||
|
}
|
||||||
|
var usuario = _mapper.Map<Usuario>(usuarioDto);
|
||||||
|
usuario.IdUsuario = idUsuario;
|
||||||
|
bool modificado = await _UsuarioRepo.Put(usuario);
|
||||||
|
if (modificado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al modificar el usuario");
|
||||||
|
}
|
||||||
|
return Ok(modificado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elimina el usuario especificado por su id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idUsuario"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpDelete("{idUsuario}"), Authorize(Roles = "ADMINISTRADOR")]
|
||||||
|
public async Task<IActionResult> Delete(string idUsuario)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var usuarioTemp = await _UsuarioRepo.Get(idUsuario);
|
||||||
|
if (usuarioTemp == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El usuario a eliminar no existe");
|
||||||
|
}
|
||||||
|
bool eliminado = await _UsuarioRepo.Delete(idUsuario);
|
||||||
|
if (eliminado == false)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("Hubo un problema al eliminar el usuario");
|
||||||
|
}
|
||||||
|
return Ok(eliminado);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Crea un token para un usuario
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="correoUsuario"></param>
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.OK)]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(ExceptionResponse))]
|
||||||
|
[ProducesResponseType((int)HttpStatusCode.InternalServerError, Type = typeof(ExceptionResponse))]
|
||||||
|
[HttpGet("GenerarToken/{correoUsuario}")]
|
||||||
|
public async Task<IActionResult> CreateToken(string correoUsuario)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string jkt = await CrearToken(correoUsuario);
|
||||||
|
return Ok(jkt);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Metodos privados
|
||||||
|
//este metodo genera los tokens
|
||||||
|
private async Task<string> CrearToken(string correo)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var usuario = await _UsuarioRepo.GetUsuarioPorCorreo(correo);
|
||||||
|
if (usuario == null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException($"El usuario {correo} no está registrado en la aplicación \n Por favor contacte con soporte técnico");
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Claim> claims = new List<Claim>
|
||||||
|
{
|
||||||
|
new Claim(ClaimTypes.NameIdentifier,usuario.IdUsuario),
|
||||||
|
new Claim(ClaimTypes.Name,usuario.Nombre),
|
||||||
|
};
|
||||||
|
|
||||||
|
List<RolDeUsuario> rolesDeUsuario = await _rolDeUsuarioRepo.Get(usuario.IdUsuario);
|
||||||
|
|
||||||
|
if (rolesDeUsuario.Count == 0)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("El usuario no está asociado a un rol");
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (RolDeUsuario rolDeUsuario in rolesDeUsuario)
|
||||||
|
{
|
||||||
|
claims.Add(new Claim(ClaimTypes.Role, rolDeUsuario.DescripcionDeRol));
|
||||||
|
}
|
||||||
|
|
||||||
|
var key = new SymmetricSecurityKey(System.Text.Encoding.UTF8.GetBytes(
|
||||||
|
_configuration.GetSection("AppSettings:Token").Value));
|
||||||
|
|
||||||
|
var creds = new SigningCredentials(key, SecurityAlgorithms.HmacSha512Signature);
|
||||||
|
|
||||||
|
var Token = new JwtSecurityToken(
|
||||||
|
claims: claims,
|
||||||
|
expires: DateTime.Now.AddDays(1),
|
||||||
|
signingCredentials: creds);
|
||||||
|
|
||||||
|
var jwt = new JwtSecurityTokenHandler().WriteToken(Token);
|
||||||
|
|
||||||
|
return jwt;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.GetType() != typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
throw new InternalErrorException("Hubo un problema en el servidor");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<SccProjectName>SAK</SccProjectName>
|
||||||
|
<SccProvider>SAK</SccProvider>
|
||||||
|
<SccAuxPath>SAK</SccAuxPath>
|
||||||
|
<SccLocalPath>SAK</SccLocalPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.0" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.19" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.12" />
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.2" />
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.2">
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.2" />
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.2">
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
|
||||||
|
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="7.0.6" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\CuentasCobrar.CORE\CuentasCobrar.CORE.csproj" />
|
||||||
|
<ProjectReference Include="..\CuentasCobrar.INFRASTRUCTURE\CuentasCobrar.INFRASTRUCTURE.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<doc>
|
||||||
|
<assembly>
|
||||||
|
<name>SettingManager.Api</name>
|
||||||
|
</assembly>
|
||||||
|
<members>
|
||||||
|
<member name="T:SettingManager.Api.Installers.CorsInstaller">
|
||||||
|
<summary>
|
||||||
|
Enable Cross-Origin Requests (CORS)
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
</members>
|
||||||
|
</doc>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
using CuentasCobrar.INFRASTRUCTURE.Mappings;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.API.Installers
|
||||||
|
{
|
||||||
|
public class AutoMapperInstaller : IInstaller
|
||||||
|
{
|
||||||
|
public void InstallServices(IServiceCollection services, IConfiguration configuration)
|
||||||
|
{
|
||||||
|
services.AddAutoMapper(typeof(AutoMapperProfile));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
using CuentasCobrar.INFRASTRUCTURE.Filters;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.API.Installers
|
||||||
|
{
|
||||||
|
public class ControllersInstaller : IInstaller
|
||||||
|
{
|
||||||
|
public void InstallServices(IServiceCollection services, IConfiguration configuration)
|
||||||
|
{
|
||||||
|
services.AddControllers(options => { options.Filters.Add<GlobalExeptionFilter>(); });
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
using Microsoft.Net.Http.Headers;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.API.Installers
|
||||||
|
{
|
||||||
|
public class CorsInstaller : IInstaller
|
||||||
|
{
|
||||||
|
public void InstallServices(IServiceCollection services, IConfiguration configuration)
|
||||||
|
{
|
||||||
|
services.AddCors(options =>
|
||||||
|
{
|
||||||
|
options.AddPolicy("CorsPolicy",
|
||||||
|
builder => builder.AllowAnyOrigin()
|
||||||
|
.WithMethods("PUT", "DELETE", "GET", "POST")
|
||||||
|
.WithHeaders(HeaderNames.ContentType, "x-transactionId")
|
||||||
|
.WithHeaders(HeaderNames.ContentType, "x-sessionId")
|
||||||
|
.WithHeaders(HeaderNames.ContentType, "x-lang"));
|
||||||
|
//.AllowCredentials());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
using CuentasCobrar.INFRASTRUCTURE.Data;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.API.Installers
|
||||||
|
{
|
||||||
|
public class DBContextInstaller : IInstaller
|
||||||
|
{
|
||||||
|
public void InstallServices(IServiceCollection services, IConfiguration configuration)
|
||||||
|
{
|
||||||
|
services.AddDbContext<CuentasCobrarContext>(options =>
|
||||||
|
options.UseSqlServer(configuration.GetConnectionString("CuentasCobrar")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
namespace CuentasCobrar.API.Installers
|
||||||
|
{
|
||||||
|
public interface IInstaller
|
||||||
|
{
|
||||||
|
void InstallServices(IServiceCollection services, IConfiguration configuration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
namespace CuentasCobrar.API.Installers
|
||||||
|
{
|
||||||
|
public static class InstallerExtensions
|
||||||
|
{
|
||||||
|
public static void InstallServicesInAssembly(this IServiceCollection service, IConfiguration configuration)
|
||||||
|
{
|
||||||
|
var installers = typeof(Program).Assembly.ExportedTypes.Where(x =>
|
||||||
|
typeof(IInstaller).IsAssignableFrom(x) && !x.IsInterface && !x.IsAbstract).Select(Activator.CreateInstance).Cast<IInstaller>().ToList();
|
||||||
|
|
||||||
|
installers.ForEach(installers => installers.InstallServices(service, configuration));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
using Microsoft.OpenApi.Models;
|
||||||
|
using Swashbuckle.AspNetCore.Filters;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.API.Installers
|
||||||
|
{
|
||||||
|
public class SwaggerInstaller : IInstaller
|
||||||
|
{
|
||||||
|
public void InstallServices(IServiceCollection services, IConfiguration configuration)
|
||||||
|
{
|
||||||
|
//Configure Swagger
|
||||||
|
// Set the comments path for the Swagger JSON and UI.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
services.AddSwaggerGen(doc =>
|
||||||
|
{
|
||||||
|
doc.SwaggerDoc("v1", new OpenApiInfo
|
||||||
|
{
|
||||||
|
Version = "v1",
|
||||||
|
Title = "Cuentas Por Cobrar Documentación",
|
||||||
|
Description = "REST API para la Aplicacion Cuentas Por Cobrar by: CR. ATESA S.A.",
|
||||||
|
//TermsOfService = new Uri("https://www.isystemcorp.io/terms"),
|
||||||
|
Contact = new OpenApiContact
|
||||||
|
{
|
||||||
|
Name = "CR. ATESA S.A.",
|
||||||
|
Email = "servicioalcliente@atesacr.com",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
|
||||||
|
var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);
|
||||||
|
doc.IncludeXmlComments(xmlPath);
|
||||||
|
|
||||||
|
doc.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme
|
||||||
|
{
|
||||||
|
Description = "Standar Authorization header using the Bearer scheme (\"bearer {token}\")",
|
||||||
|
In = ParameterLocation.Header,
|
||||||
|
Name = "Authorization",
|
||||||
|
Type = SecuritySchemeType.ApiKey
|
||||||
|
});
|
||||||
|
doc.OperationFilter<SecurityRequirementsOperationFilter>();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
using CuentasCobrar.CORE.Interfaces;
|
||||||
|
using CuentasCobrar.INFRASTRUCTURE.Repositories;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.API.Installers
|
||||||
|
{
|
||||||
|
public class TransientInstaller : IInstaller
|
||||||
|
{
|
||||||
|
public void InstallServices(IServiceCollection services, IConfiguration configuration)
|
||||||
|
{
|
||||||
|
services.AddTransient<IRolRepo, RolRepo>();
|
||||||
|
services.AddTransient<IPaisRepo, PaisRepo>();
|
||||||
|
services.AddTransient<IPagoRepo, PagoRepo>();
|
||||||
|
services.AddTransient<IBancoRepo, BancoRepo>();
|
||||||
|
services.AddTransient<IFacturaRepo, FacturaRepo>();
|
||||||
|
services.AddTransient<IMonedaRepo, MonedaRepo>();
|
||||||
|
services.AddTransient<IUsuarioRepo, UsuarioRepo>();
|
||||||
|
services.AddTransient<IClienteRepo, ClienteRepo>();
|
||||||
|
services.AddTransient<ITelefonoRepo, TelefonoRepo>();
|
||||||
|
services.AddTransient<ITipoPagoRepo, TipoPagoRepo>();
|
||||||
|
services.AddTransient<ITipoTelefonoRepo, TipoTelefonoRepo>();
|
||||||
|
services.AddTransient<IRolDeUsuarioRepo, RolDeUsuarioRepo>();
|
||||||
|
services.AddTransient<ITipoDocumentoRepo, TipoDocumentoRepo>();
|
||||||
|
services.AddTransient<IPagoContieneFacturaRepo, PagoContieneFacturaRepo>();
|
||||||
|
services.AddTransient<ITipoIdentificacionRepo, TipoIdentificacionRepo>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
40
TPAtesa_CuentasCobrar/CuentasCobrar.API/Program.cs
Normal file
40
TPAtesa_CuentasCobrar/CuentasCobrar.API/Program.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
using CuentasCobrar.API.Installers;
|
||||||
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||||
|
using Microsoft.IdentityModel.Tokens;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
//builder.Services.AddControllers();
|
||||||
|
builder.Services.AddEndpointsApiExplorer();
|
||||||
|
//builder.Services.AddSwaggerGen();
|
||||||
|
builder.Services.InstallServicesInAssembly(builder.Configuration);
|
||||||
|
|
||||||
|
//Jw Token
|
||||||
|
builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
|
||||||
|
.AddJwtBearer(options =>
|
||||||
|
{
|
||||||
|
options.TokenValidationParameters = new TokenValidationParameters
|
||||||
|
{
|
||||||
|
ValidateIssuerSigningKey = true,
|
||||||
|
IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8
|
||||||
|
.GetBytes(builder.Configuration.GetSection("AppSettings:Token").Value)),
|
||||||
|
ValidateIssuer = false,
|
||||||
|
ValidateAudience = false
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
var app = builder.Build();
|
||||||
|
|
||||||
|
if (app.Environment.IsDevelopment())
|
||||||
|
{
|
||||||
|
app.UseSwagger();
|
||||||
|
app.UseSwaggerUI();
|
||||||
|
}
|
||||||
|
|
||||||
|
app.UseAuthentication();
|
||||||
|
|
||||||
|
app.UseAuthorization();
|
||||||
|
|
||||||
|
app.MapControllers();
|
||||||
|
|
||||||
|
app.Run();
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/launchsettings.json",
|
||||||
|
"iisSettings": {
|
||||||
|
"windowsAuthentication": false,
|
||||||
|
"anonymousAuthentication": true,
|
||||||
|
"iisExpress": {
|
||||||
|
"applicationUrl": "http://localhost:17885",
|
||||||
|
"sslPort": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"profiles": {
|
||||||
|
"CuentasCobrar.API": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"launchBrowser": true,
|
||||||
|
"launchUrl": "swagger",
|
||||||
|
"applicationUrl": "https://localhost:7131;http://localhost:3310",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"IIS Express": {
|
||||||
|
"commandName": "IISExpress",
|
||||||
|
"launchBrowser": true,
|
||||||
|
"launchUrl": "swagger",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
19
TPAtesa_CuentasCobrar/CuentasCobrar.API/appsettings.json
Normal file
19
TPAtesa_CuentasCobrar/CuentasCobrar.API/appsettings.json
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"ConnectionStrings": {
|
||||||
|
"CuentasCobrar": "Server=SRV-ULQA73\\ULTIMUSATESA;Database=CUENTAS_COBRAR;User ID=sa;Password=Ultimus@Davivienda;Trust Server Certificate=true"
|
||||||
|
},
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"PaginationDefaultConfig": {
|
||||||
|
"NumeroDePagina": 1,
|
||||||
|
"RegistrosPorPagina": 5
|
||||||
|
},
|
||||||
|
"AppSettings": {
|
||||||
|
"Token": "my top secret key"
|
||||||
|
},
|
||||||
|
"AllowedHosts": "*"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<SccProjectName>SAK</SccProjectName>
|
||||||
|
<SccProvider>SAK</SccProvider>
|
||||||
|
<SccAuxPath>SAK</SccAuxPath>
|
||||||
|
<SccLocalPath>SAK</SccLocalPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
12
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/DTOs/BancoDTO.cs
Normal file
12
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/DTOs/BancoDTO.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
namespace CuentasCobrar.CORE.DTOs;
|
||||||
|
|
||||||
|
public class BancoDTO
|
||||||
|
{
|
||||||
|
public int? IdBanco { get; set; }
|
||||||
|
|
||||||
|
public string Nombre { get; set; } = null!;
|
||||||
|
|
||||||
|
public string Nomenclatura { get; set; } = null!;
|
||||||
|
|
||||||
|
public bool Habilitado { get; set; }
|
||||||
|
}
|
||||||
13
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/DTOs/ClienteDTO.cs
Normal file
13
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/DTOs/ClienteDTO.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
namespace CuentasCobrar.CORE.DTOs;
|
||||||
|
public class ClienteDTO
|
||||||
|
{
|
||||||
|
public string NoIdentificacion { get; set; } = null!;
|
||||||
|
public int IdTipoIdentificacion { get; set; }
|
||||||
|
public int IdPaisNacionalidad { get; set; }
|
||||||
|
public string Nombre { get; set; } = null!;
|
||||||
|
public string? Apellido1 { get; set; }
|
||||||
|
public string? Apellido2 { get; set; }
|
||||||
|
public string Correo { get; set; } = null!;
|
||||||
|
public string? Direccion { get; set; } = null!;
|
||||||
|
public bool Habilitado { get; set; }
|
||||||
|
}
|
||||||
26
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/DTOs/FacturaDTO.cs
Normal file
26
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/DTOs/FacturaDTO.cs
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
namespace CuentasCobrar.CORE.DTOs;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Esta clase es una representación exacta de la entidad Factura, sin los atributos necesarios
|
||||||
|
/// para el funcionamiento de entity framework.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks> Este objeto es el que se envía al usuario</remarks>
|
||||||
|
public partial class FacturaDTO
|
||||||
|
{
|
||||||
|
public string Consecutivo { get; set; } = null!;
|
||||||
|
public string NoIdentificacionCliente { get; set; } = null!;
|
||||||
|
public int IdMoneda { get; set; }
|
||||||
|
public int IdTipoDocumento { get; set; }
|
||||||
|
public DateTime FechaEmision { get; set; }
|
||||||
|
public DateTime FechaVencimiento { get; set; }
|
||||||
|
public string? ConsecutivoNotaReferencia { get; set; }
|
||||||
|
public string NombreReceptor { get; set; } = null!;
|
||||||
|
public decimal SubTotal { get; set; }
|
||||||
|
public decimal TotalImpuestos { get; set; }
|
||||||
|
public decimal TotalFactura { get; set; }
|
||||||
|
public int DiasCredito { get; set; }
|
||||||
|
public decimal Saldo { get; set; }
|
||||||
|
public string Estado { get; set; } = null!;
|
||||||
|
public bool isActive { get; set; }
|
||||||
|
public decimal? MontoPagado { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
namespace CuentasCobrar.CORE.DTOs;
|
||||||
|
public class MonedaDTO
|
||||||
|
{
|
||||||
|
public int? IdMoneda { get; set; }
|
||||||
|
public string Descripcion { get; set; } = null!;
|
||||||
|
public string? Simbolo { get; set; }
|
||||||
|
public bool Habilitado { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
namespace CuentasCobrar.CORE.DTOs
|
||||||
|
{
|
||||||
|
public class PagoContieneFacturaDTO
|
||||||
|
{
|
||||||
|
public string ConsecutivoFactura { get; set; } = null!;
|
||||||
|
public int NoReciboPago { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
11
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/DTOs/PagoDTO.cs
Normal file
11
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/DTOs/PagoDTO.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
namespace CuentasCobrar.CORE.DTOs;
|
||||||
|
public class PagoDTO
|
||||||
|
{
|
||||||
|
public int NoRecibo { get; set; }
|
||||||
|
public DateTime FechaPago { get; set; }
|
||||||
|
public int IdBanco { get; set; }
|
||||||
|
public int IdTipoPago { get; set; }
|
||||||
|
public int IdMoneda { get; set; }
|
||||||
|
public decimal? TipoCambio { get; set; }
|
||||||
|
public List<FacturaDTO?>? Facturas { get; set; }
|
||||||
|
}
|
||||||
11
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/DTOs/PaisDTO.cs
Normal file
11
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/DTOs/PaisDTO.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
namespace CuentasCobrar.CORE.DTOs
|
||||||
|
{
|
||||||
|
public class PaisDTO
|
||||||
|
{
|
||||||
|
public int? IdPais { get; set; }
|
||||||
|
public string Nombre { get; set; } = null!;
|
||||||
|
public string Nacionalidad { get; set; } = null!;
|
||||||
|
public string CodigoDeArea { get; set; } = null!;
|
||||||
|
public bool Habilitado { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
7
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/DTOs/RolDTO.cs
Normal file
7
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/DTOs/RolDTO.cs
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
namespace CuentasCobrar.CORE.DTOs;
|
||||||
|
public class RolDTO
|
||||||
|
{
|
||||||
|
public int? IdRol { get; set; }
|
||||||
|
public string Descripcion { get; set; } = null!;
|
||||||
|
public bool Habilitado { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
namespace CuentasCobrar.CORE.DTOs;
|
||||||
|
public partial class RolDeUsuarioDTO
|
||||||
|
{
|
||||||
|
public string IdUsuario { get; set; } = null!;
|
||||||
|
public int IdRol { get; set; }
|
||||||
|
}
|
||||||
10
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/DTOs/TelefonoDTO.cs
Normal file
10
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/DTOs/TelefonoDTO.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
namespace CuentasCobrar.CORE.DTOs;
|
||||||
|
public class TelefonoDTO
|
||||||
|
{
|
||||||
|
public int? IdTelefono { get; set; }
|
||||||
|
public int IdTipoTelefono { get; set; }
|
||||||
|
public string NoIdentificacionCliente { get; set; } = null!;
|
||||||
|
public string Numero { get; set; } = null!;
|
||||||
|
public bool Habilitado { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
namespace CuentasCobrar.CORE.DTOs;
|
||||||
|
public class TipoDocumentoDTO
|
||||||
|
{
|
||||||
|
public int? IdTipoDocumento { get; set; }
|
||||||
|
public string Descripcion { get; set; } = null!;
|
||||||
|
public bool Habilitado { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
namespace CuentasCobrar.CORE.DTOs;
|
||||||
|
public class TipoIdentificacionDTO
|
||||||
|
{
|
||||||
|
public int? IdTipoIdentificacion { get; set; }
|
||||||
|
public string Descripcion { get; set; } = null!;
|
||||||
|
public bool Habilitado { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
namespace CuentasCobrar.CORE.DTOs;
|
||||||
|
public class TipoPagoDTO
|
||||||
|
{
|
||||||
|
public int? IdTipoPago { get; set; }
|
||||||
|
public string Descripcion { get; set; } = null!;
|
||||||
|
public bool Habilitado { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
namespace CuentasCobrar.CORE.DTOs;
|
||||||
|
public partial class TipoTelefonoDTO
|
||||||
|
{
|
||||||
|
public int? IdTipoTelefono { get; set; }
|
||||||
|
public string Descripcion { get; set; } = null!;
|
||||||
|
public bool Habilitado { get; set; }
|
||||||
|
}
|
||||||
10
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/DTOs/UsuarioDTO.cs
Normal file
10
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/DTOs/UsuarioDTO.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
namespace CuentasCobrar.CORE.DTOs;
|
||||||
|
public class UsuarioDTO
|
||||||
|
{
|
||||||
|
public string? IdUsuario { get; set; } = null!;
|
||||||
|
public string Nombre { get; set; } = null!;
|
||||||
|
public string Apellido1 { get; set; } = null!;
|
||||||
|
public string Apellido2 { get; set; } = null!;
|
||||||
|
public string Correo { get; set; } = null!;
|
||||||
|
public bool Habilitado { get; set; }
|
||||||
|
}
|
||||||
26
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/Entities/Banco.cs
Normal file
26
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/Entities/Banco.cs
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
namespace CuentasCobrar.CORE.Entities;
|
||||||
|
/// <summary>
|
||||||
|
/// Representación de la entidad <c>Banco</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public partial class Banco
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Identificador auto incremetal del banco dentro de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public int IdBanco { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Nombre del banco
|
||||||
|
/// </summary>
|
||||||
|
public string Nombre { get; set; } = null!;
|
||||||
|
/// <summary>
|
||||||
|
/// Nomenclatura del banco
|
||||||
|
/// </summary>
|
||||||
|
public string Nomenclatura { get; set; } = null!;
|
||||||
|
/// <summary>
|
||||||
|
/// Estado del banco dentro de la aplicación
|
||||||
|
/// </summary>
|
||||||
|
public bool Habilitado { get; set; }
|
||||||
|
|
||||||
|
/// Atributos necesarios para el entity framework
|
||||||
|
public virtual ICollection<Pago> Pagos { get; } = new List<Pago>();
|
||||||
|
}
|
||||||
49
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/Entities/Cliente.cs
Normal file
49
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/Entities/Cliente.cs
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
namespace CuentasCobrar.CORE.Entities;
|
||||||
|
/// <summary>
|
||||||
|
/// Representación de la entidad <c>Cliente</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public partial class Cliente
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Número de identificación del cliente
|
||||||
|
/// </summary>
|
||||||
|
public string NoIdentificacion { get; set; } = null!;
|
||||||
|
/// <summary>
|
||||||
|
/// Id que hace referencia al tipo de idetificación del cliente
|
||||||
|
/// </summary>
|
||||||
|
public int IdTipoIdentificacion { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Id que hace referencia al pais de origen del cliente
|
||||||
|
/// </summary>
|
||||||
|
public int IdPaisNacionalidad { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Nombre del cliente
|
||||||
|
/// </summary>
|
||||||
|
public string Nombre { get; set; } = null!;
|
||||||
|
/// <summary>
|
||||||
|
/// Primer apellido del cliente
|
||||||
|
/// </summary>
|
||||||
|
public string? Apellido1 { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Segundo apellido del cliente
|
||||||
|
/// </summary>
|
||||||
|
public string? Apellido2 { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Correo del cliente
|
||||||
|
/// </summary>
|
||||||
|
public string Correo { get; set; } = null!;
|
||||||
|
/// <summary>
|
||||||
|
/// Direccion exacta del cliente
|
||||||
|
/// </summary>
|
||||||
|
public string? Direccion { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Estado del cliente dentro de la aplicación
|
||||||
|
/// </summary>
|
||||||
|
public bool Habilitado { get; set; }
|
||||||
|
|
||||||
|
/// Atributos necesarios para el entity framework
|
||||||
|
public virtual Pais IdPaisNacionalidadNavigation { get; set; } = null!;
|
||||||
|
public virtual TipoIdentificacion IdTipoIdentificacionNavigation { get; set; } = null!;
|
||||||
|
public virtual ICollection<Telefono> Telefonos { get; } = new List<Telefono>();
|
||||||
|
public virtual ICollection<Factura> Facturas { get; } = new List<Factura>();
|
||||||
|
}
|
||||||
85
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/Entities/Factura.cs
Normal file
85
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/Entities/Factura.cs
Normal file
|
|
@ -0,0 +1,85 @@
|
||||||
|
namespace CuentasCobrar.CORE.Entities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Representación de la entidad <c>Factura</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public partial class Factura
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Número de consecutivo de factura
|
||||||
|
/// </summary>
|
||||||
|
public string Consecutivo { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Número de identificación del cliente al que se le emitió la factura
|
||||||
|
/// </summary>
|
||||||
|
public string NoIdentificacionCliente { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id que hace referencia al tipo de moneda utilizado en la factura
|
||||||
|
/// </summary>
|
||||||
|
public int IdMoneda { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id que hace referencia al tipo de documento utilizado en la factura
|
||||||
|
/// </summary>
|
||||||
|
public int IdTipoDocumento { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fecha en la que fue emitida la factura
|
||||||
|
/// </summary>
|
||||||
|
public DateTime FechaEmision { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fecha límite para pagar la factura
|
||||||
|
/// </summary>
|
||||||
|
public DateTime FechaVencimiento { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Referencia al consecutivo de factura en caso de hacer una nota de crédito o débito
|
||||||
|
/// </summary>
|
||||||
|
public string? ConsecutivoNotaReferencia { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Nombre del cliente al que se le emitió la factura
|
||||||
|
/// </summary>
|
||||||
|
public string NombreReceptor { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Monto sub-total de la factura.
|
||||||
|
/// </summary>
|
||||||
|
public decimal SubTotal { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Monto total a pagar de impuestos por la factura.
|
||||||
|
/// </summary>
|
||||||
|
public decimal TotalImpuestos { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Monto total a pagar por la factura.
|
||||||
|
/// </summary>
|
||||||
|
public decimal TotalFactura { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Cantidad de días que se tiene para pagar un crédito
|
||||||
|
/// </summary>
|
||||||
|
public int DiasCredito { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Saldo pagado para la factura.
|
||||||
|
/// </summary>
|
||||||
|
public decimal Saldo { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Estado actual de la factura
|
||||||
|
/// </summary>
|
||||||
|
public string Estado { get; set; } = null!;
|
||||||
|
|
||||||
|
/// Atributos necesarios para el entity framework
|
||||||
|
public virtual Cliente? NoIdentificacionClienteNavigation { get; set; }
|
||||||
|
public virtual Moneda? IdMonedaNavigation { get; set; }
|
||||||
|
public virtual TipoDocumento? IdTipoDocumentoNavigation { get; set; }
|
||||||
|
public ICollection<PagoContieneFactura> PagoContieneFacturas { get; set; } = null!;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
28
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/Entities/Moneda.cs
Normal file
28
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/Entities/Moneda.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
namespace CuentasCobrar.CORE.Entities;
|
||||||
|
/// <summary>
|
||||||
|
/// Representación de la entidad <c>Moneda</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public partial class Moneda
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Identificador auto incremetal de la moneda dentro de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public int IdMoneda { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Descripción de la moneda
|
||||||
|
/// </summary>
|
||||||
|
public string Descripcion { get; set; } = null!;
|
||||||
|
/// <summary>
|
||||||
|
/// Símbolo de la moneda
|
||||||
|
/// </summary>
|
||||||
|
public string? Simbolo { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Estado de la moneda dentro de la aplicación
|
||||||
|
/// </summary>
|
||||||
|
public bool Habilitado { get; set; }
|
||||||
|
|
||||||
|
/// Atributos necesarios para el entity framework
|
||||||
|
public virtual ICollection<Pago> Pagos { get; } = new List<Pago>();
|
||||||
|
public virtual ICollection<Factura> Facturas { get; } = new List<Factura>();
|
||||||
|
|
||||||
|
}
|
||||||
37
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/Entities/Pago.cs
Normal file
37
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/Entities/Pago.cs
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
namespace CuentasCobrar.CORE.Entities;
|
||||||
|
/// <summary>
|
||||||
|
/// Representación de la entidad <c>Pago</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public partial class Pago
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Número de recibo del pago
|
||||||
|
/// </summary>
|
||||||
|
public int NoRecibo { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Fecha en la que se realizó el pago
|
||||||
|
/// </summary>
|
||||||
|
public DateTime FechaPago { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Id que hace referencia al banco utilizado en el pago
|
||||||
|
/// </summary>
|
||||||
|
public int IdBanco { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Id que hace referencia al tipo de pago utilizado en el pago
|
||||||
|
/// </summary>
|
||||||
|
public int IdTipoPago { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Id que hace referencia al tipo de moneda utilizado en la factura
|
||||||
|
/// </summary>
|
||||||
|
public int IdMoneda { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Hace referencia al tipo de cambio de la moneda utilizada el día que se llevó a cabo el pago
|
||||||
|
/// </summary>
|
||||||
|
public decimal? TipoCambio { get; set; }
|
||||||
|
|
||||||
|
/// Atributos necesarios para el entity framework
|
||||||
|
public virtual Moneda IdMonedaNavigation { get; set; } = null!;
|
||||||
|
public virtual TipoPago IdTipoPagoNavigation { get; set; } = null!;
|
||||||
|
public virtual Banco IdBancoNavigation { get; set; } = null!;
|
||||||
|
public ICollection<PagoContieneFactura> PagoContieneFacturas { get; set; } = null!;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
namespace CuentasCobrar.CORE.Entities;
|
||||||
|
/// <summary>
|
||||||
|
/// Representación de la entidad <c>Pago Contiene Factura</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public partial class PagoContieneFactura
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Número de consecutivo de factura
|
||||||
|
/// </summary>
|
||||||
|
public string ConsecutivoFactura { get; set; } = null!;
|
||||||
|
/// <summary>
|
||||||
|
/// Número de recibo del pago
|
||||||
|
/// </summary>
|
||||||
|
public int NoReciboPago { get; set; }
|
||||||
|
|
||||||
|
/// Atributos necesarios para el entity framework
|
||||||
|
public virtual Factura? ConsecutivoFacturaNavigation { get; set; }
|
||||||
|
public virtual Pago? NoReciboNavigation { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
30
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/Entities/Pais.cs
Normal file
30
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/Entities/Pais.cs
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
namespace CuentasCobrar.CORE.Entities;
|
||||||
|
/// <summary>
|
||||||
|
/// Representación de la entidad <c>País</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public partial class Pais
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Identificador auto incremetal del país dentro de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public int IdPais { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Nombre del país
|
||||||
|
/// </summary>
|
||||||
|
public string Nombre { get; set; } = null!;
|
||||||
|
/// <summary>
|
||||||
|
/// Nacionalidad asociada al país
|
||||||
|
/// </summary>
|
||||||
|
public string Nacionalidad { get; set; } = null!;
|
||||||
|
/// <summary>
|
||||||
|
/// Código de area asociado al país
|
||||||
|
/// </summary>
|
||||||
|
public string CodigoDeArea { get; set; } = null!;
|
||||||
|
/// <summary>
|
||||||
|
/// Estado del país dentro de la aplicación
|
||||||
|
/// </summary>
|
||||||
|
public bool Habilitado { get; set; }
|
||||||
|
|
||||||
|
/// Atributos necesarios para el entity framework
|
||||||
|
public virtual ICollection<Cliente> Clientes { get; } = new List<Cliente>();
|
||||||
|
}
|
||||||
22
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/Entities/Rol.cs
Normal file
22
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/Entities/Rol.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
namespace CuentasCobrar.CORE.Entities;
|
||||||
|
/// <summary>
|
||||||
|
/// Representación de la entidad <c>Rol</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public partial class Rol
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Identificador auto incremetal del rol dentro de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public int IdRol { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Descripción del rol
|
||||||
|
/// </summary>
|
||||||
|
public string Descripcion { get; set; } = null!;
|
||||||
|
/// <summary>
|
||||||
|
/// Estado del rol dentro de la aplicación
|
||||||
|
/// </summary>
|
||||||
|
public bool Habilitado { get; set; }
|
||||||
|
|
||||||
|
/// Atributos necesarios para el entity framework
|
||||||
|
public ICollection<RolDeUsuario> RolesdeUsuario { get; set; } = null!;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
namespace CuentasCobrar.CORE.Entities;
|
||||||
|
/// <summary>
|
||||||
|
/// Representación de la entidad <c>Rol De Usuario</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public partial class RolDeUsuario
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Identificador de un usuario dentro de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public string IdUsuario { get; set; } = null!;
|
||||||
|
/// <summary>
|
||||||
|
/// Identificador auto incremetal de un rol dentro de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public int IdRol { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Descripción asociada al Id del rol indicado
|
||||||
|
/// </summary>
|
||||||
|
public string? DescripcionDeRol { get; set; }
|
||||||
|
|
||||||
|
/// Atributos necesarios para el entity framework
|
||||||
|
public Usuario UsuarioNavigation { get; set; } = null!;
|
||||||
|
public Rol RolNavigation { get; set; } = null!;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
namespace CuentasCobrar.CORE.Entities;
|
||||||
|
/// <summary>
|
||||||
|
/// Representación de la entidad <c>Teléfono</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public partial class Telefono
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Identificador auto incremetal de un teléfono dentro de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public int IdTelefono { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Id que hace referencia al tipo de teléfono asociado al teléfono
|
||||||
|
/// </summary>
|
||||||
|
public int IdTipoTelefono { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Número de identificación del cliente al que está asociado el teléfono
|
||||||
|
/// </summary>
|
||||||
|
public string NoIdentificacionCliente { get; set; } = null!;
|
||||||
|
/// <summary>
|
||||||
|
/// Número del teléfono
|
||||||
|
/// </summary>
|
||||||
|
public string Numero { get; set; } = null!;
|
||||||
|
/// <summary>
|
||||||
|
/// Estado del teléfono dentro de la aplicación
|
||||||
|
/// </summary>
|
||||||
|
public bool Habilitado { get; set; }
|
||||||
|
|
||||||
|
/// Atributos necesarios para el entity framework
|
||||||
|
public virtual Cliente? NoIdentificacionClienteNavigation { get; set; }
|
||||||
|
public virtual TipoTelefono IdTipoTelefonoNavigation { get; set; } = null!;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
namespace CuentasCobrar.CORE.Entities;
|
||||||
|
/// <summary>
|
||||||
|
/// Representación de la entidad <c>Tipo Documento</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public partial class TipoDocumento
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Identificador auto incremetal del tipo de documento dentro de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public int IdTipoDocumento { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Descripción del tipo de documento
|
||||||
|
/// </summary>
|
||||||
|
public string Descripcion { get; set; } = null!;
|
||||||
|
/// <summary>
|
||||||
|
/// Estado del tipo de documento dentro de la aplicación
|
||||||
|
/// </summary>
|
||||||
|
public bool Habilitado { get; set; }
|
||||||
|
|
||||||
|
/// Atributos necesarios para el entity framework
|
||||||
|
public virtual ICollection<Factura> Facturas { get; } = new List<Factura>();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
namespace CuentasCobrar.CORE.Entities;
|
||||||
|
/// <summary>
|
||||||
|
/// Representación de la entidad <c>Tipo de Identificacion</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public partial class TipoIdentificacion
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Identificador auto incremetal del tipo de identificación dentro de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public int IdTipoIdentificacion { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Descripción del tipo de identificación
|
||||||
|
/// </summary>
|
||||||
|
public string Descripcion { get; set; } = null!;
|
||||||
|
/// <summary>
|
||||||
|
/// Estado del tipo de identificación dentro de la aplicación
|
||||||
|
/// </summary>
|
||||||
|
public bool Habilitado { get; set; }
|
||||||
|
|
||||||
|
/// Atributos necesarios para el entity framework
|
||||||
|
public virtual ICollection<Cliente> Clientes { get; } = new List<Cliente>();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
namespace CuentasCobrar.CORE.Entities;
|
||||||
|
/// <summary>
|
||||||
|
/// Representación de la entidad <c>Tipo Pago</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public partial class TipoPago
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Identificador auto incremetal del tipo de pago dentro de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public int IdTipoPago { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Descripción del tipo de pago
|
||||||
|
/// </summary>
|
||||||
|
public string Descripcion { get; set; } = null!;
|
||||||
|
/// <summary>
|
||||||
|
/// Estado del tipo de pago dentro de la aplicación
|
||||||
|
/// </summary>
|
||||||
|
public bool Habilitado { get; set; }
|
||||||
|
|
||||||
|
/// Atributos necesarios para el entity framework
|
||||||
|
public virtual ICollection<Pago> Pagos { get; } = new List<Pago>();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
namespace CuentasCobrar.CORE.Entities;
|
||||||
|
/// <summary>
|
||||||
|
/// Representación de la entidad <c>Tipo Telefono</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public partial class TipoTelefono
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Identificador auto incremetal del tipo de teléfono dentro de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public int IdTipoTelefono { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Descripción del tipo de teléfono
|
||||||
|
/// </summary>
|
||||||
|
public string Descripcion { get; set; } = null!;
|
||||||
|
/// <summary>
|
||||||
|
/// Estado del tipo de teléfono dentro de la aplicación
|
||||||
|
/// </summary>
|
||||||
|
public bool Habilitado { get; set; }
|
||||||
|
|
||||||
|
/// Atributos necesarios para el entity framework
|
||||||
|
public virtual ICollection<Telefono> Telefonos { get; } = new List<Telefono>();
|
||||||
|
}
|
||||||
34
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/Entities/Usuario.cs
Normal file
34
TPAtesa_CuentasCobrar/CuentasCobrar.CORE/Entities/Usuario.cs
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
namespace CuentasCobrar.CORE.Entities;
|
||||||
|
/// <summary>
|
||||||
|
/// Representación de la entidad <c>Usuario</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public partial class Usuario
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Identificador de un usuario dentro de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
public string IdUsuario { get; set; } = null!;
|
||||||
|
/// <summary>
|
||||||
|
/// Nombre del usuario
|
||||||
|
/// </summary>
|
||||||
|
public string Nombre { get; set; } = null!;
|
||||||
|
/// <summary>
|
||||||
|
/// Primer apellido del usuario
|
||||||
|
/// </summary>
|
||||||
|
public string Apellido1 { get; set; } = null!;
|
||||||
|
/// <summary>
|
||||||
|
/// Segundo apellido del usuario
|
||||||
|
/// </summary>
|
||||||
|
public string Apellido2 { get; set; } = null!;
|
||||||
|
/// <summary>
|
||||||
|
/// Correo del usuario
|
||||||
|
/// </summary>
|
||||||
|
public string Correo { get; set; } = null!;
|
||||||
|
/// <summary>
|
||||||
|
/// Estado del usuario dentro de la aplicación
|
||||||
|
/// </summary>
|
||||||
|
public bool Habilitado { get; set; }
|
||||||
|
|
||||||
|
/// Atributos necesarios para el entity framework
|
||||||
|
public ICollection<RolDeUsuario> RolesdeUsuario { get; set; } = null!;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
namespace CuentasCobrar.CORE.Exceptions
|
||||||
|
{
|
||||||
|
public class BadRequestException : Exception
|
||||||
|
{
|
||||||
|
public BadRequestException() { }
|
||||||
|
|
||||||
|
public BadRequestException(string message) : base(message) { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
namespace CuentasCobrar.CORE.Exceptions
|
||||||
|
{
|
||||||
|
public class InternalErrorException : Exception
|
||||||
|
{
|
||||||
|
public InternalErrorException() { }
|
||||||
|
|
||||||
|
public InternalErrorException(string message) : base(message) { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
using CuentasCobrar.CORE.Pagination;
|
||||||
|
using CuentasCobrar.CORE.QueryFilters;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.CORE.Interfaces
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Representación abstracta de un repositorio de Bancos.
|
||||||
|
/// </summary>
|
||||||
|
public interface IBancoRepo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene todos los bancos de la base de datos.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns> Una tarea de tipo <c>IEnumerable</c> de la entidad <c>Banco</c> </returns>
|
||||||
|
Task<List<Banco>> Get();
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene todos los bancos de la base de datos tomando en cuenta
|
||||||
|
/// los filtros dados.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea tipo <c>ListaDePaginacion</c> donde se encuentran todos los bancos filtrados y paginados.
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="filtros"> Un objeto de tipo <c>PaginacionQueryFilter</c> que define los filtros a usar </param>
|
||||||
|
Task<ListaDePaginacion<Banco>> Get(PaginacionQueryFilter filtros);
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene un banco de la base de datos especificado
|
||||||
|
/// por su atributo <c>IdBanco</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>Banco</c> cuyo atributo <c>IdBanco</c> es igual al parámetro dado
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="id"> Un objeto de tipo <c>int</c> que representa el atributo <c>IdBanco</c>
|
||||||
|
/// de un banco
|
||||||
|
/// </param>
|
||||||
|
Task<Banco> Get(int id);
|
||||||
|
/// <summary>
|
||||||
|
/// Este método agrega un objeto de tipo <c>Banco</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>Banco</c> es agregado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="banco">
|
||||||
|
/// Un objeto de tipo <c>Banco</c> que se desea agregar a la base de datos
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Post(Banco banco);
|
||||||
|
/// <summary>
|
||||||
|
/// Este método modifica en la base de datos el objeto de tipo <c>Banco</c> dado
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>Banco</c> es modificado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="banco">
|
||||||
|
/// Un objeto de tipo <c>Banco</c> que se desea modificar en la base de datos
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Put(Banco banco);
|
||||||
|
/// <summary>
|
||||||
|
/// Este método elimina un banco de la base de datos especificado
|
||||||
|
/// por su atributo <c>IdBanco</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>Banco</c> es eliminado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="idBanco"> Un objeto de tipo <c>int</c> que representa el atributo <c>IdBanco</c>
|
||||||
|
/// de un banco
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Delete(int idBanco);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,74 @@
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
using CuentasCobrar.CORE.Pagination;
|
||||||
|
using CuentasCobrar.CORE.QueryFilters;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.CORE.Interfaces
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Representación abstracta de un repositorio de Clientes.
|
||||||
|
/// </summary>
|
||||||
|
public interface IClienteRepo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene todos los clientes de la base de datos.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns> Una tarea de tipo <c>IEnumerable</c> de la entidad <c>Cliente</c> </returns>
|
||||||
|
Task<List<Cliente>> Get();
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene todos los clientes de la base de datos tomando en cuenta
|
||||||
|
/// los filtros dados.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea tipo <c>ListaDePaginacion</c> donde se encuentran los clientes filtrados y paginados.
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="filtros"> Un objeto de tipo <c>ClienteQueryFilter</c> que define los filtros a usar </param>
|
||||||
|
Task<ListaDePaginacion<Cliente>> Get(ClienteQueryFilter filtros);
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene un cliente de la base de datos especificado
|
||||||
|
/// por su atributo <c>NoIdentificacion</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>Cliente</c> cuyo atributo <c>NoIdentificacion</c> es igual al parámetro dado
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="noIdentificacion"> Un objeto de tipo <c>string</c> que representa el atributo <c>NoIdentificacion</c>
|
||||||
|
/// de un cliente
|
||||||
|
/// </param>
|
||||||
|
Task<Cliente> Get(string noIdentificacion);
|
||||||
|
/// <summary>
|
||||||
|
/// Este método agrega un objeto de tipo <c>Cliente</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>Cliente</c> es agregado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="cliente">
|
||||||
|
/// Un objeto de tipo <c>Cliente</c> que se desea agregar a la base de datos
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Post(Cliente cliente);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método modifica en la base de datos el objeto de tipo <c>Cliente</c> especificado
|
||||||
|
/// por su atributo <c>NoIdentificacion</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>Cliente</c> es modificado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="cliente">
|
||||||
|
/// Un objeto de tipo <c>Cliente</c> que se desea modificar en la base de datos
|
||||||
|
/// </param>
|
||||||
|
/// /// <param name="noIdentificacion"> Un objeto de tipo <c>string</c> que representa el atributo <c>NoIdentificacion</c>
|
||||||
|
/// de un cliente
|
||||||
|
Task<bool> Put(string noIdentificacion, Cliente cliente);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método elimina un cliente de la base de datos especificado
|
||||||
|
/// por su atributo <c>NoIdentificacion</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>Cliente</c> es eliminado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="noIdentificacion"> Un objeto de tipo <c>string</c> que representa el atributo <c>NoIdentificacion</c>
|
||||||
|
/// de un cliente
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Delete(string noIdentificacion);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,76 @@
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
using CuentasCobrar.CORE.Pagination;
|
||||||
|
using CuentasCobrar.CORE.QueryFilters;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.CORE.Interfaces
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Representación abstracta de un repositorio de Facturas.
|
||||||
|
/// </summary>
|
||||||
|
public interface IFacturaRepo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene todas las facturas de la base de datos.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns> Una tarea de tipo <c>IEnumerable</c> de la entidad <c>Factura</c> </returns>
|
||||||
|
Task<IEnumerable<Factura>> Get();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene todas las facturas de la base de datos tomando en cuenta
|
||||||
|
/// los filtros dados.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea tipo <c>ListaDePaginacion</c> donde se encuentran las facturas filtradas y paginadas.
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="filtros"> Un objeto de tipo <c>FacturaQueryFilter</c> que define los filtros a usar </param>
|
||||||
|
Task<ListaDePaginacion<Factura>> Get(FacturaQueryFilter filtros);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene una factura de la base de datos especificada
|
||||||
|
/// por su atributo <c>Consecutivo</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>Factura</c> cuyo atributo <c>Consecutivo</c> es igual al parámetro dado
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="consecutivo"> Un objeto de tipo <c>string</c> que representa el atributo <c>Consecutivo</c>
|
||||||
|
/// de una factura
|
||||||
|
/// </param>
|
||||||
|
Task<Factura> Get(string consecutivo);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método agrega un objeto de tipo <c>Factura</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si la <c>Factura</c> es agregada o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="factura">
|
||||||
|
/// Un objeto de tipo <c>Factura</c> que se desea agregar a la base de datos
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Post(Factura factura);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método modifica en la base de datos el objeto de tipo <c>Factura</c> dado
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si la <c>Factura</c> es modificada o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="factura">
|
||||||
|
/// Un objeto de tipo <c>Factura</c> que se desea modificar en la base de datos
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Put(Factura factura);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método elimina una factura de la base de datos especificada
|
||||||
|
/// por su atributo <c>Consecutivo</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si la <c>Factura</c> es eliminada o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="consecutivo"> Un objeto de tipo <c>string</c> que representa el atributo <c>Consecutivo</c>
|
||||||
|
/// de una factura
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Delete(string consecutivo);
|
||||||
|
|
||||||
|
Task<bool> GenerarNotaCredito(Factura factura, Factura notaCredito);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.CORE.Interfaces
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Representación abstracta de un repositorio de Monedas.
|
||||||
|
/// </summary>
|
||||||
|
public interface IMonedaRepo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene todas las monedas de la base de datos.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns> Una tarea de tipo <c>IEnumerable</c> de la entidad <c>Moneda</c> </returns>
|
||||||
|
Task<IEnumerable<Moneda>> Get();
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene una moneda de la base de datos especificada
|
||||||
|
/// por su atributo <c>IdMoneda</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>Moneda</c> cuyo atributo <c>IdMoneda</c> es igual al parámetro dado
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="id"> Un objeto de tipo <c>int</c> que representa el atributo <c>IdMoneda</c>
|
||||||
|
/// de una moneda
|
||||||
|
/// </param>
|
||||||
|
Task<Moneda> Get(int id);
|
||||||
|
/// <summary>
|
||||||
|
/// Este método agrega un objeto de tipo <c>Moneda</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si la <c>Moneda</c> es agregada o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="moneda">
|
||||||
|
/// Un objeto de tipo <c>Moneda</c> que se desea agregar a la base de datos
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Post(Moneda moneda);
|
||||||
|
/// <summary>
|
||||||
|
/// Este método modifica en la base de datos el objeto de tipo <c>Moneda</c> dado
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si la <c>Moneda</c> es modificada o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="moneda">
|
||||||
|
/// Un objeto de tipo <c>Moneda</c> que se desea modificar en la base de datos
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Put(Moneda moneda);
|
||||||
|
/// <summary>
|
||||||
|
/// Este método elimina una moneda de la base de datos especificada
|
||||||
|
/// por su atributo <c>IdMoneda</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si la <c>Moneda</c> es eliminada o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="id"> Un objeto de tipo <c>int</c> que representa el atributo <c>IdMoneda</c>
|
||||||
|
/// de una moneda
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Delete(int id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
using CuentasCobrar.CORE.Pagination;
|
||||||
|
using CuentasCobrar.CORE.QueryFilters;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.CORE.Interfaces
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Representación abstracta de un repositorio de Pago Contiene Facturas.
|
||||||
|
/// </summary>
|
||||||
|
public interface IPagoContieneFacturaRepo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene todas las facuras relacionados a todos los pagos de la base de datos.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns> Una tarea de tipo <c>IEnumerable</c> de la entidad <c>Cliente</c> </returns>
|
||||||
|
Task<List<PagoContieneFactura>> Get();
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene todas las facuras relacionados a todos los pagos de la base de datos tomando en cuenta
|
||||||
|
/// los filtros dados.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea tipo <c>ListaDePaginacion</c> donde se encuentran las facuras relacionados a todos los pagos filtradas y paginadas.
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="filtros"> Un objeto de tipo <c>PaginacionQueryFilter</c> que define los filtros a usar </param>
|
||||||
|
Task<ListaDePaginacion<PagoContieneFactura>> Get(PaginacionQueryFilter filtros);
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene las facuras relacionados a un pago de la base de datos especificadas
|
||||||
|
/// por su atributo <c>NoRecibo</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>IEnumerable</c> de la entidad <c>Factura</c> es igual al parámetro dado
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="noRecibo"> Un objeto de tipo <c>int</c> que representa el atributo <c>NoRecibo</c>
|
||||||
|
/// de una factura
|
||||||
|
/// </param>
|
||||||
|
Task<List<Factura>> GetFacturasDePago(int noRecibo);
|
||||||
|
/// <summary>
|
||||||
|
/// Este método agrega un objeto de tipo <c>PagoContieneFactura</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>PagoContieneFactura</c> es agregado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="pagoContieneFactura">
|
||||||
|
/// Un objeto de tipo <c>PagoContieneFactura</c> que se desea agregar a la base de datos
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Post(PagoContieneFactura pagoContieneFactura);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
using CuentasCobrar.CORE.Pagination;
|
||||||
|
using CuentasCobrar.CORE.QueryFilters;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.CORE.Interfaces
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Representación abstracta de un repositorio de Pagos.
|
||||||
|
/// </summary>
|
||||||
|
public interface IPagoRepo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene todos los pagos de la base de datos.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns> Una tarea de tipo <c>IEnumerable</c> de la entnoReciboad <c>Pago</c> </returns>
|
||||||
|
Task<List<Pago>> Get();
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene todos los pagos de la base de datos tomando en cuenta
|
||||||
|
/// los filtros dados.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea tipo <c>ListaDePaginacion</c> donde se encuentran los pagos filtrados y paginados.
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="filtros"> Un objeto de tipo <c>PaginacionQueryFilter</c> que define los filtros a usar </param>
|
||||||
|
Task<ListaDePaginacion<Pago>> Get(PagoQueryFilter filtros);
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene un pago de la base de datos especificado
|
||||||
|
/// por su atributo <c>NoRecibo</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>Pago</c> cuyo atributo <c>NoRecibo</c> es igual al parámetro dado
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="noRecibo"> Un objeto de tipo <c>int</c> que representa el atributo <c>NoRecibo</c>
|
||||||
|
/// de un pago
|
||||||
|
/// </param>
|
||||||
|
Task<Pago> Get(int noRecibo);
|
||||||
|
/// <summary>
|
||||||
|
/// Este método agrega un objeto de tipo <c>Pago</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>Pago</c> es agregado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="pago">
|
||||||
|
/// Un objeto de tipo <c>Pago</c> que se desea agregar a la base de datos
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Post(Pago pago, List<Factura> facturas);
|
||||||
|
/// <summary>
|
||||||
|
/// Este método modifica en la base de datos el objeto de tipo <c>Pago</c> dado
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>Pago</c> es modificado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="pago">
|
||||||
|
/// Un objeto de tipo <c>Pago</c> que se desea modificar en la base de datos
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Put(Pago pago);
|
||||||
|
/// <summary>
|
||||||
|
/// Este método elimina un pago de la base de datos especificado
|
||||||
|
/// por su atributo <c>NoRecibo</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>Pago</c> es eliminado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="noRecibo"> Un objeto de tipo <c>int</c> que representa el atributo <c>NoRecibo</c>
|
||||||
|
/// de un pago
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Delete(int noRecibo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
using CuentasCobrar.CORE.Pagination;
|
||||||
|
using CuentasCobrar.CORE.QueryFilters;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.CORE.Interfaces
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Representación abstracta de un repositorio de Paises.
|
||||||
|
/// </summary>
|
||||||
|
public interface IPaisRepo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene todos los paises de la base de datos.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns> Una tarea de tipo <c>IEnumerable</c> de la entidad <c>Pais</c> </returns>
|
||||||
|
Task<List<Pais>> Get();
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene todos los paises de la base de datos tomando en cuenta
|
||||||
|
/// los filtros dados.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea tipo <c>ListaDePaginacion</c> donde se encuentran los paises filtrados y paginados.
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="filtros"> Un objeto de tipo <c>PaginacionQueryFilter</c> que define los filtros a usar </param>
|
||||||
|
Task<ListaDePaginacion<Pais>> Get(PaginacionQueryFilter filtros);
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene un pais de la base de datos especificado
|
||||||
|
/// por su atributo <c>IdPais</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>Pais</c> cuyo atributo <c>IdPais</c> es igual al parámetro dado
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="id"> Un objeto de tipo <c>int</c> que representa el atributo <c>IdPais</c>
|
||||||
|
/// de un pais
|
||||||
|
/// </param>
|
||||||
|
Task<Pais> Get(int id);
|
||||||
|
/// <summary>
|
||||||
|
/// Este método agrega un objeto de tipo <c>Pais</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>Pais</c> es agregado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="pais">
|
||||||
|
/// Un objeto de tipo <c>Pais</c> que se desea agregar a la base de datos
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Post(Pais pais);
|
||||||
|
/// <summary>
|
||||||
|
/// Este método modifica en la base de datos el objeto de tipo <c>Pais</c> dado
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>Pais</c> es modificado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="pais">
|
||||||
|
/// Un objeto de tipo <c>Pais</c> que se desea modificar en la base de datos
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Put(Pais pais);
|
||||||
|
/// <summary>
|
||||||
|
/// Este método elimina un pais de la base de datos especificado
|
||||||
|
/// por su atributo <c>IdPais</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>Pais</c> es eliminado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="id"> Un objeto de tipo <c>int</c> que representa el atributo <c>IdPais</c>
|
||||||
|
/// de un pais
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Delete(int id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.CORE.Interfaces
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Representación abstracta de un repositorio de Roles De Usuario.
|
||||||
|
/// </summary>
|
||||||
|
public interface IRolDeUsuarioRepo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene todos los roles de un usuario de la base de datos especificado
|
||||||
|
/// por su atributo <c>IdUsuario</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns> Una tarea de tipo <c>IEnumerable</c> de la entidad <c>RolDeUsuario</c> </returns>
|
||||||
|
/// <param name="idUsuario"> Un objeto de tipo <c>string</c> que representa el atributo <c>IdUsuario</c>
|
||||||
|
/// de un rol de usuario
|
||||||
|
/// </param>
|
||||||
|
Task<List<RolDeUsuario>> Get(string idUsuario);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene un rol de usuario de la base de datos especificado
|
||||||
|
/// por sus atributos <c>IdUsuario</c> y <c>IdRol</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>RolDeUsuario</c> cuyos atributos <c>IdUsuario</c> y <c>IdRol</c>
|
||||||
|
/// sean iguales a los parámetros dados
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="idUsuario"> Un objeto de tipo <c>string</c> que representa el atributo <c>IdUsuario</c>
|
||||||
|
/// de un rol de usuario
|
||||||
|
/// </param>
|
||||||
|
/// /// <param name="idRol"> Un objeto de tipo <c>int</c> que representa el atributo <c>IdRol</c>
|
||||||
|
/// de un rol de usuario
|
||||||
|
/// </param>
|
||||||
|
Task<RolDeUsuario> Get(string idUsuario, int idRol);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método agrega un objeto de tipo <c>RolDeUsuario</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>RolDeUsuario</c> es agregado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="rolDeUsuario">
|
||||||
|
/// Un objeto de tipo <c>RolDeUsuario</c> que se desea agregar a la base de datos
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Post(RolDeUsuario rolDeUsuario);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método elimina un rol de usuario de la base de datos especificado
|
||||||
|
/// por sus atributos <c>IdUsuario</c> y <c>IdRol</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>RolDeUsuario</c> es eliminado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="idUsuario"> Un objeto de tipo <c>string</c> que representa el atributo <c>IdUsuario</c>
|
||||||
|
/// de un rol de usuario
|
||||||
|
/// </param>
|
||||||
|
/// /// <param name="idRol"> Un objeto de tipo <c>int</c> que representa el atributo <c>IdRol</c>
|
||||||
|
/// de un rol de usuario
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Delete(string idUsuario, int idRol);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.CORE.Interfaces
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Representación abstracta de un repositorio de Roles.
|
||||||
|
/// </summary>
|
||||||
|
public interface IRolRepo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene todos los roles de la base de datos.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns> Una tarea de tipo <c>IEnumerable</c> de la entidad <c>Rol</c> </returns>
|
||||||
|
Task<IEnumerable<Rol>> Get();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene un rol de la base de datos especificado
|
||||||
|
/// por su atributo <c>IdRol</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>Rol</c> cuyo atributo <c>IdRol</c> es igual al parámetro dado
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="id"> Un objeto de tipo <c>string</c> que representa el atributo <c>IdRol</c>
|
||||||
|
/// de un rol
|
||||||
|
/// </param>
|
||||||
|
Task<Rol> Get(int id);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método agrega un objeto de tipo <c>Rol</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>Rol</c> es agregado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="rol">
|
||||||
|
/// Un objeto de tipo <c>Rol</c> que se desea agregar a la base de datos
|
||||||
|
Task<bool> Post(Rol rol);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método modifica en la base de datos el objeto de tipo <c>Rol</c> dado
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>Rol</c> es modificado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="rol">
|
||||||
|
/// Un objeto de tipo <c>Rol</c> que se desea modificar en la base de datos
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Put(Rol rol);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método elimina un rol de la base de datos especificado
|
||||||
|
/// por su atributo <c>IdRol</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>Rol</c> es eliminado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="id"> Un objeto de tipo <c>int</c> que representa el atributo <c>IdRol</c>
|
||||||
|
/// de un rol
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Delete(int id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.CORE.Interfaces
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Representación abstracta de un repositorio de Telefonos.
|
||||||
|
/// </summary>
|
||||||
|
public interface ITelefonoRepo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene todos los telefonos de la base de datos.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns> Una tarea de tipo <c>IEnumerable</c> de la entidad <c>Telefono</c> </returns>
|
||||||
|
Task<IEnumerable<Telefono>> Get();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene un teléfono de la base de datos especificado
|
||||||
|
/// por su atributo <c>IdTelefono</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>Telefono</c> cuyo atributo <c>IdTelefono</c> es igual al parámetro dado
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="id"> Un objeto de tipo <c>int</c> que representa el atributo <c>IdTelefono</c>
|
||||||
|
/// de un teléfono
|
||||||
|
/// </param>
|
||||||
|
Task<Telefono> Get(int id);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método agrega un objeto de tipo <c>Telefono</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>Telefono</c> es agregado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="telefono">
|
||||||
|
/// Un objeto de tipo <c>Telefono</c> que se desea agregar a la base de datos
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Post(Telefono telefono);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método modifica en la base de datos el objeto de tipo <c>Telefono</c> dado
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>Telefono</c> es modificado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="telefono">
|
||||||
|
/// Un objeto de tipo <c>Telefono</c> que se desea modificar en la base de datos
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Put(Telefono telefono);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método elimina un teléfono de la base de datos especificado
|
||||||
|
/// por su atributo <c>IdTelefono</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>Telefono</c> es eliminado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="id"> Un objeto de tipo <c>int</c> que representa el atributo <c>IdTelefono</c>
|
||||||
|
/// de un teléfono
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Delete(int id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.CORE.Interfaces
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Representación abstracta de un repositorio de Tipos De Documento.
|
||||||
|
/// </summary>
|
||||||
|
public interface ITipoDocumentoRepo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene todos los tipos de documento de la base de datos.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns> Una tarea de tipo <c>IEnumerable</c> de la entidad <c>TipoDocumento</c> </returns>
|
||||||
|
Task<IEnumerable<TipoDocumento>> Get();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene un tipo de documento de la base de datos especificado
|
||||||
|
/// por su atributo <c>IdTipoDocumento</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>TipoDocumento</c> cuyo atributo <c>IdTipoDocumento</c> es igual al parámetro dado
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="id"> Un objeto de tipo <c>int</c> que representa el atributo <c>IdTipoDocumento</c>
|
||||||
|
/// de un tipo de documento
|
||||||
|
/// </param>
|
||||||
|
Task<TipoDocumento> Get(int id);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método agrega un objeto de tipo <c>TipoDocumento</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>TipoDocumento</c> es agregado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="tipoDocumento">
|
||||||
|
/// Un objeto de tipo <c>TipoDocumento</c> que se desea agregar a la base de datos
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Post(TipoDocumento tipoDocumento);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método modifica en la base de datos el objeto de tipo <c>TipoDocumento</c> dado
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>TipoDocumento</c> es modificado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="tipoDocumento">
|
||||||
|
/// Un objeto de tipo <c>TipoDocumento</c> que se desea modificar en la base de datos
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Put(TipoDocumento tipoDocumento);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método elimina un tipo de documento de la base de datos especificado
|
||||||
|
/// por su atributo <c>IdTipoDocumento</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>TipoDocumento</c> es eliminado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="id"> Un objeto de tipo <c>int</c> que representa el atributo <c>IdTipoDocumento</c>
|
||||||
|
/// de un tipo de documento
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Delete(int id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.CORE.Interfaces
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Representación abstracta de un repositorio de Tipos De Identificacion.
|
||||||
|
/// </summary>
|
||||||
|
public interface ITipoIdentificacionRepo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene todos los tipos de identificación de la base de datos.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns> Una tarea de tipo <c>IEnumerable</c> de la entidad <c>TipoIdentificacion</c> </returns>
|
||||||
|
Task<IEnumerable<TipoIdentificacion>> Get();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene un tipo de identificación de la base de datos especificado
|
||||||
|
/// por su atributo <c>IdTipoIdentificacion</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>TipoIdentificacion</c> cuyo atributo <c>IdTipoIdentificacion</c> es igual al parámetro dado
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="id"> Un objeto de tipo <c>int</c> que representa el atributo <c>IdTipoIdentificacion</c>
|
||||||
|
/// de un tipo de identificación
|
||||||
|
/// </param>
|
||||||
|
Task<TipoIdentificacion> Get(int id);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método agrega un objeto de tipo <c>TipoIdentificacion</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>TipoIdentificacion</c> es agregado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="tipoIdentificacion">
|
||||||
|
/// Un objeto de tipo <c>TipoIdentificacion</c> que se desea agregar a la base de datos
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Post(TipoIdentificacion tipoIdentificacion);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método modifica en la base de datos el objeto de tipo <c>TipoIdentificacion</c> dado
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>TipoIdentificacion</c> es modificado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="tipoIdentificacion">
|
||||||
|
/// Un objeto de tipo <c>TipoIdentificacion</c> que se desea modificar en la base de datos
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Put(TipoIdentificacion tipoIdentificacion);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método elimina un tipo de identificación de la base de datos especificado
|
||||||
|
/// por su atributo <c>IdTipoIdentificacion</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>TipoIdentificacion</c> es eliminado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="id"> Un objeto de tipo <c>int</c> que representa el atributo <c>IdTipoIdentificacion</c>
|
||||||
|
/// de un tipo de identificación
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Delete(int id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.CORE.Interfaces
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Representación abstracta de un repositorio de Tipos De Pago.
|
||||||
|
/// </summary>
|
||||||
|
public interface ITipoPagoRepo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene todos los tipos de pago de la base de datos.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns> Una tarea de tipo <c>IEnumerable</c> de la entidad <c>TipoPago</c> </returns>
|
||||||
|
Task<IEnumerable<TipoPago>> Get();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene un tipo de pago de la base de datos especificado
|
||||||
|
/// por su atributo <c>IdTipoPago</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>TipoPago</c> cuyo atributo <c>IdTipoPago</c> es igual al parámetro dado
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="id"> Un objeto de tipo <c>int</c> que representa el atributo <c>IdTipoPago</c>
|
||||||
|
/// de un tipo de pago
|
||||||
|
/// </param>
|
||||||
|
Task<TipoPago> Get(int id);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método agrega un objeto de tipo <c>TipoPago</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>TipoPago</c> es agregado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="tipoPago">
|
||||||
|
/// Un objeto de tipo <c>TipoPago</c> que se desea agregar a la base de datos
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Post(TipoPago pago);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método modifica en la base de datos el objeto de tipo <c>TipoPago</c> dado
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>TipoPago</c> es modificado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="tipoPago">
|
||||||
|
/// Un objeto de tipo <c>TipoPago</c> que se desea modificar en la base de datos
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Put(TipoPago pago);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método elimina un tipo de pago de la base de datos especificado
|
||||||
|
/// por su atributo <c>IdTipoPago</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>TipoPago</c> es eliminado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="id"> Un objeto de tipo <c>int</c> que representa el atributo <c>IdTipoPago</c>
|
||||||
|
/// de un tipo de pago
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Delete(int id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.CORE.Interfaces
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Representación abstracta de un repositorio de Tipos De Telefono.
|
||||||
|
/// </summary>
|
||||||
|
public interface ITipoTelefonoRepo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene todos los tipos de teléfono de la base de datos.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns> Una tarea de tipo <c>IEnumerable</c> de la entidad <c>TipoTelefono</c> </returns>
|
||||||
|
Task<IEnumerable<TipoTelefono>> Get();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene un tipo de teléfono de la base de datos especificado
|
||||||
|
/// por su atributo <c>IdTipoTelefono</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>TipoTelefono</c> cuyo atributo <c>IdTipoTelefono</c> es igual al parámetro dado
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="id"> Un objeto de tipo <c>int</c> que representa el atributo <c>IdTipoTelefono</c>
|
||||||
|
/// de un tipo de teléfono
|
||||||
|
/// </param>
|
||||||
|
Task<TipoTelefono> Get(int id);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método agrega un objeto de tipo <c>TipoTelefono</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>TipoTelefono</c> es agregado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="tipoTelefono">
|
||||||
|
/// Un objeto de tipo <c>TipoTelefono</c> que se desea agregar a la base de datos
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Post(TipoTelefono tipoTelefono);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método modifica en la base de datos el objeto de tipo <c>TipoTelefono</c> dado
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>TipoTelefono</c> es modificado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="tipoTelefono">
|
||||||
|
/// Un objeto de tipo <c>TipoTelefono</c> que se desea modificar en la base de datos
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Put(TipoTelefono tipoTelefono);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método elimina un tipo de teléfono de la base de datos especificado
|
||||||
|
/// por su atributo <c>IdTipoTelefono</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>TipoTelefono</c> es eliminado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="id"> Un objeto de tipo <c>int</c> que representa el atributo <c>IdTipoTelefono</c>
|
||||||
|
/// de un tipo de teléfono
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Delete(int id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,86 @@
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
using CuentasCobrar.CORE.Pagination;
|
||||||
|
using CuentasCobrar.CORE.QueryFilters;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.CORE.Interfaces
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Representación abstracta de un repositorio de Usuarios.
|
||||||
|
/// </summary>
|
||||||
|
public interface IUsuarioRepo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene todos los usuarios de la base de datos.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns> Una tarea de tipo <c>IEnumerable</c> de la entidad <c>Usuario</c> </returns>
|
||||||
|
Task<List<Usuario>> Get();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene todos los usuarios de la base de datos tomando en cuenta
|
||||||
|
/// los filtros dados.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea tipo <c>ListaDePaginacion</c> donde se encuentran los usuarios filtrados y paginados.
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="filtros"> Un objeto de tipo <c>UsuarioQueryFilter</c> que define los filtros a usar </param>
|
||||||
|
Task<ListaDePaginacion<Usuario>> Get(PaginacionQueryFilter filtros);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene un usuario de la base de datos especificado
|
||||||
|
/// por su atributo <c>username</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>Usuario</c> cuyo atributo <c>username</c> es igual al parámetro dado
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="username"> Un objeto de tipo <c>string</c> que representa el atributo <c>username</c>
|
||||||
|
/// de un usuario
|
||||||
|
/// </param>
|
||||||
|
Task<Usuario> Get(string username);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método obtiene un usuario de la base de datos especificado
|
||||||
|
/// por su atributo <c>correo</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>Usuario</c> cuyo atributo <c>correo</c> es igual al parámetro dado
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="correo"> Un objeto de tipo <c>string</c> que representa el atributo <c>correo</c>
|
||||||
|
/// de un usuario
|
||||||
|
/// </param>
|
||||||
|
Task<Usuario> GetUsuarioPorCorreo(string correo);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método agrega un objeto de tipo <c>Usuario</c> de la base de datos
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>Usuario</c> es agregado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="usuario">
|
||||||
|
/// Un objeto de tipo <c>Usuario</c> que se desea agregar a la base de datos
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Post(Usuario usuario);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método modifica en la base de datos el objeto de tipo <c>Usuario</c> dado
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>Usuario</c> es modificado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="usuario">
|
||||||
|
/// Un objeto de tipo <c>Usuario</c> que se desea modificar en la base de datos
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Put(Usuario usuario);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método elimina un usuario de la base de datos especificado
|
||||||
|
/// por su atributo <c>IdUsuario</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Una tarea de tipo <c>bool</c> que es <c>true</c> si el <c>Usuario</c> es eliminado o <c>false</c> en caso contrario
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="id"> Un objeto de tipo <c>string</c> que representa el atributo <c>IdUsuario</c>
|
||||||
|
/// de un usuario
|
||||||
|
/// </param>
|
||||||
|
Task<bool> Delete(string id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,78 @@
|
||||||
|
namespace CuentasCobrar.CORE.Pagination
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Lista de tipo genérico <c><T></c> que contiene los atributos de paginación
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks> Implementa la clase <c>List<T></c> </remarks>
|
||||||
|
public class ListaDePaginacion<T> : List<T>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Representa el número de página en el que se encuentra el usuario
|
||||||
|
/// </summary>
|
||||||
|
public int NumeroDePagina { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Representa la cantidad de páginas totales que puede tener la lista
|
||||||
|
/// con base en la cantidad de registros por página.
|
||||||
|
/// </summary>
|
||||||
|
public int PaginasTotales { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Representa la cantidad de registros totales que tiene la lista
|
||||||
|
/// </summary>
|
||||||
|
public int RegistrosTotales { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Representa la cantidad de registros por página que desea el usuario
|
||||||
|
/// </summary>
|
||||||
|
public int RegistrosPorPagina { get; set; }
|
||||||
|
|
||||||
|
public bool HayPaginaAnterior => NumeroDePagina > 1;
|
||||||
|
public bool HayPaginaSiguiente => NumeroDePagina < PaginasTotales;
|
||||||
|
public int? NumeroPaginaSiguiente => HayPaginaSiguiente ? NumeroDePagina + 1 : null;
|
||||||
|
public int? NumeroPaginaAnterior => HayPaginaAnterior ? NumeroDePagina - 1 : null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor de la clase <c>List<ListaDePaginacion></c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Un objeto de tipo <c>ListaDePaginacion<T></c>
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="registros">
|
||||||
|
/// Un objeto de tipo <c>List<T>?</c> con los registros a paginar
|
||||||
|
/// </param>
|
||||||
|
/// /// <param name="paginaActual">
|
||||||
|
/// Un <c>int</c> que representa la página actual del usuario
|
||||||
|
/// </param>
|
||||||
|
/// /// <param name="registrosPorPagina">
|
||||||
|
/// Un <c>int</c> que representa la cantidad de registros por página del usuario
|
||||||
|
/// </param>
|
||||||
|
public ListaDePaginacion(List<T> registros, int paginaActual, int registrosPorPagina, bool obtenerTodas = false)
|
||||||
|
{
|
||||||
|
RegistrosTotales = registros.Count();
|
||||||
|
if (obtenerTodas == true)
|
||||||
|
{
|
||||||
|
RegistrosPorPagina = RegistrosTotales;
|
||||||
|
PaginasTotales = 1;
|
||||||
|
NumeroDePagina = 1;
|
||||||
|
AddRange(registros);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RegistrosPorPagina = registrosPorPagina;
|
||||||
|
PaginasTotales = (int)Math.Ceiling(RegistrosTotales / (double)registrosPorPagina);
|
||||||
|
if (paginaActual > PaginasTotales)
|
||||||
|
{
|
||||||
|
NumeroDePagina = PaginasTotales;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NumeroDePagina = paginaActual;
|
||||||
|
}
|
||||||
|
var datosPaginados = registros.Skip((NumeroDePagina - 1) * RegistrosPorPagina).Take(RegistrosPorPagina).ToList();
|
||||||
|
|
||||||
|
AddRange(datosPaginados);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,85 @@
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.CORE.QueryFilters
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Clase que representa los atributos por los que se pueden filtrar los Clientes.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks> Implementa la clase <c>PaginacionQueryFilter</c> </remarks>
|
||||||
|
public class ClienteQueryFilter : PaginacionQueryFilter
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Representa un <c>String</c> que puede ser usado para buscar los clientes
|
||||||
|
/// que tengan un valor en alguno de sus atributos que coincida con este atributo.
|
||||||
|
/// </summary>
|
||||||
|
public string? Busqueda { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método filtra los clientes con base en el atributo <c>Busqueda</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Un objeto de tipo <c>List<Cliente>?</c> con los clientes filtrados
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="clientes">
|
||||||
|
/// Un objeto de tipo <c>List<Pais>?</c> con los clientes a filtrar
|
||||||
|
/// </param>
|
||||||
|
/// /// <param name="paises">
|
||||||
|
/// Un objeto de tipo <c>List<Pais></c> con los paises registrados en la base de datos
|
||||||
|
/// </param>
|
||||||
|
/// /// <param name="tiposIdentificacion">
|
||||||
|
/// Un objeto de tipo <c>List<TipoIdentificacion></c> con los tipos de identificación registrados en
|
||||||
|
/// la base de datos
|
||||||
|
/// </param>
|
||||||
|
public List<Cliente>? FiltrarPorBusqueda(List<Cliente>? clientes, List<Pais> paises, List<TipoIdentificacion> tiposIdentificacion)
|
||||||
|
{
|
||||||
|
List<Cliente>? busquedaClientes = new List<Cliente>();
|
||||||
|
|
||||||
|
foreach (Cliente cliente in clientes)
|
||||||
|
{
|
||||||
|
foreach (PropertyInfo propiedad in clientes[0].GetType().GetProperties())
|
||||||
|
{
|
||||||
|
if (busquedaClientes.FirstOrDefault(x => x.NoIdentificacion == cliente.NoIdentificacion) == null)
|
||||||
|
{
|
||||||
|
if (propiedad.GetValue(cliente) != null)
|
||||||
|
{
|
||||||
|
if (propiedad.Name == "IdPais")
|
||||||
|
{
|
||||||
|
paises = paises.Where(x => x.Nombre.ToUpper().Contains(this.Busqueda.ToUpper())).ToList();
|
||||||
|
foreach (var pais in paises)
|
||||||
|
{
|
||||||
|
if (pais.IdPais == cliente.IdPaisNacionalidad)
|
||||||
|
{
|
||||||
|
busquedaClientes.Add(cliente);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (propiedad.Name == "IdTipoIdentificacion")
|
||||||
|
{
|
||||||
|
tiposIdentificacion = tiposIdentificacion.Where(x => x.Descripcion.ToUpper().Contains(this.Busqueda.ToUpper())).ToList();
|
||||||
|
foreach (var tipoDocumento in tiposIdentificacion)
|
||||||
|
{
|
||||||
|
if (tipoDocumento.IdTipoIdentificacion == cliente.IdTipoIdentificacion)
|
||||||
|
{
|
||||||
|
busquedaClientes.Add(cliente);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (propiedad.GetValue(cliente).ToString().ToUpper().Contains(this.Busqueda.ToUpper()))
|
||||||
|
{
|
||||||
|
busquedaClientes.Add(cliente);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (busquedaClientes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,197 @@
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.CORE.QueryFilters
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clase que representa los atributos por los que se pueden filtrar las facturas.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks> Implementa la clase <c>PaginacionQueryFilter</c> </remarks>
|
||||||
|
public class FacturaQueryFilter : PaginacionQueryFilter
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Representa un <c>String</c> que puede ser usado para buscar las facturas
|
||||||
|
/// que tengan un valor en alguno de sus atributos que coincida con este atributo.
|
||||||
|
/// </summary>
|
||||||
|
public string? Busqueda { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id que hace referencia al tipo de moneda utilizado en la factura
|
||||||
|
/// </summary>
|
||||||
|
public int? IdMoneda { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id que hace referencia al tipo de documento utilizado en la factura
|
||||||
|
/// </summary>
|
||||||
|
public int? IdTipoDocumento { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Representa la fecha inicial en un rango de fechas
|
||||||
|
/// se filtra por el atributo <c>FechaEmision</c>
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? FechaInicio { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Representa la fecha final en un rango de fechas
|
||||||
|
/// se filtra por el atributo <c>FechaEmision</c>
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? FechaFin { get; set; }
|
||||||
|
|
||||||
|
public string? IdCliente { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Estado actual de la factura
|
||||||
|
/// </summary>
|
||||||
|
public string? Estado { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método filtra las facturas con base en el atributo <c>Busqueda</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Un objeto de tipo <c>List<Factura>?</c> con las facturas filtradas
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="facturas">
|
||||||
|
/// Un objeto de tipo <c>List<Factura>?</c> con las facturas a filtrar
|
||||||
|
/// </param>
|
||||||
|
/// /// <param name="monedas">
|
||||||
|
/// Un objeto de tipo <c>List<Moneda></c> con las Monedas registradas en la base de datos
|
||||||
|
/// </param>
|
||||||
|
/// /// <param name="tiposDocumento">
|
||||||
|
/// Un objeto de tipo <c>List<TipoDocumento></c> con los tipos de documentos registrados en
|
||||||
|
/// la base de datos
|
||||||
|
/// </param>
|
||||||
|
public List<Factura>? FiltrarPorBusqueda(List<Factura>? facturas, List<Moneda> monedas, List<TipoDocumento> tiposDocumento)
|
||||||
|
{
|
||||||
|
List<Factura>? busquedaFacturas = new List<Factura>();
|
||||||
|
|
||||||
|
foreach (Factura factura in facturas)
|
||||||
|
{
|
||||||
|
foreach (PropertyInfo propiedad in facturas[0].GetType().GetProperties())
|
||||||
|
{
|
||||||
|
if (busquedaFacturas.FirstOrDefault(x => x.Consecutivo == factura.Consecutivo) == null)
|
||||||
|
{
|
||||||
|
if (propiedad.GetValue(factura) != null)
|
||||||
|
{
|
||||||
|
if (propiedad.Name == "IdMoneda")
|
||||||
|
{
|
||||||
|
monedas = monedas.Where(x => x.Descripcion.ToUpper().Contains(this.Busqueda.ToUpper())).ToList();
|
||||||
|
foreach (var moneda in monedas)
|
||||||
|
{
|
||||||
|
if (moneda.IdMoneda == factura.IdMoneda)
|
||||||
|
{
|
||||||
|
busquedaFacturas.Add(factura);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (propiedad.Name == "IdTipoDocumento")
|
||||||
|
{
|
||||||
|
tiposDocumento = tiposDocumento.Where(x => x.Descripcion.ToUpper().Contains(this.Busqueda.ToUpper())).ToList();
|
||||||
|
foreach (var tipoDocumento in tiposDocumento)
|
||||||
|
{
|
||||||
|
if (tipoDocumento.IdTipoDocumento == factura.IdTipoDocumento)
|
||||||
|
{
|
||||||
|
busquedaFacturas.Add(factura);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (propiedad.Name == "FechaEmision")
|
||||||
|
{
|
||||||
|
DateTime? fecha = (DateTime?)propiedad.GetValue(factura);
|
||||||
|
var fechaString = fecha?.ToString("dd/MM/yyyy");
|
||||||
|
if (fechaString.Contains(this.Busqueda))
|
||||||
|
{
|
||||||
|
busquedaFacturas.Add(factura);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (propiedad.GetValue(factura).ToString().ToUpper().Contains(this.Busqueda.ToUpper()))
|
||||||
|
{
|
||||||
|
busquedaFacturas.Add(factura);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (busquedaFacturas);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método filtra las facturas con base en el atributo <c>IdMoneda</c>.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Un objeto de tipo <c>List<Factura>?</c> con las facturas filtradas
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="facturas">
|
||||||
|
/// Un objeto de tipo <c>List<Factura>?</c> con las facturas a filtrar
|
||||||
|
/// </param>
|
||||||
|
public List<Factura>? FiltrarPorIdMoneda(List<Factura> facturas)
|
||||||
|
{
|
||||||
|
return facturas.Where(x => x.IdMoneda == this.IdMoneda).ToList(); ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método filtra las facturas con base en el atributo <c>IdTipoDocumento</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Un objeto de tipo <c>List<Factura>?</c> con las facturas filtradas
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="facturas">
|
||||||
|
/// Un objeto de tipo <c>List<Factura>?</c> con las facturas a filtrar
|
||||||
|
/// </param>
|
||||||
|
public List<Factura>? FiltrarPorIdTipoDocumento(List<Factura> facturas)
|
||||||
|
{
|
||||||
|
return facturas.Where(x => x.IdTipoDocumento == this.IdTipoDocumento).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Factura>? FiltrarPorIdCliente(List<Factura> facturas)
|
||||||
|
{
|
||||||
|
return facturas.Where(x => x.NoIdentificacionCliente == this.IdCliente).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método filtra las facturas con base en el atributo <c>Estado</c>.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Un objeto de tipo <c>List<Factura>?</c> con las facturas filtradas
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="facturas">
|
||||||
|
/// Un objeto de tipo <c>List<Factura>?</c> con las facturas a filtrar
|
||||||
|
/// </param>
|
||||||
|
public List<Factura>? FiltrarPorEstado(List<Factura> facturas)
|
||||||
|
{
|
||||||
|
return facturas.Where(x => x.Estado.ToUpper() == this.Estado.ToUpper()).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método filtra las facturas con base en un rango de fechas definido por
|
||||||
|
/// los atributos <c>FechaInicio</c> y <c>FechaFin</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Un objeto de tipo <c>List<Factura>?</c> con las facturas filtradas
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="facturas">
|
||||||
|
/// Un objeto de tipo <c>List<Factura>?</c> con las facturas a filtrar
|
||||||
|
/// </param>
|
||||||
|
public List<Factura>? FiltrarPorFecha(List<Factura> facturas)
|
||||||
|
{
|
||||||
|
if (this.FechaInicio != null)
|
||||||
|
{
|
||||||
|
facturas = facturas.Where(x => x.FechaEmision >= this.FechaInicio).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.FechaFin != null)
|
||||||
|
{
|
||||||
|
facturas = facturas.Where(x => x.FechaEmision <= this.FechaFin).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
return facturas;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
namespace CuentasCobrar.CORE.QueryFilters
|
||||||
|
{
|
||||||
|
public class PaginacionQueryFilter
|
||||||
|
{
|
||||||
|
public int NumeroDePagina { get; set; }
|
||||||
|
public int RegistrosPorPagina { get; set; }
|
||||||
|
public bool ObtenerTodas { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,202 @@
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.CORE.QueryFilters
|
||||||
|
{
|
||||||
|
public class PagoQueryFilter : PaginacionQueryFilter
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Representa un <c>String</c> que puede ser usado para buscar los pagos
|
||||||
|
/// que tengan un valor en alguno de sus atributos que coincida con este atributo.
|
||||||
|
/// </summary>
|
||||||
|
public string? Busqueda { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id que hace referencia al banco utilizado para realizar el pago
|
||||||
|
/// </summary>
|
||||||
|
public int? IdBanco { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id que hace referencia al tipo de pago utilizado en la factura
|
||||||
|
/// </summary>
|
||||||
|
public int? IdTipoPago { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id que hace referencia al tipo de moneda utilizado en el pago
|
||||||
|
/// </summary>
|
||||||
|
public int? IdMoneda { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Representa la fecha inicial en un rango de fechas
|
||||||
|
/// se filtra por el atributo <c>FechaPago</c>
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? FechaInicio { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Representa la fecha final en un rango de fechas
|
||||||
|
/// se filtra por el atributo <c>FechaPago</c>
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? FechaFin { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método filtra los pagos con base en el atributo <c>Busqueda</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Un objeto de tipo <c>List<Pago>?</c> con los pagos filtrados
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="pagos">
|
||||||
|
/// Un objeto de tipo <c>List<Pago>?</c> con los pagos a filtrar
|
||||||
|
/// </param>
|
||||||
|
/// <param name="monedas">
|
||||||
|
/// Un objeto de tipo <c>List<Moneda></c> con las Monedas registradas en la base de datos
|
||||||
|
/// </param>
|
||||||
|
/// <param name="tiposPago">
|
||||||
|
/// Un objeto de tipo <c>List<TipoPago></c> con los tipos de documentos registrados en
|
||||||
|
/// la base de datos
|
||||||
|
/// </param>
|
||||||
|
/// <param name="bancos">
|
||||||
|
/// Un objeto de tipo <c>List<Banco></c> con los bancos registrados en
|
||||||
|
/// la base de datos
|
||||||
|
/// </param>
|
||||||
|
public List<Pago>? FiltrarPorBusqueda(List<Pago>? pagos, List<Moneda> monedas, List<TipoPago> tiposPago, List<Banco> bancos)
|
||||||
|
{
|
||||||
|
List<Pago>? busquedaPagos = new List<Pago>();
|
||||||
|
|
||||||
|
foreach (Pago pago in pagos)
|
||||||
|
{
|
||||||
|
foreach (PropertyInfo propiedad in pagos[0].GetType().GetProperties())
|
||||||
|
{
|
||||||
|
if (busquedaPagos.FirstOrDefault(x => x.NoRecibo == pago.NoRecibo) == null)
|
||||||
|
{
|
||||||
|
if (propiedad.GetValue(pago) != null)
|
||||||
|
{
|
||||||
|
if (propiedad.Name == "IdMoneda")
|
||||||
|
{
|
||||||
|
monedas = monedas.Where(x => x.Descripcion.ToUpper().Contains(this.Busqueda.ToUpper())).ToList();
|
||||||
|
foreach (var moneda in monedas)
|
||||||
|
{
|
||||||
|
if (moneda.IdMoneda == pago.IdMoneda)
|
||||||
|
{
|
||||||
|
busquedaPagos.Add(pago);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (propiedad.Name == "IdTipoPago")
|
||||||
|
{
|
||||||
|
tiposPago = tiposPago.Where(x => x.Descripcion.ToUpper().Contains(this.Busqueda.ToUpper())).ToList();
|
||||||
|
foreach (var tipoPago in tiposPago)
|
||||||
|
{
|
||||||
|
if (tipoPago.IdTipoPago == pago.IdTipoPago)
|
||||||
|
{
|
||||||
|
busquedaPagos.Add(pago);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (propiedad.Name == "IdBanco")
|
||||||
|
{
|
||||||
|
bancos = bancos.Where(x => x.Nombre.ToUpper().Contains(this.Busqueda.ToUpper())).ToList();
|
||||||
|
foreach (var banco in bancos)
|
||||||
|
{
|
||||||
|
if (banco.IdBanco == pago.IdBanco)
|
||||||
|
{
|
||||||
|
busquedaPagos.Add(pago);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (propiedad.Name == "FechaPago")
|
||||||
|
{
|
||||||
|
DateTime? fecha = (DateTime?)propiedad.GetValue(pago);
|
||||||
|
var fechaString = fecha?.ToString("dd/MM/yyyy");
|
||||||
|
if (fechaString.Contains(this.Busqueda))
|
||||||
|
{
|
||||||
|
busquedaPagos.Add(pago);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (propiedad.GetValue(pago).ToString().ToUpper().Contains(this.Busqueda.ToUpper()))
|
||||||
|
{
|
||||||
|
busquedaPagos.Add(pago);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (busquedaPagos);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método filtra los pagos con base en el atributo <c>IdBanco</c>.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Un objeto de tipo <c>List<Pago>?</c> con los pagos filtrados
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="pagos">
|
||||||
|
/// Un objeto de tipo <c>List<Pago>?</c> con los pagos a filtrar
|
||||||
|
/// </param>
|
||||||
|
public List<Pago>? FiltrarPorIdBanco(List<Pago> pagos)
|
||||||
|
{
|
||||||
|
return pagos.Where(x => x.IdBanco == this.IdBanco).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método filtra los pagos con base en el atributo <c>IdMoneda</c>.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Un objeto de tipo <c>List<Pago>?</c> con los pagos filtrados
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="pagos">
|
||||||
|
/// Un objeto de tipo <c>List<Pago>?</c> con los pagos a filtrar
|
||||||
|
/// </param>
|
||||||
|
public List<Pago>? FiltrarPorIdMoneda(List<Pago> pagos)
|
||||||
|
{
|
||||||
|
return pagos.Where(x => x.IdMoneda == this.IdMoneda).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método filtra los pagos con base en el atributo <c>IdTipoPago</c>.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Un objeto de tipo <c>List<Pago>?</c> con los pagos filtrados
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="pagos">
|
||||||
|
/// Un objeto de tipo <c>List<Pago>?</c> con los pagos a filtrar
|
||||||
|
/// </param>
|
||||||
|
public List<Pago>? FiltrarPorIdTipoPago(List<Pago> pagos)
|
||||||
|
{
|
||||||
|
return pagos.Where(x => x.IdTipoPago == this.IdTipoPago).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Este método filtra los pagos con base en un rango de fechas definido por
|
||||||
|
/// los atributos <c>FechaInicio</c> y <c>FechaFin</c>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// Un objeto de tipo <c>List<Pago>?</c> con los pagos filtrados
|
||||||
|
/// </returns>
|
||||||
|
/// <param name="pagos">
|
||||||
|
/// Un objeto de tipo <c>List<Pago>?</c> con los pagos a filtrar
|
||||||
|
/// </param>
|
||||||
|
public List<Pago>? FiltrarPorFecha(List<Pago> pagos)
|
||||||
|
{
|
||||||
|
if (this.FechaInicio != null)
|
||||||
|
{
|
||||||
|
pagos = pagos.Where(x => x.FechaPago >= this.FechaInicio).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.FechaFin != null)
|
||||||
|
{
|
||||||
|
pagos = pagos.Where(x => x.FechaPago <= this.FechaFin).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
return pagos;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
namespace CuentasCobrar.CORE.ResponseObjects
|
||||||
|
{
|
||||||
|
public partial class ExceptionResponse
|
||||||
|
{
|
||||||
|
public int Status { get; set; }
|
||||||
|
public string? Title { get; set; }
|
||||||
|
public string? Detail { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<SccProjectName>SAK</SccProjectName>
|
||||||
|
<SccProvider>SAK</SccProvider>
|
||||||
|
<SccAuxPath>SAK</SccAuxPath>
|
||||||
|
<SccLocalPath>SAK</SccLocalPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="AutoMapper" Version="12.0.0" />
|
||||||
|
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.0" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.13" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.2" />
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.2">
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\CuentasCobrar.CORE\CuentasCobrar.CORE.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,276 @@
|
||||||
|
using CuentasCobrar.CORE.Entities;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.INFRASTRUCTURE.Data;
|
||||||
|
public partial class CuentasCobrarContext : DbContext
|
||||||
|
{
|
||||||
|
public CuentasCobrarContext()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public CuentasCobrarContext(DbContextOptions<CuentasCobrarContext> options)
|
||||||
|
: base(options)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public virtual DbSet<Banco> Bancos { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<Cliente> Clientes { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<Pais> Paises { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<Rol> Roles { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<Telefono> Telefonos { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<TipoIdentificacion> TipoIdentificaciones { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<TipoTelefono> TipoTelefonos { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<Usuario> Usuarios { get; set; }
|
||||||
|
|
||||||
|
// Agregados manualmente
|
||||||
|
public virtual DbSet<Moneda> Monedas { get; set; }
|
||||||
|
public virtual DbSet<Pago> Pagos { get; set; }
|
||||||
|
public virtual DbSet<TipoDocumento> TiposDocumento { get; set; }
|
||||||
|
public virtual DbSet<TipoPago> TiposPago { get; set; }
|
||||||
|
public virtual DbSet<Factura> Facturas { get; set; }
|
||||||
|
public virtual DbSet<RolDeUsuario> RolesDeUsuarios { get; set; }
|
||||||
|
public virtual DbSet<PagoContieneFactura> PagoContieneFacturas { get; set; }
|
||||||
|
|
||||||
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
|
||||||
|
modelBuilder.Entity<Banco>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.IdBanco).HasName("PK__Banco__2D3F553E3E070539");
|
||||||
|
|
||||||
|
entity.ToTable("Banco", "catalogo");
|
||||||
|
|
||||||
|
entity.Property(e => e.Nombre).HasMaxLength(255);
|
||||||
|
entity.Property(e => e.Nomenclatura).HasMaxLength(100);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<Cliente>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(c => c.NoIdentificacion).HasName("PK__Cliente__85CD349F66C6A8E0");
|
||||||
|
|
||||||
|
entity.ToTable("Cliente", "global");
|
||||||
|
|
||||||
|
entity.Property(c => c.Apellido1).HasMaxLength(255);
|
||||||
|
entity.Property(c => c.Apellido2).HasMaxLength(255);
|
||||||
|
entity.Property(c => c.Correo)
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.IsUnicode(false);
|
||||||
|
entity.Property(c => c.Direccion)
|
||||||
|
.HasMaxLength(500)
|
||||||
|
.IsUnicode(false);
|
||||||
|
entity.Property(c => c.Nombre).HasMaxLength(255);
|
||||||
|
|
||||||
|
entity.HasOne(c => c.IdPaisNacionalidadNavigation)
|
||||||
|
.WithMany(p => p.Clientes)
|
||||||
|
.HasForeignKey(c => c.IdPaisNacionalidad)
|
||||||
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||||
|
.HasConstraintName("FK__Cliente__IdPaisN__47FBA9D6");
|
||||||
|
|
||||||
|
entity.HasOne(c => c.IdTipoIdentificacionNavigation)
|
||||||
|
.WithMany(ti => ti.Clientes)
|
||||||
|
.HasForeignKey(c => c.IdTipoIdentificacion)
|
||||||
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||||
|
.HasConstraintName("FK__Cliente__IdTipoI__4707859D");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<PagoContieneFactura>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(pcf => new { pcf.NoReciboPago, pcf.ConsecutivoFactura }).HasName("PK__PagoCont__8B63A4E4F1870F3F");
|
||||||
|
|
||||||
|
entity.ToTable("PagoContieneFactura", "global");
|
||||||
|
|
||||||
|
entity.HasOne(pcf => pcf.NoReciboNavigation)
|
||||||
|
.WithMany(p => p.PagoContieneFacturas)
|
||||||
|
.HasForeignKey(pcf => pcf.NoReciboPago)
|
||||||
|
.HasConstraintName("FK__PagoConti__NoRec__3572E547");
|
||||||
|
|
||||||
|
entity.HasOne(pcf => pcf.ConsecutivoFacturaNavigation)
|
||||||
|
.WithMany(p => p.PagoContieneFacturas)
|
||||||
|
.HasForeignKey(pcf => pcf.ConsecutivoFactura)
|
||||||
|
.HasConstraintName("FK__PagoConti__Conse__347EC10E");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<Pais>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.IdPais).HasName("PK__Pais__FC850A7BC674C915");
|
||||||
|
|
||||||
|
entity.ToTable("Pais", "catalogo");
|
||||||
|
|
||||||
|
entity.Property(e => e.CodigoDeArea)
|
||||||
|
.HasMaxLength(4)
|
||||||
|
.IsUnicode(false);
|
||||||
|
entity.Property(e => e.Nombre).HasMaxLength(50);
|
||||||
|
entity.Property(e => e.Nacionalidad).HasMaxLength(100);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<Pago>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(c => c.NoRecibo).HasName("[PK__Pago__7688EB130D619E62]");
|
||||||
|
|
||||||
|
entity.ToTable("Pago", "global");
|
||||||
|
|
||||||
|
entity.HasOne(p => p.IdMonedaNavigation)
|
||||||
|
.WithMany(m => m.Pagos)
|
||||||
|
.HasForeignKey(p => p.IdMoneda)
|
||||||
|
.HasConstraintName("FK__Pago__IdMoneda__5DB5E0CB");
|
||||||
|
|
||||||
|
entity.HasOne(p => p.IdTipoPagoNavigation)
|
||||||
|
.WithMany(tp => tp.Pagos)
|
||||||
|
.HasForeignKey(p => p.IdTipoPago)
|
||||||
|
.HasConstraintName("FK__Pago__IdTipoPago__5EAA0504");
|
||||||
|
|
||||||
|
entity.HasOne(p => p.IdBancoNavigation)
|
||||||
|
.WithMany(b => b.Pagos)
|
||||||
|
.HasForeignKey(p => p.IdBanco)
|
||||||
|
.HasConstraintName("FK__Pago__IdBanco__5CC1BC92");
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<Factura>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(c => c.Consecutivo).HasName("[PK__Factura__AB810F674E340669]");
|
||||||
|
|
||||||
|
entity.ToTable("Factura", "global");
|
||||||
|
|
||||||
|
entity.HasOne(f => f.IdMonedaNavigation)
|
||||||
|
.WithMany(m => m.Facturas)
|
||||||
|
.HasForeignKey(f => f.IdMoneda)
|
||||||
|
.HasConstraintName("FK__Factura__IdMoned__627A95E8");
|
||||||
|
|
||||||
|
entity.HasOne(f => f.IdTipoDocumentoNavigation)
|
||||||
|
.WithMany(td => td.Facturas)
|
||||||
|
.HasForeignKey(f => f.IdTipoDocumento)
|
||||||
|
.HasConstraintName("FK__Factura__IdTipoD__636EBA21");
|
||||||
|
|
||||||
|
entity.HasOne(f => f.NoIdentificacionClienteNavigation)
|
||||||
|
.WithMany(c => c.Facturas)
|
||||||
|
.HasForeignKey(f => f.NoIdentificacionCliente)
|
||||||
|
.HasConstraintName("FK__Factura__NoIdent__618671AF");
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<Rol>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.IdRol).HasName("PK__Rol__2A49584C04DA73D1");
|
||||||
|
|
||||||
|
entity.ToTable("Rol", "catalogo");
|
||||||
|
|
||||||
|
entity.Property(e => e.Descripcion).HasMaxLength(255);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<Telefono>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.IdTelefono).HasName("PK__Telefono__9B8AC75359567F35");
|
||||||
|
|
||||||
|
entity.ToTable("Telefono", "global");
|
||||||
|
|
||||||
|
entity.Property(e => e.Numero).HasMaxLength(25);
|
||||||
|
entity.Property(e => e.NoIdentificacionCliente).HasMaxLength(25);
|
||||||
|
|
||||||
|
entity.HasOne(t => t.NoIdentificacionClienteNavigation)
|
||||||
|
.WithMany(c => c.Telefonos)
|
||||||
|
.HasForeignKey(t => t.NoIdentificacionCliente)
|
||||||
|
.HasConstraintName("FK__Telefono__NoIden__4BCC3ABA");
|
||||||
|
|
||||||
|
entity.HasOne(t => t.IdTipoTelefonoNavigation)
|
||||||
|
.WithMany(tp => tp.Telefonos)
|
||||||
|
.HasForeignKey(t => t.IdTipoTelefono)
|
||||||
|
.HasConstraintName("FK__Telefono__IdTipo__4AD81681");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<TipoIdentificacion>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.IdTipoIdentificacion).HasName("PK__TipoIden__F521C6A8FE1D2C50");
|
||||||
|
|
||||||
|
entity.ToTable("TipoIdentificacion", "catalogo");
|
||||||
|
|
||||||
|
entity.Property(e => e.Descripcion).HasMaxLength(50);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<TipoTelefono>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.IdTipoTelefono).HasName("PK__TipoTele__6FA65CBF794852A9");
|
||||||
|
|
||||||
|
entity.ToTable("TipoTelefono", "catalogo");
|
||||||
|
|
||||||
|
entity.Property(e => e.Descripcion).HasMaxLength(50);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<Moneda>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(m => m.IdMoneda).HasName("PK__Moneda__AA690671C7075783");
|
||||||
|
|
||||||
|
entity.ToTable("Moneda", "catalogo");
|
||||||
|
|
||||||
|
entity.Property(m => m.Descripcion).HasMaxLength(255);
|
||||||
|
entity.Property(m => m.Simbolo).HasMaxLength(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<TipoDocumento>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(td => td.IdTipoDocumento).HasName("PK__TipoDocu__3AB3332F9C573562");
|
||||||
|
|
||||||
|
entity.ToTable("TipoDocumento", "catalogo");
|
||||||
|
|
||||||
|
entity.Property(td => td.Descripcion).HasMaxLength(255);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<TipoPago>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(tp => tp.IdTipoPago).HasName("PK__TipoPago__EB0AA9E7D5EF4FF4");
|
||||||
|
|
||||||
|
entity.ToTable("TipoPago", "catalogo");
|
||||||
|
|
||||||
|
entity.Property(tp => tp.Descripcion).HasMaxLength(255);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<RolDeUsuario>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(ar => new { ar.IdUsuario, ar.IdRol }).HasName("PK__RolDeUsu__89C12A131E4152F0");
|
||||||
|
|
||||||
|
entity.ToTable("RolDeUsuario", "global");
|
||||||
|
|
||||||
|
entity.Property(arp => arp.DescripcionDeRol).HasMaxLength(255);
|
||||||
|
|
||||||
|
entity.HasOne(ru => ru.RolNavigation)
|
||||||
|
.WithMany(r => r.RolesdeUsuario)
|
||||||
|
.HasForeignKey(ru => ru.IdRol)
|
||||||
|
.HasConstraintName("FK__RolDeUsua__IdRol__30242045");
|
||||||
|
|
||||||
|
entity.HasOne(ru => ru.UsuarioNavigation)
|
||||||
|
.WithMany(p => p.RolesdeUsuario)
|
||||||
|
.HasForeignKey(ru => ru.IdUsuario)
|
||||||
|
.HasConstraintName("FK__RolDeUsua__IdUsu__2F2FFC0C");
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<Usuario>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.IdUsuario).HasName("PK__Usuario__5B65BF97E1E9D674 ");
|
||||||
|
|
||||||
|
entity.ToTable("Usuario", "catalogo");
|
||||||
|
|
||||||
|
entity.Property(e => e.IdUsuario)
|
||||||
|
.HasMaxLength(20)
|
||||||
|
.IsUnicode(false);
|
||||||
|
entity.Property(e => e.Apellido1).HasMaxLength(255);
|
||||||
|
entity.Property(e => e.Apellido2).HasMaxLength(255);
|
||||||
|
entity.Property(e => e.Correo)
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.IsUnicode(false);
|
||||||
|
entity.Property(e => e.Nombre).HasMaxLength(255);
|
||||||
|
});
|
||||||
|
|
||||||
|
OnModelCreatingPartial(modelBuilder);
|
||||||
|
}
|
||||||
|
|
||||||
|
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
using CuentasCobrar.CORE.Exceptions;
|
||||||
|
using CuentasCobrar.CORE.ResponseObjects;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.Mvc.Filters;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
|
namespace CuentasCobrar.INFRASTRUCTURE.Filters
|
||||||
|
{
|
||||||
|
public class GlobalExeptionFilter : IExceptionFilter
|
||||||
|
{
|
||||||
|
public void OnException(ExceptionContext context)
|
||||||
|
{
|
||||||
|
if (context.Exception.GetType() == typeof(BadRequestException))
|
||||||
|
{
|
||||||
|
var exception = (BadRequestException)context.Exception;
|
||||||
|
var validation = new ExceptionResponse
|
||||||
|
{
|
||||||
|
Status = 400,
|
||||||
|
Title = "Bad Resquest",
|
||||||
|
Detail = exception.Message
|
||||||
|
};
|
||||||
|
|
||||||
|
context.Result = new ObjectResult(validation);
|
||||||
|
context.HttpContext.Response.StatusCode = (int)HttpStatusCode.BadRequest;
|
||||||
|
context.ExceptionHandled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (context.Exception.GetType() == typeof(InternalErrorException))
|
||||||
|
{
|
||||||
|
var exception = (InternalErrorException)context.Exception;
|
||||||
|
var validation = new ExceptionResponse
|
||||||
|
{
|
||||||
|
Status = 500,
|
||||||
|
Title = "Internal Server Error",
|
||||||
|
Detail = exception.Message
|
||||||
|
};
|
||||||
|
|
||||||
|
context.Result = new ObjectResult(validation);
|
||||||
|
context.HttpContext.Response.StatusCode = (int)HttpStatusCode.InternalServerError;
|
||||||
|
context.ExceptionHandled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue