Table of Contents

Class PartyService

Namespace
Integrations.Application.Parties
Assembly
Integrations.Application.dll

Keeps customers and vendors in the tax provider in step with PVC Connect, per entity. A customer shared with another entity is synced to that entity's AvaTax company too (one record here per entity). Sync is off until the entity enables PartySync; records are still stored so they can be sent later.

public sealed class PartyService
Inheritance
PartyService
Inherited Members

Constructors

PartyService(IAppDbContext, IPartyProvider, EntityGuard, IEventPublisher, BusinessClock, ILogger<PartyService>)

Keeps customers and vendors in the tax provider in step with PVC Connect, per entity. A customer shared with another entity is synced to that entity's AvaTax company too (one record here per entity). Sync is off until the entity enables PartySync; records are still stored so they can be sent later.

public PartyService(IAppDbContext db, IPartyProvider provider, EntityGuard guard, IEventPublisher events, BusinessClock clock, ILogger<PartyService> logger)

Parameters

db IAppDbContext
provider IPartyProvider
guard EntityGuard
events IEventPublisher
clock BusinessClock
logger ILogger<PartyService>

Methods

GetAsync(string, PartyType, string, CancellationToken)

A customer or vendor and its sync state.

public Task<PartyDto> GetAsync(string entityId, PartyType type, string code, CancellationToken ct)

Parameters

entityId string
type PartyType
code string
ct CancellationToken

Returns

Task<PartyDto>

SyncPendingAsync(int, CancellationToken)

Sends pending records (after an outage, or once PartySync is switched on). Used by the retry job.

public Task<int> SyncPendingAsync(int take, CancellationToken ct)

Parameters

take int
ct CancellationToken

Returns

Task<int>

UpsertAsync(string, PartyType, string, UpsertPartyRequest, long?, CancellationToken)

Saves the customer or vendor and syncs it to the provider. When version is given and a change with the same or a newer version was already applied, the call is ignored (an out-of-order or redelivered message).

public Task<PartyDto> UpsertAsync(string entityId, PartyType type, string code, UpsertPartyRequest request, long? version, CancellationToken ct)

Parameters

entityId string
type PartyType
code string
request UpsertPartyRequest
version long?
ct CancellationToken

Returns

Task<PartyDto>

UpsertAsync(string, PartyType, string, UpsertPartyRequest, CancellationToken)

Saves the customer or vendor and syncs it to the provider; a failed sync is retried by the background job.

public Task<PartyDto> UpsertAsync(string entityId, PartyType type, string code, UpsertPartyRequest request, CancellationToken ct)

Parameters

entityId string
type PartyType
code string
request UpsertPartyRequest
ct CancellationToken

Returns

Task<PartyDto>