### DB architecture guidelines #### Overview ... #### Core Concepts - .... #### User table - # Model App\Models\User - # Migrations database/migrations/0001_01_01_000000_create_users_table.php - # Seeder database/seeders/UsersTableSeeder.php ... ##### Structure - id - username - first_name - last_name - phone - phone_verified_at - locale - password_must_be_changed - options - email_verified_at - remember_token - created_at - updated_at ##### Indexes - username (unique) - phone (unique) - email (unique) - email_verified_at - remember_token ##### Relations - roles (Role model) #### Branch table - # Model App\Modules\Branch\Models\Branch - # Migrations app/Modules/Branch/Database/Migrations/2025_10_09_190439_create_branches_table.php - # Seeder Not found ##### Structure - id - unique_code - name (json) - address (json) - region (string)[in: ag, mr, ah, ak, dz, bn, lb] - province_id - phone_numbers (json) - billing_username - billing_password - billing_swift_username - billing_swift_password - billing_visa_master_username - billing_visa_master_password - billing_sber_username - billing_sber_password - active - created_at - updated_at ##### Indexes - unique_code (unique) - region ##### Relations - province (Province model) - users (User model) #### Province table - # Model App\Modules\Province\Models\Province - # Migrations app/Modules/Province/Database/Migrations/2025_10_09_185951_create_provinces_table.php - # Seeder Not found ##### Structure - id - region - name (json) - active - created_at - updated_at ##### Indexes - None ##### Relations - None #### LoanOrderRequiredDocs table - # Model App\Modules\LoanOrder\Models\LoanOrderRequiredDocs - # Migrations app/Modules/LoanOrder/Database/Migrations/2025_10_09_211513_create_loan_order_required_docs_table.php - # Seeder Not found ##### Structure - id - name (text) - value (text) - created_at - updated_at ##### Indexes - None ##### Relations - loanOrders (LoanOrder model) #### LoanType table - # Model App\Modules\LoanOrder\Models\LoanType - # Migrations app/Modules/LoanOrder/Database/Migrations/2025_10_09_183412_create_loan_types_table.php - # Seeder Not found ##### Structure - id - name (json) - tax - maturity - notes - active - created_at - updated_at ##### Indexes - None ##### Relations - None #### LoanOrder table - # Model App\Modules\LoanOrder\Models\LoanOrder - # Migrations app/Modules/LoanOrder/Database/Migrations/2025_10_09_220443_create_loan_orders_table.php - # Seeder Not found ##### Structure - id - unique_id - source - user_id - loan_type - region - branch_id - customer_name - customer_surname - customer_patronic_name - passport_address - real_address - passport_serie - passport_id - passport_given_at - passport_given_by - born_place - born_at - email - phone - phone_additional - phone_home - work_region - work_province_id - work_company - work_company_accountant_number - work_started_at - work_salary - work_position - education - marriage_status - passport_one (text) - passport_two (text) - passport_three (text) - passport_four (text) - loan_amount - card_number - card_name - card_month - card_year - guarantor_name - guarantor_surname - guarantor_patronic_name - guarantor_passport_serie - guarantor_passport_id - guarantor_card_number - guarantor_card_name - guarantor_card_month - guarantor_card_year - guarantor_note - guarantor_2_name - guarantor_2_surname - guarantor_2_patronic_name - guarantor_2_passport_serie - guarantor_2_passport_id - guarantor_2_card_number - guarantor_2_card_name - guarantor_2_card_month - guarantor_2_card_year - guarantor_2_note - loan_card_number - loan_card_name - loan_card_month - loan_card_year - loan_order_required_doc_id - status - satisfiable - notes (text) - created_at - updated_at - deleted_at ##### Indexes - unique_id (unique) - source - customer_name - customer_surname - passport_serie - passport_id - phone - work_region - loan_amount ##### Relations - loanType (LoanType model) - branch (Branch model) - workProvince (Province model) - user (User model) - requiredDocs (LoanOrderRequiredDocs model) #### OtpVerification table - # Model App\Modules\OtpVerification\Models\OtpVerification - # Migrations app/Modules/OtpVerification/Database/Migrations/2025_09_22_164249_create_otp_verifications_table.php - # Seeder Not found ##### Structure - id - username - code - created_at - updated_at ##### Indexes - None ##### Relations - None #### AuthEvent table - # Model App\Modules\BaseAuth\Models\AuthEvent - # Migrations app/Modules/BaseAuth/Database/Migrations/2025_10_07_181725_create_auth_events_table.php - # Seeder Not found ##### Structure - id - name - request_method - ip - user_agent - target_url - options (json) - created_at - updated_at ##### Indexes - name - request_method - ip - user_agent - target_url ##### Relations - None