This commit is contained in:
2020-07-09 21:49:41 +00:00
parent dc5945d308
commit 64fa92cffc
3 changed files with 41 additions and 2 deletions

View File

@@ -30,8 +30,9 @@ namespace AyaNova.Models
public virtual DbSet<Contract> Contract { get; set; }
public virtual DbSet<HeadOffice> HeadOffice { get; set; }
public virtual DbSet<LoanUnit> LoanUnit { get; set; }
public virtual DbSet<NotifySubscription> NotifySubscription { get; set; }
public virtual DbSet<NotifyEvent> NotifyEvent { get; set; }
public virtual DbSet<Part> Part { get; set; }
public virtual DbSet<PM> PM { get; set; }

View File

@@ -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

View File

@@ -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");