This commit is contained in:
2021-08-02 22:28:30 +00:00
parent 5ecf1a2620
commit f522dda8f1
9 changed files with 104 additions and 41 deletions

View File

@@ -43,7 +43,7 @@ namespace AyaNova.Models
public virtual DbSet<LoanUnit> LoanUnit { get; set; }
public virtual DbSet<NotifySubscription> NotifySubscription { get; set; }
public virtual DbSet<NotifyEvent> NotifyEvent { get; set; }
public virtual DbSet<Notification> Notification { get; set; }
public virtual DbSet<InAppNotification> InAppNotification { get; set; }
public virtual DbSet<NotifyDeliveryLog> NotifyDeliveryLog { get; set; }
public virtual DbSet<Part> Part { get; set; }
public virtual DbSet<PartInventory> PartInventory { get; set; }

View File

@@ -1,15 +1,12 @@
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 Notification
public class InAppNotification
{
public long Id { get; set; }
public uint Concurrency { get; set; }
@@ -32,7 +29,7 @@ namespace AyaNova.Models
[Required]
public bool Fetched { get; set; }
public Notification()
public InAppNotification()
{
Created = DateTime.UtcNow;
Fetched = false;

View File

@@ -6,8 +6,11 @@ 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
//This model holds the deliveries that have been attempted in the past 90 days (cleaned out by corenotifysweeper)
//it is used for verification / troubleshooting purposes from the OPS log
//and also used as a circuit breaker by the corejobnotify to ensure users are not spammed with identical messages
public class NotifyDeliveryLog
{
@@ -16,20 +19,21 @@ namespace AyaNova.Models
[Required]
public DateTime Processed { get; set; }
public AyaType AyaType { get; set; }
//public AyaType AyaType { get; set; }
public long ObjectId { get; set; }
[Required]
public NotifyEventType EventType { get; set; }
// [Required]
//public NotifyEventType EventType { get; set; }
[Required]
public long NotifySubscriptionId { get; set; }
[Required]
public long IdValue { get; set; }
[Required]
public decimal DecValue { get; set; }
[Required]
public long UserId { get; set; }
[Required]
public NotifyDeliveryMethod DeliveryMethod { get; set; }
// [Required]
// public long IdValue { get; set; }
//[Required]
// public decimal DecValue { get; set; }
// [Required]
// public long UserId { get; set; }
// [Required]
// public NotifyDeliveryMethod DeliveryMethod { get; set; }
[Required]
public bool Fail { get; set; }
public string Error { get; set; }
@@ -38,9 +42,11 @@ namespace AyaNova.Models
public NotifyDeliveryLog()
{
Processed = DateTime.UtcNow;
IdValue = 0;
DecValue = 0;
AyaType = AyaType.NoType;
Fail = false;
// IdValue = 0;
// DecValue = 0;
// AyaType = AyaType.NoType;
ObjectId = 0;
}

View File

@@ -14,6 +14,7 @@ namespace AyaNova.Models
//it's the result of an event happening, not the subscription which is seperate and decides who gets what
//when an object is modified it may create a NotifyEvent record if anyone subscribes to that event
//it will create one of these for every user with that subscription
//which will then be delivered as a notification later when the corejobnotify job runs if it's deliverable
public class NotifyEvent
{
public long Id { get; set; }