Skip to content

Commit e9d9cb2

Browse files
committed
fix: 🎨 pr feedback for adding score
1 parent 10905c7 commit e9d9cb2

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

packages/optimize/android/src/main/java/com/adobe/marketing/mobile/reactnative/optimize/RCTAEPOptimizeUtil.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,15 @@ static WritableMap convertOfferToWritableMap(final Offer offer) {
7171
offerWritableMap.putString("etag", offer.getEtag());
7272
}
7373
offerWritableMap.putString("schema", offer.getSchema());
74+
if (offer.getMeta() != null) {
75+
offerWritableMap.putMap("meta", convertMapToWritableMap(new HashMap<String, Object>(offer.getMeta())));
76+
}
77+
offerWritableMap.putInt("score", offer.getScore());
7478

7579
final WritableMap dataWritableMap = new WritableNativeMap();
7680
dataWritableMap.putString("id", offer.getId());
7781
dataWritableMap.putString("format", offer.getType().toString());
7882
dataWritableMap.putString("content", offer.getContent());
79-
dataWritableMap.putInt("score", offer.getScore());
8083
if (offer.getLanguage() != null) {
8184
dataWritableMap.putArray("language", convertListToWritableArray(new ArrayList<Object>(offer.getLanguage())));
8285
}
@@ -85,10 +88,6 @@ static WritableMap convertOfferToWritableMap(final Offer offer) {
8588
dataWritableMap.putMap("characteristics", convertMapToWritableMap(new HashMap<String, Object>(offer.getCharacteristics())));
8689
}
8790

88-
if (offer.getMeta() != null) {
89-
dataWritableMap.putMap("meta", convertMapToWritableMap(new HashMap<String, Object>(offer.getMeta())));
90-
}
91-
9291
offerWritableMap.putMap("data", dataWritableMap);
9392
return offerWritableMap;
9493
}

packages/optimize/ts/models/Offer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class Offer {
9393
* Note: The Edge sendEvent API can be used to dispatch this data in an Experience Event along with any additional XDM, free-form data, and override
9494
* dataset identifier.
9595
* @param {Proposition} proposition - the proposition this Offer belongs to
96-
* @return {Promise<Record<string, any>>} - a promise that resolves to xdm map
96+
* @return {Promise<Map<string, any>>} - a promise that resolves to xdm map
9797
*/
9898
generateDisplayInteractionXdm(proposition: Proposition): Promise<Map<string, any>> {
9999
const entries = Object.entries(proposition).filter(([_, value]) => typeof(value) !== "function");
@@ -107,7 +107,7 @@ class Offer {
107107
* Note: The Edge sendEvent API can be used to dispatch this data in an Experience Event along with any additional XDM, free-form data, and override
108108
* dataset identifier.
109109
* @param {Proposition} proposition - proposition this Offer belongs to
110-
* @return {Promise<Record<string, any>>} a promise that resolves to xdm map
110+
* @return {Promise<Map<string, any>>} a promise that resolves to xdm map
111111
*/
112112
generateTapInteractionXdm(proposition: Proposition): Promise<Map<string, any>> {
113113
const entries = Object.entries(proposition).filter(([_, value]) => typeof(value) !== "function");

0 commit comments

Comments
 (0)