Inicio del desarrollo del sistema de notificaciones
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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>();
|
||||
|
||||
25
Entidades/Notificacione.cs
Normal file
25
Entidades/Notificacione.cs
Normal 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!;
|
||||
}
|
||||
@@ -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>();
|
||||
|
||||
Reference in New Issue
Block a user