All Models¶
Complete reference of all Craft Easy models (Beanie documents backed by MongoDB collections).
Identity & Access¶
User¶
Collection: users | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
name |
str |
Display name |
email |
str |
Email address (unique) |
phone |
str |
Phone number (unique) |
description |
str |
User description |
personal_id |
str |
National ID (GDPR-tagged) |
data_access |
str |
Data access level |
role |
str |
Legacy role field |
email_oauth |
str |
OAuth email |
oauth_provider |
str |
OAuth provider name |
api_code |
str |
API key code (unique) |
api_code_ips |
list[str] |
Allowed IPs for API key |
api_code_public_keys |
list |
Public keys for API auth |
api_key_hash |
str |
Hashed API key |
scope |
str |
User scope level |
partner_id |
str |
Partner association |
org_scope_id |
str |
Organization scope |
is_enabled |
bool |
Account active |
system_user |
bool |
System-level access |
public_user |
bool |
Public/anonymous user |
Tenant¶
Collection: tenants | Tenant scoped: No
| Field | Type | Description |
|---|---|---|
name |
str |
Tenant name |
slug |
str |
URL-friendly identifier |
is_enabled |
bool |
Active state |
branding |
dict |
White-label branding config |
enabled_features |
list[str] |
Feature flags |
default_currency |
str |
ISO 4217 currency |
enabled_currencies |
list[str] |
Additional currencies |
partner_id |
str |
Partner (cascade: null) |
partner_name |
str |
Partner name (readonly) |
parent_tenant_id |
str |
Parent for sub-tenants (cascade: deny) |
tenant_path |
str |
Materialized path |
depth |
int |
Hierarchy depth |
max_users |
int |
User limit |
max_storage_mb |
int |
Storage limit |
Role¶
Collection: roles | Tenant scoped: No
| Field | Type | Description |
|---|---|---|
name |
str |
Role identifier |
display_name |
str |
Human-readable name |
description |
str |
Role description |
capabilities |
list[str] |
Granted capabilities |
inherits_from |
list[str] |
Parent roles |
is_system |
bool |
System-defined role |
tenant_id |
str |
Tenant scope (null = global) |
RoleAssignment¶
Collection: role_assignments | Tenant scoped: No
| Field | Type | Description |
|---|---|---|
user_id |
str |
Assigned user |
role_name |
str |
Role name |
scope_type |
str |
Scope: system, tenant, partner, parking_area, org_node |
scope_id |
str |
Scope entity ID |
valid_from |
datetime |
Assignment start |
valid_until |
datetime |
Assignment end (null = permanent) |
assigned_by |
str |
Who assigned |
reason |
str |
Assignment reason |
ApiClient¶
Collection: api_clients | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
client_id |
str |
Unique client identifier |
name |
str |
Client name |
description |
str |
Client description |
keys |
list[ApiClientKey] |
Authentication keys |
capabilities |
list[str] |
Granted capabilities |
scope_level |
str |
system, partner, or tenant |
ip_whitelist |
list[str] |
Allowed IP addresses |
dpop_required |
bool |
Require DPoP proof |
access_token_ttl_seconds |
int |
Token lifetime |
is_enabled |
bool |
Active state |
revoked_at |
datetime |
Revocation timestamp |
AccessGroup¶
Collection: access_groups | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
name |
str |
Group name |
description |
str |
Group description |
template_id |
str |
Source template |
access_rights |
ResourceAccess |
Per-resource permissions |
features |
list[str] |
Granted features |
tag_scopes |
list |
Tag-based scope restrictions |
AccessGroupTemplate¶
Collection: access_group_templates | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
name |
str |
Template name |
description |
str |
Template description |
access_rights |
ResourceAccess |
Default permissions |
features |
list[str] |
Default features |
SubcontractorAccess¶
Collection: subcontractor_access | Tenant scoped: No
| Field | Type | Description |
|---|---|---|
partner_tenant_id |
str |
Subcontractor's tenant |
owner_tenant_id |
str |
Property owner's tenant |
scope_tags |
list |
Tag-based scope |
permissions |
list[str] |
read, write, manage |
resources |
list[str] |
Accessible resources |
valid_from |
datetime |
Access start |
valid_to |
datetime |
Access end |
is_active |
bool |
Active state |
Sessions & Auth¶
UserSession¶
Collection: user_sessions | Tenant scoped: No
| Field | Type | Description |
|---|---|---|
user_id |
str |
Session owner |
token_fingerprint |
str |
SHA-256 fingerprint |
device_info |
str |
Device description |
ip_address |
str |
Client IP |
origin_app |
str |
Originating application |
last_active_at |
datetime |
Last activity |
expires_at |
datetime |
Session expiry |
is_active |
bool |
Active state |
terminated_by |
str |
self, admin, or system |
TokenBlacklist¶
Collection: token_blacklist | Tenant scoped: No
| Field | Type | Description |
|---|---|---|
token_fingerprint |
str |
Blacklisted token (unique) |
user_id |
str |
Token owner |
expires_at |
datetime |
Auto-cleanup after this date |
reason |
str |
Blacklist reason |
UserAuthentication¶
Collection: user_authentications | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
user_id |
str |
User (cascade: delete) |
user_name |
str |
Cached name (readonly) |
token_id |
str |
Token identifier (unique) |
origin_app |
str |
Application source |
refresh_count |
int |
Token refresh count |
ip |
str |
Client IP |
AuthenticationCode¶
Collection: authentication_codes | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
user_id |
str |
User (cascade: delete) |
code_hash |
str |
SHA-256 hash of OTP code |
method |
str |
email or sms |
target |
str |
Delivery target |
is_used |
bool |
Code consumed |
send_count |
int |
Times re-sent |
attempt_count |
int |
Verification attempts |
expires_at |
datetime |
Code expiry |
UserTwoFactor¶
Collection: user_two_factor | Tenant scoped: No
| Field | Type | Description |
|---|---|---|
user_id |
str |
User (unique, cascade: delete) |
secret |
str |
TOTP secret (Base32) |
is_enabled |
bool |
2FA active |
enabled_at |
datetime |
Activation timestamp |
recovery_codes |
list[str] |
Backup codes |
WebAuthnCredential¶
Collection: webauthn_credentials | Tenant scoped: No
| Field | Type | Description |
|---|---|---|
user_id |
str |
User (cascade: delete) |
credential_id |
str |
WebAuthn credential (unique) |
public_key |
str |
COSE public key |
sign_count |
int |
Signature counter |
device_name |
str |
Device display name |
aaguid |
str |
Authenticator AAGUID |
transports |
list[str] |
Supported transports |
last_used_at |
datetime |
Last authentication |
ApiClientAuditEvent¶
Collection: api_client_audit | Tenant scoped: No
| Field | Type | Description |
|---|---|---|
client_id |
str |
API client |
event_type |
str |
token_issued, token_failed, key_added, key_rotated, key_revoked, scope_changed, client_created, client_disabled, client_revoked, ip_whitelist_changed, dpop_toggled, anomaly_detected |
timestamp |
datetime |
Event time |
request_ip |
str |
Client IP |
success |
bool |
Success state |
failure_reason |
str |
Failure details |
actor_user_id |
str |
Who performed the action |
ApiJtiCache¶
Collection: api_jti_cache | Tenant scoped: No
| Field | Type | Description |
|---|---|---|
jti |
str |
JWT ID (unique) |
client_id |
str |
API client |
purpose |
str |
client_assertion, dpop_proof, or access_token |
expires_at |
datetime |
TTL index (auto-cleanup) |
Organization¶
Partner¶
Collection: partners | Tenant scoped: No
| Field | Type | Description |
|---|---|---|
name |
str |
Partner name |
slug |
str |
URL-friendly ID (unique) |
description |
str |
Partner description |
contact_email |
str |
Contact email |
contact_phone |
str |
Contact phone |
is_enabled |
bool |
Active state |
logo_url |
str |
Partner logo |
primary_color |
str |
Brand color |
OrgNode¶
Collection: org_nodes | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
name |
str |
Node name |
parent_id |
str |
Parent node |
level |
int |
Hierarchy level |
node_type |
str |
Level type name |
path |
str |
Materialized path (comma-separated ancestor IDs) |
is_enabled |
bool |
Active state |
OrgHierarchyConfig¶
Collection: org_hierarchy_configs | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
levels |
list[LevelDefinition] |
Level names and config |
max_depth |
int |
Maximum hierarchy depth |
TenantAgreement¶
Collection: tenant_agreements | Tenant scoped: No
| Field | Type | Description |
|---|---|---|
tenant_id |
str |
Associated tenant |
status |
str |
draft, active, terminated, ended |
version |
int |
Agreement version number |
replaces_agreement_id |
str |
Previous version ID |
start_date |
date |
Effective date |
end_date |
date |
End date |
notice_period_days |
int |
Termination notice |
enabled_features |
list[str] |
Feature flags |
revenue_split_rules |
list |
Revenue split configuration |
service_fees |
list |
Service fee rules |
settlement_order |
list |
Payment allocation order |
Tags¶
Tag¶
Collection: tags | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
name |
str |
Tag name |
category |
str |
Tag category |
description |
str |
Tag description |
icon |
str |
Icon identifier |
color |
str |
Display color |
sort_order |
int |
Sort position |
parent_id |
str |
Parent tag (cascade: null) |
path |
str |
Materialized path (readonly) |
depth |
int |
Hierarchy depth (readonly) |
Financial¶
Payment¶
Collection: payments | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
resource_type |
str |
order, subscription, or invoice |
resource_id |
str |
Associated resource |
user_id |
str |
Paying user |
amount |
Decimal |
Payment amount |
currency |
str |
ISO 4217 currency |
provider |
str |
stripe, klarna, paypal, manual |
provider_reference |
str |
Provider transaction ID |
status |
str |
pending, processing, completed, failed, refunded, partially_refunded |
refunded_amount |
Decimal |
Total refunded |
paid_at |
datetime |
Payment timestamp |
PaymentAccount¶
Collection: payment_accounts | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
organization_id |
str |
Organization |
account_type |
str |
bankgiro, plusgiro, iban, stripe_connect |
account_mode |
str |
own or system_owner |
account_number |
str |
Account number |
bank_name |
str |
Bank name |
bic |
str |
BIC/SWIFT code |
holder_name |
str |
Account holder |
currency |
str |
Account currency |
status |
str |
pending_verification, verified, disabled |
is_primary |
bool |
Primary account flag |
Claim¶
Collection: claims | Tenant scoped: No
| Field | Type | Description |
|---|---|---|
tenant_id |
str |
Associated tenant |
source_type |
str |
invoice, order, fee, manual |
source_id |
str |
Source document ID |
debtor_name |
str |
Debtor name |
debtor_email |
str |
Debtor email |
debtor_national_id |
str |
National ID (GDPR) |
original_amount |
Decimal |
Original claim amount |
interest_accrued |
Decimal |
Accrued interest |
paid_amount |
Decimal |
Amount paid so far |
currency |
str |
Currency |
status |
str |
active, partial, paid, written_off, collection |
collection_stage |
str |
normal, overdue, reminder, collection, enforcement |
due_date |
date |
Payment due date |
dispute_status |
str |
Dispute status |
payment_plan_id |
str |
Associated payment plan |
PaymentPlan¶
Collection: payment_plans | Tenant scoped: No
| Field | Type | Description |
|---|---|---|
claim_id |
str |
Associated claim |
tenant_id |
str |
Tenant |
status |
str |
active, completed, defaulted, cancelled |
installments |
list[Installment] |
Payment schedule |
total_amount |
Decimal |
Total plan amount |
created_by |
str |
Creator |
Settlement¶
Collection: settlements | Tenant scoped: No
| Field | Type | Description |
|---|---|---|
tenant_id |
str |
Tenant |
period_start |
date |
Settlement period start |
period_end |
date |
Settlement period end |
gross_amount |
Decimal |
Gross revenue |
platform_fee |
Decimal |
Platform fees |
net_payout |
Decimal |
Net payout amount |
currency |
str |
Currency |
status |
str |
draft, pending_approval, approved, paid, failed |
auto_approved |
bool |
Auto-approved flag |
RecurringBillingPlan¶
Collection: recurring_billing_plans | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
name |
str |
Plan name |
description |
str |
Plan description |
amount |
Decimal |
Billing amount |
currency |
str |
Currency |
interval |
str |
daily, weekly, monthly, yearly |
interval_count |
int |
Intervals between charges |
trial_days |
int |
Trial period |
is_active |
bool |
Plan active |
Subscription¶
Collection: subscriptions | Tenant scoped: No
| Field | Type | Description |
|---|---|---|
plan_id |
str |
Billing plan |
tenant_id |
str |
Tenant |
user_id |
str |
Subscriber |
status |
str |
trial, active, past_due, cancelled, expired |
current_period_start |
datetime |
Current period start |
current_period_end |
datetime |
Current period end |
next_billing_date |
datetime |
Next charge date |
retry_count |
int |
Payment retry count |
RevenueSplitRule¶
Collection: revenue_split_rules | Tenant scoped: No
| Field | Type | Description |
|---|---|---|
agreement_id |
str |
Parent agreement |
tenant_id |
str |
Tenant |
split_type |
str |
percentage, fixed, tiered |
platform_share |
Decimal |
Platform percentage |
owner_share |
Decimal |
Owner percentage |
valid_from |
date |
Rule effective date |
valid_to |
date |
Rule expiry date |
CostType¶
Collection: cost_types | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
code |
str |
Unique cost type code |
category |
str |
Cost category |
name |
str |
Display name |
description |
str |
Description |
is_system |
bool |
System-defined |
accounting_code |
str |
Linked account code |
vat_rate |
Decimal |
VAT rate |
revenue_split_applicable |
bool |
Include in splits |
PayoutBatch¶
Collection: payout_batches | Tenant scoped: No
| Field | Type | Description |
|---|---|---|
recipient_type |
str |
tenant or partner |
recipient_id |
str |
Recipient entity |
recipient_name |
str |
Cached name (readonly) |
gross_amount |
Decimal |
Gross amount |
fee_amount |
Decimal |
Fee amount |
net_amount |
Decimal |
Net payout |
currency |
str |
Currency |
period_start |
datetime |
Period start |
period_end |
datetime |
Period end |
status |
str |
draft, approved, processing, completed, failed |
payment_count |
int |
Included payments |
payment_ids |
list[str] |
Payment IDs |
bank_reference |
str |
Bank reference |
paid_at |
datetime |
Payout timestamp |
Bookkeeping¶
Account¶
Collection: accounts | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
code |
str |
Account code |
name |
str |
Account name |
account_type |
str |
asset, liability, revenue, expense, equity |
description |
str |
Description |
is_system |
bool |
System-defined |
is_active |
bool |
Active state |
parent_code |
str |
Parent account |
vat_code |
str |
VAT code |
LedgerEntry¶
Collection: ledger_entries | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
transaction_id |
str |
Transaction group |
entry_type |
str |
debit or credit |
account_code |
str |
Account code |
amount |
Decimal |
Entry amount |
currency |
str |
Currency |
booking_date |
date |
Booking date |
period |
str |
Period (YYYY-MM) |
verification_number |
str |
Verification number |
is_posted |
bool |
Posted to ledger |
Invoice¶
Collection: invoices | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
invoice_number |
str |
Invoice number |
invoice_type |
str |
service_fee, customer_charge, self_billing, credit_note |
issuer_name |
str |
Issuer name |
recipient_name |
str |
Recipient name |
recipient_email |
str |
Recipient email |
subtotal |
Decimal |
Subtotal before VAT |
vat_amount |
Decimal |
VAT amount |
total |
Decimal |
Total including VAT |
currency |
str |
Currency |
status |
str |
Invoice status |
line_items |
list |
Invoice line items |
due_date |
date |
Payment due date |
Collections¶
CollectionFlow¶
Collection: collection_flows | Tenant scoped: No
| Field | Type | Description |
|---|---|---|
claim_id |
str |
Associated claim |
tenant_id |
str |
Tenant |
current_stage |
str |
Current collection stage |
transitions |
list |
Stage transition history |
reminders_sent |
int |
Reminder count |
collection_agency |
str |
External agency |
collection_reference |
str |
Agency reference |
CollectionConfig¶
Collection: collection_configs | Tenant scoped: No
| Field | Type | Description |
|---|---|---|
tenant_id |
str |
Tenant |
grace_period_days |
int |
Days before first reminder |
max_reminders |
int |
Maximum reminders |
reminder_interval_days |
int |
Days between reminders |
reminder_fee |
Decimal |
Fee per reminder |
days_to_collection |
int |
Days before collection handover |
reference_rate |
Decimal |
Base interest rate |
interest_margin |
Decimal |
Interest margin |
Client Funds¶
ClientFundAccount¶
Collection: client_fund_accounts | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
balance |
Decimal |
Current balance |
currency |
str |
Account currency |
is_frozen |
bool |
Frozen state |
ClientFundTransaction¶
Collection: client_fund_transactions | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
account_id |
str |
Account |
transaction_type |
str |
deposit, withdrawal, fee, interest, adjustment |
amount |
Decimal |
Amount |
balance_after |
Decimal |
Balance after transaction |
currency |
str |
Currency |
description |
str |
Description |
reference_type |
str |
Reference type |
reference_id |
str |
Reference ID |
Jobs¶
JobRun¶
Collection: job_runs | Tenant scoped: No
| Field | Type | Description |
|---|---|---|
job_name |
str |
Job identifier |
job_type |
str |
scheduled, manual, chain |
status |
str |
pending, running, completed, failed, cancelled |
started_at |
datetime |
Start time |
completed_at |
datetime |
Completion time |
duration_ms |
int |
Duration in ms |
parameters |
dict |
Job parameters |
result |
dict |
Job result |
error |
str |
Error message |
progress_current |
int |
Current progress |
progress_total |
int |
Total work items |
JobSchedule¶
Collection: job_schedules | Tenant scoped: No
| Field | Type | Description |
|---|---|---|
job_name |
str |
Job identifier |
description |
str |
Schedule description |
cron_expression |
str |
Cron schedule |
is_enabled |
bool |
Active state |
parameters |
dict |
Default parameters |
timeout_seconds |
int |
Job timeout |
chain |
list[str] |
Chained job names |
next_run_at |
datetime |
Next scheduled run |
File Import¶
ImportTemplate¶
Collection: import_templates | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
name |
str |
Template name |
file_type |
str |
csv, excel, json, xml, fixed_width |
delimiter |
str |
Field delimiter |
field_mapping |
list[FieldMapping] |
Column-to-field mapping |
target_resource |
str |
Target resource name |
import_mode |
str |
create, upsert, update, sync, append |
upsert_key |
str |
Unique key for upsert |
auto_execute |
bool |
Auto-execute after validation |
ImportRun¶
Collection: import_runs | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
template_id |
str |
Template used |
file_name |
str |
Uploaded file name |
status |
str |
Import status |
total_rows |
int |
Total rows in file |
created_count |
int |
Records created |
updated_count |
int |
Records updated |
error_count |
int |
Errors encountered |
is_dry_run |
bool |
Dry run mode |
RejectedRecord¶
Collection: rejected_records | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
import_run_id |
str |
Parent import run |
row_number |
int |
Source row number |
original_data |
dict |
Original row data |
validation_errors |
list |
Error details |
status |
str |
pending, corrected, retried, discarded |
Integration¶
NotificationTemplate¶
Collection: notification_templates | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
name |
str |
Template name (unique) |
channel |
str |
email, sms, push |
status |
str |
draft, active, archived |
locales |
list[TemplateLocale] |
Localized content |
required_variables |
list[str] |
Required template vars |
version |
int |
Template version |
NotificationLog¶
Collection: notification_logs | Tenant scoped: No
| Field | Type | Description |
|---|---|---|
channel |
str |
email, sms, push |
provider |
str |
Delivery provider |
recipient |
str |
Recipient address |
status |
str |
pending, sent, delivered, failed, bounced |
message_id |
str |
Provider message ID |
attempts |
int |
Delivery attempts |
EventLog¶
Collection: event_log | Tenant scoped: No
| Field | Type | Description |
|---|---|---|
event_id |
str |
Unique event ID |
event_type |
str |
Dot-separated type |
tenant_id |
str |
Tenant context |
actor_id |
str |
User who triggered |
payload |
dict |
Event data |
timestamp |
datetime |
Event time |
Webhook¶
Collection: webhooks | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
name |
str |
Webhook name |
url |
str |
Delivery URL |
events |
list[str] |
Subscribed event types |
secret |
str |
Signing secret |
is_enabled |
bool |
Active state |
retry_policy |
str |
Retry strategy |
max_retries |
int |
Maximum delivery retries |
WebhookEvent¶
Collection: webhook_events | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
webhook_id |
str |
Parent webhook |
event_type |
str |
Event type |
payload |
dict |
Event payload |
status |
str |
pending, delivered, failed, dead_letter |
attempts |
int |
Delivery attempts |
last_attempt_at |
datetime |
Last delivery attempt |
response_status |
int |
Last HTTP response status |
next_retry_at |
datetime |
Next scheduled retry |
Compliance¶
AuditEntry¶
Collection: audit_log | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
resource |
str |
Resource/collection name |
item_id |
str |
Document ID |
operation |
str |
insert, update, replace, delete |
user_id |
str |
User who made the change |
user_name |
str |
User display name |
ip |
str |
Client IP |
changes |
dict |
Diff (before/after) |
snapshot |
dict |
Full document on delete |
ConsentRecord¶
Collection: consent_records | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
user_id |
str |
User |
consent_type |
str |
Consent category |
is_granted |
bool |
Consent granted |
granted_at |
datetime |
Grant timestamp |
revoked_at |
datetime |
Revocation timestamp |
source |
str |
app, portal, admin |
ip_address |
str |
Client IP |
version |
str |
Consent version |
Payment Matching¶
UnmatchedPayment¶
Collection: unmatched_payments | Tenant scoped: Yes
| Field | Type | Description |
|---|---|---|
amount |
Decimal |
Payment amount |
currency |
str |
Currency |
reference |
str |
Payment reference |
sender_name |
str |
Sender name |
payment_date |
date |
Payment date |
status |
str |
unmatched, matched, written_off, refunded |
matched_claim_id |
str |
Matched claim (when resolved) |
candidate_claim_ids |
list[str] |
Potential matches |
Allocation¶
AllocationResult¶
Collection: allocation_results | Tenant scoped: No
| Field | Type | Description |
|---|---|---|
tenant_id |
str |
Tenant |
payment_amount |
Decimal |
Total payment |
currency |
str |
Currency |
allocated_total |
Decimal |
Amount allocated |
unallocated |
Decimal |
Remaining unallocated |
claim_allocations |
list[ClaimAllocation] |
Per-claim allocations |
SettlementOrder¶
Collection: settlement_orders | Tenant scoped: No
| Field | Type | Description |
|---|---|---|
tenant_id |
str |
Tenant |
entries |
list[SettlementOrderEntry] |
Allocation priority order (default: collection_cost, fee, interest, capital) |