Files
raven/server/AyaNova/models/Memo.cs
2020-12-14 19:39:55 +00:00

57 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
using AyaNova.Biz;
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 Memo : ICoreBizObjectModel
{
public long Id { get; set; }
public uint Concurrency { get; set; }
[Required]
public string Name { get; set; }//"subject"
public string Notes { get; set; }//"message"
public string Wiki { get; set; }
public string CustomFields { get; set; }
public List<string> Tags { get; set; }
public bool Viewed { get; set; }
public bool Replied { get; set; }
public long? FromId { get; set; }
public long? ToId { get; set; }
public DateTime Sent { get; set; }//redundant but displayed all over the place in the UI so properly redundant
public Memo()
{
Tags = new List<string>();
Sent = DateTime.UtcNow;
}
[NotMapped, JsonIgnore]
public AyaType AyaType { get => AyaType.Memo; }
}//eoc
}//eons
/*
CREATE TABLE [dbo].[AMEMO](
[AID] [uniqueidentifier] NOT NULL,
[ACREATED] [datetime] NULL,
[AMODIFIED] [datetime] NULL,
[ACREATOR] [uniqueidentifier] NULL,
[AMODIFIER] [uniqueidentifier] NULL,
[ASUBJECT] [nvarchar](255) NULL,
[AMESSAGE] [ntext] NULL,
[AFROMID] [uniqueidentifier] NOT NULL,
[ATOID] [uniqueidentifier] NOT NULL,
[AVIEWED] [bit] NOT NULL,
[AREPLIED] [bit] NOT NULL,
*/