files tree made better.

This commit is contained in:
Paul Schneider 2019-01-01 16:28:47 +00:00
commit ccc91bbf19
1630 changed files with 18209 additions and 41860 deletions

View file

@ -0,0 +1,35 @@
using System;
namespace Yavsc
{
public interface IActivity
{
string Code { get; set; }
string Name { get; set; }
string ParentCode { get; set; }
string Photo { get; set; }
string Description { get; set; }
string ModeratorGroupName { get; set; }
int Rate { get; set; }
string SettingsClassName { get; set; }
DateTime DateCreated
{
get; set;
}
string UserCreated
{
get; set;
}
DateTime DateModified
{
get; set;
}
string UserModified
{
get; set;
}
}
}

View file

@ -0,0 +1,9 @@
namespace Yavsc.Models
{
public interface IBlackListed
{
long Id { get; set; }
string UserId { get; set; }
string OwnerId { get; set; }
}
}

View file

@ -0,0 +1,9 @@
namespace Yavsc.Interfaces
{
public interface ICircle
{
long Id { get; set; }
string Name { get; set; }
string OwnerId { get; set; }
}
}

View file

@ -0,0 +1,10 @@
namespace Yavsc
{
public interface ICoWorking
{
long Id {get; set; }
string PerformerId { get; set; }
string WorkingForId { get; set; }
}
}

View file

@ -0,0 +1,11 @@
namespace Yavsc
{
public interface ICommandForm
{
long Id { get; set; }
string ActionName { get; set; }
string Title { get; set; }
string ActivityCode { get; set; }
}
}

View file

@ -0,0 +1,10 @@
namespace Yavsc
{
using Abstract.Identity;
public interface IContact
{
IApplicationUser Owner { get; set; }
string OwnerId { get; set; }
string UserId { get; set; }
}
}

View file

@ -0,0 +1,19 @@
namespace Yavsc.Interfaces.Workflow {
public interface IEvent {
/// <summary>
/// <c>/topic/(bookquery|estimate)</c>
/// </summary>
/// <returns></returns>
string Topic { get; }
/// <summary>
/// Should be the user's name
/// </summary>
/// <returns></returns>
string Sender { get; set ; }
string CreateBody();
}
}

View file

@ -0,0 +1,39 @@
// Copyright (C) 2016 Paul Schneider
//
// This file is part of yavsc.
//
// yavsc is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 2 of the License, or
// (at your option) any later version.
//
// yavsc is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with yavsc. If not, see <http://www.gnu.org/licenses/>.
//
using System;
using Yavsc.Abstract.Identity;
namespace Yavsc
{
public interface IGCMDeclaration
{
string DeviceId { get; set; }
string GCMRegistrationId { get; set; }
string Model { get; set; }
string Platform { get; set; }
string Version { get; set; }
DateTime? LatestActivityUpdate { get; set; }
}
public interface IGoogleCloudMobileDeclaration: IGCMDeclaration
{
IApplicationUser DeviceOwner { get; set; }
string DeviceOwnerId { get; set; }
}
}

View file

@ -0,0 +1,8 @@
namespace Yavsc
{
public interface ILocation : IPosition
{
string Address { get; set; }
long Id { get; set; }
}
}

View file

@ -0,0 +1,10 @@
using System;
namespace Yavsc.Abstract.Workflow
{
public interface IDecidableQuery: IQuery
{
bool Rejected { get; set; }
DateTime RejectedAt { get; set; }
}
}

View file

@ -0,0 +1,17 @@
namespace Yavsc.Workflow
{
public interface IPerformerProfile
{
string PerformerId { get; set; }
string SIREN { get; set; }
bool AcceptNotifications { get; set; }
long OrganizationAddressId { get; set; }
bool AcceptPublicContact { get; set; }
bool UseGeoLocalizationToReduceDistanceWithClients { get; set; }
string WebSite { get; set; }
bool Active { get; set; }
int? MaxDailyCost { get; set; }
int? MinDailyCost { get; set; }
int Rate { get; set; }
}
}

View file

