country |
country_code- ISO 3166-1 alpha-2 key used by nationality, residency, address, institution, document, and market selectors.
alpha_3_code, numeric_code- Other ISO identifiers for interoperability.
source, source_version, last_synced_at- Reference-data provenance and refresh tracking.
is_supported_market, is_selectable, is_active, display_order- Controls market availability and dropdown behavior without code deploys.
|
Backend-owned reference table. Do not model countries or nationalities as Prisma enums. |
country_label |
country_code, locale- Composite label scope for one country and language/market locale.
country_name, short_country_name, nationality_label- Display labels for country and nationality selectors.
|
Lets UI render country/nationality options from backend reference data. |
industry, industry_label |
industry_code- Stable backend code such as
hospitality, aviation, or banking_financial_services.
parent_industry_code- Optional hierarchy for grouped industry choices.
is_selectable, is_active, display_order- Controls which values appear in forms.
locale, label- Localized display label on
industry_label.
|
Backend-owned employment/underwriting reference data, not an enum. |
person |
first_name, middle_name, last_name- Stable human name parts.
legal_full_name, preferred_name- Legal display name and preferred display name.
date_of_birth- Stable birth date when known; application-submitted identity facts still live under
identity_profile.
|
The durable human. Do not put application-specific nationality, residency, tax residency, or documents here in this pass. |
person_role |
person_id- Person holding the role.
role- Broad lifecycle role:
user, customer, or operator.
starts_at, ends_at- Role validity window.
|
Global product/person role. Application capacities belong in application_party_role. |
platform_account |
person_id- Local person represented by this product account.
iam_subject_id- Sooner-IAM subject identifier.
account_status- Lifecycle of platform access: invited, active, suspended, disabled, deleted.
profile_picture_url- Optional account avatar/display image.
|
Separates login/platform account from finance applicant/customer identity. |
authorization_assignment, bundle_assignment |
tenant_id- Sooner-IAM tenant/workspace scope.
subject_type, subject_id- IAM authorization subject represented locally.
platform_account_id- Convenience link when the subject is a human account.
authorization_assignment_id, bundle_name- Bundle assigned to that IAM authorization subject.
|
Local mirror of Sooner-IAM access; bundle definitions remain owned by IAM/catalog tooling. |
contact_method, owner joins |
type, value, normalized_value- Email/phone/WhatsApp value and normalized lookup value.
person_contact_method.person_id, institution_contact_method.institution_id- Owner of this use of the contact value.
label, is_primary, verified_at, verification_source- Owner-specific label, primary flag, and verification state.
|
Do not infer one global identity from a shared phone/email. Ownership and verification are scoped. |
address, owner joins |
line_1, line_2, city, region, postal_code, country_code- Structured address parts.
formatted_address- Display-ready address string.
address_type, is_primary, verified_at- Owner-specific address usage and verification fields on
person_address or institution_address.
|
Addresses are structured data, not contact-method strings. |
related_contact, application_related_contact |
owner_person_id, related_person_id, institution_id- Canonical links when the contact is already known.
display_name, institution_name_text, job_title, notes- Contact-only details when a full person/institution row is not warranted.
relationship_type, is_primary- Relationship label and primary contact flag.
application_id, application_party_id, related_contact_id, purpose- Application usage and repeatable purposes such as verification, solicitor, lender, representative, or emergency.
|
For partner, donor, adviser, employer, solicitor, lender, or emergency contacts that are not necessarily application parties. |
institution, classifications, identifiers, roles |
name, legal_name, country_code- Reusable organization identity.
classification- Repeatable role/category: lender, broker, employer, insurer, solicitor, conveyancer, credit provider, etc.
identifier_type, identifier_value, issuer- Registration, licence, regulator, tax, company, or provider identifiers.
person_institution_role.relationship_type, title, department, started_on, ended_on- Person's relationship to an institution, such as employment or adviser role.
|
Use for reusable finance ecosystem entities, not IAM organizations or one-off human contacts. |
imported_record_link |
subject_type, subject_id- Canonical row this lineage belongs to.
source_system, source_table, source_record_id, source_url- Source dataset and row reference.
imported_at, metadata- Import time and source-specific trace details.
|
Use only for lineage to V1, Supabase, imported forms, or other source rows. |
application, application_status_history |
application_number, market, intake_channel- Readable application reference, market/country context, and origin channel.
status, mortgage_search_status- Overall journey lifecycle and simple mortgage-search intake answer.
submitted_at, nullified_at, withdrawn_at, completed_at- Important lifecycle timestamps.
from_status, to_status, reason, changed_by_person_id, changed_at- Append-only status transition history.
|
Application is the finance journey; do not overload it with every lender, document, or property status. |
application_party, identity children |
application_id, person_id- Places one person inside one application.
identity_profile.legal_full_name, first_name, middle_name, last_name, date_of_birth- Identity facts submitted for this application party.
declared_at, verified_at, verification_status- Disclosure and verification state.
nationality.country_code, status, is_primary- Repeatable nationality/citizenship disclosures.
residency.country_code, residency_status, residency_basis, started_on, ended_on- Repeatable legal or immigration residency disclosures.
tax_residency.country_code, tax_identifier, status, self_certified_at- Repeatable tax-residency disclosures.
|
Application-party records hold submitted applicant facts. Person-level identity reuse can be added later. |
application_party_role, application_party_relationship |
application_party_id, role, starts_at, ends_at- Repeatable legal/workflow capacity for a party.
from_application_party_id, to_application_party_id, relationship_type- Directional relationship between parties in the same application.
ownership_share_percent, financial_contribution_percent- Optional contribution/ownership-intent data when captured by the form.
|
Primary applicant and co-applicant are roles, not scalar columns on application_party. |
application_institution_role |
application_id, institution_id- Institution participating in one application.
role, status- Institutional capacity and lifecycle, such as lender, broker firm, solicitor firm, valuation provider, company borrower, or corporate guarantor.
reference, started_at, ended_at- Optional lender/provider/case reference and role validity window.
|
Use when an institution, not a person, has a formal role in the application. |
consent_event, application_acknowledgement |
application_id, application_party_id, person_id, platform_account_id- Scopes the consent or acknowledgement to the correct subject.
consent_type, status, captured_at, revoked_at- Consent category, current event state, grant time, and revocation time.
acknowledgement_type, version, confirmed_at, ip_address- Versioned user confirmation, such as cost-breakdown acknowledgement.
|
Use events for revocable/auditable consent rather than one boolean on application or party. |
requested_loan_terms, selected_service, fee_quote |
requested_amount, currency, term_months, repayment_type, rate_preference, purpose_of_borrowing- The finance ask from the applicant.
deposit_amount, estimated_property_value, loan_to_value_percent- Requested terms used for mortgage calculations.
service_code, selected_at, status- Customer-selected Sooner service/package state.
fee_tier, fee_percent, quoted_at, expires_at, metadata- Displayed fee quote snapshot.
|
Keep requested borrowing, selected Sooner services, and displayed fee quote separate. |
employment, income_source |
application_party_id, employment_type, employer_institution_id, employer_name_text- Party-scoped employment or business profile with normalized or text employer.
job_title, occupation_family_code, seniority_level, industry_code- Work classification and underwriting context.
started_on, tenure_months, business_years, verification_status- Stability and verification indicators.
income_source.type, amount, currency, cadence, is_variable, stability_months, commission_percent- Repeatable income components linked to party and optionally employment.
|
One applicant can have multiple employments and income sources; do not flatten income onto application. |
asset, liability, housing_expense, funding_source |
type, amount, amount_band, currency, institution_name, account_reference, verified_at- Asset details, including savings, deposits, investments, or gift funds.
asset_owner.application_party_id, ownership_percent- Who owns the asset and optional percentage.
lender_name, balance_amount, limit_amount, monthly_payment_amount, opened_on- Liability/debt exposure used for affordability.
liability_party.responsibility_type, responsibility_percent- Party responsibility for a liability.
housing_expense.monthly_amount, starts_on, ends_on- Rent or housing outgoing that affects affordability without being debt.
funding_source.country_code, verification_status, funding_source_asset.asset_id- Deposit/down-payment source and optional link to assets.
|
Financial facts are repeatable and party/application scoped; evidence attaches through documents. |
credit_check, credit_report, credit_score, credit_report_tradeline |
provider_institution_id, country_code, search_type, purpose- Credit provider/reference agency and check purpose.
consent_event_id, requested_at, responded_at, status- Consent and lifecycle of the credit check request.
report_reference, reported_at, document_id, raw_status- Returned credit report reference, timestamp, file, and provider-native status.
score, score_band, score_model, source- Score facts from provider or self-report.
account_type, balance_amount, limit_amount, monthly_payment_amount- Reported tradeline/account details.
|
AECB is a provider value/institution, not a model name. |
application_property_preference |
target_amount, currency- Target property/purchase amount and currency.
preferred_property_types, preferred_bedrooms, preferred_bathrooms- Selected array preferences.
purchase_timeline, intended_use, property_search_status- Purchase timing, residence/investment intent, and search state.
location_data- Location snapshots with PSL/address references, names, and address IDs.
is_location_agnostic, location_confidence, location_confidence_score- Location flexibility and source/quality confidence.
metadata.specific_property- Optional typed intake details when the applicant has a specific property in mind.
|
Application property intent. Sourced property options use property_listing and applicant-specific candidate state uses application_property_match. |
property |
location_data- Canonical location payload when the property/location anchor is known. Use PSL/address references rather than scalar area/community fields.
address_text- Human-readable address or unresolved source text when a structured location has not been resolved.
property_type- Broad property type when known, using the same enum vocabulary as preferences/listings.
metadata- Owner-scoped details that are not yet query-critical, with lower_snake_case keys.
|
Stable lightweight property/location anchor. Do not use this as title ownership, valuation, collateral/security-property, or lender-property model. |
property_listing |
property_id- Property/location anchor this sourced option belongs to.
source, source_reference, source_url- Listing source, upstream ID, and source URL when available. V1/third-party lineage can also be tracked in
imported_record_link.
title, description- Display text from the listing/source.
transaction_type, sale_type, listing_status- Listing-side classification and market availability; not applicant workflow.
property_type, bedrooms, bathrooms, area_sqm, area_sqft- Unit-like physical facts merged into the listing for this pass.
asking_amount, currency- Advertised or stated asking amount. Avoid
price_amount because price and amount duplicate the same meaning.
location_data- Listing-stated location payload when the source location is more specific or less verified than the linked property anchor.
agent_contact_metadata, source_metadata, metadata- Agent/source payload fragments and non-canonical details that should not become first-class columns yet.
|
Merges the proposed unit/listing concepts into one simple sourced option table. Add property_unit later only if Sooner needs independent unit identity or multiple listings for the same unit. |
application_property_match |
application_property_preference_id- The applicant's search intent this candidate is being considered against.
property_listing_id- The sourced property option being considered.
status- Applicant/preference-specific candidate progress, such as new, shortlisted, agent contacted, viewing scheduled, offer made, rejected, or archived.
workflow_stage_id- Optional CRM workflow stage when operator pipeline stages are configurable.
matched_at, archived_at- Candidate lifecycle timestamps.
metadata- Migration and workflow detail that is not yet canonical, with lower_snake_case keys.
|
V1 listing.status maps here because it describes Sooner's progress for one applicant/preference, not global listing availability. |
document, document_link, document_requirement |
document_type, country_code, local_document_type, document_side- Portable document taxonomy plus market-local detail such as Emirates ID.
period_start, period_end, provider, storage_key, mime_type- Statement/report coverage dates, provider, and storage metadata.
document_link.application_id, typed target FKs, link_type- What the document supports, such as party, identity, residency, income, asset, liability, funding, lender submission, or offer.
document_requirement.source, typed target FKs, status, required_by, due_at- Evidence request and its owner/source.
document_requirement_document.document_id- Many-to-many satisfaction link between requirements and documents.
|
Documents are files; links and requirements explain evidence meaning. |
document_review, document_extraction, verification_event |
status, reviewed_by_person_id, reviewed_at, notes- Human/operator document review state.
extracted_fields, confidence, provider- OCR/provider/AI extraction payload and confidence.
target_type, target_id, verification_status, verified_at- Provider or human verification of a fact or document.
|
Review, extraction, and verification are separate workflows with different provenance. |
application_cost_estimate, affordability_assessment |
total_upfront_amount, closing_cost_amount, sooner_savings_amount, calculated_at- Displayed cost estimate snapshot.
requested_loan_terms_id, income_snapshot, commitment_snapshot, expenditure_lines- Inputs used for affordability calculation.
dependants, stress_assumptions, policy_version, max_borrowing_amount, result- Assessment assumptions, policy version, output, and result.
|
Derived snapshots; do not treat display-only values as submitted form facts. |
lender_submission, decision_in_principle, credit_decision, mortgage_offer, mortgage_offer_response |
lender_institution_id, requested_loan_terms_id, stage, status, submitted_at- One lender-specific path/package.
approved_amount, offered_amount, rate_type, interest_rate_percent, term_months- DIP, decision, or offer financial terms.
expires_at, conditions, decline_reason, decision_at- Outcome lifecycle, conditions, and reason capture.
response_status, responded_at, response_reason- Applicant response to an offer.
|
One application can have multiple lender paths. Do not flatten lender outcomes into application.status. |
mortgage_case, case parties, workflow, activity, task |
case_number, lender_case_reference, status, assigned_to_person_id, target_completion_date, completed_at- Operational case file after application/lender path progresses.
mortgage_case_party, mortgage_case_institution_role- Customer-side people and institutions attached to the case.
workflow_track.kind, current_stage_id, workflow_stage.key, group, position- Operational state machine.
activity.type, body, performed_by_person_id, occurred_at- Case/application timeline event.
task.subject, priority, status, due_at, completed_at- Action item attached to a concrete finance subject.
|
Operational workflow records should attach to real subjects without becoming the finance aggregate. |
conversation, message, extracted_fact, webhook, audit |
conversation_application, conversation_application_party, conversation_mortgage_case, conversation_lender_submission- Typed conversation links for active relations.
message.sender, body, attachments, sent_at- Communication content and delivery metadata.
extracted_fact.subject, fact_path, fact_value, confidence, evidence- Staged extracted data from documents, provider payloads, imports, or conversations before projection into canonical V2.1 records.
webhook.event_type, payload, delivered_at, status- Integration event delivery state.
audit_log.actor, resource, resource_id, diff, created_at- Immutable audit event for business or system changes.
|
Infrastructure context around the finance model; use typed links for active records and generic subjects for immutable event payloads. |