Skip to main content

Devlog: 2026-04-07 — PSX LLPA Evaluation Plugin

What Happened

Wrote a PowerBuilder plugin for the PowerSeller Desktop App that calls PSX's ephemeral LLPA evaluation endpoint (ADR-099). Tom (senior developer) provided a sample JSON payload (llpa.json) showing 435 loans he wants evaluated against FNMA's LLPA grid. This plugin gives him that capability without modifying the core Desktop App.

Research Conducted

Deep-dived the existing plugin repos to understand the exact patterns:

  • fnmb2b plugin — discovered Tom uses PB's native HttpClient (not C# / .NET) for HTTP calls, JsonGenerator/JsonParser for JSON, and psb2b_service_urls for endpoint configuration
  • ahmratesheet plugin — studied the simpler plugin structure for the file/folder conventions
  • BidMgr plugin — studied the complex plugin for database update and macro registration patterns
  • Base framework (n_cst_rate_sheet_fn) — understood the version check and plugin registration flow

What Was Built

10 PowerBuilder source export files at desktop-plugin/psxllpa/:

FilePurpose
n_cst_psxllpa.sruMain NVO — HTTP client, JSON build/parse, rmcat_loan updates
w_psxllpa.srwMain window with Settings and Results tabs
m_psxllpa.srmMenu with Actions → Evaluate LLPAs
uo_tab_psxllpa_settings.sruSettings tab for PSX URL and API key
uo_tab_psxllpa_results.sruResults tab showing LLPA evaluation results
d_psxllpa_settings.srdDataWindow for psb2b_service_urls config
d_psxllpa_request_loans.srdDataWindow showing loans to evaluate
d_psxllpa_results.srdDataWindow showing LLPA results
d_psxllpa_results_detail.srdDataWindow for per-component detail
psxllpa.pbgLibrary group file

How It Works

  1. User opens the PSX LLPA Evaluation plugin from the Desktop App
  2. Plugin loads loans from rmcat_loan for the selected Risk Manager profile
  3. Builds a JSON payload matching Tom's llpa.json format (21 MISMO PascalCase fields per loan)
  4. POSTs to PSX's /api/v1/pricing/llpa-evaluation endpoint via PB's native HttpClient
  5. Parses the JSON response (per-loan TotalLLPA, BasePrice, AdjustedPrice, etc.)
  6. UPDATEs rmcat_loan with the returned pricing values
  7. Displays results in a grid for review

What Tom Needs to Do

  1. Copy the 10 source files to his plugin workspace
  2. Import into PowerBuilder IDE and compile psxllpa.pbl
  3. Add to the Desktop App's library list
  4. Configure the PSX staging URL and API key (via the Settings tab)
  5. Test with a Risk Manager profile

Key Technical Decisions

  • Pure PowerBuilder — no C# components needed (matches fnmb2b pattern)
  • Uses psb2b_service_urls for endpoint configuration (same table fnmb2b uses)
  • Self-registers on first run via of_update_database
  • JSON fields match MISMO PascalCase (aligned with PSX ADR-093)
  • Response maps directly to rmcat_loan pricing columns