Files
sockeye/server/models/Purchase.cs
2023-01-20 01:28:14 +00:00

52 lines
1.9 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
using Sockeye.Biz;
namespace Sockeye.Models
{
public class Purchase : ICoreBizObjectModel
{
public long Id { get; set; }
public uint Concurrency { get; set; }
public long? CustomerId { get; set; }
[NotMapped]
public string CustomerViz { get; set; }
[Required]
public long VendorId { get; set; }
[NotMapped]
public string VendorViz { get; set; }
public long? ProductId { get; set; }//optional because a new vendor notification won't have a product set yet also pgroup will be NotSet
[Required]
public ProductGroup PGroup { get; set; }
[NotMapped]
public string ProductViz { get; set; }
public string SalesOrderNumber { get; set; }
[Required]
public DateTime PurchaseDate { get; set; }
public DateTime? ExpireDate { get; set; }
public DateTime? CancelDate { get; set; }
public string CouponCode { get; set; }
public string Notes { get; set; }
public bool RenewNoticeSent { get; set; } = false;
public int Quantity { get; set; } = 1;
public string VendorData { get; set; }
public bool Processed { get; set; } = false;//indicates it was processed, false means it should be processed
public string Wiki { get; set; }
public List<string> Tags { get; set; }
//workaround for notification
[NotMapped, JsonIgnore]
public string Name { get; set; }
public Purchase()
{
Tags = new List<string>();
}
[NotMapped, JsonIgnore]
public SockType SType { get => SockType.Purchase; }
}//eoc
}//eons