diff --git a/server/AyaNova/models/AyContext.cs b/server/AyaNova/models/AyContext.cs index 61c4d836..58c9d415 100644 --- a/server/AyaNova/models/AyContext.cs +++ b/server/AyaNova/models/AyContext.cs @@ -30,8 +30,9 @@ namespace AyaNova.Models public virtual DbSet Contract { get; set; } public virtual DbSet HeadOffice { get; set; } public virtual DbSet LoanUnit { get; set; } - + public virtual DbSet NotifySubscription { get; set; } + public virtual DbSet NotifyEvent { get; set; } public virtual DbSet Part { get; set; } public virtual DbSet PM { get; set; } diff --git a/server/AyaNova/models/NotifyEvent.cs b/server/AyaNova/models/NotifyEvent.cs new file mode 100644 index 00000000..2e48a984 --- /dev/null +++ b/server/AyaNova/models/NotifyEvent.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using AyaNova.Biz; +using System.ComponentModel.DataAnnotations; +using Newtonsoft.Json; + +namespace AyaNova.Models +{ + //NOTE: Any non required field (nullable in DB) sb nullable here, i.e. decimal? not decimal, + //otherwise the server will call it an invalid record if the field isn't sent from client + + public class NotifyEvent + { + public long Id { get; set; } + public uint Concurrency { get; set; } + + [Required] + public DateTime Created { get; set; } + public AyaType? AyaType { get; set; } + public long? ObjectId { get; set; } + [Required] + public NotifyEventType EventType { get; set; } + [Required] + public long SubscriptionId { get; set; } + public long? IdValue { get; set; } + public decimal? DecValue { get; set; } + public DateTime? EventDate { get; set; } + public string Message { get; set; } + + + public NotifyEvent() + { + Created = DateTime.UtcNow; + } + + }//eoc + +}//eons diff --git a/server/AyaNova/util/AySchema.cs b/server/AyaNova/util/AySchema.cs index 68eb945d..2391963f 100644 --- a/server/AyaNova/util/AySchema.cs +++ b/server/AyaNova/util/AySchema.cs @@ -685,7 +685,7 @@ $BODY$; "idvalue bigint, decvalue decimal(19,4), deliverymethod integer not null, deliveryaddress text, attachreportid bigint, intags varchar(255) ARRAY, outtags varchar(255) ARRAY)"); await ExecQueryAsync("CREATE TABLE anotifyevent (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, created timestamp not null, " + - "ayatype integer, objectid bigint, eventtype integer not null, subscriptionid bigint not null, idvalue bigint, decvalue decimal(19,4), eventdate timestamp, savedmessage text"); + "ayatype integer, objectid bigint, eventtype integer not null, subscriptionid bigint not null, idvalue bigint, decvalue decimal(19,4), eventdate timestamp, message text"); await ExecQueryAsync("CREATE TABLE anotification (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, ayatype integer, objectid bigint, eventtype integer not null, subscriptionid bigint not null, message text");