This commit is contained in:
20
server/AyaNova/biz/NotifyDeliveryMethod.cs
Normal file
20
server/AyaNova/biz/NotifyDeliveryMethod.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
namespace AyaNova.Biz
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// All AyaNova notification delivery methods
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public enum NotifyDeliveryMethod : int
|
||||||
|
{
|
||||||
|
|
||||||
|
App = 1,//deliver in app via notification system
|
||||||
|
SMTP = 2//deliver to an email address or other entity reachable via smtp such as sms from email etc
|
||||||
|
|
||||||
|
//NEW ITEMS REQUIRE translation KEYS
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}//eons
|
||||||
@@ -30,6 +30,9 @@ namespace AyaNova.Models
|
|||||||
public virtual DbSet<Contract> Contract { get; set; }
|
public virtual DbSet<Contract> Contract { get; set; }
|
||||||
public virtual DbSet<HeadOffice> HeadOffice { get; set; }
|
public virtual DbSet<HeadOffice> HeadOffice { get; set; }
|
||||||
public virtual DbSet<LoanUnit> LoanUnit { get; set; }
|
public virtual DbSet<LoanUnit> LoanUnit { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<NotifySubscription> NotifySubscription { get; set; }
|
||||||
|
|
||||||
public virtual DbSet<Part> Part { get; set; }
|
public virtual DbSet<Part> Part { get; set; }
|
||||||
public virtual DbSet<PM> PM { get; set; }
|
public virtual DbSet<PM> PM { get; set; }
|
||||||
public virtual DbSet<PMItem> PMItem { get; set; }
|
public virtual DbSet<PMItem> PMItem { get; set; }
|
||||||
|
|||||||
@@ -8,35 +8,31 @@ namespace AyaNova.Models
|
|||||||
{
|
{
|
||||||
//NOTE: Any non required field (nullable in DB) sb nullable here, i.e. decimal? not decimal,
|
//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
|
//otherwise the server will call it an invalid record if the field isn't sent from client
|
||||||
|
|
||||||
public class NotifySubscription : ICoreBizObjectModel
|
public class NotifySubscription
|
||||||
{
|
{
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
public uint Concurrency { get; set; }
|
public uint Concurrency { get; set; }
|
||||||
|
|
||||||
[Required]
|
|
||||||
public long SubscriberId { get; set; }
|
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
public long SubscriberAyaType { get; set; }
|
public long UserId { get; set; }
|
||||||
|
public AyaType? AyaType { get; set; }
|
||||||
|
[Required]
|
||||||
|
public NotifyEventType EventType { get; set; }
|
||||||
|
public TimeSpan? AdvanceNotice { get; set; } //Note: I've been doing nullable wrong sort of: https://stackoverflow.com/a/29149207/8939
|
||||||
|
public long? IdValue { get; set; }
|
||||||
[Required]
|
public decimal? DecValue { get; set; }
|
||||||
public string Name { get; set; }
|
[Required]
|
||||||
|
public NotifyDeliveryMethod DeliveryMethod { get; set; }
|
||||||
public bool Active { get; set; }
|
public string DeliveryAddress { get; set; }
|
||||||
public string Notes { get; set; }
|
public long? AttachReportId { get; set; }
|
||||||
public string Wiki {get;set;}
|
public List<string> InTags { get; set; }
|
||||||
public string CustomFields { get; set; }
|
public List<string> OutTags { get; set; }
|
||||||
public List<string> Tags { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public NotifySubscription()
|
public NotifySubscription()
|
||||||
{
|
{
|
||||||
Tags = new List<string>();
|
InTags = new List<string>();
|
||||||
|
OutTags = new List<string>();
|
||||||
}
|
}
|
||||||
|
|
||||||
}//eoc
|
}//eoc
|
||||||
|
|||||||
@@ -682,15 +682,15 @@ $BODY$;
|
|||||||
|
|
||||||
await ExecQueryAsync("CREATE TABLE anotifysubscription (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, " +
|
await ExecQueryAsync("CREATE TABLE anotifysubscription (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, " +
|
||||||
"userid bigint not null, ayatype integer, eventtype integer not null, advancenotice interval, " +
|
"userid bigint not null, ayatype integer, eventtype integer not null, advancenotice interval, " +
|
||||||
"idvalue integer, decvalue decimal(19,4), deliverymethod integer not null, deliveryaddress text, attachreportid bigint, intags varchar(255) ARRAY, outtags varchar(255) ARRAY)");
|
"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, " +
|
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 integer, 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, savedmessage 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");
|
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");
|
||||||
|
|
||||||
await ExecQueryAsync("CREATE TABLE anotifydeliverylog (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, ayatype integer, objectid bigint, "+
|
await ExecQueryAsync("CREATE TABLE anotifydeliverylog (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, ayatype integer, objectid bigint, "+
|
||||||
"eventtype integer not null, subscriptionid bigint not null, idvalue integer, decvalue decimal(19,4), processed timestamp not null, touserid bigint not null, deliverymethod integer not null, fail bool, error text");
|
"eventtype integer not null, subscriptionid bigint not null, idvalue bigint, decvalue decimal(19,4), processed timestamp not null, touserid bigint not null, deliverymethod integer not null, fail bool, error text");
|
||||||
|
|
||||||
await SetSchemaLevelAsync(++currentSchema);
|
await SetSchemaLevelAsync(++currentSchema);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user