generated from amazon-archives/__template_MIT-0
-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
Summary
A set of fixes to align the Java runtime with the other runtimes (Python, TypeScript, .NET) for functional equivalence and cross-runtime consistency.
Contracts Service
Class rename
- Renamed class
ContractEventHandler→ContractEventHandlerFunctioninunicorn_contracts/ContractsService/src/main/java/contracts/ContractEventHandler.java - Renamed the file to
ContractEventHandlerFunction.java - Updated
CreateContractTests.javato referenceContractEventHandlerFunction
Timestamp type change (Contract.java)
- Changed
contractCreatedfield fromLongtoString - Changed
contractLastModifiedOnfield fromLongtoString
Timestamp storage in createContract
- Replaced
Instant.now().toEpochMilli()withInstant.now().toString() - Changed DynamoDB attribute storage from
.n(String.valueOf(timestamp))to.s(Instant.now().toString()) - Applied to both
contract_createdandcontract_last_modified_onattributes
Timestamp storage in updateContract
- Changed expression attribute value
:modifiedDatefrom.n(String.valueOf(Instant.now().toEpochMilli()))to.s(Instant.now().toString())
ResponseParser.java
- Removed
.map(Long::valueOf)fromcontract_createdandcontract_last_modified_onparsing chains (fields are nowString, notLong)
Observability metrics
- Added
ContractCreatedmetric (MetricUnit.COUNT, value1) tocreateContractsuccess path - Added
ContractUpdatedmetric (MetricUnit.COUNT, value1) toupdateContractsuccess path - Uses
MetricsFactory.getMetricsInstance().addMetric(...)(correct instance-based API for Powertools Java v2.x)
Web Service (Publication Manager)
Event source from environment variable (RequestApprovalFunction.java)
- Added
SERVICE_NAMESPACEfield read fromSystem.getenv("SERVICE_NAMESPACE") - Replaced hardcoded
"Unicorn.Web"source insendEventwith theSERVICE_NAMESPACEfield
Complete event payload (RequestApprovalFunction.java)
- Expanded the
RequestApprovalinner class to include all required fields:status,listprice(Float),images(List<String>),description,currency - Updated
sendEventto populate all fields from thePropertyobject into the event detail
Observability metrics (RequestApprovalFunction.java)
- Added
ApprovalsRequestedmetric (MetricUnit.COUNT, value1) tosendEventsuccess path
Evaluation result validation (PublicationEvaluationEventHandler.java)
- Added guard to only process events where
evaluationResultisAPPROVEDorDECLINED - Logs a warning and returns without writing to DynamoDB for any other value
Observability metrics (PublicationEvaluationEventHandler.java)
- Added
PropertiesApprovedmetric (MetricUnit.COUNT, value1) toupdatePropertyStatussuccess path
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels