From 073ba4a629d1e519a22150291388c38a7a615079 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Mon, 29 Dec 2025 22:20:31 +0000 Subject: [PATCH 1/3] Fix real-time position aggregation in Position Blotter The update() method was replacing position quantities instead of aggregating them when receiving WebSocket updates. This caused multiple trades for the same security to show as separate entries instead of a single net position. Changed the logic to add the incoming quantity to the existing quantity rather than replacing it. Co-Authored-By: genes.victor@gmail.com --- .../trade/position-blotter/position-blotter.component.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web-front-end/angular/main/app/trade/position-blotter/position-blotter.component.ts b/web-front-end/angular/main/app/trade/position-blotter/position-blotter.component.ts index 6b7546019..6683975ce 100644 --- a/web-front-end/angular/main/app/trade/position-blotter/position-blotter.component.ts +++ b/web-front-end/angular/main/app/trade/position-blotter/position-blotter.component.ts @@ -74,10 +74,12 @@ export class PositionBlotterComponent implements OnChanges, OnDestroy { const row = this.gridApi.getRowNode(data.security); let positionData; if (row) { + const currentQuantity = row.data.quantity || 0; + const newQuantity = currentQuantity + data.quantity; positionData = { - update: [Object.assign(row.data, { quantity: data.quantity })] + update: [Object.assign(row.data, { quantity: newQuantity })] }; - } else { + }else { positionData = { add: [{ accountid: data.accountid, From efd131069a7eba5db1e37ef397d31bbe3d79adf4 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Mon, 29 Dec 2025 23:01:29 +0000 Subject: [PATCH 2/3] Fix position aggregation bug in both Angular and React frontends Angular fix: - Fixed row-id mismatch: getRowNode() now uses 'Position-{security}' format to match getRowId() return value - Removed incorrect quantity aggregation (WebSocket sends absolute totals) React fix: - Fixed position update logic to find and update existing positions instead of always appending new rows - Positions are now properly updated by security symbol Co-Authored-By: genes.victor@gmail.com --- .../position-blotter/position-blotter.component.ts | 9 ++++----- web-front-end/react/src/Datatable/Datatable.tsx | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/web-front-end/angular/main/app/trade/position-blotter/position-blotter.component.ts b/web-front-end/angular/main/app/trade/position-blotter/position-blotter.component.ts index 6683975ce..d64bc738f 100644 --- a/web-front-end/angular/main/app/trade/position-blotter/position-blotter.component.ts +++ b/web-front-end/angular/main/app/trade/position-blotter/position-blotter.component.ts @@ -71,15 +71,14 @@ export class PositionBlotterComponent implements OnChanges, OnDestroy { } update(data: any) { - const row = this.gridApi.getRowNode(data.security); + const rowId = `Position-${data.security}`; + const row = this.gridApi.getRowNode(rowId); let positionData; if (row) { - const currentQuantity = row.data.quantity || 0; - const newQuantity = currentQuantity + data.quantity; positionData = { - update: [Object.assign(row.data, { quantity: newQuantity })] + update: [Object.assign(row.data, { quantity: data.quantity })] }; - }else { + } else { positionData = { add: [{ accountid: data.accountid, diff --git a/web-front-end/react/src/Datatable/Datatable.tsx b/web-front-end/react/src/Datatable/Datatable.tsx index 60ce9ee03..c2a2cfad4 100644 --- a/web-front-end/react/src/Datatable/Datatable.tsx +++ b/web-front-end/react/src/Datatable/Datatable.tsx @@ -45,7 +45,17 @@ export const Datatable = () => { } if (data.topic === `/accounts/${event.target.value}/positions`) { console.log("INCOMING POSITION DATA: ", data); - setPositionRowData((current: PositionData[]) => [...current, data.payload]); + setPositionRowData((current: PositionData[]) => { + const existingIndex = current.findIndex( + (pos: PositionData) => pos.security === data.payload.security + ); + if (existingIndex >= 0) { + const updated = [...current]; + updated[existingIndex] = data.payload; + return updated; + } + return [...current, data.payload]; + }); } }); }, [selectedId]) @@ -86,4 +96,4 @@ return ( ); -} \ No newline at end of file +} From 8d1c04dc5902b0b2a900e722702bd60d75d18081 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 1 Jan 2026 22:21:05 +0000 Subject: [PATCH 3/3] Make people-service port configurable via PEOPLE_SERVICE_PORT environment variable - Updated Program.cs to read PEOPLE_SERVICE_PORT env var (defaults to 18089) - Updated launchSettings.json to use the environment variable - Updated README.md to document the configuration option and remove TODO --- people-service/PeopleService.WebApi/Program.cs | 4 ++++ .../PeopleService.WebApi/Properties/launchSettings.json | 4 ++-- people-service/README.md | 8 +++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/people-service/PeopleService.WebApi/Program.cs b/people-service/PeopleService.WebApi/Program.cs index 57a344ef1..acdacfd3a 100644 --- a/people-service/PeopleService.WebApi/Program.cs +++ b/people-service/PeopleService.WebApi/Program.cs @@ -6,6 +6,10 @@ var builder = WebApplication.CreateBuilder(args); +// Configure port from environment variable +var port = Environment.GetEnvironmentVariable("PEOPLE_SERVICE_PORT") ?? "18089"; +builder.WebHost.UseUrls($"http://0.0.0.0:{port}"); + // Add services to the container. builder.Services.AddControllers(); diff --git a/people-service/PeopleService.WebApi/Properties/launchSettings.json b/people-service/PeopleService.WebApi/Properties/launchSettings.json index b8cf77f56..cd9a7a89c 100644 --- a/people-service/PeopleService.WebApi/Properties/launchSettings.json +++ b/people-service/PeopleService.WebApi/Properties/launchSettings.json @@ -14,9 +14,9 @@ "dotnetRunMessages": true, "launchBrowser": true, "launchUrl": "swagger", - "applicationUrl": "http://0.0.0.0:18089", "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" + "ASPNETCORE_ENVIRONMENT": "Development", + "PEOPLE_SERVICE_PORT": "18089" } }, "IIS Express": { diff --git a/people-service/README.md b/people-service/README.md index 5f09ce137..f0c0f099d 100644 --- a/people-service/README.md +++ b/people-service/README.md @@ -12,7 +12,7 @@ The people service is used for managing users in the system, and associating the Default Port is 18089. -TODO: Get this port configurable by env var PEOPLE_SERVICE_PORT +The port can be configured using the `PEOPLE_SERVICE_PORT` environment variable. ## Building and Running ```bash @@ -20,6 +20,12 @@ $ cd PeopleService.WebApi $ dotnet run ``` +To run on a different port: +```bash +$ export PEOPLE_SERVICE_PORT=8080 +$ dotnet run +``` + ## Accessing the Swagger URL Visit the forwarded port `/swagger` to open the SwaggerUI.