@opendoor/partner-sdk-server-js-core 1.0.7-beta.70.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"answerKeyMapping.d.ts","sourceRoot":"","sources":["../src/answerKeyMapping.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAgGH;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"answerKeyMapping.d.ts","sourceRoot":"","sources":["../src/answerKeyMapping.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAgGH;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA2HzB"}
|
package/dist/answerKeyMapping.js
CHANGED
|
@@ -96,9 +96,20 @@ const NUMERIC_KEYS = new Set([
|
|
|
96
96
|
export function transformAnswersToOfferInput(answers) {
|
|
97
97
|
const offerInput = {};
|
|
98
98
|
const experimental = [];
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
// Normalize values that differ between prefill data (MLS) and BFF expectations.
|
|
100
|
+
const POOL_TYPE_NORMALIZE = {
|
|
101
|
+
none: 'no_pool',
|
|
102
|
+
community: 'community_pool',
|
|
103
|
+
};
|
|
104
|
+
for (const [key, rawValue] of Object.entries(answers)) {
|
|
105
|
+
if (rawValue === undefined || SKIP_KEYS.has(key))
|
|
101
106
|
continue;
|
|
107
|
+
// Normalize pool type values from prefill data to BFF enum keys
|
|
108
|
+
const value = key === 'home.pool_type' &&
|
|
109
|
+
typeof rawValue === 'string' &&
|
|
110
|
+
rawValue in POOL_TYPE_NORMALIZE
|
|
111
|
+
? POOL_TYPE_NORMALIZE[rawValue]
|
|
112
|
+
: rawValue;
|
|
102
113
|
// Special case: home.hoa_type fans out to separate boolean fields
|
|
103
114
|
// GraphQL has homeHoaTypeAgeRestrictedCommunity and homeHoaTypeGatedCommunity as booleans
|
|
104
115
|
// Value can be a string (legacy single-select) or string[] (multi-select checkboxes)
|