deploy-local-de-la-v1-del-sistema #68
@@ -81,7 +81,7 @@ public class AdminController: ControllerBase
|
||||
if (mcon == null) throw new Exception();
|
||||
|
||||
mc = new MinioClient().WithCredentials(mcon.usr, mcon.scrt)
|
||||
.WithEndpoint("192.168.1.11:9000")
|
||||
.WithEndpoint("0.0.0.0:9000")
|
||||
.WithSSL(false)
|
||||
.Build();
|
||||
}
|
||||
|
||||
@@ -519,10 +519,10 @@ public class ContratoController: ControllerBase {
|
||||
if (mcon == null) throw new Exception();
|
||||
|
||||
mc = new MinioClient().WithCredentials(mcon.usr, mcon.scrt)
|
||||
.WithEndpoint("192.168.1.11:9000")
|
||||
.WithEndpoint("0.0.0.0:9000")
|
||||
.WithSSL(false)
|
||||
.Build();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPost("api/contratos/subirContrato")]
|
||||
@@ -768,7 +768,7 @@ public class ContratoController: ControllerBase {
|
||||
Contrato? cont = RepositorioContratos.Singleton.ObtenerContratoPorId(idcontrato);
|
||||
if (cont == null) return BadRequest();
|
||||
|
||||
if (cont.Dniinquilino != cli.Dni && cont.Dnipropietario != cli.Dni) return BadRequest();
|
||||
if ((cont.Dniinquilino != cli.Dni && cont.Dnipropietario != cli.Dni)|| !RepositorioGrupos.Singleton.CheckGrupos(Auth, "Admin")) return BadRequest();
|
||||
|
||||
var list = cont.Idgarantes;
|
||||
List<GaranteDto> l = new();
|
||||
@@ -835,4 +835,4 @@ public class ContratoController: ControllerBase {
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ public class VentaController:ControllerBase {
|
||||
if (mcon == null) throw new Exception();
|
||||
|
||||
mc = new MinioClient().WithCredentials(mcon.usr, mcon.scrt)
|
||||
.WithEndpoint("192.168.1.11:9000")
|
||||
.WithEndpoint("0.0.0.0:9000")
|
||||
.WithSSL(false)
|
||||
.Build();
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
builder.Services.AddMinio(options => options
|
||||
.WithCredentials(mcon.usr, mcon.scrt)
|
||||
.WithEndpoint("192.168.1.11:9000")
|
||||
.WithEndpoint("127.0.0.0:9000")
|
||||
.WithSSL(false)
|
||||
.Build());
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"usr":"u39RPWIpfVa5S67gGiNk",
|
||||
"scrt":"UzNdqpwpao7Cjh3VSyvZVw7IIXW8SQ9c1F2JsttY"
|
||||
"usr":"nwFNMLJcn5m0owbzeXMs",
|
||||
"scrt":"Mf9HxTir5mIGwWSBtQXd6DRK2k00V0EyXk7QTu70"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"usr":"aVO9C3PqeK1hiPCyqZCj",
|
||||
"scrt":"szj58kceWG3GcRZ8P1QCQiv5tSjMI7iD5zfjneTT"
|
||||
}
|
||||
"usr":"nwFNMLJcn5m0owbzeXMs",
|
||||
"scrt":"Mf9HxTir5mIGwWSBtQXd6DRK2k00V0EyXk7QTu70"
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public partial class AlquilaFacilContext : DbContext
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see https://go.microsoft.com/fwlink/?LinkId=723263.
|
||||
=> optionsBuilder.UseMySQL("Server=fedesrv.ddns.net;Port=30006;Database=AlquilaFacil;Uid=AlquilaFacil;Pwd=.n@9c2ve*0,b1ETv].Kipa/~pR~V;Connection Timeout=5;SslMode=none");
|
||||
=> optionsBuilder.UseMySQL("Server=127.0.0.1;Port=3306;Database=AlquilaFacil;Uid=AlquilaFacil;Pwd=.n@9c2ve*0,b1ETv].Kipa/~pR~V;Connection Timeout=5;SslMode=none");
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
@@ -419,6 +419,42 @@ public partial class AlquilaFacilContext : DbContext
|
||||
entity.Property(e => e.Nombre)
|
||||
.HasMaxLength(12)
|
||||
.HasColumnName("nombre");
|
||||
|
||||
entity.HasMany(d => d.IdGrupoHijos).WithMany(p => p.IdGrupoPadres)
|
||||
.UsingEntity<Dictionary<string, object>>(
|
||||
"GrupoSubgrupo",
|
||||
r => r.HasOne<Grupo>().WithMany()
|
||||
.HasForeignKey("IdGrupoHijo")
|
||||
.HasConstraintName("Grupo_Subgrupo_ibfk_2"),
|
||||
l => l.HasOne<Grupo>().WithMany()
|
||||
.HasForeignKey("IdGrupoPadre")
|
||||
.HasConstraintName("Grupo_Subgrupo_ibfk_1"),
|
||||
j =>
|
||||
{
|
||||
j.HasKey("IdGrupoPadre", "IdGrupoHijo").HasName("PRIMARY");
|
||||
j.ToTable("Grupo_Subgrupo");
|
||||
j.HasIndex(new[] { "IdGrupoHijo" }, "IdGrupoHijo");
|
||||
j.IndexerProperty<int>("IdGrupoPadre").HasColumnType("int(11)");
|
||||
j.IndexerProperty<int>("IdGrupoHijo").HasColumnType("int(11)");
|
||||
});
|
||||
|
||||
entity.HasMany(d => d.IdGrupoPadres).WithMany(p => p.IdGrupoHijos)
|
||||
.UsingEntity<Dictionary<string, object>>(
|
||||
"GrupoSubgrupo",
|
||||
r => r.HasOne<Grupo>().WithMany()
|
||||
.HasForeignKey("IdGrupoPadre")
|
||||
.HasConstraintName("Grupo_Subgrupo_ibfk_1"),
|
||||
l => l.HasOne<Grupo>().WithMany()
|
||||
.HasForeignKey("IdGrupoHijo")
|
||||
.HasConstraintName("Grupo_Subgrupo_ibfk_2"),
|
||||
j =>
|
||||
{
|
||||
j.HasKey("IdGrupoPadre", "IdGrupoHijo").HasName("PRIMARY");
|
||||
j.ToTable("Grupo_Subgrupo");
|
||||
j.HasIndex(new[] { "IdGrupoHijo" }, "IdGrupoHijo");
|
||||
j.IndexerProperty<int>("IdGrupoPadre").HasColumnType("int(11)");
|
||||
j.IndexerProperty<int>("IdGrupoHijo").HasColumnType("int(11)");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Log>(entity =>
|
||||
|
||||
@@ -4,14 +4,34 @@ using System.Text.Json.Serialization;
|
||||
|
||||
namespace Entidades;
|
||||
|
||||
public partial class Grupo
|
||||
public partial class Grupo:IComponenteSeguridad
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Nombre { get; set; } = null!;
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<Grupo> IdGrupoHijos { get; set; } = new List<Grupo>();
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<Grupo> IdGrupoPadres { get; set; } = new List<Grupo>();
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<Cliente> Idclientes { get; set; } = new List<Cliente>();
|
||||
|
||||
public virtual ICollection<Permiso> Idpermisos { get; set; } = new List<Permiso>();
|
||||
|
||||
public void ObtenerPermisos(HashSet<Permiso> permisos, HashSet<int> visitados)
|
||||
{
|
||||
if (visitados.Contains(Id)) return;
|
||||
visitados.Add(Id);
|
||||
foreach (var permiso in Idpermisos) {
|
||||
permisos.Add(permiso);
|
||||
}
|
||||
|
||||
foreach (var subgrupo in IdGrupoPadres) {
|
||||
subgrupo.ObtenerPermisos(permisos, visitados);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,12 +4,17 @@ using System.Text.Json.Serialization;
|
||||
|
||||
namespace Entidades;
|
||||
|
||||
public partial class Permiso
|
||||
public partial class Permiso:IComponenteSeguridad
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Descripcion { get; set; } = null!;
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<Grupo> Idgrupos { get; set; } = new List<Grupo>();
|
||||
|
||||
public void ObtenerPermisos(HashSet<Permiso> permisos, HashSet<int> visitados)
|
||||
{
|
||||
permisos.Add(this);
|
||||
}
|
||||
}
|
||||
|
||||
5
Entidades/SeguridadComposite/ComponenteSeguridad.cs
Normal file
5
Entidades/SeguridadComposite/ComponenteSeguridad.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
namespace Entidades;
|
||||
|
||||
public interface IComponenteSeguridad {
|
||||
public void ObtenerPermisos(HashSet<Permiso> permisos, HashSet<int> visitados);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
run:
|
||||
dotnet ef dbcontext scaffold "Server=fedesrv.ddns.net;Port=30006;Database=AlquilaFacil;Uid=AlquilaFacil;Pwd=.n@9c2ve*0,b1ETv].Kipa/~pR~V;Connection Timeout=5;SslMode=none" MySql.EntityFrameworkCore -o .
|
||||
dotnet ef dbcontext scaffold "Server=127.0.0.1;Port=3306;Database=AlquilaFacil;Uid=AlquilaFacil;Pwd=.n@9c2ve*0,b1ETv].Kipa/~pR~V;Connection Timeout=5;SslMode=none" MySql.EntityFrameworkCore -o .
|
||||
./convert_to_pascalcase.sh
|
||||
|
||||
clean:
|
||||
|
||||
20
Front/package-lock.json
generated
20
Front/package-lock.json
generated
@@ -9,6 +9,7 @@
|
||||
"version": "0.0.0",
|
||||
"dependencies": {
|
||||
"@sveltestrap/sveltestrap": "^6.2.8",
|
||||
"bootstrap": "^5.3.3",
|
||||
"chartjs": "^0.3.24",
|
||||
"svelte-routing": "^2.13.0"
|
||||
},
|
||||
@@ -206,6 +207,25 @@
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/bootstrap": {
|
||||
"version": "5.3.3",
|
||||
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.3.tgz",
|
||||
"integrity": "sha512-8HLCdWgyoMguSO9o+aH+iuZ+aht+mzW0u3HIMzVu7Srrpv7EBBxTnrFlSCskwdY1+EOFQSm7uMJhNQHkdPcmjg==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/twbs"
|
||||
},
|
||||
{
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/bootstrap"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"@popperjs/core": "^2.11.8"
|
||||
}
|
||||
},
|
||||
"node_modules/chartjs": {
|
||||
"version": "0.3.24",
|
||||
"license": "MIT"
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@sveltestrap/sveltestrap": "^6.2.8",
|
||||
"bootstrap": "^5.3.3",
|
||||
"chartjs": "^0.3.24",
|
||||
"svelte-routing": "^2.13.0"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import 'bootstrap/dist/css/bootstrap.min.css';
|
||||
import Login from "./paginas/login.svelte";
|
||||
import { Router, Route, link } from 'svelte-routing';
|
||||
import MenuPage from './paginas/menu.svelte';
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
disabled={!contratoDescargado}
|
||||
/>
|
||||
<label class="form-check-label" for="leiContratoCheckbox">
|
||||
Firme el contrato con el agente de la inmobiliaria
|
||||
Leí el contrato con el agente de la inmobiliaria
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -33,9 +33,29 @@
|
||||
onMount(()=>{
|
||||
getparams();
|
||||
obtenerDatosACargar();
|
||||
|
||||
getgarantes();
|
||||
});
|
||||
|
||||
|
||||
async function getgarantes() {
|
||||
try{
|
||||
const ret = await fetch($urlG+"/api/contratos/garantes"+"?idcontrato="+contratoid,{
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Auth": token
|
||||
},
|
||||
});
|
||||
if (!ret.ok){
|
||||
let data = await ret.json();
|
||||
modaldata = data.message;
|
||||
return;
|
||||
}
|
||||
let data = await ret.json();
|
||||
garantes = data;
|
||||
return;
|
||||
}catch{
|
||||
modaldata = "No se pudo obtener la lista de garantes actualizada";
|
||||
}
|
||||
}
|
||||
async function refreshCanon() {
|
||||
try {
|
||||
const ret = await fetch($urlG+"/api/admin/contrato/canons?id="+contratoid, {
|
||||
@@ -313,4 +333,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -144,9 +144,12 @@
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="hea2">
|
||||
<button class="accordion-button"
|
||||
<button class="accordion-button collapsed"
|
||||
type="button"
|
||||
data-bs-toggle="collapse"
|
||||
data-bs-target="#c2"
|
||||
aria-expanded="false"
|
||||
aria-controls="c2"
|
||||
onclick={()=>{
|
||||
if(visibleMesesDuracion === true){
|
||||
visibleMesesDuracion=false;
|
||||
@@ -194,4 +197,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
import { readable, type Readable } from 'svelte/store';
|
||||
|
||||
export const urlG: Readable<string> = readable('https://fedesrv.ddns.net');
|
||||
export const urlG: Readable<string> = readable('http://127.0.0.1:5007');
|
||||
|
||||
Reference in New Issue
Block a user