Two things:
* User views its devices, from a /manage index link * Yavsc.Server resurection
This commit is contained in:
101
Yavsc.Server/Models/Workflow/Activity.cs
Normal file
101
Yavsc.Server/Models/Workflow/Activity.cs
Normal file
@ -0,0 +1,101 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Yavsc.Models.Workflow
|
||||
{
|
||||
using Yavsc.Models.Market;
|
||||
using Yavsc;
|
||||
|
||||
public class Activity : IBaseTrackedEntity, IActivity
|
||||
{
|
||||
|
||||
[StringLength(512), Required, Key]
|
||||
[Display(Name = "Code")]
|
||||
public string Code { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[StringLength(512), Required()]
|
||||
[Display(Name = "Nom")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[StringLength(512)]
|
||||
[Display(Name = "Code du parent")]
|
||||
public string ParentCode { get; set; }
|
||||
|
||||
[ForeignKey("ParentCode"), JsonIgnore]
|
||||
[Display(Name = "Activité parent")]
|
||||
public virtual Activity Parent { get; set; }
|
||||
|
||||
[InverseProperty("Parent"), JsonIgnore]
|
||||
[Display(Name = "Activités filles")]
|
||||
public virtual List<Activity> Children { get; set; }
|
||||
|
||||
[Display(Name = "Description")]
|
||||
public string Description { get; set; }
|
||||
|
||||
[Display(Name = "Photo")]
|
||||
public string Photo { get; set; }
|
||||
|
||||
[InverseProperty("Context")]
|
||||
[DisplayAttribute(Name = "Services liés")]
|
||||
public List<Service> Services { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Moderation settings
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[DisplayAttribute(Name = "Groupe de modération")]
|
||||
public string ModeratorGroupName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// indice de recherche de cette activité
|
||||
/// rendu par le système.
|
||||
/// Valide entre 0 et 100,
|
||||
/// Il démarre à 0.
|
||||
/// </summary>
|
||||
[Range(0, 100)][DisplayAttribute(Name = "Indice d'exposition")]
|
||||
[DisplayFormatAttribute(DataFormatString="{0}%")]
|
||||
public int Rate { get; set; }
|
||||
[DisplayAttribute(Name = "Classe de paramétrage")]
|
||||
public string SettingsClassName { get; set; }
|
||||
|
||||
[InverseProperty("Context")]
|
||||
[Display(Name="Formulaires de commande")]
|
||||
public virtual List<CommandForm> Forms { get; set; }
|
||||
|
||||
[Display(Name="Date de création")]
|
||||
public DateTime DateCreated
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
[Display(Name="Createur")]
|
||||
public string UserCreated
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
[Display(Name="Date de dernière modification")]
|
||||
public DateTime DateModified
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
[Display(Name="Utilisateur ayant modifié le dernier")]
|
||||
public string UserModified
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
[Display(Name="Caché")]
|
||||
|
||||
public bool Hidden { get; set; }
|
||||
|
||||
}
|
||||
}
|
22
Yavsc.Server/Models/Workflow/CoWorking.cs
Normal file
22
Yavsc.Server/Models/Workflow/CoWorking.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Workflow
|
||||
{
|
||||
using Yavsc;
|
||||
|
||||
public class CoWorking: ICoWorking
|
||||
{
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id {get; set; }
|
||||
|
||||
public string PerformerId { get; set; }
|
||||
public string WorkingForId { get; set; }
|
||||
|
||||
[ForeignKey("PerformerId")]
|
||||
public virtual PerformerProfile Performer { get; set; }
|
||||
|
||||
[ForeignKey("WorkingForId")]
|
||||
public virtual ApplicationUser WorkingFor { get; set; }
|
||||
}
|
||||
}
|
23
Yavsc.Server/Models/Workflow/CommandForm.cs
Normal file
23
Yavsc.Server/Models/Workflow/CommandForm.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Yavsc.Models.Workflow
|
||||
{
|
||||
using Yavsc;
|
||||
public class CommandForm : ICommandForm
|
||||
{
|
||||
[Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
public string ActionName { get; set; }
|
||||
|
||||
public string Title { get; set; }
|
||||
|
||||
[Required]
|
||||
public string ActivityCode { get; set; }
|
||||
|
||||
[ForeignKey("ActivityCode"),JsonIgnore]
|
||||
public virtual Activity Context { get; set; }
|
||||
}
|
||||
}
|
64
Yavsc.Server/Models/Workflow/PerformerProfile.cs
Normal file
64
Yavsc.Server/Models/Workflow/PerformerProfile.cs
Normal file
@ -0,0 +1,64 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Workflow
|
||||
{
|
||||
using System;
|
||||
using Models.Relationship;
|
||||
using Newtonsoft.Json;
|
||||
using Yavsc.Workflow;
|
||||
|
||||
public class PerformerProfile : IPerformerProfile {
|
||||
|
||||
[Key]
|
||||
public string PerformerId { get; set; }
|
||||
[ForeignKey("PerformerId")]
|
||||
public virtual ApplicationUser Performer { get; set; }
|
||||
|
||||
[InverseProperty("User")]
|
||||
[Display(Name="Activity"), JsonIgnore]
|
||||
public virtual List<UserActivity> Activity { get; set; }
|
||||
|
||||
[Required,StringLength(14),Display(Name="SIREN"),
|
||||
RegularExpression(@"^[0-9]{9,14}$", ErrorMessage = "Only numbers are allowed here")]
|
||||
public string SIREN { get; set; }
|
||||
|
||||
public long OrganizationAddressId { get; set; }
|
||||
|
||||
[Required,Display(Name="Organization address"),ForeignKey("OrganizationAddressId")]
|
||||
public virtual Location OrganizationAddress { get; set; }
|
||||
|
||||
[Display(Name="Accept notifications on client query")]
|
||||
public bool AcceptNotifications { get; set; }
|
||||
|
||||
[Display(Name="Accept notifications from non-VIP users")]
|
||||
public bool AcceptPublicContact { get; set; }
|
||||
|
||||
[Display(Name="Use my geo-localization, and give me clients near by me")]
|
||||
public bool UseGeoLocalizationToReduceDistanceWithClients { get; set; }
|
||||
|
||||
[Display(Name="Web site")]
|
||||
public string WebSite { get; set; }
|
||||
|
||||
[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; }
|
||||
|
||||
[Obsolete("Implement and use a new specialization setting")]
|
||||
[Display(Name="Minimal Daily Cost (euro/day)"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public int? MinDailyCost { get; set; }
|
||||
|
||||
[Display(Name="Rate from clients")]
|
||||
public int Rate { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public bool DoesBlog { get {
|
||||
return Performer?.Posts?.Count > 0 ;
|
||||
} }
|
||||
|
||||
}
|
||||
}
|
9
Yavsc.Server/Models/Workflow/Process/Action.cs
Normal file
9
Yavsc.Server/Models/Workflow/Process/Action.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yavsc.Models.Process
|
||||
{
|
||||
public abstract class Action<TResult,TInput>
|
||||
{
|
||||
public abstract Task<TResult> GetTask(TInput data);
|
||||
}
|
||||
}
|
16
Yavsc.Server/Models/Workflow/Process/Conjonction.cs
Normal file
16
Yavsc.Server/Models/Workflow/Process/Conjonction.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Yavsc.Models.Process
|
||||
{
|
||||
public class Conjonction : List<IRequisition>, IRequisition
|
||||
{
|
||||
public bool Eval()
|
||||
{
|
||||
foreach (var req in this)
|
||||
if (!req.Eval())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
16
Yavsc.Server/Models/Workflow/Process/Disjonction.cs
Normal file
16
Yavsc.Server/Models/Workflow/Process/Disjonction.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Yavsc.Models.Process
|
||||
{
|
||||
public class Disjonction : List<IRequisition>, IRequisition
|
||||
{
|
||||
public bool Eval()
|
||||
{
|
||||
foreach (var req in this)
|
||||
if (req.Eval())
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
12
Yavsc.Server/Models/Workflow/Process/InputValue.cs
Normal file
12
Yavsc.Server/Models/Workflow/Process/InputValue.cs
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
namespace Yavsc.Models.Process
|
||||
{
|
||||
public class ConstInputValue : NamedRequisition
|
||||
{
|
||||
public bool Value { get; set; }
|
||||
public override bool Eval()
|
||||
{
|
||||
return Value;
|
||||
}
|
||||
}
|
||||
}
|
10
Yavsc.Server/Models/Workflow/Process/NamedRequisition.cs
Normal file
10
Yavsc.Server/Models/Workflow/Process/NamedRequisition.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using Yavsc.Interfaces;
|
||||
|
||||
namespace Yavsc.Models.Process
|
||||
{
|
||||
public abstract class NamedRequisition : IRequisition, INamedObject
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public abstract bool Eval();
|
||||
}
|
||||
}
|
16
Yavsc.Server/Models/Workflow/Process/Negation.cs
Normal file
16
Yavsc.Server/Models/Workflow/Process/Negation.cs
Normal file
@ -0,0 +1,16 @@
|
||||
|
||||
namespace Yavsc.Models.Process
|
||||
{
|
||||
public class Negation<Exp> : IRequisition where Exp : IRequisition
|
||||
{
|
||||
Exp _expression;
|
||||
public Negation(Exp expression)
|
||||
{
|
||||
_expression = expression;
|
||||
}
|
||||
public bool Eval()
|
||||
{
|
||||
return !_expression.Eval();
|
||||
}
|
||||
}
|
||||
}
|
34
Yavsc.Server/Models/Workflow/Process/Rule.cs
Normal file
34
Yavsc.Server/Models/Workflow/Process/Rule.cs
Normal file
@ -0,0 +1,34 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models.Process
|
||||
{
|
||||
/// <summary>
|
||||
/// An abstract, identified rule
|
||||
/// </summary>
|
||||
public class Rule<TResult,TInput>
|
||||
{
|
||||
[Key]
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Left part for this rule, a conjonction.
|
||||
/// All of these requisitions must be true
|
||||
/// in order to begin any related process.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Conjonction Left { get; set; }
|
||||
/// <summary>
|
||||
/// Right part of this rule, a disjonction.
|
||||
/// That is, only one of these post requisitions
|
||||
/// has to be true in order for this rule
|
||||
/// to expose a success.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Disjonction Right { get; set; }
|
||||
|
||||
public string Description { get; set; }
|
||||
|
||||
public Action<TResult,TInput> Execution { get; set; }
|
||||
|
||||
}
|
||||
}
|
19
Yavsc.Server/Models/Workflow/Profiles/FormationSettings.cs
Normal file
19
Yavsc.Server/Models/Workflow/Profiles/FormationSettings.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Models.Workflow.Profiles
|
||||
{
|
||||
using Models.Workflow;
|
||||
using Yavsc;
|
||||
public class FormationSettings : ISpecializationSettings
|
||||
{
|
||||
public virtual List<CoWorking> CoWorking { get; set; }
|
||||
|
||||
[Key]
|
||||
public string UserId
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
17
Yavsc.Server/Models/Workflow/Projet.cs
Normal file
17
Yavsc.Server/Models/Workflow/Projet.cs
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public partial class Projet
|
||||
{
|
||||
[Key(),DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
[ForeignKeyAttribute("AspNetUsers.Id")]
|
||||
public string ManagerId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
}
|
||||
}
|
66
Yavsc.Server/Models/Workflow/RdvQuery.cs
Normal file
66
Yavsc.Server/Models/Workflow/RdvQuery.cs
Normal file
@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Workflow
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using Yavsc.Models.Billing;
|
||||
using Yavsc.Models.Relationship;
|
||||
using Yavsc.Billing;
|
||||
|
||||
/// <summary>
|
||||
/// Query, for a date, with a given perfomer, at this given place.
|
||||
/// </summary>
|
||||
|
||||
public class RdvQuery : NominativeServiceCommand
|
||||
{
|
||||
/// <summary>
|
||||
/// The command identifier
|
||||
/// </summary>
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
override public long Id { get; set; }
|
||||
|
||||
[Display(Name = "Event date")]
|
||||
public DateTime EventDate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public Location Location
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public LocationKind LocationType
|
||||
{
|
||||
set;
|
||||
get;
|
||||
}
|
||||
|
||||
[Display(Name="GiveAnExplicitReason")]
|
||||
public string Reason { get; set; }
|
||||
|
||||
public override string GetDescription ()
|
||||
{
|
||||
return "Rendez-vous";
|
||||
}
|
||||
|
||||
public RdvQuery()
|
||||
{
|
||||
}
|
||||
|
||||
public RdvQuery(string activityCode, Location eventLocation, DateTime eventDate)
|
||||
{
|
||||
Location = eventLocation;
|
||||
EventDate = eventDate;
|
||||
ActivityCode = activityCode;
|
||||
}
|
||||
|
||||
public override List<IBillItem> GetBillItems()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
39
Yavsc.Server/Models/Workflow/RendezVous.cs
Normal file
39
Yavsc.Server/Models/Workflow/RendezVous.cs
Normal file
@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Models.Market;
|
||||
|
||||
namespace Yavsc.Models.Workflow
|
||||
{
|
||||
using Models.Relationship;
|
||||
|
||||
/// <summary>
|
||||
/// A date, between two persons
|
||||
/// </summary>
|
||||
public class RendezVous: Service {
|
||||
// Haut les mains.
|
||||
|
||||
/// <summary>
|
||||
/// Event date
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Required(),Display(Name="EventDate")]
|
||||
public DateTime EventDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Location identifier
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Required]
|
||||
public long LocationId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A Location for this event
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Required(ErrorMessage="SpecifyPlace"),Display(Name="Location"),ForeignKey("LocationId")]
|
||||
public Location Location { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
22
Yavsc.Server/Models/Workflow/Skill.cs
Normal file
22
Yavsc.Server/Models/Workflow/Skill.cs
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models {
|
||||
public class Skill {
|
||||
public string Name { get; set; }
|
||||
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// indice de recherche de ce talent
|
||||
/// rendu par le système.
|
||||
/// Valide entre 0 et 100,
|
||||
/// Il démarre à 0.
|
||||
/// </summary>
|
||||
public int Rate { get; set; }
|
||||
}
|
||||
|
||||
}
|
15
Yavsc.Server/Models/Workflow/Specialization.cs
Normal file
15
Yavsc.Server/Models/Workflow/Specialization.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Workflow
|
||||
{
|
||||
public abstract class SpecializationSettings
|
||||
{
|
||||
[Key]
|
||||
public long UserActivityId { get; set; }
|
||||
|
||||
[ForeignKey("UserActivityId")]
|
||||
public virtual UserActivity Context { get; set; }
|
||||
|
||||
}
|
||||
}
|
27
Yavsc.Server/Models/Workflow/UserActivity.cs
Normal file
27
Yavsc.Server/Models/Workflow/UserActivity.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Yavsc.Models.Workflow
|
||||
{
|
||||
public class UserActivity
|
||||
{
|
||||
[Required]
|
||||
public string UserId { get; set; }
|
||||
|
||||
[ForeignKey("UserId")]
|
||||
public virtual PerformerProfile User { get; set; }
|
||||
|
||||
[Required]
|
||||
public string DoesCode { get; set; }
|
||||
|
||||
[ForeignKey("DoesCode")]
|
||||
public virtual Activity Does { get; set; }
|
||||
|
||||
[Range(0,100)]
|
||||
public int Weight { get; set; }
|
||||
|
||||
[NotMapped,JsonIgnore]
|
||||
public object Settings { get; internal set; }
|
||||
}
|
||||
}
|
24
Yavsc.Server/Models/Workflow/UserSkills.cs
Normal file
24
Yavsc.Server/Models/Workflow/UserSkills.cs
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public partial class UserSkills
|
||||
{
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
public string UserId { get; set; }
|
||||
|
||||
[ForeignKey("UserId")]
|
||||
public virtual ApplicationUser User { get; set; }
|
||||
|
||||
public long SkillId { get; set; }
|
||||
|
||||
[ForeignKey("SkillId")]
|
||||
public virtual Skill Skill { get; set; }
|
||||
|
||||
public string Comment { get; set; }
|
||||
public int Rate { get; set; }
|
||||
}
|
||||
}
|
10
Yavsc.Server/Models/Workflow/hr.cs
Normal file
10
Yavsc.Server/Models/Workflow/hr.cs
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public partial class hr
|
||||
{
|
||||
public string userid { get; set; }
|
||||
public string comment { get; set; }
|
||||
public decimal rate { get; set; }
|
||||
}
|
||||
}
|
9
Yavsc.Server/Models/Workflow/taskdeps.cs
Normal file
9
Yavsc.Server/Models/Workflow/taskdeps.cs
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public partial class taskdeps
|
||||
{
|
||||
public long taskId { get; set; }
|
||||
public long deptask { get; set; }
|
||||
}
|
||||
}
|
14
Yavsc.Server/Models/Workflow/tasks.cs
Normal file
14
Yavsc.Server/Models/Workflow/tasks.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
|
||||
namespace Yavsc.Models
|
||||
{
|
||||
public partial class tasks
|
||||
{
|
||||
public long id { get; set; }
|
||||
public DateTime endd { get; set; }
|
||||
public string name { get; set; }
|
||||
public long prid { get; set; }
|
||||
public DateTime start { get; set; }
|
||||
public string tdesc { get; set; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user