Table of Contents

Class AppDbContext

Namespace
Integrations.Infrastructure.Persistence
Assembly
Integrations.Infrastructure.dll

EF Core context for the integrations schema, including the MassTransit outbox tables.

public sealed class AppDbContext : DbContext, IInfrastructure<IServiceProvider>, IDbContextDependencies, IDbSetCache, IDbContextPoolable, IResettableService, IDisposable, IAsyncDisposable, IAppDbContext
Inheritance
AppDbContext
Implements
Inherited Members

Constructors

AppDbContext(DbContextOptions<AppDbContext>)

EF Core context for the integrations schema, including the MassTransit outbox tables.

public AppDbContext(DbContextOptions<AppDbContext> options)

Parameters

options DbContextOptions<AppDbContext>

Fields

Schema

Postgres schema for every table.

public const string Schema = "integrations"

Field Value

string

Properties

AdminAudit

Append-only log of money and configuration changes (who, what, when).

public DbSet<AdminAuditEntry> AdminAudit { get; }

Property Value

DbSet<AdminAuditEntry>

CertificateExpiryNotices

Expiry notices already sent (so each is sent once).

public DbSet<CertificateExpiryNotice> CertificateExpiryNotices { get; }

Property Value

DbSet<CertificateExpiryNotice>

CertificateRequests

Certificate invites and resale-certificate requests.

public DbSet<CertificateRequest> CertificateRequests { get; }

Property Value

DbSet<CertificateRequest>

DeferredMessages

Consumed messages waiting for delayed redelivery (infrastructure only; not part of IAppDbContext).

public DbSet<DeferredMessage> DeferredMessages { get; }

Property Value

DbSet<DeferredMessage>

Entities

Configured legal entities (PVC, DXT-CA, ...).

public DbSet<LegalEntity> Entities { get; }

Property Value

DbSet<LegalEntity>

ExchangeRates

Daily exchange rates (immutable once stored).

public DbSet<ExchangeRateObservation> ExchangeRates { get; }

Property Value

DbSet<ExchangeRateObservation>

JobRuns

Last run of each scheduled job, shared by every replica (infrastructure only).

public DbSet<JobRun> JobRuns { get; }

Property Value

DbSet<JobRun>

Parties

Customers and vendors and their sync state with the provider.

public DbSet<PartySyncRecord> Parties { get; }

Property Value

DbSet<PartySyncRecord>

ProviderCallAudits

One row per external provider call.

public DbSet<ProviderCallAudit> ProviderCallAudits { get; }

Property Value

DbSet<ProviderCallAudit>

RateLocks

Exchange-rate locks.

public DbSet<RateLock> RateLocks { get; }

Property Value

DbSet<RateLock>

ReconciliationIssues

Differences found by the nightly reconciliation.

public DbSet<ReconciliationIssue> ReconciliationIssues { get; }

Property Value

DbSet<ReconciliationIssue>

TaxCodeMappings

Work type / category to tax code mappings.

public DbSet<TaxCodeMapping> TaxCodeMappings { get; }

Property Value

DbSet<TaxCodeMapping>

TaxDocuments

Tax documents with their lines and jurisdiction details.

public DbSet<TaxDocument> TaxDocuments { get; }

Property Value

DbSet<TaxDocument>

Methods

ConfigureConventions(ModelConfigurationBuilder)

Default precision for money and rates.

protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder)

Parameters

configurationBuilder ModelConfigurationBuilder

IsUniqueViolation(DbUpdateException)

True when the save failed on a unique index (a concurrent insert won the race).

public bool IsUniqueViolation(DbUpdateException exception)

Parameters

exception DbUpdateException

Returns

bool

OnModelCreating(ModelBuilder)

Applies the entity configurations in this assembly and the outbox tables.

protected override void OnModelCreating(ModelBuilder modelBuilder)

Parameters

modelBuilder ModelBuilder