Flaminco.SLA 1.0.0

dotnet add package Flaminco.SLA --version 1.0.0                
NuGet\Install-Package Flaminco.SLA -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="Flaminco.SLA" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Flaminco.SLA --version 1.0.0                
#r "nuget: Flaminco.SLA, 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.
// Install Flaminco.SLA as a Cake Addin
#addin nuget:?package=Flaminco.SLA&version=1.0.0

// Install Flaminco.SLA as a Cake Tool
#tool nuget:?package=Flaminco.SLA&version=1.0.0                

Flaminco.SLA Library

The Flaminco.SLA library is a .NET library designed to calculate Service Level Agreement (SLA) related metrics such as delivery dates, remaining days, and working days. It includes features to account for holidays and custom working days.

Features

  • Calculate Remaining Days: Determine the number of remaining working days until a delivery date.
  • Calculate Delivery Date: Calculate the delivery date based on task duration and working days.
  • Check Working Day: Verify if a specific date is a working day.
  • Check Holiday: Verify if a specific date is a holiday.
  • Calculate Spent Days: Calculate the number of spent working days between two dates.

Installation

dotnet add package Flaminco.SLA

Usage

Here's an example of how to use the SLAServiceBase class:


public class SLAService : SLAServiceBase
{
    public SLAService(ILogger<SLAService> logger) : base(logger) { }

    /// <summary>
    /// Gets the calendar information.
    /// In a real example, you will get the data from the database, and it is preferred to cache it.
    /// </summary>
    /// <returns>A task that represents the asynchronous operation. The task result contains the calendar information.</returns>
    public override ValueTask<CalendarInfo> GetCalendar()
    {
        return ValueTask.FromResult(new CalendarInfo
        {
            WorkingDays = new List<DayOfWeek>
            {
                DayOfWeek.Saturday,
                DayOfWeek.Sunday,
                DayOfWeek.Monday,
                DayOfWeek.Tuesday,
                DayOfWeek.Thursday,
            },
            Holidays = new List<Holiday>
            {
                new Holiday(new DateOnly(2024, 01, 01), new DateOnly(2024, 01, 11))
            }
        });
    }
}

// Inject it to DI to be accessable within your app.

builder.Services.AddScoped<SLAServiceBase,SLAService>();

Contribution

Contributions are welcome! If you have suggestions, bug reports, or contributions, please submit them as issues or pull requests on our GitHub repository.

License

This project is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.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 95 8/4/2024