refactoring

This commit is contained in:
2018-08-01 06:12:42 +02:00
parent 29d85a0ccf
commit 8246d59ca9
20 changed files with 152 additions and 131 deletions

View File

@ -13,7 +13,7 @@ namespace Yavsc.Models.Billing
using Yavsc.Abstract.Workflow;
using Yavsc.Services;
public abstract class NominativeServiceCommand : IBaseTrackedEntity, INominativeQuery, IIdentified<long>
public abstract class NominativeServiceCommand : IBaseTrackedEntity, IDecidableQuery, IIdentified<long>
{
public string GetInvoiceId() { return GetType().Name + "/" + Id; }

View File

@ -1,37 +1,20 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using Yavsc.Abstract.IT;
using Yavsc.Billing;
using Yavsc.Models.Billing;
using Yavsc.Server.Models.IT.SourceCode;
namespace Yavsc.Server.Models.IT
{
public class ProjectBuildConfiguration
{
[Key]
public long Id { get; set; }
[Required]
public string Name { get; set; }
public long ProjectId { get; set; }
[ForeignKey("ProjectId")]
public virtual Project TargetProject { get; set; }
}
public class Project : NominativeServiceCommand
public class Project : NominativeServiceCommand, IProject
{
[Key]
public override long Id { get; set ; }
public override long Id { get; set; }
public string OwnerId { get; set; }
/// <summary>
/// This field is something like a key,
/// since it is required non null,
@ -51,22 +34,28 @@ namespace Yavsc.Server.Models.IT
[ForeignKey("Name")]
public virtual GitRepositoryReference Repository { get; set; }
List<IBillItem> bill = new List<IBillItem> ();
List<IBillItem> bill = new List<IBillItem>();
public void AddBillItem(IBillItem item)
{
bill.Add(item);
}
public override List<IBillItem> GetBillItems()
{
return bill;
}
public IEnumerable<string> GetConfigurations()
{
return Configurations.Select(c => c.Name);
}
string description;
public override string Description => description;
public Project()
{
}
}
}

View File

@ -0,0 +1,24 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Yavsc.Server.Models.IT
{
public class ProjectBuildConfiguration
{
/// <summary>
/// A Numerical Id
/// </summary>
/// <value></value>
[Key]
public long Id { get; set; }
[Required]
public string Name { get; set; }
public long ProjectId { get; set; }
[ForeignKey("ProjectId")]
public virtual Project TargetProject { get; set; }
}
}