Skip to content

Commit 4dde7a4

Browse files
committed
fix: stop using 'multipleOf' to treat decimals
1 parent a48898a commit 4dde7a4

File tree

4 files changed

+51
-51
lines changed

4 files changed

+51
-51
lines changed

routes/@checkout.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ const schema = {
145145
},
146146
'quantity': {
147147
'type': 'number',
148-
'multipleOf': 0.0001,
148+
// 'multipleOf': 0.0001,
149149
'minimum': 0,
150150
'maximum': 9999999,
151151
'description': 'Item quantity in cart'
@@ -247,7 +247,7 @@ const schema = {
247247
},
248248
'addition': {
249249
'type': 'number',
250-
'multipleOf': 0.0001,
250+
// 'multipleOf': 0.0001,
251251
'minimum': -99999999,
252252
'maximum': 99999999,
253253
'description': 'Additional value, could be negative'
@@ -278,7 +278,7 @@ const schema = {
278278
},
279279
'add_to_price': {
280280
'type': 'number',
281-
'multipleOf': 0.0001,
281+
// 'multipleOf': 0.0001,
282282
'minimum': 0,
283283
'maximum': 99999999,
284284
'description': 'Additional value due to this gift wrap'

routes/calculate_shipping.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ const schema = {
146146
},
147147
'quantity': {
148148
'type': 'number',
149-
'multipleOf': 0.0001,
149+
// 'multipleOf': 0.0001,
150150
'minimum': 0,
151151
'maximum': 9999999,
152152
'description': 'Item quantity in cart'
@@ -165,14 +165,14 @@ const schema = {
165165
},
166166
'price': {
167167
'type': 'number',
168-
'multipleOf': 0.00001,
168+
// 'multipleOf': 0.00001,
169169
'minimum': 0,
170170
'maximum': 999999999,
171171
'description': 'Product sale price specifically for this cart'
172172
},
173173
'final_price': {
174174
'type': 'number',
175-
'multipleOf': 0.00001,
175+
// 'multipleOf': 0.00001,
176176
'minimum': 0,
177177
'maximum': 999999999,
178178
'description': 'Final item price including additions due to customizations and gift wrap'
@@ -188,7 +188,7 @@ const schema = {
188188
'properties': {
189189
'value': {
190190
'type': 'number',
191-
'multipleOf': 0.001,
191+
// 'multipleOf': 0.001,
192192
'minimum': 0,
193193
'maximum': 999999,
194194
'description': 'Size in specified unit'
@@ -212,7 +212,7 @@ const schema = {
212212
'properties': {
213213
'value': {
214214
'type': 'number',
215-
'multipleOf': 0.001,
215+
// 'multipleOf': 0.001,
216216
'minimum': 0,
217217
'maximum': 999999,
218218
'description': 'Size in specified unit'
@@ -233,7 +233,7 @@ const schema = {
233233
},
234234
'subtotal': {
235235
'type': 'number',
236-
'multipleOf': 0.00001,
236+
// 'multipleOf': 0.00001,
237237
'minimum': 0,
238238
'maximum': 9999999999,
239239
'description': 'The sum of all items prices'
@@ -281,7 +281,7 @@ const responseSchema = {
281281
'properties': {
282282
'free_shipping_from_value': {
283283
'type': 'number',
284-
'multipleOf': 0.00001,
284+
// 'multipleOf': 0.00001,
285285
'minimum': 0,
286286
'maximum': 9999999999,
287287
'description': 'Optional minimum cart subtotal to earn free shipping with some shipping service'
@@ -359,7 +359,7 @@ const responseSchema = {
359359
'properties': {
360360
'value': {
361361
'type': 'number',
362-
'multipleOf': 0.001,
362+
// 'multipleOf': 0.001,
363363
'minimum': 0,
364364
'maximum': 999999,
365365
'description': 'Size in specified unit'
@@ -383,7 +383,7 @@ const responseSchema = {
383383
'properties': {
384384
'value': {
385385
'type': 'number',
386-
'multipleOf': 0.001,
386+
// 'multipleOf': 0.001,
387387
'minimum': 0,
388388
'maximum': 999999,
389389
'description': 'Size in specified unit'
@@ -402,21 +402,21 @@ const responseSchema = {
402402
},
403403
'price': {
404404
'type': 'number',
405-
'multipleOf': 0.00001,
405+
// 'multipleOf': 0.00001,
406406
'minimum': 0,
407407
'maximum': 9999999999,
408408
'description': 'Freight cost for this shipping line, without additionals'
409409
},
410410
'declared_value': {
411411
'type': 'number',
412-
'multipleOf': 0.00001,
412+
// 'multipleOf': 0.00001,
413413
'minimum': 0,
414414
'maximum': 9999999999,
415415
'description': 'The package value declared to carrier, generally the sum of all items prices'
416416
},
417417
'declared_value_price': {
418418
'type': 'number',
419-
'multipleOf': 0.00001,
419+
// 'multipleOf': 0.00001,
420420
'minimum': 0,
421421
'maximum': 999999,
422422
'description': 'Cost for the "declared value" additional service'
@@ -428,7 +428,7 @@ const responseSchema = {
428428
},
429429
'own_hand_price': {
430430
'type': 'number',
431-
'multipleOf': 0.00001,
431+
// 'multipleOf': 0.00001,
432432
'minimum': 0,
433433
'maximum': 999999,
434434
'description': 'Cost for the "own hand" additional service'
@@ -440,7 +440,7 @@ const responseSchema = {
440440
},
441441
'receipt_price': {
442442
'type': 'number',
443-
'multipleOf': 0.00001,
443+
// 'multipleOf': 0.00001,
444444
'minimum': 0,
445445
'maximum': 999999,
446446
'description': 'Cost for the "acknowledgment of receipt" additional service'
@@ -466,7 +466,7 @@ const responseSchema = {
466466
},
467467
'price': {
468468
'type': 'number',
469-
'multipleOf': 0.00001,
469+
// 'multipleOf': 0.00001,
470470
'minimum': 0,
471471
'maximum': 999999,
472472
'description': 'Cost for this additional service'
@@ -497,14 +497,14 @@ const responseSchema = {
497497
},
498498
'price': {
499499
'type': 'number',
500-
'multipleOf': 0.00001,
500+
// 'multipleOf': 0.00001,
501501
'minimum': 0,
502502
'maximum': 999999999,
503503
'description': 'Tax value applied'
504504
},
505505
'rate': {
506506
'type': 'number',
507-
'multipleOf': 0.0001,
507+
// 'multipleOf': 0.0001,
508508
'minimum': 0,
509509
'maximum': 100,
510510
'description': 'Tax rate as a function of package value'
@@ -516,14 +516,14 @@ const responseSchema = {
516516
},
517517
'discount': {
518518
'type': 'number',
519-
'multipleOf': 0.0001,
519+
// 'multipleOf': 0.0001,
520520
'minimum': -999999999,
521521
'maximum': 999999999,
522522
'description': 'Discount on shipping price, negative if value was additionated (not discounted)'
523523
},
524524
'total_price': {
525525
'type': 'number',
526-
'multipleOf': 0.00001,
526+
// 'multipleOf': 0.00001,
527527
'minimum': 0,
528528
'maximum': 9999999999,
529529
'description': 'Total cost for this shipping line, with additionals and taxes'

routes/create_transaction.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ const schema = {
147147
},
148148
'quantity': {
149149
'type': 'number',
150-
'multipleOf': 0.0001,
150+
// 'multipleOf': 0.0001,
151151
'minimum': 0,
152152
'maximum': 9999999,
153153
'description': 'Item quantity in cart'
@@ -166,14 +166,14 @@ const schema = {
166166
},
167167
'price': {
168168
'type': 'number',
169-
'multipleOf': 0.00001,
169+
// 'multipleOf': 0.00001,
170170
'minimum': 0,
171171
'maximum': 999999999,
172172
'description': 'Product sale price specifically for this cart'
173173
},
174174
'final_price': {
175175
'type': 'number',
176-
'multipleOf': 0.00001,
176+
// 'multipleOf': 0.00001,
177177
'minimum': 0,
178178
'maximum': 999999999,
179179
'description': 'Final item price including additions due to customizations and gift wrap'
@@ -202,42 +202,42 @@ const schema = {
202202
'properties': {
203203
'total': {
204204
'type': 'number',
205-
'multipleOf': 0.00001,
205+
// 'multipleOf': 0.00001,
206206
'minimum': 0,
207207
'maximum': 9999999999,
208208
'description': 'Order total amount'
209209
},
210210
'subtotal': {
211211
'type': 'number',
212-
'multipleOf': 0.00001,
212+
// 'multipleOf': 0.00001,
213213
'minimum': 0,
214214
'maximum': 9999999999,
215215
'description': 'The sum of all items prices'
216216
},
217217
'freight': {
218218
'type': 'number',
219-
'multipleOf': 0.00001,
219+
// 'multipleOf': 0.00001,
220220
'minimum': 0,
221221
'maximum': 9999999999,
222222
'description': 'Order freight cost'
223223
},
224224
'discount': {
225225
'type': 'number',
226-
'multipleOf': 0.00001,
226+
// 'multipleOf': 0.00001,
227227
'minimum': 0,
228228
'maximum': 9999999999,
229229
'description': 'Applied discount value'
230230
},
231231
'tax': {
232232
'type': 'number',
233-
'multipleOf': 0.00001,
233+
// 'multipleOf': 0.00001,
234234
'minimum': 0,
235235
'maximum': 9999999999,
236236
'description': 'The sum of all the taxes applied to the order'
237237
},
238238
'extra': {
239239
'type': 'number',
240-
'multipleOf': 0.00001,
240+
// 'multipleOf': 0.00001,
241241
'minimum': 0,
242242
'maximum': 9999999999,
243243
'description': 'Sum of optional extra costs applied'
@@ -788,14 +788,14 @@ const responseSchema = {
788788
},
789789
'discount': {
790790
'type': 'number',
791-
'multipleOf': 0.0001,
791+
// 'multipleOf': 0.0001,
792792
'minimum': -999999999,
793793
'maximum': 999999999,
794794
'description': 'Discount by payment method, negative if value was additionated (not discounted)'
795795
},
796796
'amount': {
797797
'type': 'number',
798-
'multipleOf': 0.00001,
798+
// 'multipleOf': 0.00001,
799799
'minimum': 0,
800800
'maximum': 9999999999,
801801
'description': 'Transaction amount, disregarding installment rates'
@@ -813,7 +813,7 @@ const responseSchema = {
813813
},
814814
'value': {
815815
'type': 'number',
816-
'multipleOf': 0.00001,
816+
// 'multipleOf': 0.00001,
817817
'minimum': 0,
818818
'maximum': 9999999999,
819819
'description': 'Installment value'
@@ -825,7 +825,7 @@ const responseSchema = {
825825
},
826826
'total': {
827827
'type': 'number',
828-
'multipleOf': 0.00001,
828+
// 'multipleOf': 0.00001,
829829
'minimum': 0,
830830
'maximum': 9999999999,
831831
'description': 'Total value, sum of all plots'
@@ -839,28 +839,28 @@ const responseSchema = {
839839
'properties': {
840840
'installment': {
841841
'type': 'number',
842-
'multipleOf': 0.00001,
842+
// 'multipleOf': 0.00001,
843843
'minimum': 0,
844844
'maximum': 99999999,
845845
'description': 'Installment fee'
846846
},
847847
'operational': {
848848
'type': 'number',
849-
'multipleOf': 0.00001,
849+
// 'multipleOf': 0.00001,
850850
'minimum': 0,
851851
'maximum': 99999999,
852852
'description': 'Operation fee'
853853
},
854854
'intermediation': {
855855
'type': 'number',
856-
'multipleOf': 0.00001,
856+
// 'multipleOf': 0.00001,
857857
'minimum': 0,
858858
'maximum': 99999999,
859859
'description': 'Intermediation fee, if transaction have an intermediary'
860860
},
861861
'other': {
862862
'type': 'number',
863-
'multipleOf': 0.00001,
863+
// 'multipleOf': 0.00001,
864864
'minimum': 0,
865865
'maximum': 99999999,
866866
'description': 'Sum of other transaction rates'

0 commit comments

Comments
 (0)