Files
raven/server/AyaNova/models/NotifySubscription.cs
2020-07-16 17:58:23 +00:00

44 lines
1.8 KiB
C#

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 NotifySubscription
{
public long Id { get; set; }
public uint Concurrency { get; set; }
[Required]
public long UserId { 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; }
public decimal? DecValue { get; set; }
public TimeSpan? AgeValue {get;set;}//for events that depend on an age of something (e.g. WorkorderStatusAge)
[Required]
public NotifyDeliveryMethod DeliveryMethod { get; set; }
public string DeliveryAddress { get; set; }
public long? AttachReportId { get; set; }
//CONDITIONS - Following fields are all conditions set on whether to notify or not
public AyaType AyaType { get; set; }//Note: must be specific object, not global for any object related stuff to avoid many role issues and also potential overload
[Required]
public NotifyEventType EventType { get; set; }
public List<string> Tags { get; set; }//Tags to filter an event, object *must* have these tags to generate event related to it (AT TIME OF UPDATE)
public NotifySubscription()
{
Tags = new List<string>();
AyaType= AyaType.NoType;
}
}//eoc
}//eons