@ -0,0 +1,8 @@
namespace Yavsc
{
public interface IPosition
{
double Latitude { get; set; }
double Longitude { get; set; }
}
}

View file

@ -0,0 +1,11 @@
namespace Yavsc.Abstract.Workflow
{
using Yavsc;
using Yavsc.Billing;
public interface IQuery: IBaseTrackedEntity, IBillable
{
QueryStatus Status { get; set; }
string PaymentId { get; set; }
}
}

View file

@ -0,0 +1,37 @@
//
// IIdentified.cs
//
// Author:
// Paul Schneider <paul@pschneider.fr>
//
// Copyright (c) 2015 GNU GPL
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// 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
{
/// <summary>
/// I rating.
/// </summary>
public interface IRating<TK>: IIdentified<TK>
{
/// <summary>
/// Gets or sets the rate.
/// </summary>
/// <value>The rate.</value>
int Rate { get; set; }
}
}

View file

@ -0,0 +1,7 @@
namespace Yavsc
{
public interface ISpecializationSettings
{
string UserId { get ; set ; }
}
}

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

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

View file

@ -0,0 +1,12 @@
namespace Yavsc.Models.Process
{
public class ConstInputValue : NamedRequisition
{
public bool Value { get; set; }
public override bool Eval()
{
return Value;
}
}
}

View 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();
}
}

View 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();
}
}
}

View file

@ -0,0 +1,34 @@
using System.ComponentModel.DataAnnotations;
namespace Yavsc.Models.Process
{
/// <summary>
/// An abstract, identified rule
/// </summary>
public abstract class Rule<TResult,TInput>
{
[Key]
public string Id { get; set; }
/// <summary>
/// Left part for this class of 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 abstract TResult Execute(TInput inputData);
}
}

View file

@ -0,0 +1,22 @@
namespace Yavsc
{
/// <summary>
/// Status,
/// should be associated to any
/// client user query to a provider user or
/// other external entity.
/// </summary>
public enum QueryStatus: int
{
Inserted,
OwnerValidated,
Visited,
Rejected,
Accepted,
InProgress,
// final states
Failed,
Success
}
}

View file

@ -0,0 +1,17 @@
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Yavsc.Abstract.Workflow
{
public interface IExecutionData
{
Task Payload { get; }
ITaskMetaData MetaData { get; }
string [] Args { get; }
IList<IMayBeFixable> Faults { get; }
}
}

View file

@ -0,0 +1,9 @@
namespace Yavsc.Abstract.Workflow
{
public interface IMayBeFixable
{
bool Fixable { get; }
void TryAndFix();
}
}

View file

@ -0,0 +1,7 @@
namespace Yavsc.Models
{
public interface IRequisition
{
bool Eval();
}
}

View file

@ -0,0 +1,11 @@
using System.Collections.Generic;
using Yavsc.Models;
namespace Yavsc.Abstract.Workflow
{
public interface ITaskMetaData
{
string TaskName { get; }
IEnumerable <IRequisition> Prerequisites { get; }
}
}

View file

@ -0,0 +1,7 @@
namespace Yavsc.Abstract.Workflow
{
public interface ITaskRunner
{
IExecutionData Run( ITaskMetaData taskMetaData, string [] args);
}
}

View file

@ -0,0 +1,8 @@
namespace Yavsc.Abstract.Workflow
{
public interface ITaskRunnerProvider
{
ITaskRunner[] FindRunner(string runnerName);
}
}

View file

@ -0,0 +1,20 @@
using System.Collections.Generic;
using System.Linq;
namespace Yavsc.Abstract.Workflow
{
public class TaskManager : ITaskRunnerProvider
{
List<ITaskRunner> runners = new List<ITaskRunner>();
public void Register(ITaskRunner runner)
{
runners.Add(runner);
}
public ITaskRunner[] FindRunner(string runnerName)
{
if (string.IsNullOrWhiteSpace(runnerName))
return runners.ToArray();
return runners.Where(r => r.GetType().Name.IndexOf(runnerName.Trim())>=0).ToArray();
}
}
}