Entity Slices

Five normalized collections live under src/app/core/pyb/entities/. Each uses createEntityAdapter with an explicit selectId, because the API keys are not called id.

Slice Key selectId

Countries

countries

entity.countryCode

Marketplaces

marketplaces

entity.marketplaceKey

Supplier Marketplaces

supplierMarketplaces

entity.marketplaceKey

Onboarding

onboarding

entity.complianceKey

Daily Summary Report

reports.dailySummaryReports

entity.xactPostDate

Every slice re-exports the adapter’s selectors:

export const { selectIds, selectEntities, selectAll, selectTotal } = adapter.getSelectors();

countries

Model

CountryModel

Module

CountriesFeatureModule

Purpose

Reference data for every address form and the country/phone pickers.

Actions

fetchCountries, loadedCountriesSuccess

marketplaces

Model

MarketplaceModel

Module

MarketplacesFeatureModule

Purpose

The catalog of supported marketplaces — names, logos, connection capabilities.

Config token

MARKETPLACES_CONFIG_TOKEN (declared in marketplaces.tokens.ts)

Actions:

Action Purpose

fetchMarketplaces / fetchMarketplacesSuccess / fetchMarketplacesError

Load the catalog.

openAmazonInviteWrapper

Open the Amazon invite-Payability wizard.

openAmazonPermissionWrapper

Open the Amazon grant-permissions wizard.

amazonSuspendedProcessBreak

The supplier abandoned the Amazon-suspended flow.

amazonSuspendedProcessCompleted

The Amazon-suspended flow finished.

Marketplace identities are fixed UUIDs in MarketplaceEnum — see Marketplaces & Compliance.

supplierMarketplaces

Model

MarketplaceModel (same shape, supplier-scoped instances)

Module

SupplierMarketplacesFeatureModule

Purpose

The channels this supplier has connected, with per-channel connection health.

Actions:

Group Actions

Load

fetchSupplierMarketplaces, loadedSupplierMarketplaceSuccess, loadedSupplierMarketplaceError

Add

addSupplierMarketplace, addSupplierMarketplaceSuccess

Bulk add

bulkAddSupplierMarketplaces, bulkAddSupplierMarketplacesSuccess, bulkAddSupplierMarketplacesError

Bulk add (unsupported)

bulkAddUnsupportedSupplierMarketplaces, …Success, …Error

Save

saveSupplierMarketplace, saveSupplierMarketplaceSuccess

Remove

removeSupplierMarketplace, removeSupplierMarketplaceSuccess, removeSupplierMarketplaceError

"Unsupported" marketplaces are channels a supplier reports selling on that Payability does not integrate with. They are recorded for underwriting context but never produce a connector.

This slice is the input to the API connectors — ApiConnectorsService dispatches fetchSupplierMarketplaces() on init and the Amazon and Shopify connectors watch it for connection loss. See Marketplace API Connectors.

DocusignVerificationService also re-dispatches fetchSupplierMarketplaces() after a successful Advance Line withdrawal, since drawing funds can change per-marketplace availability.

onboarding

Model

PayabilityComplianceModel

Module

OnboardingFeatureModule

Purpose

Onboarding progress, modelled as a set of compliance records keyed by complianceKey.

Actions

initializeOnboarding, initializedOnboarding, fetchCompliances, loadedCompliances

Each compliance record is a step the supplier must satisfy. The keys are the UUIDs in PayabilityComplianceEnum — link marketplace, personal information, offer summary, sign an agreement, two-step verification, transfer information, business information, KYC identity, personal details, sales call summary, bank statement, other.

See Onboarding.

reports.dailySummaryReports

Model

DailySummary (from @payability/pyb-ng2-api)

Module

DailySummaryReportModule

Purpose

Paginated daily transaction summaries for the Daily Summary report.

selectId

entity.xactPostDate — one record per posting date

This is the one slice that still uses class-based actions rather than createAction:

export enum DailySummaryReportActionTypes {
    DailySummaryReportsRequest     = '[DailySummaryReport] Request data',
    DailySummaryReportsLoadSuccess = '[DailySummaryReport] Load data success',
    DailySummaryReportsLoadFailed  = '[DailySummaryReport] Load data failed',
    AddDailySummaryReport          = '[DailySummaryReport] Add DailySummaryReport',
    AddDailySummaryReports         = '[DailySummaryReport] Add DailySummaryReports',
    ClearDailySummaryReports       = '[DailySummaryReport] Clear DailySummaryReports',
}

export class DailySummaryReportsRequest implements Action {
    readonly type = DailySummaryReportActionTypes.DailySummaryReportsRequest;
    constructor(public payload: { page: QueryParamsModel }) {}
}

export class DailySummaryReportsLoadSuccess implements Action {
    readonly type = DailySummaryReportActionTypes.DailySummaryReportsLoadSuccess;
    constructor(public payload: { data: DailySummary[]; totalCount: number; page: QueryParamsModel }) {}
}

Paging is expressed with QueryParamsModel from core/_base/crud, which the AG Grid server-side datasource also speaks. This is why the slice carries the page descriptor alongside the data.

Load failures are counted as a CloudWatch metric via initializeDailySummaryLoadDataErrorTrackerProvider — see Observability.