Inicio del desarrollo del sistema de notificaciones

This commit is contained in:
2025-01-05 17:23:33 -03:00
parent 57bfb42f00
commit c1c088813a
6 changed files with 154 additions and 1 deletions

View File

@@ -33,6 +33,8 @@ public partial class AlquilaFacilContext : DbContext
public virtual DbSet<Grupo> Grupos { get; set; }
public virtual DbSet<Notificacione> Notificaciones { get; set; }
public virtual DbSet<Permiso> Permisos { get; set; }
public virtual DbSet<Propiedade> Propiedades { get; set; }
@@ -371,6 +373,49 @@ public partial class AlquilaFacilContext : DbContext
.HasColumnName("nombre");
});
modelBuilder.Entity<Notificacione>(entity =>
{
entity.HasKey(e => e.Dnicliente).HasName("PRIMARY");
entity.HasIndex(e => e.Idpropiedad, "FK_NOTPROP");
entity.HasIndex(e => e.Dniremitente, "FK_NOTREM");
entity.Property(e => e.Dnicliente)
.HasColumnType("bigint(20)")
.HasColumnName("dnicliente");
entity.Property(e => e.Accion)
.HasMaxLength(15)
.HasColumnName("accion");
entity.Property(e => e.Dniremitente)
.HasColumnType("bigint(20)")
.HasColumnName("dniremitente");
entity.Property(e => e.Fecha)
.HasColumnType("date")
.HasColumnName("fecha");
entity.Property(e => e.Idpropiedad)
.HasColumnType("int(11)")
.HasColumnName("idpropiedad");
entity.Property(e => e.Mensaje)
.HasMaxLength(255)
.HasColumnName("mensaje");
entity.HasOne(d => d.DniclienteNavigation).WithOne(p => p.NotificacioneDniclienteNavigation)
.HasForeignKey<Notificacione>(d => d.Dnicliente)
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("FK_NOTCLI");
entity.HasOne(d => d.DniremitenteNavigation).WithMany(p => p.NotificacioneDniremitenteNavigations)
.HasForeignKey(d => d.Dniremitente)
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("FK_NOTREM");
entity.HasOne(d => d.IdpropiedadNavigation).WithMany(p => p.Notificaciones)
.HasForeignKey(d => d.Idpropiedad)
.OnDelete(DeleteBehavior.Restrict)
.HasConstraintName("FK_NOTPROP");
});
modelBuilder.Entity<Permiso>(entity =>
{
entity.HasKey(e => e.Id).HasName("PRIMARY");

View File

@@ -27,6 +27,10 @@ public partial class Cliente
public virtual ICollection<Contrato> ContratoDnipropietarioNavigations { get; set; } = new List<Contrato>();
public virtual Notificacione? NotificacioneDniclienteNavigation { get; set; }
public virtual ICollection<Notificacione> NotificacioneDniremitenteNavigations { get; set; } = new List<Notificacione>();
public virtual ICollection<Propiedade> Propiedades { get; set; } = new List<Propiedade>();
public virtual ICollection<Venta> VentaIdCompradorNavigations { get; set; } = new List<Venta>();

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
namespace Entidades;
public partial class Notificacione
{
public long Dnicliente { get; set; }
public long Dniremitente { get; set; }
public DateTime Fecha { get; set; }
public string Mensaje { get; set; } = null!;
public string Accion { get; set; } = null!;
public int Idpropiedad { get; set; }
public virtual Cliente DniclienteNavigation { get; set; } = null!;
public virtual Cliente DniremitenteNavigation { get; set; } = null!;
public virtual Propiedade IdpropiedadNavigation { get; set; } = null!;
}

View File

@@ -31,6 +31,8 @@ public partial class Propiedade
public virtual TipoPropiedad IdtipropiedadNavigation { get; set; } = null!;
public virtual ICollection<Notificacione> Notificaciones { get; set; } = new List<Notificacione>();
public virtual ICollection<Venta> Venta { get; set; } = new List<Venta>();
public virtual ICollection<Servicio> IdServicios { get; set; } = new List<Servicio>();