generated from amazon-archives/__template_MIT-0
-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Labels
Description
Summary
A set of fixes to align the TypeScript runtime with the other runtimes (Java, Python, .NET) for functional equivalence and cross-runtime consistency.
Contracts Service
DynamoDB attribute name (contractEventHandler.ts)
updateContract: changedUpdateExpressionfrom'set contract_status = :t, modified_date = :m'to'set contract_status = :t, contract_last_modified_on = :m'- This corrects a bug where
updateContractwrote to a non-existentmodified_dateattribute instead of the correctcontract_last_modified_onattribute written bycreateContract
Web Service
Event source from environment variable (requestApprovalFunction.ts)
- Replaced hardcoded
'unicorn-web'source in thefirePropertyEventcall withprocess.env.SERVICE_NAMESPACE ?? 'unicorn-web' - Ensures the EventBridge event
Sourcefield reflects theSERVICE_NAMESPACEenvironment variable, consistent with other runtimes
Metric name correction (publicationEvaluationEventHandler.ts)
- Changed
metrics.addMetric('ContractUpdated', ...)tometrics.addMetric('PropertiesApproved', ...) ContractUpdatedwas incorrect for this handler (which tracks property publication evaluation, not contract updates)
Evaluation result validation (publicationEvaluationEventHandler.ts)
- Added guard to only process events where
evaluationResultis'APPROVED'or'DECLINED' - Logs a warning and returns without writing to DynamoDB for any other value
Structured logging in propertySearchFunction.ts
- Replaced all
console.log(...)calls in thepropertyDetailsmethod withlogger.info(...) - Ensures all log output goes through the Powertools structured logger rather than raw
console.log
Reactions are currently unavailable