59 lines
1.8 KiB
C#
59 lines
1.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using AyaNova.Biz;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace AyaNova.Models
|
|
{
|
|
//Customer notification event
|
|
public class CustomerNotifyEvent
|
|
{
|
|
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 string Name { get; set; }//object name or closest equivalent for display
|
|
[Required]
|
|
public NotifyEventType EventType { get; set; }
|
|
[Required]
|
|
public long CustomerId { get; set; }
|
|
[Required]
|
|
public long CustomerNotifySubscriptionId { get; set; }//source subscription that triggered this event to be created
|
|
|
|
public decimal DecValue { get; set; }
|
|
|
|
//date of the event actually occuring, e.g. WarrantyExpiry date. Compared with subscription to determine if deliverable or not
|
|
public DateTime EventDate { get; set; }
|
|
public string Subject { get; set; }//email subject line
|
|
public string Message { get; set; }//email body
|
|
|
|
|
|
|
|
public CustomerNotifyEvent()
|
|
{
|
|
Created = EventDate = DateTime.UtcNow;
|
|
// IdValue = 0;
|
|
DecValue = 0;
|
|
AyaType = AyaType.NoType;
|
|
ObjectId = 0;
|
|
Name = string.Empty;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.None);
|
|
}
|
|
|
|
//linked entity
|
|
// public NotifySubscription NotifySubscription { get; set; }
|
|
// public User User { get; set; }
|
|
|
|
}//eoc
|
|
|
|
}//eons
|