Two things:

* User views its devices, from a /manage index link
* Yavsc.Server resurection
This commit is contained in:
2018-05-15 12:13:38 +02:00
parent a77b83bf24
commit f7d4447594
201 changed files with 3297 additions and 43 deletions

28
Yavsc.Abstract/:w Normal file
View File

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using Yavsc.Services;
namespace Yavsc.Billing
{
public interface IBillable {
string GetDescription ();
List<IBillItem> GetBillItems();
long Id { get; set; }
string ActivityCode { get; set; }
string PerformerId { get; set; }
string ClientId { get; set; }
/// <summary>
/// Date de validation de la demande par le client
/// </summary>
/// <returns></returns>
DateTime? ValidationDate { get; }
bool GetIsAcquitted ();
string GetFileBaseName (IBillingService service);
}
}

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using Yavsc.Services;
namespace Yavsc.Billing
{
@ -21,7 +22,7 @@ namespace Yavsc.Billing
bool GetIsAcquitted ();
string GetFileBaseName ();
string GetFileBaseName (IBillingService service);
}
}

View File

@ -1,27 +1,29 @@
namespace Yavsc.Services
{
using System.Linq;
using System.Threading.Tasks;
using Yavsc.Abstract.Workflow;
using System.Linq;
using System.Threading.Tasks;
using Yavsc.Abstract.Workflow;
using System.Collections.Generic;
public interface IBillingService
{
/// <summary>
/// Renvoye la facture associée à une clé de facturation:
/// le couple suivant :
///
/// * un code de facturation
/// (identifiant associé à un type de facturation d'un flux de travail)
/// * un entier long identifiant la demande du client
/// (à une demande, on associe au maximum une seule facture)
/// </summary>
/// <param name="billingCode">Identifiant du type de facturation</param>
/// <param name="queryId">Identifiant de la demande du client</param>
/// <returns>La facture</returns>
Task<INominativeQuery> GetBillAsync(string billingCode, long queryId);
Task<IQueryable<ISpecializationSettings>> GetPerformersSettingsAsync(string activityCode);
Task<ISpecializationSettings> GetPerformerSettingsAsync(string activityCode, string userId);
public interface IBillingService
{
/// <summary>
/// Renvoye la facture associée à une clé de facturation,
/// à partir du couple suivant :
///
/// * un code de facturation
/// (identifiant associé à un type de demande du client)
/// * un entier long identifiant la demande du client
/// (à une demande, on associe au maximum une seule facture)
/// </summary>
/// <param name="billingCode">Identifiant du type de facturation</param>
/// <param name="queryId">Identifiant de la demande du client</param>
/// <returns>La facture</returns>
Dictionary<string,string> BillingMap { get; }
Task<INominativeQuery> GetBillAsync(string billingCode, long queryId);
Task<IQueryable<ISpecializationSettings>> GetPerformersSettingsAsync(string activityCode);
}
}
Task<ISpecializationSettings> GetPerformerSettingsAsync(string activityCode, string userId);
}
}

View File

@ -5,6 +5,7 @@ using System.Linq;
using Yavsc.Abstract.FileSystem;
using Yavsc.Billing;
using Yavsc.Models.Billing;
using Yavsc.Services;
namespace Yavsc.Helpers
{
@ -21,10 +22,10 @@ namespace Yavsc.Helpers
return bill;
}
public static FileInfo GetBillInfo(this IBillable bill)
public static FileInfo GetBillInfo(this IBillable bill, IBillingService service)
{
var suffix = bill.GetIsAcquitted() ? "-ack":null;
var filename = bill.GetFileBaseName()+".pdf";
var filename = bill.GetFileBaseName(service)+".pdf";
return new FileInfo(Path.Combine(AbstractFileSystemHelpers.UserBillsDirName, filename));
}
}

View File

@ -0,0 +1,8 @@
using System.Collections.Generic;
namespace Yavsc {
interface IBillingService_deux {
}
}

View File

@ -89,11 +89,11 @@ namespace Yavsc.Models.Billing
return Regularisation?.IsOk() ?? false;
}
public string GetFileBaseName()
public string GetFileBaseName(IBillingService billingService)
{
string type = GetType().Name;
string ack = GetIsAcquitted() ? "-ack" : null;
var bcode = BillingService.BillingMap[type];
var bcode = billingService.BillingMap[type];
return $"facture-{bcode}-{Id}{ack}";
}

Some files were not shown because too many files have changed in this diff Show More