102 lines
3.6 KiB
C#
102 lines
3.6 KiB
C#
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using AyaNova.Biz;
|
|
using Newtonsoft.Json;
|
|
using System;
|
|
|
|
namespace AyaNova.Models
|
|
{
|
|
|
|
|
|
public class Contract : ICoreBizObjectModel
|
|
{
|
|
public long Id { get; set; }
|
|
public uint Concurrency { get; set; }
|
|
|
|
[Required]
|
|
public string Name { get; set; }
|
|
public bool Active { get; set; }
|
|
public string Notes { get; set; }
|
|
public string Wiki { get; set; }
|
|
public string CustomFields { get; set; }
|
|
public List<string> Tags { get; set; }
|
|
|
|
//any optional ones here sb zero to indicate not set (or equivalent to zero)
|
|
[Required]
|
|
public TimeSpan ResponseTime { get; set; }
|
|
[Required]
|
|
public bool ContractServiceRatesOnly { get; set; }
|
|
[Required]
|
|
public bool ContractTravelRatesOnly { get; set; }
|
|
[Required]
|
|
public decimal PartsOverridePct { get; set; }
|
|
[Required]
|
|
public ContractOverrideType PartsOverrideType { get; set; }
|
|
[NotMapped]
|
|
public string PartsOverrideTypeViz { get; set; }
|
|
[Required]
|
|
public decimal ServiceRatesOverridePct { get; set; }
|
|
[Required]
|
|
public ContractOverrideType ServiceRatesOverrideType { get; set; }
|
|
[NotMapped]
|
|
public string ServiceRatesOverrideTypeViz { get; set; }
|
|
[Required]
|
|
public decimal TravelRatesOverridePct { get; set; }
|
|
[Required]
|
|
public ContractOverrideType TravelRatesOverrideType { get; set; }
|
|
[NotMapped]
|
|
public string TravelRatesOverrideTypeViz { get; set; }
|
|
public string AlertNotes { get; set; }//alert on workorder etc
|
|
|
|
|
|
public List<ContractServiceRate> ServiceRateItems { get; set; } = new List<ContractServiceRate>();
|
|
public List<ContractTravelRate> TravelRateItems { get; set; } = new List<ContractTravelRate>();
|
|
public List<ContractPartOverride> ContractPartOverrideItems { get; set; } = new List<ContractPartOverride>();
|
|
public List<ContractTravelRateOverride> ContractTravelRateOverrideItems { get; set; } = new List<ContractTravelRateOverride>();
|
|
public List<ContractServiceRateOverride> ContractServiceRateOverrideItems { get; set; } = new List<ContractServiceRateOverride>();
|
|
|
|
public Contract()
|
|
{
|
|
Tags = new List<string>();
|
|
}
|
|
|
|
[NotMapped, JsonIgnore]
|
|
public AyaType AyaType { get => AyaType.Contract; }
|
|
|
|
}//eoc
|
|
|
|
}//eons
|
|
|
|
/*
|
|
CREATE TABLE [dbo].[ACONTRACT](
|
|
[AID] [uniqueidentifier] NOT NULL,
|
|
[ACREATOR] [uniqueidentifier] NULL,
|
|
[AMODIFIER] [uniqueidentifier] NULL,
|
|
[ACREATED] [datetime] NULL,
|
|
[AMODIFIED] [datetime] NULL,
|
|
[ADISCOUNTPARTS] [decimal](19, 5) NULL,//rename PartsOverride
|
|
[ANAME] [nvarchar](255) NULL,
|
|
[AACTIVE] [bit] NOT NULL,
|
|
[ANOTES] [ntext] NULL,
|
|
[ACONTRACTRATESONLY] [bit] NOT NULL,
|
|
[ACUSTOM1] [ntext] NULL,
|
|
[ACUSTOM2] [ntext] NULL,
|
|
[ACUSTOM3] [ntext] NULL,
|
|
[ACUSTOM4] [ntext] NULL,
|
|
[ACUSTOM5] [ntext] NULL,
|
|
[ACUSTOM6] [ntext] NULL,
|
|
[ACUSTOM7] [ntext] NULL,
|
|
[ACUSTOM8] [ntext] NULL,
|
|
[ACUSTOM9] [ntext] NULL,
|
|
[ACUSTOM0] [ntext] NULL,
|
|
[AREGIONID] [uniqueidentifier] NULL,
|
|
|
|
|
|
CHILDREN
|
|
ContractRate - specific contract rates available to contract holding entities only
|
|
ContractTravel - specific contract travel rates only ''
|
|
ContractRateOverride - tags and discount / markup to apply collection
|
|
ContractTravelOverride - ''
|
|
ContractPartOverride - ''
|
|
*/ |