BFF Web Service

Java Lambda-based Backend for Frontend service providing API orchestration for web clients, proxying requests to Quote, Policy, Claims, Customer, Partner, Pricing and File Upload domain services.

Service BFF Service AWS Lambda

Overview

The BFF Web Service is a Java Lambda-based Backend for Frontend service that provides a unified API entry point for web clients interacting with the Capstone PAS system. It orchestrates requests across Quote, Policy, Claims, Customer, Partner, Pricing, and File Upload domain services.

Architecture

  • Runtime: Java 21 on AWS Lambda
  • API Gateway: AWS API Gateway triggers individual Lambda handlers
  • Handler count: 69 Lambda handlers
  • Pattern: One Lambda handler per HTTP endpoint
Web Client
|
v
AWS API Gateway
|
v
BFF Web Lambda Handlers (69)
|
+---> Quote Domain
+---> Policy Domain
+---> Claims Domain
+---> Customer Domain
+---> Partner Domain
+---> Pricing Service
+---> File Upload Service

Capabilities

Quote Management (26 handlers)

  • Create quotes and quotes linked to policies
  • Manage products, beneficiaries, and optional benefits
  • Capture policyholder, sales agent, and collection details
  • Set terms, cover start dates, and replacement cover details
  • Finalise and accept quotes

Policy Servicing (20 handlers)

  • Manage beneficiaries and personal details
  • Generate and refresh policy schedules
  • Cancel, reinstate, stack, and stagger cover
  • Record deceased notifications
  • Import policies and add verifications

Claims Processing (19 handlers)

  • Create claims for main life and covered life deaths
  • Update claim details, banking details, and death details
  • Calculate payouts and process payments
  • Repudiate and override claims
  • Submit claims to CRM

Customer & Partner Queries (4 handlers)

  • Retrieve customer details and banking information
  • Retrieve partner configuration and product rules

Pricing (1 handler)

  • Perform pricing calculations

File Management (5 handlers)

  • Upload, download, and delete files
  • Generate pre-signed S3 URLs
  • Track file command status

Technical Stack

  • Runtime: Java 21 on AWS Lambda
  • Framework: Custom clean architecture with Google Guice DI
  • Messaging: AWS SQS for async command dispatching
  • HTTP Client: Java HTTP Client for domain service calls
  • Serialization: Jackson for JSON processing
  • Resilience: Resilience4j for fault tolerance

Observability Events

The service emits structured JSON log events for observability:

  • RequestReceivedEventV1 - Every incoming HTTP request
  • CaptchaValidatedEventV1 / CaptchaFailedEventV1 - CAPTCHA outcomes
  • ProxyRequestSentEventV1 / ProxyResponseReceivedEventV1 - Proxy lifecycle
  • ProxyUpstreamErrorEventV1 - Backend connectivity failures