NextHelios.FiscalCalendar.Data 1.0.0

dotnet add package NextHelios.FiscalCalendar.Data --version 1.0.0
                    
NuGet\Install-Package NextHelios.FiscalCalendar.Data -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NextHelios.FiscalCalendar.Data" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NextHelios.FiscalCalendar.Data" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="NextHelios.FiscalCalendar.Data" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NextHelios.FiscalCalendar.Data --version 1.0.0
                    
#r "nuget: NextHelios.FiscalCalendar.Data, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NextHelios.FiscalCalendar.Data@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NextHelios.FiscalCalendar.Data&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=NextHelios.FiscalCalendar.Data&version=1.0.0
                    
Install as a Cake Tool

NextHelios.FiscalCalendar.Data

Librairie partagée .NET pour les microservices de l'écosystème NextHelios.
Standardise la vérification d'autorisation d'écriture comptable via le calendrier fiscal centralisé (MSComptabilite).

C'est une librairie NuGet légère que chaque microservice importe pour poser une seule question avant de poster une écriture :

"Est-ce que j'ai le droit d'écrire en base pour ce tenant, à cette date, pour cette activité ?"

Ce qu'elle fournit concrètement Une seule méthode principale :

Task<FiscalCalendarAuthorizationResult> CheckAuthorizationAsync( Guid tenantId, DateOnly date, string activity // "PRODUCTION", "CLAIM" ou "ACCOUNTING" ); Un résultat structuré :

result.IsAuthorized // true ou false result.Reason // pourquoi c'est refusé (null si autorisé) result.PeriodCode // "202605" result.PeriodStatus // "OPEN" result.ActivityStatus // "OPEN" // + calendarId, periodId, dates... Ce qu'elle vérifie en interne (la cascade)

tenantId + date + activity │ ▼

  1. Existe-t-il un calendrier ACTIVE ? → Non → refusé │ ▼
  2. Y a-t-il une période couvrant la date ? → Non → refusé │ ▼
  3. Cette période est-elle OPEN ? → Non → refusé (CLOSED, LOCKED…) │ ▼
  4. L'activité est-elle OPEN ? → Non → refusé (activité fermée) │ ▼ ✅ Autorisé

Fonctionnalités

  • Vérification en cascade : calendrier ACTIVE → période OPEN → activité OPEN.
  • Retourne toujours un résultat structuré (FiscalCalendarAuthorizationResult) — jamais d'exception métier.
  • Support de trois activités : PRODUCTION, CLAIM, ACCOUNTING.
  • Filtrage automatique des enregistrements supprimés (IsDeleted = 0).
  • Configuration simple via IServiceCollection (deux surcharges).

Installation

dotnet add reference ../NextHelios.FiscalCalendar.Data/NextHelios.FiscalCalendar.Data.csproj
# ou via NuGet (une fois publié) :
dotnet add package NextHelios.FiscalCalendar.Data

Configuration

Option 1 — via appsettings.json

// appsettings.json
{
  "ConnectionStrings": {
    "FiscalCalendarDb": "Server=...;Database=MSComptabilite;..."
  }
}
// Program.cs
builder.Services.AddFiscalCalendarDatabase(builder.Configuration);

Option 2 — Configuration manuelle

builder.Services.AddFiscalCalendarDatabase(options =>
{
    options.ConnectionString = "Server=...;Database=MSComptabilite;...";
});

Utilisation

public class ProductionService(IFiscalCalendarDatabaseService fiscalCalendar)
{
    public async Task PostEntryAsync(Guid tenantId, DateOnly date, decimal amount)
    {
        var auth = await fiscalCalendar.CheckAuthorizationAsync(
            tenantId, date, "PRODUCTION");

        if (!auth.IsAuthorized)
            throw new InvalidOperationException($"Écriture refusée : {auth.Reason}");

        // ... logique de saisie
    }
}

Tables SQL requises (base MSComptabilite)

Table Colonnes minimales attendues
FiscalCalendars Id, Code, TenantId, Status, IsDeleted
AccountingPeriods Id, Code, Name, PeriodNumber, StartDate, EndDate, Status, FiscalCalendarId, TenantId, IsDeleted
PeriodActivityStatuses Id, AccountingPeriodId, Activity, Status, IsDeleted

Les valeurs de Status sont les chaînes : DRAFT, ACTIVE, OPEN, CLOSED, LOCKED, CANCELLED.
Les valeurs de Activity sont : PRODUCTION, CLAIM, ACCOUNTING.


NextHelios Team — 2026

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 122 5/28/2026