Skip to content

twu027/Lending-lite

Repository files navigation

Lending Lite

Test Coverage

Overview

Lending Lite is a Salesforce-based lending application designed to demonstrate production-grade software engineering practices within the Salesforce platform. The project is built with a strong emphasis on clean architecture, modular design, and CI/CD automation.

Architecture

The system follows a layered architecture aligned with Salesforce best practices:

+--------------------------+
|        Lightning UI      |  ← LWC (loanAppWorkbench)
+------------+-------------+
             ↓
+------------+-------------+
|   Apex Controller Layer  |  ← LoanApplicationController
+------------+-------------+
             ↓
+------------+-------------+
|     Trigger Layer        |  ← LoanApplicationTrigger
+------------+-------------+
             ↓
+------------+-------------+
|   Handler Layer          |  ← LoanSubmitHandler
+------------+-------------+
             ↓
+------------+-------------+
|   Service Layer           |  ← LoanApplicationService, ServiceFactory
+------------+-------------+
             ↓
+------------+-------------+
| Integration/Async Layer   |
|  (REST, Platform Events,  |
|   Queueables, External    |
|   Credit Bureau API)      |
+--------------------------+

Data Flow Summary

  • Trigger → Handler → Service: Loan submission events are processed through a decoupled chain promoting reusability and testability.
  • REST Layer: Exposes the CreditScoreRest API for external integrations.
  • Platform Events: Publishes Credit_Risk_Calculation_Request__e for async communication.
  • Queueable Jobs: Handles background processing and external service calls.

Key Features

  • Unlocked Package Structure for modular deployment.
  • Trigger-Handler-Service Pattern for maintainability.
  • Dependency Injection via ServiceFactory and @TestVisible annotations.
  • Automated Testing & CI/CD via GitHub Actions.
  • Pre-commit Hooks (Husky + Prettier) for code quality enforcement.
  • Lightning Web Component (LWC) for loan application UI.

Test Strategy

Unit tests are implemented for all major classes, leveraging a central TestDataFactory for consistency. The project maintains ≥85% Apex coverage across the namespace.

CI/CD Pipeline

The repository includes GitHub Actions workflows for:

  • Pull Request validation (linting, test execution)
  • Automated packaging and deployment
  • Version tagging for releases

Extensibility

The solution is designed for easy evolution:

  • New features or UI elements can be added without impacting core logic.
  • Service interfaces promote scalability and testability.
  • Platform Events and Queueables ensure asynchronous extensibility.

Getting Started

  1. Clone the repository

  2. Authenticate to your Dev Hub:

    sf org login web --set-default-dev-hub --alias DevHub
  3. Create a scratch org:

    sf org create scratch --definition-file config/project-scratch-def.json --alias lending-scratch --set-default
  4. Deploy the source:

    sf project deploy start
  5. Run tests:

    sf apex run test --test-level RunLocalTests --code-coverage --result-format human

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors