orc-shared 5.9.0-dev.2 → 5.9.0-dev.3

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.
package/dist/constants.js CHANGED
@@ -173,6 +173,7 @@ var serializationTypeKey = exports.serializationTypeKey = "__type";
173
173
  var jsonCargoType = exports.jsonCargoType = {
174
174
  boolean: "Boolean",
175
175
  double: "Double",
176
+ decimal: "Decimal",
176
177
  dateTime: "DateTime",
177
178
  integer: "Int32",
178
179
  stringArray: "String[]",
@@ -23,6 +23,7 @@ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoader
23
23
  };
24
24
  var customDataType = exports.customDataType = {
25
25
  money: "Money",
26
+ moneyDecimal: "moneyDecimal",
26
27
  priceTieredRateTable: "PriceTieredRateTable",
27
28
  quantityTieredRateTable: "QuantityTieredRateTable",
28
29
  password: "Password",
@@ -75,6 +76,8 @@ var toJsonCargo = exports.toJsonCargo = function toJsonCargo(attribute, value) {
75
76
  switch (attribute.customDataType) {
76
77
  case customDataType.money:
77
78
  return createJsonCargo(_constants.jsonCargoType.double, Number(formatNumber(value, 2)));
79
+ case customDataType.moneyDecimal:
80
+ return createJsonCargo(_constants.jsonCargoType.decimal, Number(formatNumber(value, 2)));
78
81
  case customDataType.priceTieredRateTable:
79
82
  case customDataType.quantityTieredRateTable:
80
83
  return createTieredTableJsonCargo(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orc-shared",
3
- "version": "5.9.0-dev.2",
3
+ "version": "5.9.0-dev.3",
4
4
  "description": "Shared code for Orckestra applications",
5
5
  "main": "./src/index.js",
6
6
  "exports": {
package/src/constants.js CHANGED
@@ -171,6 +171,7 @@ export const serializationTypeKey = "__type";
171
171
  export const jsonCargoType = {
172
172
  boolean: "Boolean",
173
173
  double: "Double",
174
+ decimal: "Decimal",
174
175
  dateTime: "DateTime",
175
176
  integer: "Int32",
176
177
  stringArray: "String[]",
@@ -11,6 +11,7 @@ import { parseGuid } from "./parseHelper";
11
11
 
12
12
  export const customDataType = {
13
13
  money: "Money",
14
+ moneyDecimal: "moneyDecimal",
14
15
  priceTieredRateTable: "PriceTieredRateTable",
15
16
  quantityTieredRateTable: "QuantityTieredRateTable",
16
17
  password: "Password",
@@ -70,6 +71,8 @@ export const toJsonCargo = (attribute, value) => {
70
71
  switch (attribute.customDataType) {
71
72
  case customDataType.money:
72
73
  return createJsonCargo(jsonCargoType.double, Number(formatNumber(value, 2)));
74
+ case customDataType.moneyDecimal:
75
+ return createJsonCargo(jsonCargoType.decimal, Number(formatNumber(value, 2)));
73
76
  case customDataType.priceTieredRateTable:
74
77
  case customDataType.quantityTieredRateTable:
75
78
  return createTieredTableJsonCargo(value);
@@ -78,6 +78,8 @@ describe("toJsonCargo function", () => {
78
78
  [15.4321, attributeDataType.decimal, null, { __type: "ValueOfDouble", value: 15.4321 }],
79
79
  [15.4321, attributeDataType.customType, customDataType.money, { __type: "ValueOfDouble", value: 15.43 }],
80
80
  [15.4285, attributeDataType.customType, customDataType.money, { __type: "ValueOfDouble", value: 15.43 }],
81
+ [15.4321, attributeDataType.customType, customDataType.moneyDecimal, { __type: "ValueOfDecimal", value: 15.43 }],
82
+ [15.4285, attributeDataType.customType, customDataType.moneyDecimal, { __type: "ValueOfDecimal", value: 15.43 }],
81
83
  [
82
84
  ["d22679f2-5807-4068-b17f-700742d97503"],
83
85
  attributeDataType.entityReference,