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
dbIAppDbContextproviderIPartyProviderguardEntityGuardeventsIEventPublisherclockBusinessClockloggerILogger<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
entityIdstringtypePartyTypecodestringctCancellationToken
Returns
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
takeintctCancellationToken
Returns
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
entityIdstringtypePartyTypecodestringrequestUpsertPartyRequestversionlong?ctCancellationToken
Returns
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
entityIdstringtypePartyTypecodestringrequestUpsertPartyRequestctCancellationToken