Cappy.SDK 1.0.2

dotnet add package Cappy.SDK --version 1.0.2
                    
NuGet\Install-Package Cappy.SDK -Version 1.0.2
                    
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="Cappy.SDK" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cappy.SDK" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Cappy.SDK" />
                    
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 Cappy.SDK --version 1.0.2
                    
#r "nuget: Cappy.SDK, 1.0.2"
                    
#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 Cappy.SDK@1.0.2
                    
#: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=Cappy.SDK&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Cappy.SDK&version=1.0.2
                    
Install as a Cake Tool

Cappy.SDK

Cappy is a service to offer flexible pay to employees. The service gives an ongoing control over time worked and earned salary, as well as the possibility to withdraw part of your earned salary when the employee needs it and between regular paydays. Everything available around the clock, every day of the year, in a user-friendly mobile app.

This SDK helps .NET developers integrate with Cappy by using the underlying Cappy Integration API.

GitHub repository

NuGet package

Installation

dotnet add package Cappy.SDK --version 1.0.0

Usage

Add Cappy SDK in Program.cs

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddCappySdk("cappy-integration-api-url", "your-cappy-api-key");

This will add a scoped DI registration to the current ServiceCollection so that the main service can be injected as such:

public class MyController
{
    private readonly ICappyService _cappyService;

    public MyController(ICappyService cappyService)
    {
        //Scoped service
        _cappyService = cappyService;
    }
}

ICappyService Interface Usage

The ICappyService interface provides the following methods:

Use this method to synchronize a specific window of deviations. This method takes a CappyDeviationSynchronization object as a parameter.

Task SynchronizeDeviationAsync(CappyDeviationSynchronization synchronization);

This method allows you to create a list of deviations.

Task CreateDeviationsAsync(List<CappyDeviation> deviations);

This method is for updating a list of deviations.

Task UpdateDeviations(List<CappyDeviation> deviations);

This method deletes a specific deviation by ID.

Task DeleteDeviationAsync(string id);

This method is for creating an employee.

Task CreateEmployeeAsync(CappyDetailedEmployee employee);

This method creates multiple employees.

Task CreateEmployeesAsync(List<CappyDetailedEmployee> employees);

This method updates the details of a specified employee.

Task UpdateEmployeeAsync(CappyDetailedEmployee employee);

This method updates multiple employees.

Task UpdateEmployeesAsync(List<CappyDetailedEmployee> employees);

Retrieve all employees using this method.

Task<List<CappyEmployee>> GetAllEmployeesAsync();

Retrieve a specific employee using their ID.

Task<CappyDetailedEmployee> GetEmployeeAsync(string id);

Use this method to retrieve only employees who have given consent.

Task<List<CappyEmployee>> GetEmployeesWithConsentAsync();

This method retrieves all active employees.

Task<List<CappyEmployee>> GetActiveEmployeesAsync();

This method fetches employees who are awaiting activation.

Task<List<CappyEmployee>> GetEmployeesAwaitingActivationAsync();

This method activates a specific employee by their ID.

Task ActivateEmployeeAsync(string id);

Use this method to retrieve all employers.

Task<List<CappyEmployer>> GetEmployersAsync();

Use this method to create an OffCyclePayment.

Task CreateOffCyclePaymentAsync(DateTime paymentDate, string id, 
CappyOffCyclePayment offCyclePayment);

This method is used to create a Payroll file.

Task CreatePayrollFileAsync(CappyPayRollFile payRollFile);

This method deletes a Payroll file.

Task DeletePayrollFileAsync(DateTime payDay, string fileId);

Use this method to create a raw Payroll file.

Task CreateRawPayrollFileAsync(DateTime payDay, string fileId, string fileContent);

Use this method to synchronize shifts.

Task SynchronizeShifts(CappyShiftSynchronization synchronization);

This method creates one or more shifts.

Task CreateShiftsAsync(List<CappyShift> shifts);

This method updates a range of shifts.

Task UpdateShiftsAsync(List<CappyShift> shifts);

This method deletes a specific shift with the provided ID.

Task DeleteShiftsAsync(string id);

Dependencies

  • .NET 6 (LTS)
  • Microsoft.AspNetCore.Http.Abstractions | 2.2.0
  • Microsoft.AspNetCore.Mvc.Abstractions | 2.2.0
  • Microsoft.Extensions.DependencyInjection | 8.0.0
  • Microsoft.Extensions.Primitives | 8.0.0
  • Newtonsoft.Json | 13.0.3

License

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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.2 250 1/16/2024