Skip to content

Data Dictionary PREMIUM ​

This data dictionary documents the database schema used in the Business Continuity Suite, based on the data synchronization patterns from your Banclo cloud platform. Understanding this structure helps you integrate effectively with the read-only API and webhook system.

Overview ​

The Business Continuity Suite database stores synchronized loan application data from your main Banclo platform. All entities use hashid identifiers for external references while maintaining internal numeric IDs for database relationships. The system supports hierarchical document management, real-time messaging, and comprehensive audit logging.

Core Entities ​

LoanRequest ​

The central entity representing a mortgage/loan application.

ColumnTypeDescriptionRequiredDefaultExample
hashidSTRING (Virtual)External identifier for API referencesYes-"AbC123Def"
applicationIdSTRINGUnique application identifier from bank systemYes-"APXY1"
statusSTRINGCurrent application statusYes-"PENDING", "APPROVED", "REJECTED"
isExclusiveBOOLEANWhether loan is exclusive to the bank or it came from the bazaar routeNofalsetrue
metadataJSONBAdditional application metadata and configurationNo{}
loanTypeSTRINGType of loan being requestedNo"MORTGAGE""MORTGAGE", "PERSONAL", "BUSINESS"
principalAmountDECIMALRequested loan amountNo0250000.00
currencySTRINGCurrency code for the loanNo"EUR""EUR", "USD", "GBP"
cancelCommentSTRINGReason for cancellation if applicableNonull"Customer withdrew application"
syncedAtTIMESTAMPLast synchronization timestampYescurrent"2024-01-15T10:30:00Z"
syncVersionINTEGERVersion number for sync trackingYes15
createdAtTIMESTAMPRecord creation timestampYescurrent"2024-01-15T09:00:00Z"
updatedAtTIMESTAMPLast update timestampYescurrent"2024-01-15T10:30:00Z"

Key Points:

  • Status changes trigger webhook events (loan_request.status_changed)
  • Stub records can be created during file sync and later populated
  • Sync version increments with each update

LoanParticipant ​

People involved in the loan application process (clients, bank staff, professionals).

ColumnTypeDescriptionRequiredDefaultExample
hashidSTRING (Virtual)External identifier for API referencesYes-"PRT_abc123"
loanRequestHashidSTRINGReference to parent loan requestYes-"LR_xyz789"
roleSTRINGParticipant's role in the processYes-"MAIN_APPLICANT", "LOAN_ASSIGNEE"
accessViaARRAYHow participant gained accessNo[]["bankMember", "invitation"]
participantTypeENUMType of participantYes-"CLIENT", "USER", "PROFESSIONAL"
statusSTRINGParticipant statusNo"ACTIVE""ACTIVE", "INACTIVE"
firstNameSTRINGParticipant's first nameYes"Unknown""John"
lastNameSTRINGParticipant's last nameYes"User""Doe"
emailSTRINGEmail addressYes[email protected]"[email protected]"
phoneSTRINGPhone numberNonull"+1234567890"
clientHashidSTRINGReference to client record if type=CLIENTNonull"CLT_def456"
userHashidSTRINGReference to user record if type=USERNonull"USR_ghi789"
permissionsJSONBUser permissions objectNo{}
companySTRINGCompany name for professionalsNonull"ABC Law Firm"
specializationSTRINGProfessional specializationNonull"Real Estate Law"
licenseNumberSTRINGProfessional license numberNonull"LAW-12345"
metadataJSONBAdditional participant informationNo{}

Key Points:

  • Participant category is stored in metadata: main_applicant, co_applicant, bank_assignee, bank_member, external_professional
  • Bank employees are identified by role or accessVia patterns
  • Email serves as fallback identifier when other hashids are unavailable

Task ​

Work items assigned to participants in the loan process.

