refactoring

This commit is contained in:
2017-05-02 13:10:23 +02:00
parent 63044b0efd
commit d590df1c92
40 changed files with 161 additions and 103 deletions

View File

@ -1,10 +0,0 @@
using System;
namespace Yavsc.Interfaces
{
public interface ILifeTime
{
DateTime Modified { get; set; }
DateTime Posted { get; set; }
}
}

View File

@ -2,10 +2,9 @@ using Yavsc.Models.Market;
namespace Yavsc.Models.Billing
{
public class ServiceContract<P> where P : Service
{
}
}
}

View File

@ -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
{

View File

@ -8,6 +8,10 @@ namespace Yavsc.Models.Haircut
{
public class BrusherProfile : ISpecializationSettings
{
public BrusherProfile()
{
}
[Key]
public string UserId
{

View File

@ -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

View File

@ -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; }
}
}
}

View File

@ -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; }
}
}
}

View File

@ -23,8 +23,8 @@ using System.ComponentModel.DataAnnotations;
namespace Yavsc.Models.Messaging
{
using Interfaces;
using Interfaces.Workflow;
using YavscLib;
/// <summary>
/// Base event.

View File

@ -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; }

View File

@ -7,7 +7,7 @@ using Newtonsoft.Json;
namespace Yavsc.Models.Workflow
{
using Market;
using Yavsc.Models.Market;
using YavscLib;
public class Activity : IBaseTrackedEntity, IActivity

View File

@ -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 ;
} }
}
}
}

View File

@ -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
}
}
}

View File

@ -61,7 +61,7 @@
"Google.Apis.Core": "1.11.1",
"Google.Apis": "1.11.1",
"MailKit": "1.12.0",
"MarkdownDeep-av.NET": "1.5.5",
"MarkdownDeep-av.NET": "1.5.6",
"Microsoft.AspNet.Authentication.Cookies": "1.0.0-rc1-final",
"Microsoft.AspNet.Authentication.Facebook": "1.0.0-rc1-final",
"Microsoft.AspNet.Authentication.Twitter": "1.0.0-rc1-final",

View File

