refactoring

This commit is contained in:
Paul Schneider 2017-02-27 19:28:32 +01:00
commit 1e6c1d15db
57 changed files with 3368 additions and 248 deletions

View file

@ -91,13 +91,15 @@ namespace Yavsc.Models
/// on his profile).
/// </summary>
/// <returns></returns>
public DbSet<BookQuery> Commands { get; set; }
public DbSet<RdvQuery> Commands { get; set; }
/// <summary>
/// Special commands, talking about
/// a given place and date.
/// </summary>
/// <returns></returns>
public DbSet<BookQuery> BookQueries { get; set; }
public DbSet<RdvQuery> RdvQueries { get; set; }
public DbSet<HairCutQuery> HairCutQueries { get; set; }
public DbSet<HairMultiCutQuery> HairMultiCutQueries { get; set; }
public DbSet<PerformerProfile> Performers { get; set; }
public DbSet<Estimate> Estimates { get; set; }
public DbSet<AccountBalance> BankStatus { get; set; }
@ -269,6 +271,8 @@ namespace Yavsc.Models
public DbSet<Notification> Notification { get; set; }
public DbSet<DimissClicked> DimissClicked { get; set; }
public DbSet<HairPrestation> HairPrestation { get; set; }
}

View file

@ -2,7 +2,6 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
using Yavsc.Models.Market;
namespace Yavsc.Models.Billing
{
@ -14,7 +13,7 @@ namespace Yavsc.Models.Billing
[Required,MaxLength(512)]
public string Description { get; set; }
public BaseProduct Article { get; set; }
public int Count { get; set; }
[DisplayFormat(DataFormatString="{0:C}")]

View file

@ -24,7 +24,7 @@ namespace Yavsc.Models.Billing
/// </summary>
/// <returns></returns>
[ForeignKey("CommandId"),JsonIgnore]
public BookQuery Query { get; set; }
public RdvQuery Query { get; set; }
public string Description { get; set; }
public string Title { get; set; }

View file

@ -5,11 +5,12 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace Yavsc.Models.Billing
{
using Interfaces.Workflow;
using Workflow;
using YavscLib;
using Interfaces.Workflow;
using Newtonsoft.Json;
using Workflow;
using YavscLib;
public abstract class NominativeServiceCommand : IBaseTrackedEntity, IQuery
public abstract class NominativeServiceCommand : IBaseTrackedEntity, IQuery
{
public DateTime DateCreated
{
@ -60,6 +61,10 @@ using YavscLib;
/// </summary>
/// <returns></returns>
[Required]
public string ActivityCode { get; set; }
[ForeignKey("ActivityCode"),JsonIgnore]
public virtual Activity Context  { get; set ; }
}
}

View file

@ -35,7 +35,7 @@ namespace Yavsc.Models.Calendar
/// <returns>The free dates.</returns>
/// <param name="username">Username.</param>
/// <param name="req">Req.</param>
IFreeDateSet GetFreeDates(string username, BookQuery req);
IFreeDateSet GetFreeDates(string username, RdvQuery req);
/// <summary>
/// Book the specified username and ev.
/// </summary>

View file

@ -1,7 +1,9 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Yavsc.Models.Billing;
using Yavsc.Models.Relationship;
namespace Yavsc.Models.Haircut
{
@ -9,6 +11,14 @@ namespace Yavsc.Models.Haircut
{
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long Id { get; set; }
HairPrestation [] Prestations { get; set; }
HairPrestation Prestation { get; set; }
public Location Location { get; set; }
public DateTime EventDate
{
get;
set;
}
}
}

View file

@ -2,7 +2,7 @@ using Yavsc.Interfaces.Workflow;
namespace Yavsc.Models.Haircut
{
public class HairCutQueryEvent : BookQueryProviderInfo, IEvent
public class HairCutQueryEvent : RdvQueryProviderInfo, IEvent
{
public HairCutQueryEvent()
{

View file

@ -1,7 +1,14 @@
using System.ComponentModel.DataAnnotations;
namespace Yavsc.Models.Haircut
{
public enum HairDressings {
Coiffage,
Brushing,
[Display(Name="Mise en plis")]
Folding
}
}

View file

@ -0,0 +1,23 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Yavsc.Models.Billing;
using Yavsc.Models.Relationship;
namespace Yavsc.Models.Haircut
{
public class HairMultiCutQuery : NominativeServiceCommand
{
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long Id { get; set; }
HairPrestation [] Prestations { get; set; }
public Location Location { get; set; }
public DateTime EventDate
{
get;
set;
}
}
}

View file

@ -1,18 +1,39 @@
using Yavsc.Models.Market;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Yavsc.Models.Haircut
{
public class HairPrestation : Service
public class HairPrestation
{
[Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long Id { get; set; }
[Display(Name="Longueur de cheveux")]
public HairLength Length { get; set; }
[Display(Name="Pour qui")]
public HairCutGenders Gender { get; set; }
[Display(Name="Coupe")]
public bool Cut { get; set; }
[Display(Name="Coiffage")]
public HairDressings Dressing { get; set; }
[Display(Name="Technique")]
public HairTechnos Tech { get; set; }
[Display(Name="Shampoing")]
public bool Shampoo { get; set; }
public HairTaint[] Taints { get; set; }
[Display(Name="Couleurs")]
public virtual List<HairTaint> Taints { get; set; }
[Display(Name="Soins")]
public bool Cares { get; set; }
}

View file

@ -1,13 +1,18 @@
using System.ComponentModel.DataAnnotations;
namespace Yavsc.Models.Haircut
{
public enum HairTechnos
{
Color,
[Display(Name="Permantante")]
Permanent,
[Display(Name="Défrisage")]
Defris,
[Display(Name="Mêches")]
Mech,
Balayage,
TyAndDie
Balayage
}
}
}

View file

@ -1,16 +1,10 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Yavsc.Models.Market
{
public partial class BaseProduct
public class BaseProduct
{
/// <summary>
/// An unique product identifier.
/// </summary>
/// <returns></returns>
[Key(),DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long Id { get; set; }
public string Name { get; set; }
/// <summary>
/// A contractual description for this product.

View file

@ -1,9 +1,15 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Yavsc.Models.Market
{
public partial class Product : BaseProduct
public class Product : BaseProduct
{
[Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long Id { get; set; }
/// <summary>
/// Weight in gram
/// </summary>

View file

@ -2,11 +2,19 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
namespace Yavsc.Models.Market {
using System.ComponentModel.DataAnnotations;
using Billing;
using Workflow;
public partial class Service : BaseProduct
public class Service : BaseProduct
{
/// <summary>
/// An unique product identifier.
/// </summary>
/// <returns></returns>
[Key(),DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long Id { get; set; }
public string ContextId { get; set; }
[ForeignKey("ContextId")]
public virtual Activity Context { get; set; }

View file

@ -25,9 +25,9 @@ using Interfaces.Workflow;
public class BookQueryEvent: BookQueryProviderInfo, IEvent
public class RdvQueryEvent: RdvQueryProviderInfo, IEvent
{
public BookQueryEvent()
public RdvQueryEvent()
{
Topic = "BookQuery";
}

View file

@ -5,7 +5,7 @@ namespace Yavsc.Models
using Models.Messaging;
using Models.Relationship;
public class BookQueryProviderInfo
public class RdvQueryProviderInfo
{
public ClientProviderInfo Client { get; set; }
public Location Location { get; set; }

View file

@ -1,7 +1,6 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
namespace Yavsc.Models.Workflow
{
@ -11,7 +10,7 @@ namespace Yavsc.Models.Workflow
/// Query, for a date, with a given perfomer, at this given place.
/// </summary>
public class BookQuery : NominativeServiceCommand
public class RdvQuery : NominativeServiceCommand
{
/// <summary>
/// The command identifier
@ -38,22 +37,18 @@ namespace Yavsc.Models.Workflow
}
public string Reason { get; set; }
public BookQuery()
public RdvQuery()
{
}
public BookQuery(string activityCode, Location eventLocation, DateTime eventDate)
public RdvQuery(string activityCode, Location eventLocation, DateTime eventDate)
{
Location = eventLocation;
EventDate = eventDate;
ActivityCode = activityCode;
}
[Required]
public string ActivityCode { get; set; }
[ForeignKey("ActivityCode"),JsonIgnore]
public virtual Activity Context  { get; set ; }
}
}