yavsc/Yavsc/Models/Billing/Estimate.cs

84 lines
2.5 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
namespace Yavsc.Models.Billing
{
8 years ago
using Models.Workflow;
8 years ago
using Newtonsoft.Json;
8 years ago
using YavscLib.Workflow;
8 years ago
public partial class Estimate : IEstimate
{
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long Id { get; set; }
public long? CommandId { get; set; }
/// <summary>
/// A command is not required to create
/// an estimate,
/// it will result in a new estimate template
/// </summary>
/// <returns></returns>
8 years ago
[ForeignKey("CommandId"),JsonIgnore]
8 years ago
public RdvQuery Query { get; set; }
public string Description { get; set; }
public string Title { get; set; }
8 years ago
[InverseProperty("Estimate")]
public virtual List<CommandLine> Bill { get; set; }
/// <summary>
/// List of attached graphic files
/// to this estimate, as relative pathes to
/// the command performer's root path.
/// In db, they are separated by <c>:</c>
/// </summary>
/// <returns></returns>
[NotMapped]
public List<string> AttachedGraphics { get; set; }
8 years ago
public string AttachedGraphicsString
{
get { return string.Join(":", AttachedGraphics); }
8 years ago
set { AttachedGraphics = value.Split(':').ToList(); }
}
/// <summary>
/// List of attached files
/// to this estimate, as relative pathes to
/// the command performer's root path.
/// In db, they are separated by <c>:</c>
/// </summary>
/// <returns></returns>
[NotMapped]
public List<string> AttachedFiles { get; set; }
8 years ago
public string AttachedFilesString
{
get { return string.Join(":", AttachedFiles); }
8 years ago
set { AttachedFiles = value.Split(':').ToList(); }
}
[Required]
public string OwnerId { get; set; }
8 years ago
[ForeignKey("OwnerId"),JsonIgnore]
public virtual PerformerProfile Owner { get; set; }
[Required]
public string ClientId { get; set; }
8 years ago
[ForeignKey("ClientId"),JsonIgnore]
public virtual ApplicationUser Client { get; set; }
8 years ago
[Required]
8 years ago
public string CommandType
{
get; set;
}
8 years ago
public DateTime ProviderValidationDate { get; set; }
public DateTime ClientValidationDate { get; set; }
}
}