ColumnTypeDescriptionRequiredDefaultExample
hashidSTRING (Virtual)External identifier for API referencesYes-"TSK_abc123"
loanRequestHashidSTRINGReference to parent loan requestYes-"LR_xyz789"
loanBidHashidSTRINGReference to associated loan bidNonull"BID_def456"
bankIdSTRINGBank identifierNonull"bank_123"
nameSTRINGTask display nameYes-"Upload Income Documents"
slugSTRINGURL-friendly task identifierYes-"upload_income_documents"
statusENUMCurrent task statusYes"PENDING""PENDING", "INPROGRESS", "SUBMITTED", "APPROVED", "COMPLETED"
typeSTRINGTask type classificationNonull"DOCUMENT_UPLOAD", "REVIEW"
assigneeHashidSTRINGWho the task is assigned toNonull"PRT_ghi789"
assigneeNameSTRINGDisplay name of assigneeNonull"John Doe"
assigneeTypeENUMType of assigneeNonull"USER", "CLIENT", "PROFESSIONAL", "SYSTEM"
dueDateTIMESTAMPTask due dateNonull"2024-01-20T23:59:59Z"
completedAtTIMESTAMPCompletion timestampNonull"2024-01-18T14:30:00Z"
dataJSONBTask configuration and form dataNo{}
llmPromptsJSONBAI prompts for task processingNonull
shortDescriptionSTRINGBrief task descriptionYesname"Upload your income documents"
descriptionSTRINGDetailed task descriptionYesname or fallback"Please upload your recent pay stubs and tax returns"
metadataJSONBAdditional task configurationNo{}{"hasUpload": true, "uploadParams":

Key Points:

  • Status "SUBMITTED" triggers task.completed webhook
  • Overdue tasks (past due date, not completed) trigger task.overdue webhook
  • Slug format uses underscores for backend evaluation
  • Task data contains form definitions and user responses

TaskResult ​

Results and outputs from completed tasks.

ColumnTypeDescriptionRequiredDefaultExample
hashidSTRING (Virtual)External identifier for API referencesYes-"TR_abc123"
taskHashIdSTRINGReference to parent taskYes-"TSK_def456"
nameSTRINGResult display nameYes-"Income Statement Analysis"
typeSTRINGType of resultNonull"DOCUMENT", "DATA", "AI_ANALYSIS"
statusSTRINGResult processing statusNonull"PROCESSED", "PENDING", "ERROR"
resultJSONBResult data and file informationNo{}
filePathSTRINGLocal file path if applicableNonull"/var/data/documents/doc_123.pdf"
metadataJSONBAdditional result metadataNo{}

Key Points:

  • Result field preserves download information across syncs (path, downloadedAt, etc.)
  • Content type and MIME type information stored in both result and metadata
  • File path information maintained for local file access

LoanBid ​

Bank offers/bids on loan requests.

ColumnTypeDescriptionRequiredDefaultExample
hashidSTRING (Virtual)External identifier for API referencesYes-"BID_abc123"
loanRequestHashidSTRINGReference to parent loan requestYes-"LR_xyz789"
isActiveBOOLEANWhether bid is currently activeNonulltrue
statusSTRINGBank's bid statusNonull"PENDING", "ISSUED", "WITHDRAWN"
clientStatusSTRINGClient's response to bidNonull"PENDING", "ACCEPTED", "REJECTED"
principalAmountDECIMALBid amountNonull240000.00
totalPrincipalAmountDECIMALTotal amount across all facilitiesNonull250000.00
facilitiesConfigJSONBConfiguration for loan facilitiesNonull
configJSONBGeneral bid configurationNo{}
periodsJSONBPayment period structureNo[][{"period": 1, "payment": 1200}]
chargesJSONBAssociated fees and chargesNo{}
collateralsJSONBRequired collateral informationNo[][{"type": "PROPERTY", "value": 300000}]
issuedOnTIMESTAMPWhen bid was issuedNonull"2024-01-15T10:00:00Z"
acceptedOnTIMESTAMPWhen client accepted bidNonull"2024-01-16T14:30:00Z"
rejectedOnTIMESTAMPWhen client rejected bidNonull"2024-01-17T09:15:00Z"
guildHashidSTRINGReference to associated communication guildNonull"GLD_def456"

Key Points:

  • Client status changes to "ACCEPTED" trigger bid.accepted webhook
  • Client status changes to "REJECTED" trigger bid.rejected webhook
  • Multiple facilities can be associated with one bid

LoanFacility ​

Individual loan components within a bid (e.g., primary mortgage, equity line).

ColumnTypeDescriptionRequiredDefaultExample
hashidSTRING (Virtual)External identifier for API referencesYes-"FAC_abc123"
loanBidHashidSTRINGReference to parent loan bidYes-"BID_xyz789"
facilityTypeSTRINGType of loan facilityYes-"PRIMARY_MORTGAGE", "EQUITY_LINE"
principalAmountDECIMALFacility amountYes-200000.00
configJSONBFacility-specific configurationNo{}
periodsJSONBPayment schedule for this facilityNo[][{"period": 1, "payment": 900}]
chargesJSONBFees specific to this facilityNo{}
collateralsJSONBCollateral for this facilityNo[][{"type": "PROPERTY", "value": 250000}]
displayOrderINTEGEROrder for display purposesNo01
isOptionalBOOLEANWhether facility is optionalNofalsetrue

Key Points:

  • Facilities are components of loan bids
  • Each facility can have its own terms and conditions
  • Display order determines UI presentation sequence

DocumentSpace ​

Hierarchical containers for organizing loan documents.

ColumnTypeDescriptionRequiredDefaultExample
hashidSTRING (Virtual)External identifier for API referencesYes-"DS_abc123"
loanRequestHashidSTRINGReference to parent loan requestYes-"LR_xyz789"
nameSTRINGSpace display nameYes-"Income Documents"
typeSTRINGSpace type classificationNonull"FOLDER", "CATEGORY"
isDefaultBOOLEANWhether this is a default system spaceNofalsetrue
parentSpaceHashidSTRINGReference to parent space for hierarchyNonull"DS_parent123"
statusSTRINGSpace statusNonull"ACTIVE", "ARCHIVED"
metadataJSONBAdditional space configurationNo{}

Key Points:

  • Supports hierarchical organization (parent-child relationships)
  • Spaces are created in hierarchy order (parents before children)
  • Orphaned spaces are handled gracefully

DocumentSpaceItem ​

Items (documents) within document spaces.

ColumnTypeDescriptionRequiredDefaultExample
hashidSTRING (Virtual)External identifier for API referencesYes-"DSI_abc123"
spaceHashidSTRINGReference to containing document spaceYes-"DS_xyz789"
documentTypeSTRINGType of documentNonull"PDF", "LOAN_DOCUMENT", "PUBLISHED_DOCUMENT"
documentHashidSTRINGReference to actual documentYes-"DOC_def456"
displayOrderINTEGEROrder within the spaceNo05
movedAtTIMESTAMPWhen item was moved to this spaceNonull"2024-01-15T11:00:00Z"
movedFromHashidSTRINGPrevious space if item was movedNonull"DS_old789"
movedByHashidSTRINGWho moved the itemNonull"PRT_user123"
metadataJSONBAdditional item informationNo{}

Key Points:

  • Tracks document movement between spaces
  • Maintains audit trail of document organization changes
  • Links to various document types in the system

Document Types Overview ​

The system manages three distinct types of documents, each serving different purposes in the loan workflow:

  • LoanDocument: Original files uploaded by participants (clients, professionals) into document spaces. These are user-provided documents like pay stubs, bank statements, ID copies, etc.

  • PublishedDocument: System-generated documents created by the Banclo platform, such as contracts, ESIS disclosures, loan agreements, and other official paperwork. These are produced from templates with loan-specific data.

  • Request: Pending workflow items that will eventually result in PublishedDocuments. These represent approval workflows, document generation requests, or other processes that produce official documents once completed.


LoanDocument ​

Original documents uploaded by participants into document spaces.

ColumnTypeDescriptionRequiredDefaultExample
hashidSTRING (Virtual)External identifier for API referencesYes-"LD_abc123"
loanRequestHashidSTRINGReference to parent loan requestYes-"LR_xyz789"
pathSTRINGOriginal file path from bank systemNonull"/documents/2024/01/paystub.pdf"
filenameSTRINGOriginal filenameYes-"january_paystub.pdf"
fileExtensionSTRINGFile extensionNonull".pdf"
fileSizeINTEGERFile size in bytesNonull245760
mimeTypeSTRINGMIME type of fileNonull"application/pdf"
resultJSONBProcessing results and metadataNo{}
createdByINTEGERReference to user who uploaded (nullable)Nonullnull
createdByParticipantIdINTEGERReference to participant who uploadedNonull5
createdByHashidSTRINGHashid of uploaderNonull"PRT_user123"
requiresSeparateDownloadBOOLEANWhether file needs separate downloadNofalsetrue

Key Points:

  • Links to FileStorage for download tracking
  • Stores processing results from document analysis
  • Maintains reference to uploading participant

PublishedDocument ​

Generated documents (contracts, disclosures, etc.).

ColumnTypeDescriptionRequiredDefaultExample
hashidSTRING (Virtual)External identifier for API referencesYes-"PD_abc123"
loanRequestHashidSTRINGReference to parent loan requestYes-"LR_xyz789"
loanBidHashidSTRINGReference to associated loan bidNonull"BID_def456"
documentSpaceHashidSTRINGReference to containing document spaceNonull"DS_ghi789"
nameSTRINGDocument nameYestype + date fallback"Mortgage Contract 2024-01-15"
typeSTRINGDocument typeYes"DOCUMENT""ESIS", "CONTRACT", "DISCLOSURE"
contentJSONBDocument content and dataNo{}{"template": "contract_v1", "variables":
authorHashidSTRINGWho created the documentNonull"PRT_bank123"
versionINTEGERDocument version numberNo12
statusSTRINGDocument statusNo"ACTIVE""ACTIVE", "DRAFT", "SIGNED"
generatedBySTRINGWhat generated the documentNonull"SYSTEM", "USER"
generatedAtTIMESTAMPWhen document was generatedNonull"2024-01-15T12:00:00Z"
signedAtTIMESTAMPWhen document was signedNonull"2024-01-16T10:30:00Z"
expiresAtTIMESTAMPDocument expirationNonull"2024-06-15T23:59:59Z"
metadataJSONBAdditional document metadataNo{}

Key Points:

  • Generated from templates with variable data
  • Can be associated with specific loan bids
  • Supports versioning and lifecycle management

Request ​

Workflow requests for document approvals and processes.

ColumnTypeDescriptionRequiredDefaultExample
hashidSTRING (Virtual)External identifier for API referencesYes-"REQ_abc123"
loanRequestHashidSTRINGReference to parent loan requestYes-"LR_xyz789"
typeSTRINGRequest typeNo"DOCUMENT_REQUEST""DOCUMENT_REQUEST", "APPROVAL_REQUEST"
statusSTRINGCurrent request statusNo"PENDING""PENDING", "APPROVED", "REJECTED", "COMPLETED"
workflowStateSTRINGCurrent workflow stateNo"INITIATED""INITIATED", "UNDER_REVIEW", "FINAL_APPROVAL"
numApproversINTEGERNumber of required approversNo13
currentApproverIndexINTEGERCurrent approver in sequenceNo01
authorHashidSTRINGWho initiated the requestNonull"PRT_bank123"
authorDetailsJSONBDetails about the authorNo{}
workflowHashidSTRINGReference to workflow definitionNonull"WF_def456"
workflowDetailsJSONBWorkflow configurationNo{}
audienceJSONBWho should see this requestNo[]["PRT_approver1", "PRT_approver2"]
bankHashidSTRINGAssociated bankNonull"BNK_xyz789"
metadataJSONBAdditional request dataNo{}

Key Points:

  • Status changes trigger specific webhooks (request.approved, request.rejected, etc.)
  • Supports multi-step approval workflows
  • Tracks approval progress through currentApproverIndex

Analysis ​

Financial analysis and calculations for loan requests.

ColumnTypeDescriptionRequiredDefaultExample
hashidSTRING (Virtual)External identifier for API referencesYes-"AN_abc123"
loanRequestHashidSTRINGReference to parent loan requestYes-"LR_xyz789"
typeSTRINGAnalysis typeNonull"AFFORDABILITY", "RISK_ASSESSMENT"
statusSTRINGAnalysis statusNonull"COMPLETED", "PENDING", "ERROR"
dataJSONBAnalysis input dataNonull
snapshotJSONBAnalysis results snapshotNonull
formulasJSONBCalculation formulas usedNonull
createdAtTIMESTAMPWhen analysis was createdNonull"2024-01-15T13:00:00Z"
updatedAtTIMESTAMPLast update timestampNonull"2024-01-15T13:30:00Z"

Key Points:

  • Stores both input data and calculated results
  • Formula definitions allow for recalculation
  • Results preserved in snapshot for historical reference

Worksheet ​

Spreadsheet-like data for calculations and analysis.

ColumnTypeDescriptionRequiredDefaultExample
hashidSTRING (Virtual)External identifier for API referencesYes-"WS_abc123"
loanRequestHashidSTRINGReference to parent loan requestYes-"LR_xyz789"
nameSTRINGWorksheet nameYes-"Income Analysis Worksheet"
descriptionSTRINGWorksheet descriptionNonull"Detailed breakdown of applicant income"
worksheetsJSONBWorksheet data and structureNo{}{"sheets": [{"name": "Income", "data": [[]]}]}
createdFromSTRINGTemplate or source usedNonull"template_income_v1"
createdAtTIMESTAMPCreation timestampNonull"2024-01-15T14:00:00Z"
updatedAtTIMESTAMPLast update timestampNonull"2024-01-15T14:30:00Z"

Key Points:

  • Contains spreadsheet-like data structures
  • Can be created from templates
  • Supports multiple sheets within one worksheet

MaterialisedView ​

Cached/computed views of data for performance.

ColumnTypeDescriptionRequiredDefaultExample
hashidSTRING (Virtual)External identifier for API referencesYes-"MV_abc123"
loanRequestHashidSTRINGReference to parent loan requestNonull"LR_xyz789"
bankHashidSTRINGAssociated bankNonull"BNK_def456"
dataJSONBCached/computed dataNonull{"summary": {"total_income": 75000}}
lastEvaluatedAtTIMESTAMPWhen view was last computedNonull"2024-01-15T15:00:00Z"
analysisSnapshotHashidSTRINGReference to analysis snapshotNonull"AN_ghi789"
worksheetHashidSTRINGReference to source worksheetNonull"WS_jkl012"
evaluationMetadataJSONBMetadata about evaluationNo{}
versionINTEGERView versionNonull3
metadataJSONBAdditional view configurationNo{}{"viewRegistry": {"name": "IncomeView"}}

Key Points:

  • Improves performance by caching computed results
  • Links to source data (worksheets, analysis)
  • Tracks when data was last refreshed

Guild ​

Communication groups for loan participants (Discord-like).

ColumnTypeDescriptionRequiredDefaultExample
hashidSTRING (Virtual)External identifier for API referencesYes-"GLD_abc123"
loanRequestHashidSTRINGReference to parent loan requestYes-"LR_xyz789"
nameSTRINGGuild display nameYes-"Loan Application #123 Discussion"
iconSTRINGGuild icon/avatarNonull"🏠"
ownerHashidSTRINGGuild owner identifierNonull"PRT_bank123"
ownerTypeSTRINGType of ownerNonull"USER", "SYSTEM"
isArchivedBOOLEANWhether guild is archivedNofalsefalse

Key Points:

  • Provides organized communication spaces for loan processes
  • Each loan request can have associated communication guilds
  • Supports archiving for completed loans

Channel ​

Communication channels within guilds.

ColumnTypeDescriptionRequiredDefaultExample
hashidSTRING (Virtual)External identifier for API referencesYes-"CH_abc123"
guildHashidSTRINGReference to parent guildYes-"GLD_xyz789"
nameSTRINGChannel nameYes-"general"
topicSTRINGChannel topic/descriptionNonull"General discussion about the loan"
isArchivedBOOLEANWhether channel is archivedNofalsefalse

Key Points:

  • Channels organize conversations within guilds
  • Support topics for context
  • Can be archived independently of guilds

ChannelMember ​

Participants who can access specific channels.

ColumnTypeDescriptionRequiredDefaultExample
channelHashidSTRINGReference to channelYes-"CH_abc123"
loanParticipantHashidSTRINGReference to loan participantYes-"PRT_def456"
roleSTRINGMember role in channelNo"MEMBER""MEMBER", "ADMIN", "MODERATOR"
joinedAtTIMESTAMPWhen member joined channelNocurrent"2024-01-15T16:00:00Z"
isActiveBOOLEANWhether membership is activeNotruetrue
permissionsJSONBMember-specific permissionsNo{}
metadataJSONBAdditional member dataNo{}

Key Points:

  • Maps loan participants to channel access
  • Supports role-based permissions
  • Members can be found by various identifiers (userHashid, clientHashid, email)

Message ​

Individual messages within channels.

ColumnTypeDescriptionRequiredDefaultExample
hashidSTRING (Virtual)External identifier for API referencesYes-"MSG_abc123"
channelHashidSTRINGReference to parent channelYes-"CH_xyz789"
authorHashidSTRINGMessage author identifierYes-"PRT_def456"
authorNameSTRINGDisplay name of authorNonull"John Doe"
authorEmailSTRINGAuthor's email addressNonull"[email protected]"
authorTypeSTRINGType of authorNonull"CLIENT", "USER", "PROFESSIONAL", "SYSTEM"
contentTEXTMessage content (decrypted)Yes-"I have uploaded the requested documents."
attachmentsJSONBFile attachments to messageNo[][{"name": "document.pdf", "url": "/files/doc.pdf"}]
metadataJSONBAdditional message dataNo{}

Key Points:

  • Messages from clients/professionals trigger message.received webhook
  • Content is stored decrypted for offline access
  • Supports file attachments and rich metadata

Additional Tables ​

FileStorage ​

Tracks file download status and local storage information.

AuditLog ​

Comprehensive audit trail of all system actions and changes (last 30 days retained).

LoanComments ​

Structured comments and notes associated with loan requests.


Data Synchronization Notes ​

  1. Hashid Usage: All external references use hashids to avoid exposing internal numeric IDs
  2. Webhook Events: Key status changes trigger webhook notifications for real-time updates
  3. Transaction Management: Critical operations use database transactions for consistency
  4. File Management: Documents are queued for download and tracked through FileStorage
  5. Hierarchy Support: Document spaces support parent-child relationships with proper ordering
  6. Audit Trail: Comprehensive logging of all changes with 30-day retention
  7. Offline Support: Data is fully synchronized for offline operation with conflict resolution

Version Information ​

This data dictionary reflects the schema as of the DataStorageService implementation and may be updated as the system evolves. All timestamps are stored in UTC format and webhook events are emitted asynchronously to avoid blocking sync operations.