Files
sockeye/server/models/License.cs
2022-12-22 01:47:53 +00:00

52 lines
1.9 KiB
C#

using System;
using System.Collections.Generic;
using Sockeye.Biz;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
namespace Sockeye.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 License : ICoreBizObjectModel
{
public long Id { get; set; }
public uint Concurrency { get; set; }
public DateTime Created { get; set; }
public long CustomerId { get; set; }
[NotMapped]
public string CustomerViz { get; set; }
public string RegTo { get; set; }
public string Key { get; set; }
public string FetchCode { get; set; }
public string FetchEmail { get; set; }
public DateTime FetchedOn { get; set; }
public string DbId { get; set; }
public DateTime LicenseExpire { get; set; }
public DateTime MaintenanceExpire { get; set; }
public string Wiki { get; set; }
public string CustomFields { get; set; }
public List<string> Tags { get; set; }
public License()
{
Tags = new List<string>();
}
[NotMapped, JsonIgnore]
public SockType SType { get => SockType.License; }
}//eoc
}//eons
/*
await ExecQueryAsync("CREATE TABLE alicense (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, created TIMESTAMPTZ NOT NULL, "
+ "customerid BIGINT NOT NULL REFERENCES acustomer(id), regto TEXT NOT NULL, key TEXT NOT NULL, fetchcode TEXT, fetchemail TEXT, "
+ "fetchedon TIMESTAMPTZ, dbid TEXT, licenseexpire TIMESTAMPTZ, maintenanceexpire TIMESTAMPTZ NOT NULL, "
+ "wiki TEXT, customfields TEXT, tags VARCHAR(255) ARRAY )");
*/