@ -289,7 +289,7 @@
"lib/net451/MailKit.dll": {}
}
},
"MarkdownDeep-av.NET/1.5.5": {
"MarkdownDeep-av.NET/1.5.6": {
"type": "package",
"compile": {
"lib/net451/MarkdownDeep.dll": {}
@ -2514,7 +2514,7 @@
"lib/net451/MimeKit.dll": {}
}
},
"Newtonsoft.Json/7.0.1": {
"Newtonsoft.Json/10.0.2": {
"type": "package",
"compile": {
"lib/net45/Newtonsoft.Json.dll": {}
@ -2853,7 +2853,13 @@
},
"YavscLib/1.0.0": {
"type": "project",
"framework": ".NETFramework,Version=v4.5.1"
"framework": ".NETFramework,Version=v4.5.1",
"dependencies": {
"Newtonsoft.Json": "10.0.2"
},
"frameworkAssemblies": [
"System.ComponentModel.DataAnnotations"
]
},
"Zlib.Portable.Signed/1.11.0": {
"type": "package",
@ -3152,7 +3158,7 @@
"lib/net451/MailKit.dll": {}
}
},
"MarkdownDeep-av.NET/1.5.5": {
"MarkdownDeep-av.NET/1.5.6": {
"type": "package",
"compile": {
"lib/net451/MarkdownDeep.dll": {}
@ -5377,7 +5383,7 @@
"lib/net451/MimeKit.dll": {}
}
},
"Newtonsoft.Json/7.0.1": {
"Newtonsoft.Json/10.0.2": {
"type": "package",
"compile": {
"lib/net45/Newtonsoft.Json.dll": {}
@ -5716,7 +5722,13 @@
},
"YavscLib/1.0.0": {
"type": "project",
"framework": ".NETFramework,Version=v4.5.1"
"framework": ".NETFramework,Version=v4.5.1",
"dependencies": {
"Newtonsoft.Json": "10.0.2"
},
"frameworkAssemblies": [
"System.ComponentModel.DataAnnotations"
]
},
"Zlib.Portable.Signed/1.11.0": {
"type": "package",
@ -6015,7 +6027,7 @@
"lib/net451/MailKit.dll": {}
}
},
"MarkdownDeep-av.NET/1.5.5": {
"MarkdownDeep-av.NET/1.5.6": {
"type": "package",
"compile": {
"lib/net451/MarkdownDeep.dll": {}
@ -8240,7 +8252,7 @@
"lib/net451/MimeKit.dll": {}
}
},
"Newtonsoft.Json/7.0.1": {
"Newtonsoft.Json/10.0.2": {
"type": "package",
"compile": {
"lib/net45/Newtonsoft.Json.dll": {}
@ -8579,7 +8591,13 @@
},
"YavscLib/1.0.0": {
"type": "project",
"framework": ".NETFramework,Version=v4.5.1"
"framework": ".NETFramework,Version=v4.5.1",
"dependencies": {
"Newtonsoft.Json": "10.0.2"
},
"frameworkAssemblies": [
"System.ComponentModel.DataAnnotations"
]
},
"Zlib.Portable.Signed/1.11.0": {
"type": "package",
@ -8884,15 +8902,15 @@
"MailKit.nuspec"
]
},
"MarkdownDeep-av.NET/1.5.5": {
"MarkdownDeep-av.NET/1.5.6": {
"type": "package",
"sha512": "RVNumZoZCPDq3H83vrudwptPgR0YFb3MsxIAuGZccUIPiwVUyixGanymHOy0H9QPubkYWo8t00iXqVvIjiu2gg==",
"sha512": "/nK/Hzru+vAmNGX5tZtEkKxCqjUS8a/u1vZaQ4pEmlvm6C9IIJ5rWIJephDWVwbzi6eKdEeduU+xmPfLNXrQwQ==",
"files": [
"lib/dnxcore50/MarkdownDeep.dll",
"lib/MonoAndroid10/MarkdownDeep.dll",
"lib/net451/MarkdownDeep.dll",
"MarkdownDeep-av.NET.1.5.5.nupkg",
"MarkdownDeep-av.NET.1.5.5.nupkg.sha512",
"MarkdownDeep-av.NET.1.5.6.nupkg",
"MarkdownDeep-av.NET.1.5.6.nupkg.sha512",
"MarkdownDeep-av.NET.nuspec"
]
},
@ -10614,9 +10632,9 @@
"MimeKit.nuspec"
]
},
"Newtonsoft.Json/7.0.1": {
"Newtonsoft.Json/10.0.2": {
"type": "package",
"sha512": "q3V4KLetMLnt1gpAVWgtXnHjKs0UG/RalBc29u2ZKxd5t5Ze4JBL5WiiYIklJyK/5CRiIiNwigVQUo0FgbsuWA==",
"sha512": "iwElSU2IXmwGvytJsezyDML2ZWDkG2JzTYzlU/BNlmzMdlmRvbnwITsGGY74gwVEpDli1UdOLkMT7/3jxWvXzA==",
"files": [
"lib/net20/Newtonsoft.Json.dll",
"lib/net20/Newtonsoft.Json.xml",
@ -10626,12 +10644,17 @@
"lib/net40/Newtonsoft.Json.xml",
"lib/net45/Newtonsoft.Json.dll",
"lib/net45/Newtonsoft.Json.xml",
"lib/portable-net40+sl5+wp80+win8+wpa81/Newtonsoft.Json.dll",
"lib/portable-net40+sl5+wp80+win8+wpa81/Newtonsoft.Json.xml",
"lib/portable-net45+wp80+win8+wpa81+dnxcore50/Newtonsoft.Json.dll",
"lib/portable-net45+wp80+win8+wpa81+dnxcore50/Newtonsoft.Json.xml",
"Newtonsoft.Json.7.0.1.nupkg",
"Newtonsoft.Json.7.0.1.nupkg.sha512",
"lib/netstandard1.0/Newtonsoft.Json.dll",
"lib/netstandard1.0/Newtonsoft.Json.xml",
"lib/netstandard1.3/Newtonsoft.Json.dll",
"lib/netstandard1.3/Newtonsoft.Json.xml",
"lib/portable-net40+sl5+win8+wpa81+wp8/Newtonsoft.Json.dll",
"lib/portable-net40+sl5+win8+wpa81+wp8/Newtonsoft.Json.xml",
"lib/portable-net45+win8+wpa81+wp8/Newtonsoft.Json.dll",
"lib/portable-net45+win8+wpa81+wp8/Newtonsoft.Json.xml",
"LICENSE.md",
"Newtonsoft.Json.10.0.2.nupkg",
"Newtonsoft.Json.10.0.2.nupkg.sha512",
"Newtonsoft.Json.nuspec",
"tools/install.ps1"
]
@ -11550,7 +11573,7 @@
"Google.Apis.Core >= 1.11.1",
"Google.Apis >= 1.11.1",
"MailKit >= 1.12.0",
"MarkdownDeep-av.NET >= 1.5.5",
"MarkdownDeep-av.NET >= 1.5.6",
"Microsoft.AspNet.Authentication.Cookies >= 1.0.0-rc1-final",
"Microsoft.AspNet.Authentication.Facebook >= 1.0.0-rc1-final",
"Microsoft.AspNet.Authentication.Twitter >= 1.0.0-rc1-final",

View File

@ -1,11 +0,0 @@
namespace YavscLib.HairCut
{
public enum HairLength : int
{
HalfLong,
Short = 1,
Long
}
}

View File

@ -19,7 +19,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
namespace Yavsc.Interfaces
namespace YavscLib
{
/// <summary>
/// I identified.

View File

@ -18,7 +18,7 @@
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
namespace Yavsc.Interfaces
namespace YavscLib
{
public interface ITitle
{

View File

@ -4,10 +4,9 @@ namespace YavscLib.Billing
{
long Id { get; set; }
string Description { get; set; }
int Count { get; set; }
decimal UnitaryCost { get; set; }
long EstimateId { get; set; }
}
}
}

View File

@ -2,6 +2,9 @@
{
public interface IApplicationUser
{
string Id { get; set; }
string UserName { get; set; }
string Avatar { get ; set; }
IAccountBalance AccountBalance { get; set; }
string DedicatedGoogleCalendar { get; set; }
ILocation PostalAddress { get; set; }

View File

@ -7,11 +7,11 @@ namespace Yavsc.Models.Auth
}
public UserInfo(ApplicationUser user)
public UserInfo(string userId, string userName, string avatar)
{
UserId = user.Id;
UserName = user.UserName;
Avatar = user.Avatar;
UserId = userId;
UserName = userName;
Avatar = avatar;
}
public string UserId { get; set; }

View File

@ -32,4 +32,4 @@ namespace YavscLib
get; set;
}
}
}
}

View File

@ -1,4 +1,4 @@
namespace Yavsc.Models.Workflow
namespace YavscLib.Models.Workflow
{
using YavscLib;

View File

@ -18,7 +18,8 @@
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
namespace Yavsc.Interfaces
namespace YavscLib.Interfaces
{
/// <summary>

View File

@ -1,4 +1,4 @@
{
{
"version": "1.0.0-*",
"description": "Yavsc Client Api",
"authors": [
@ -12,18 +12,13 @@
"tooling": {
"defaultNamespace": "Yavsc"
},
"dependencies": {},
"dependencies": {
"Newtonsoft.Json": "10.0.2"
},
"frameworks": {
"net451": {
"System.ComponentModel.Annotations": "4.0.0"
},
".NETPortable,Version=v4.5,Profile=Profile111": {
"frameworkAssemblies": {
"System": "4.0.0",
"System.Runtime": "4.0.0",
"System.Globalization": "4.0.0",
"System.Resources.ResourceManager": "4.0.0",
"System.Collections": "4.0.0"
"System.ComponentModel.DataAnnotations": "4.0.0"
}
}
}

View File

@ -2,23 +2,75 @@
"locked": false,
"version": 2,
"targets": {
".NETFramework,Version=v4.5.1": {},
".NETPortable,Version=v4.5,Profile=Profile111": {},
".NETFramework,Version=v4.5.1/debian.8-x86": {},
".NETFramework,Version=v4.5.1/debian.8-x64": {},
".NETPortable,Version=v4.5,Profile=Profile111/debian.8-x86": {},
".NETPortable,Version=v4.5,Profile=Profile111/debian.8-x64": {}
".NETFramework,Version=v4.5.1": {
"Newtonsoft.Json/10.0.2": {
"type": "package",
"compile": {
"lib/net45/Newtonsoft.Json.dll": {}
},
"runtime": {
"lib/net45/Newtonsoft.Json.dll": {}
}
}
},
".NETFramework,Version=v4.5.1/debian.8-x86": {
"Newtonsoft.Json/10.0.2": {
"type": "package",
"compile": {
"lib/net45/Newtonsoft.Json.dll": {}
},
"runtime": {
"lib/net45/Newtonsoft.Json.dll": {}
}
}
},
".NETFramework,Version=v4.5.1/debian.8-x64": {
"Newtonsoft.Json/10.0.2": {
"type": "package",
"compile": {
"lib/net45/Newtonsoft.Json.dll": {}
},
"runtime": {
"lib/net45/Newtonsoft.Json.dll": {}
}
}
}
},
"libraries": {
"Newtonsoft.Json/10.0.2": {
"type": "package",
"sha512": "iwElSU2IXmwGvytJsezyDML2ZWDkG2JzTYzlU/BNlmzMdlmRvbnwITsGGY74gwVEpDli1UdOLkMT7/3jxWvXzA==",
"files": [
"lib/net20/Newtonsoft.Json.dll",
"lib/net20/Newtonsoft.Json.xml",
"lib/net35/Newtonsoft.Json.dll",
"lib/net35/Newtonsoft.Json.xml",
"lib/net40/Newtonsoft.Json.dll",
"lib/net40/Newtonsoft.Json.xml",
"lib/net45/Newtonsoft.Json.dll",
"lib/net45/Newtonsoft.Json.xml",
"lib/netstandard1.0/Newtonsoft.Json.dll",
"lib/netstandard1.0/Newtonsoft.Json.xml",
"lib/netstandard1.3/Newtonsoft.Json.dll",
"lib/netstandard1.3/Newtonsoft.Json.xml",
"lib/portable-net40+sl5+win8+wpa81+wp8/Newtonsoft.Json.dll",
"lib/portable-net40+sl5+win8+wpa81+wp8/Newtonsoft.Json.xml",
"lib/portable-net45+win8+wpa81+wp8/Newtonsoft.Json.dll",
"lib/portable-net45+win8+wpa81+wp8/Newtonsoft.Json.xml",
"LICENSE.md",
"Newtonsoft.Json.10.0.2.nupkg",
"Newtonsoft.Json.10.0.2.nupkg.sha512",
"Newtonsoft.Json.nuspec",
"tools/install.ps1"
]
}
},
"libraries": {},
"projectFileDependencyGroups": {
"": [],
".NETFramework,Version=v4.5.1": [],
".NETPortable,Version=v4.5,Profile=Profile111": [
"fx/System >= 4.0.0",
"fx/System.Runtime >= 4.0.0",
"fx/System.Globalization >= 4.0.0",
"fx/System.Resources.ResourceManager >= 4.0.0",
"fx/System.Collections >= 4.0.0"
"": [
"Newtonsoft.Json >= 10.0.2"
],
".NETFramework,Version=v4.5.1": [
"fx/System.ComponentModel.DataAnnotations >= 4.0.0"
]
}
}