diff --git a/Entidades/Alquilafacilcontext.cs b/Entidades/Alquilafacilcontext.cs index 8f0a69a..fefa5b9 100644 --- a/Entidades/Alquilafacilcontext.cs +++ b/Entidades/Alquilafacilcontext.cs @@ -33,6 +33,8 @@ public partial class AlquilaFacilContext : DbContext public virtual DbSet Grupos { get; set; } + public virtual DbSet Notificaciones { get; set; } + public virtual DbSet Permisos { get; set; } public virtual DbSet Propiedades { get; set; } @@ -371,6 +373,49 @@ public partial class AlquilaFacilContext : DbContext .HasColumnName("nombre"); }); + modelBuilder.Entity(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(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(entity => { entity.HasKey(e => e.Id).HasName("PRIMARY"); diff --git a/Entidades/Cliente.cs b/Entidades/Cliente.cs index ef52593..bc7313b 100644 --- a/Entidades/Cliente.cs +++ b/Entidades/Cliente.cs @@ -27,6 +27,10 @@ public partial class Cliente public virtual ICollection ContratoDnipropietarioNavigations { get; set; } = new List(); + public virtual Notificacione? NotificacioneDniclienteNavigation { get; set; } + + public virtual ICollection NotificacioneDniremitenteNavigations { get; set; } = new List(); + public virtual ICollection Propiedades { get; set; } = new List(); public virtual ICollection VentaIdCompradorNavigations { get; set; } = new List(); diff --git a/Entidades/Notificacione.cs b/Entidades/Notificacione.cs new file mode 100644 index 0000000..8fbe3e6 --- /dev/null +++ b/Entidades/Notificacione.cs @@ -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!; +} diff --git a/Entidades/Propiedade.cs b/Entidades/Propiedade.cs index c5ca2b2..4a4812c 100644 --- a/Entidades/Propiedade.cs +++ b/Entidades/Propiedade.cs @@ -31,6 +31,8 @@ public partial class Propiedade public virtual TipoPropiedad IdtipropiedadNavigation { get; set; } = null!; + public virtual ICollection Notificaciones { get; set; } = new List(); + public virtual ICollection Venta { get; set; } = new List(); public virtual ICollection IdServicios { get; set; } = new List(); diff --git a/Front/src/paginas/Notificaciones.svelte b/Front/src/paginas/Notificaciones.svelte index e260581..7b70d96 100644 --- a/Front/src/paginas/Notificaciones.svelte +++ b/Front/src/paginas/Notificaciones.svelte @@ -1,7 +1,75 @@ - \ No newline at end of file + + +{#if modaldata} + !!(modaldata = "")} /> +{/if} + +
+
+ +
+ + +
+
+
+ {#if showspinner} +
+
+ Cargando... + +
+ {:else} + + + + + + + + + + + + + {#each mensajes as men } + + + + + + + + {/each} + +
RemitenteAccionMensajeFechaPropiedad
men.remitentemen.accionmen.mensajemen.fechamen.propiedad
+ {/if} +
+
\ No newline at end of file diff --git a/Front/src/types.d.ts b/Front/src/types.d.ts index f391145..1733c51 100644 --- a/Front/src/types.d.ts +++ b/Front/src/types.d.ts @@ -54,3 +54,12 @@ export type Propiedad = { idtipropiedad: number, monto: number }; + +export type MensajeDto = { + remitente: string, + accion: string, + mensaje: string, + fecha: Date, + propiedad: string, + +} \ No newline at end of file