refactoring
This commit is contained in:
parent
797e4d381a
commit
8b5e50626e
40 changed files with 161 additions and 103 deletions
|
|
@ -2,10 +2,9 @@ using Yavsc.Models.Market;
|
|||
|
||||
namespace Yavsc.Models.Billing
|
||||
{
|
||||
|
||||
public class ServiceContract<P> where P : Service
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
|
||||
|
||||
public interface IBillingImpacter {
|
||||
decimal Impact(decimal orgValue);
|
||||
|
||||
}
|
||||
|
|
@ -8,6 +8,7 @@ namespace Yavsc.Models.Billing
|
|||
using Newtonsoft.Json;
|
||||
using Workflow;
|
||||
using YavscLib;
|
||||
using YavscLib.Models.Workflow;
|
||||
|
||||
public abstract class NominativeServiceCommand : IBaseTrackedEntity, IQuery
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@ namespace Yavsc.Models.Haircut
|
|||
{
|
||||
public class BrusherProfile : ISpecializationSettings
|
||||
{
|
||||
public BrusherProfile()
|
||||
{
|
||||
}
|
||||
|
||||
[Key]
|
||||
public string UserId
|
||||
{
|
||||
65
Yavsc/Models/HairCut/Haircut.cs
Normal file
65
Yavsc/Models/HairCut/Haircut.cs
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
using System;
|
||||
namespace YavscLib.Haircut
|
||||
{
|
||||
public interface IProviderInfo
|
||||
{
|
||||
|
||||
string UserId
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
string UserName
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
string Avatar
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
|
||||
public interface IHaircutQuery
|
||||
{
|
||||
|
||||
IProviderInfo ProviderInfo
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
long Id
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
IHairPrestation Prestation
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
long Status
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
ILocation Location
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
DateTime EventDate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
}
|
||||
19
Yavsc/Models/HairCut/IHairPrestation.cs
Normal file
19
Yavsc/Models/HairCut/IHairPrestation.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
namespace YavscLib
|
||||
{
|
||||
public interface IHairPrestation
|
||||
{
|
||||
long Id { get; set; }
|
||||
int Length { get; set; }
|
||||
int Gender { get; set; }
|
||||
bool Cut { get; set; }
|
||||
|
||||
int Dressing { get; set; }
|
||||
int Tech { get; set; }
|
||||
|
||||
bool Shampoo { get; set; }
|
||||
|
||||
long[] Taints { get; set; }
|
||||
|
||||
bool Cares { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -9,7 +9,7 @@ namespace Yavsc.Models.Haircut.Views
|
|||
public class HaircutQueryProviderInfo : HaircutQueryComonInfo {
|
||||
public HaircutQueryProviderInfo(HairCutQuery query) : base (query)
|
||||
{
|
||||
ClientInfo = new UserInfo(query.Client);
|
||||
ClientInfo = new UserInfo(query.Client.Id, query.Client.UserName, query.Client.Avatar);
|
||||
}
|
||||
public UserInfo ClientInfo { get; set; }
|
||||
|
||||
|
|
@ -17,9 +17,10 @@ namespace Yavsc.Models.Haircut.Views
|
|||
public class HaircutQueryClientInfo : HaircutQueryComonInfo {
|
||||
public HaircutQueryClientInfo(HairCutQuery query) : base (query)
|
||||
{
|
||||
ProviderInfo = new UserInfo(query.PerformerProfile.Performer);
|
||||
var user = query.PerformerProfile.Performer;
|
||||
ProviderInfo = new UserInfo(user.Id, user.UserName, user.Avatar);
|
||||
}
|
||||
public UserInfo ProviderInfo { get; set; }
|
||||
public UserInfo ProviderInfo { get; set; }
|
||||
|
||||
}
|
||||
public class HaircutQueryComonInfo
|
||||
|
|
@ -2,9 +2,8 @@ using System.Collections.Generic;
|
|||
|
||||
namespace Yavsc.Models.Market {
|
||||
|
||||
|
||||
public class Catalog {
|
||||
public List<Product> Products { get; set; }
|
||||
public List<Service> Services { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ using System.ComponentModel.DataAnnotations.Schema;
|
|||
|
||||
namespace Yavsc.Models.Market {
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Billing;
|
||||
using Workflow;
|
||||
using Yavsc.Models.Billing;
|
||||
|
||||
public class Service : BaseProduct
|
||||
{
|
||||
|
|
@ -14,27 +14,27 @@ namespace Yavsc.Models.Market {
|
|||
/// <returns></returns>
|
||||
[Key(),DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
|
||||
public string ContextId { get; set; }
|
||||
[ForeignKey("ContextId")]
|
||||
public virtual Activity Context { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// List of billing clause,
|
||||
/// associated to this service,
|
||||
/// associated to this service,
|
||||
/// that defines the transformation rules
|
||||
/// to take in account during the transformation
|
||||
/// of a corresponding prestation to an amount to pay.
|
||||
/// This property is built at constructing a new instance
|
||||
/// and is not mapped in database.
|
||||
/// and is not mapped in database.
|
||||
/// For the moment, it's hard coded only.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
|
||||
[NotMapped]
|
||||
public List<IBillingClause> Billing { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ using System.ComponentModel.DataAnnotations;
|
|||
|
||||
namespace Yavsc.Models.Messaging
|
||||
{
|
||||
using Interfaces;
|
||||
using Interfaces.Workflow;
|
||||
using YavscLib;
|
||||
|
||||
/// <summary>
|
||||
/// Base event.
|
||||
|
|
|
|||
|
|
@ -1,15 +1,16 @@
|
|||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using YavscLib;
|
||||
|
||||
namespace Yavsc.Models.Relationship
|
||||
{
|
||||
|
||||
public partial class CircleMember
|
||||
{
|
||||
|
||||
|
||||
[Required]
|
||||
public long CircleId { get; set; }
|
||||
public long CircleId { get; set; }
|
||||
|
||||
[ForeignKey("CircleId")]
|
||||
public virtual Circle Circle { get; set; }
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ using Newtonsoft.Json;
|
|||
|
||||
namespace Yavsc.Models.Workflow
|
||||
{
|
||||
using Market;
|
||||
using Yavsc.Models.Market;
|
||||
using YavscLib;
|
||||
|
||||
public class Activity : IBaseTrackedEntity, IActivity
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
namespace Yavsc.Models.Workflow
|
||||
{
|
||||
using YavscLib;
|
||||
|
||||
public interface IQuery: IBaseTrackedEntity
|
||||
{
|
||||
QueryStatus Status { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public interface IRequisition
|
||||
{
|
||||
bool Eval();
|
||||
}
|
||||
}
|
||||
|
|
@ -2,7 +2,7 @@ using System.Collections.Generic;
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Workflow
|
||||
namespace Yavsc.Models.Workflow
|
||||
{
|
||||
using System;
|
||||
using Models.Relationship;
|
||||
|
|
@ -42,7 +42,7 @@ namespace Yavsc.Models.Workflow
|
|||
|
||||
[Display(Name="Active")]
|
||||
public bool Active { get; set; }
|
||||
|
||||
|
||||
[Obsolete("Implement and use a new specialization setting")]
|
||||
[Display(Name="Maximal Daily Cost (euro/day)"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public int? MaxDailyCost { get; set; }
|
||||
|
|
@ -58,6 +58,6 @@ namespace Yavsc.Models.Workflow
|
|||
public bool DoesBlog { get {
|
||||
return Performer?.Posts?.Count > 0 ;
|
||||
} }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ using Yavsc.Models.Market;
|
|||
namespace Yavsc.Models.Workflow
|
||||
{
|
||||
using Models.Relationship;
|
||||
|
||||
/// <summary>
|
||||
/// A date, between two persons
|
||||
/// </summary>
|
||||
|
|
@ -35,4 +36,4 @@ namespace Yavsc.Models.Workflow
|
|||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue