@lendi/integrations-transform 1.9.1 → 1.9.2

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.
@@ -293,14 +293,12 @@ exports.generateLivingExpenses = generateLivingExpenses;
293
293
  function generatePropertyExpenses(propertyExpenses) {
294
294
  return propertyExpenses
295
295
  .filter((expense) => expense.amount !== undefined)
296
- .map((expense) => {
297
- normalizeAmounts(expense);
298
- return {
299
- '@Amount': expense.amount,
300
- '@Category': enum_mappings_1.propertyExpenseCategoryMapping[expense.type],
301
- '@Frequency': enum_mappings_1.incomeExpenseFrequencyMapping[expense.frequency],
302
- };
303
- });
296
+ .map(normalizeAmounts)
297
+ .map((expense) => ({
298
+ '@Amount': expense.amount,
299
+ '@Category': enum_mappings_1.propertyExpenseCategoryMapping[expense.type],
300
+ '@Frequency': enum_mappings_1.incomeExpenseFrequencyMapping[expense.frequency],
301
+ }));
304
302
  }
305
303
  exports.generatePropertyExpenses = generatePropertyExpenses;
306
304
  /**
@@ -309,17 +307,20 @@ exports.generatePropertyExpenses = generatePropertyExpenses;
309
307
  * @param propertyExpenses
310
308
  */
311
309
  function determineOccupancy(propertyExpenses) {
312
- const propertyExpenseCategoryList = propertyExpenses.map((expense) => expense.type);
310
+ const propertyExpenseCategoryList = propertyExpenses
311
+ .filter((expense) => expense.amount !== undefined)
312
+ .map((expense) => expense.type);
313
313
  if (propertyExpenseCategoryList.includes(public_asset_1.PropertyExpenseType.InvestmentPropertyRunningCosts)) {
314
314
  return lixi_internal_request_1.OccupancyList.NonOwner;
315
315
  }
316
- else if (propertyExpenseCategoryList.includes(public_asset_1.PropertyExpenseType.PrimaryResidenceRunningCosts && public_asset_1.PropertyExpenseType.SecondaryResidenceRunningCosts)) {
316
+ else if (propertyExpenseCategoryList.includes(public_asset_1.PropertyExpenseType.SecondaryResidenceRunningCosts)) {
317
317
  return lixi_internal_request_1.OccupancyList.OwnerSecondary;
318
318
  }
319
319
  else if (propertyExpenseCategoryList.some((item) => item !== public_asset_1.PropertyExpenseType.SecondaryResidenceRunningCosts &&
320
320
  item === public_asset_1.PropertyExpenseType.PrimaryResidenceRunningCosts)) {
321
321
  return lixi_internal_request_1.OccupancyList.OwnerPrimary;
322
322
  }
323
+ return lixi_internal_request_1.OccupancyList.OwnerPrimary;
323
324
  }
324
325
  exports.determineOccupancy = determineOccupancy;
325
326
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lendi/integrations-transform",
3
- "version": "1.9.1",
3
+ "version": "1.9.2",
4
4
  "description": "Library for kafka event data transforming",
5
5
  "author": "Integrations <integrations@lendi.com.au>",
6
6
  "homepage": "https://bitbucket.org/lendi-dev/integrations-shared-packages#readme",