Schema: security
Part of the generated database reference.
identity_documents
- Domain:
security Β· Feature gate: #[cfg(feature = "security")] Β· Migration: 6.5.23-branch-scope-cleanup
- Rust source:
botschema/src/security.rs
| Column |
SQL type |
Null |
Default |
Key |
References |
| id |
UUID |
no |
gen_random_uuid() |
PK |
β |
| bot_id |
UUID |
no |
β |
β |
β |
| profile_id |
UUID |
no |
β |
FK |
identity_profiles.id |
| document_type |
VARCHAR(30) |
no |
β |
β |
β |
| document_number |
VARCHAR(100) |
no |
β |
β |
β |
| issuing_country |
VARCHAR(10) |
yes |
β |
β |
β |
| issue_date |
DATE |
yes |
β |
β |
β |
| expiry_date |
DATE |
yes |
β |
β |
β |
| front_image_url |
TEXT |
yes |
β |
β |
β |
| back_image_url |
TEXT |
yes |
β |
β |
β |
| selfie_image_url |
TEXT |
yes |
β |
β |
β |
| ocr_data |
JSONB |
yes |
β |
β |
β |
| verification_status |
VARCHAR(30) |
no |
'pending' |
β |
β |
| created_at |
TIMESTAMPTZ |
no |
NOW() |
β |
β |
| branch_id |
UUID |
yes |
β |
FK |
branches.id |
identity_faces
- Domain:
security Β· Feature gate: #[cfg(feature = "security")] Β· Migration: 6.5.23-branch-scope-cleanup
- Rust source:
botschema/src/security.rs
| Column |
SQL type |
Null |
Default |
Key |
References |
| id |
UUID |
no |
gen_random_uuid() |
PK |
β |
| bot_id |
UUID |
no |
β |
β |
β |
| profile_id |
UUID |
no |
β |
FK |
identity_profiles.id |
| photo_url |
TEXT |
no |
β |
β |
β |
| embedding |
JSONB |
yes |
β |
β |
β |
| quality_score |
NUMERIC(5,4) |
yes |
β |
β |
β |
| is_primary |
BOOLEAN |
no |
false |
β |
β |
| created_at |
TIMESTAMPTZ |
no |
NOW() |
β |
β |
| branch_id |
UUID |
yes |
β |
FK |
branches.id |
identity_kyc_workflows
- Domain:
security Β· Feature gate: #[cfg(feature = "security")] Β· Migration: 6.5.50-multitenant-scope
- Rust source:
botschema/src/security.rs
| Column |
SQL type |
Null |
Default |
Key |
References |
| id |
UUID |
no |
gen_random_uuid() |
PK |
β |
| bot_id |
UUID |
no |
β |
β |
β |
| profile_id |
UUID |
no |
β |
FK |
identity_profiles.id |
| workflow_name |
VARCHAR(100) |
no |
β |
β |
β |
| current_step |
VARCHAR(100) |
no |
β |
β |
β |
| steps_completed |
JSONB |
no |
'[]' |
β |
β |
| total_steps |
INTEGER |
no |
β |
β |
β |
| status |
VARCHAR(30) |
no |
'in_progress' |
β |
β |
| started_at |
TIMESTAMPTZ |
no |
NOW() |
β |
β |
| completed_at |
TIMESTAMPTZ |
yes |
β |
β |
β |
| branch_id |
uuid |
no |
'00000000-0000-0000-0000-000000000000' |
FK |
branches.id |
identity_profiles
- Domain:
security Β· Feature gate: #[cfg(feature = "security")] Β· Migration: 6.5.23-branch-scope-cleanup
- Rust source:
botschema/src/security.rs
| Column |
SQL type |
Null |
Default |
Key |
References |
| id |
UUID |
no |
gen_random_uuid() |
PK |
β |
| bot_id |
UUID |
no |
β |
β |
β |
| person_id |
UUID |
no |
β |
β |
β |
| legal_name |
TEXT |
no |
β |
β |
β |
| tax_id |
VARCHAR(50) |
no |
β |
β |
β |
| date_of_birth |
DATE |
yes |
β |
β |
β |
| nationality |
VARCHAR(50) |
yes |
β |
β |
β |
| email |
VARCHAR(255) |
yes |
β |
β |
β |
| phone |
VARCHAR(50) |
yes |
β |
β |
β |
| address |
JSONB |
yes |
β |
β |
β |
| risk_score |
INTEGER |
yes |
β |
β |
β |
| kyc_status |
VARCHAR(30) |
no |
'pending' |
β |
β |
| created_at |
TIMESTAMPTZ |
no |
NOW() |
β |
β |
| updated_at |
TIMESTAMPTZ |
no |
NOW() |
β |
β |
| branch_id |
UUID |
yes |
β |
FK |
branches.id |
identity_signatures
- Domain:
security Β· Feature gate: #[cfg(feature = "security")] Β· Migration: 6.5.50-multitenant-scope
- Rust source:
botschema/src/security.rs
| Column |
SQL type |
Null |
Default |
Key |
References |
| id |
UUID |
no |
gen_random_uuid() |
PK |
β |
| bot_id |
UUID |
no |
β |
β |
β |
| profile_id |
UUID |
no |
β |
FK |
identity_profiles.id |
| document_id |
UUID |
no |
β |
FK |
identity_documents.id |
| signature_data |
TEXT |
no |
β |
β |
β |
| signature_image_url |
TEXT |
yes |
β |
β |
β |
| ip_address |
VARCHAR(64) |
yes |
β |
β |
β |
| user_agent |
TEXT |
yes |
β |
β |
β |
| signed_at |
TIMESTAMPTZ |
no |
NOW() |
β |
β |
| branch_id |
uuid |
no |
'00000000-0000-0000-0000-000000000000' |
FK |
branches.id |
identity_signed_documents
- Domain:
security Β· Feature gate: #[cfg(feature = "security")] Β· Migration: 6.5.23-branch-scope-cleanup
- Rust source:
botschema/src/security.rs
| Column |
SQL type |
Null |
Default |
Key |
References |
| id |
UUID |
no |
gen_random_uuid() |
PK |
β |
| bot_id |
UUID |
no |
β |
β |
β |
| signature_id |
UUID |
no |
β |
FK |
identity_signatures.id |
| document_hash |
VARCHAR(128) |
no |
β |
β |
β |
| document_name |
TEXT |
no |
β |
β |
β |
| signature_algorithm |
VARCHAR(30) |
no |
β |
β |
β |
| signed_at |
TIMESTAMPTZ |
no |
NOW() |
β |
β |
| branch_id |
UUID |
yes |
β |
FK |
branches.id |