refactoring
This commit is contained in:
@ -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; }
|
||||
|
||||
|
@ -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()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
24
Yavsc.Server/Models/IT/ProjectBuildConfiguration.cs
Normal file
24
Yavsc.Server/Models/IT/ProjectBuildConfiguration.cs
Normal 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; }
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user