Skip to content

Commit c8844bd

Browse files
committed
fix(web): correct Lambda handler class name and property ID format
Two independent functional breaks in the Java Web service: 1. template.yaml Handler referenced publicationmanager.PublicationEvaluationEventHandlerFunction, but the class is named PublicationEvaluationEventHandler (no 'Function' suffix). Every PublicationEvaluationCompleted delivery threw ClassNotFoundException, so property status was never updated to APPROVED/DECLINED. 2. Property.getId() built the id by joining the DynamoDB partition/sort keys (PROPERTY#country#city + street#number) and replacing '#' with '/', producing a 5-segment id like 'PROPERTY/usa/anytown/main-street/111'. Every consumer — the approvals state machine's DynamoDB lookups, and Web's own PublicationEvaluationEventHandler, which explicitly requires exactly 4 segments — expects the canonical 4-segment 'country/city/street/number' format used by every other language track. Rebuilt getId() directly from the raw address fields to match. Verified: PublicationEvaluationEventHandlerTests and RequestApprovalFunctionTests (which exercise getId() indirectly) pass; sam validate --lint clean.
1 parent ef5c86d commit c8844bd

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

unicorn_web/Common/src/main/java/dao/Property.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,9 @@ public String getId() {
6161
if (id != null) {
6262
return id;
6363
}
64-
String partitionKey = getPk();
65-
String sortKey = getSk();
66-
if (partitionKey != null && sortKey != null) {
67-
return (partitionKey + '/' + sortKey).replace('#', '/');
64+
if (country != null && city != null && street != null && propertyNumber != null) {
65+
return (country + "/" + city + "/" + street + "/" + propertyNumber)
66+
.replace(' ', '-').toLowerCase();
6867
}
6968
return null;
7069
}

unicorn_web/infrastructure/web-service/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Resources:
128128
Type: AWS::Serverless::Function
129129
Properties:
130130
CodeUri: ../../PublicationManagerService
131-
Handler: publicationmanager.PublicationEvaluationEventHandlerFunction::handleRequest
131+
Handler: publicationmanager.PublicationEvaluationEventHandler::handleRequest
132132
Policies:
133133
- DynamoDBCrudPolicy:
134134
TableName: !Ref PropertiesTable

0 commit comments

Comments
 (0)