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.
|
|
Status
core/auth/_models/status.model.ts — around 40 supplier state flags, built by
Status.fromDto(dto: SupplierStatusDto). Full field tables:
Domain Model.
|
|
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: |
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).
|
|
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
|
A marketplace, keyed by |
|
A supplier’s connection — adds |
|
One compliance requirement, keyed by |
|
Country reference data, keyed by |
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
|
Product offerings summary. |
|
Compliance record. |
|
The Instant Advance report row — also used as |
|
Legacy template models, unused in supplier flows. |
CRUD helpers
core/_base/crud/
|
Paging, sorting and filter descriptor sent to paginated endpoints. |
|
|
|
Query-string and HTTP parameter helpers. |
|
Date and type conversion helpers. |
|
AG Grid server-side datasource adapter ( |