HaulTech.Public.CSP 1.0.13572

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

HaulTech CSP

Welcome to HaulTech's Customer Service Portal (CSP) NuGet package. Use this package to integrate with a CSP instance, exposing the following capabilities:

  1. Resolve Accounts
  2. Resolve the Collection and Delivery Matrix
  3. Create Jobs
  4. Confirm Jobs
  5. Search for Jobs

All activity is derived from System.Net.Http.HttpClient to handle HTTP requests and responses.

The following HttpClient implementations are defined in this package:

HttpClient Purpose
AuthClient Responsible for requesting a Bearer token
AccountClient Responsible for resolving Accounts
ServiceClient Responsible for resolveing the Collection and Delivery Matrix
JobClient Responsible for the creation, confirming, and searching Jobs

Pre-Requisites

In order to consume the HaulTech CSP package, an integrator needs three things from their CSP provider:

  1. Credentials - these are represented by a username and password
  2. API URL - this is the endpoint used to interact with CSP features
  3. Authorisation URL - this is the endpoint used to request OAuth tokens

Note: Each HaulTech customer who subscribes to the CSP solution has their own dedicated instance. As such, they are considered the CSP provider, not HaulTech.

Package Flow

Package Flow

Getting Started

  1. Install the NuGet package, for example:
Install-Package HaulTech.Public.CSP
dotnet add package HaulTech.Public.CSP
  • Tip: Don't forget to add the using statement
using HaulTech.Public.CSP;
using HaulTech.Public.CSP.Models;
  1. Create a Customer Service Portal Client :
var cspClient = new CustomerServicePortalClient("username", "password", "baseUrl", "apiUrl");
  1. Finally, we can make our first CSP API call:
var accounts = await cspClient.GetAccountsAsync();
var matrices = await cspClient.GetServiceMatricesAsync();
var collectionServiceMatrix = matrices.First(x => x.Type == CSPGoodsMovementType.Collection);
var deliveryServiceMatrix = matrices.First(x => x.Type == CSPGoodsMovementType.Delivery);
var collectionDate = DateTime.UtcNow;
var job = new CspPortalJob()
{
	AccountId = accounts.First().AccountId,
	ServiceLevelId = collectionServiceMatrix.ServiceLevelId,
	CollectionDateTime = collectionDate,
	DeliveryDateTime = await cspClient.GetNextValidDeliveryDateForServiceMatrixAsync(collectionDate, deliveryServiceMatrix.ServiceLevelId),
	CollectionStartTime = collectionServiceMatrix.StartTime,
	CollectionEndTime = collectionServiceMatrix.EndTime,
	DeliveryStartTime = deliveryServiceMatrix.StartTime,
	DeliveryEndTime = deliveryServiceMatrix.EndTime,
	CollectionAddress1 = "CSP NuGet Demo Collection",
	DeliveryAddress1 = "CSP NuGet Demo Delivery",
	Weight = 1,
	DeliveryServiceLevelTimeId = deliveryServiceMatrix.ServiceTimeId,
	CollectionServiceLevelTimeId = collectionServiceMatrix.ServiceTimeId
};
var pendingJobId =  await cspClient.AddJobAsync(job);
var confirmedJobId = await cspClient.ConfirmJobAsync(pendingJobId);
var search = await cspClient.SearchForJobsAsync(new CspSearch()
{
	JobNo = jobApprovedId
});

Contribute

This package is closed to contributors.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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. 
.NET Core netcoreapp3.1 is compatible. 
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.13572 254 6/24/2024
1.0.8535 573 5/26/2022
1.0.8260 560 3/30/2022
1.0.8258 565 3/30/2022
1.0.8197 588 3/18/2022
1.0.8194 559 3/18/2022
1.0.8191 579 3/18/2022
1.0.8188 568 3/18/2022