Model Reference

Models are plain classes. Those built from an API DTO expose a static fromDto(); those bound to forms expose clear() and often a static requiredFields list used by validation.

BaseModel

src/app/core/_base/crud/

export class BaseModel {
    _isEditMode = false;
    _userId = 0;
    _createdDate: string;
    _updatedDate: string;
}

Inherited by User and Permission. The fields are template scaffolding and are not used by supplier flows.

User

core/auth/_models/user.model.ts. Full field table: Domain Model.

Built by AuthService.prepareUser(supplier: SupplierDto, token: string). clear() resets every field, including nested objects, and is called before mapping.

clear() assigns random placeholder tokens: this.accessToken = 'access-token-' + Math.random(). A User that has been cleared but not re-mapped carries a meaningless token.

Status

core/auth/_models/status.model.ts — around 40 supplier state flags, built by Status.fromDto(dto: SupplierStatusDto). Full field tables: Domain Model.

fromDto copies fields explicitly rather than spreading. A field added to SupplierStatusDto does not appear on Status until it is added to both the interface and the mapper.

AuthService.getUserByToken() merges the status differently — it iterates the existing keys of user.status and copies matching keys off the DTO:

Object.keys(user.status).forEach(key => {
    if (status.hasOwnProperty(key)) { user.status[key] = status[key]; }
});

Since clear() initialises every field to null, the key set is complete.

Address

export class Address {
    static readonly requiredFields: (keyof Address)[] = ['addressLine1', 'city', 'country', 'postCode', 'state'];
    addressLine1?: string;
    addressLine2?: string;
    city?: string;
    state?: string;
    postCode?: string;
    country?: string;
    clear?(): void;
}

country is an ISO code; the Seller Card US test compares it against CountryCode.US.

BeneficiaryAddress

The API-shaped variant used for payouts, with a mapper from Address:

export class BeneficiaryAddress {
    addr1: string; addr2?: string; addr3?: string;
    country: string; city: string; state: string; postalCode: string;

    static fromAddress(address: Address): BeneficiaryAddress { /* … */ }
}

Field naming differs between the two: addressLine1 / postCode on Address versus addr1 / postalCode on BeneficiaryAddress. Always convert with fromAddress() rather than passing an Address where a beneficiary address is expected.

PersonalInformation

export class PersonalInformation {
    static readonly requiredFields: (keyof PersonalInformation)[] =
        ['firstName', 'lastName', 'phone', 'dateOfBirth', 'taxId'];
    firstName?: string;
    lastName?: string;
    residentialAddress?: Address;
    dateOfBirth?: string;
    phone?: string;
    email?: string;
    taxId?: string;
}

residentialAddress is not in requiredFields, but it is required for Seller Card eligibility — the two notions of "required" are independent.

BusinessInformation

export class BusinessInformation {
    static readonly requiredFields: (keyof BusinessInformation)[] = ['legalName', 'startDate', 'address'];
    legalName: string;
    incorporatedInTheUS: boolean;
    stateOfIncorporation: string;
    businessTypeCode: string;
    ownerSSN: string;
    address: Address;
    ein: string;
    website: string;
    startDate: Date;
}

ein is mapped from SupplierDto.taxId, and startDate from SupplierDto.dateEstablished (converted to a Date).

ownerSSN appears on both BusinessInformation and as PersonalInformation.taxId, mapped from the same SupplierDto.ownerSSN.

Permission

export class Permission extends BaseModel {
    id: PermissionsEnum;
    title: string;
    level: number;        // 1 = root, 2 = child
    parentId: number;
    isSelected: boolean;
    name: string;         // dotted, parent-prefixed
    children: Permission[];

    constructor(id: PermissionsEnum, children: Permission[] = []) {
        super();
        this.clear();
        this.id = id;
        this.name = PermissionsEnum[this.id];
        this.children = children;
    }
}

The constructor sets name to the bare enum name; permissions.const.ts overwrites it with the dotted, parent-prefixed form while building the tree. See Permissions System.

Notification and DashboardNotifications

core/auth/_models/notifications.model.ts — see Dashboard Notifications & CTAs for the full field list and the DTO key mapping.

Typed data payloads:

export type IdentityDocumentExpiredDataDto = { airwallex_terms_accepted?: boolean };

export type SuspensionNotificationDataDto = {
    reasonCode: SuspensionReason;
    reasonCount?: number;
    lastMpStatementEndDate?: string;
    marketplace?: { marketplace_name: string; marketplace_key: string };
};

UserIdentificationModel

core/pyb/models/user-identification.model.ts — the Segment identify traits. See Event Logger.

Marketplace models

MarketplaceModel

A marketplace, keyed by marketplaceKey. Used for both the catalog and supplier connections.

SupplierMarketplacesModel

A supplier’s connection — adds apiStatus, draft, marketplaceStatus (hidden, rejected), marketplaceName and fundingParticulars.lastOptOutDate.

PayabilityComplianceModel

One compliance requirement, keyed by complianceKey.

CountryModel

Country reference data, keyed by countryCode.

fundingParticulars.lastOptOutDate drives the cancellation banners, with year 9999 as the "no opt-out date" sentinel — see Cancellation & Reactivation.

UnifiedSupplierCard

core/pyb/interfaces/unified-supplier-card.interface.ts — the provider-agnostic card model, with mapMarqetaCardFromDto(), mapAirwallexCard() and synthesizeMarqetaPaymentMethod(). See Seller Card.

Other models

ProductSummaryModel

Product offerings summary.

PayabilityComplianceModel

Compliance record.

InstantAdvanceReport

The Instant Advance report row — also used as Status.activeInstantAdvance.

Role, SocialNetworks

Legacy template models, unused in supplier flows.

CRUD helpers

core/_base/crud/

QueryParamsModel

Paging, sorting and filter descriptor sent to paginated endpoints.

QueryResultsModel

{ items, totalCount } response wrapper.

HttpUtilsService

Query-string and HTTP parameter helpers.

TypesUtilsService

Date and type conversion helpers.

BaseDataSource

AG Grid server-side datasource adapter (core/pyb/models/base/data-source/).