kumi 0.0.31 → 0.0.33
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -1
- data/README.md +31 -99
- data/data/kernels/ruby/core/arithmetic.yaml +2 -2
- data/docs/COMPOSED_SCHEMAS.md +137 -0
- data/docs/SCHEMA_IMPORTS.md +275 -0
- data/docs/SYNTAX.md +48 -0
- data/golden/array_element/expected/schema_ruby.rb +2 -27
- data/golden/array_index/expected/nast.txt +6 -6
- data/golden/array_index/expected/schema_ruby.rb +4 -31
- data/golden/array_operations/expected/lir_06_const_prop.txt +4 -8
- data/golden/array_operations/expected/schema_javascript.mjs +4 -8
- data/golden/array_operations/expected/schema_ruby.rb +10 -43
- data/golden/cascade_logic/expected/lir_06_const_prop.txt +7 -14
- data/golden/cascade_logic/expected/schema_javascript.mjs +7 -14
- data/golden/cascade_logic/expected/schema_ruby.rb +11 -45
- data/golden/chained_fusion/expected/lir_06_const_prop.txt +8 -18
- data/golden/chained_fusion/expected/schema_javascript.mjs +8 -18
- data/golden/chained_fusion/expected/schema_ruby.rb +14 -53
- data/golden/decimal_explicit/expected/schema_ruby.rb +4 -31
- data/golden/element_arrays/expected/lir_06_const_prop.txt +5 -11
- data/golden/element_arrays/expected/schema_javascript.mjs +5 -11
- data/golden/element_arrays/expected/schema_ruby.rb +13 -50
- data/golden/empty_and_null_inputs/expected/schema_ruby.rb +4 -31
- data/golden/example_xpto/expected/ast.txt +23 -0
- data/golden/example_xpto/expected/input_plan.txt +1 -0
- data/golden/example_xpto/expected/lir_00_unoptimized.txt +16 -0
- data/golden/example_xpto/expected/lir_01_hoist_scalar_references.txt +16 -0
- data/golden/example_xpto/expected/lir_02_inlined.txt +16 -0
- data/golden/example_xpto/expected/lir_03_cse.txt +16 -0
- data/golden/example_xpto/expected/lir_04_1_loop_fusion.txt +16 -0
- data/golden/example_xpto/expected/lir_04_loop_invcm.txt +16 -0
- data/golden/example_xpto/expected/lir_06_const_prop.txt +13 -0
- data/golden/example_xpto/expected/nast.txt +17 -0
- data/golden/example_xpto/expected/schema_javascript.mjs +13 -0
- data/golden/example_xpto/expected/schema_ruby.rb +13 -0
- data/golden/example_xpto/expected/snast.txt +17 -0
- data/golden/example_xpto/expected.json +4 -0
- data/golden/example_xpto/input.json +3 -0
- data/golden/example_xpto/schema.kumi +8 -0
- data/golden/function_overload/expected/schema_ruby.rb +2 -27
- data/golden/game_of_life/expected/lir_06_const_prop.txt +236 -287
- data/golden/game_of_life/expected/schema_javascript.mjs +32 -39
- data/golden/game_of_life/expected/schema_ruby.rb +34 -66
- data/golden/hash_keys/expected/lir_06_const_prop.txt +4 -10
- data/golden/hash_keys/expected/schema_javascript.mjs +6 -12
- data/golden/hash_keys/expected/schema_ruby.rb +8 -39
- data/golden/hash_value/expected/lir_06_const_prop.txt +3 -6
- data/golden/hash_value/expected/schema_javascript.mjs +3 -6
- data/golden/hash_value/expected/schema_ruby.rb +7 -37
- data/golden/hierarchical_complex/expected/lir_06_const_prop.txt +9 -18
- data/golden/hierarchical_complex/expected/schema_javascript.mjs +9 -18
- data/golden/hierarchical_complex/expected/schema_ruby.rb +14 -51
- data/golden/inline_rename_scope_leak/expected/lir_06_const_prop.txt +2 -6
- data/golden/inline_rename_scope_leak/expected/schema_javascript.mjs +2 -6
- data/golden/inline_rename_scope_leak/expected/schema_ruby.rb +7 -39
- data/golden/input_reference/expected/schema_ruby.rb +6 -35
- data/golden/interleaved_fusion/expected/lir_06_const_prop.txt +6 -14
- data/golden/interleaved_fusion/expected/schema_javascript.mjs +6 -14
- data/golden/interleaved_fusion/expected/schema_ruby.rb +11 -47
- data/golden/let_inline/expected/lir_06_const_prop.txt +1 -2
- data/golden/let_inline/expected/schema_javascript.mjs +1 -2
- data/golden/let_inline/expected/schema_ruby.rb +3 -29
- data/golden/loop_fusion/expected/lir_06_const_prop.txt +4 -10
- data/golden/loop_fusion/expected/schema_javascript.mjs +4 -10
- data/golden/loop_fusion/expected/schema_ruby.rb +8 -41
- data/golden/min_reduce_scope/expected/lir_06_const_prop.txt +3 -6
- data/golden/min_reduce_scope/expected/schema_javascript.mjs +3 -6
- data/golden/min_reduce_scope/expected/schema_ruby.rb +8 -39
- data/golden/mixed_dimensions/expected/lir_06_const_prop.txt +1 -2
- data/golden/mixed_dimensions/expected/schema_javascript.mjs +1 -2
- data/golden/mixed_dimensions/expected/schema_ruby.rb +5 -33
- data/golden/multirank_hoisting/expected/lir_06_const_prop.txt +9 -18
- data/golden/multirank_hoisting/expected/schema_javascript.mjs +9 -18
- data/golden/multirank_hoisting/expected/schema_ruby.rb +16 -55
- data/golden/nested_hash/expected/lir_06_const_prop.txt +1 -2
- data/golden/nested_hash/expected/schema_javascript.mjs +1 -2
- data/golden/nested_hash/expected/schema_ruby.rb +3 -29
- data/golden/reduction_broadcast/expected/schema_ruby.rb +5 -33
- data/golden/roll/expected/lir_06_const_prop.txt +8 -15
- data/golden/roll/expected/schema_javascript.mjs +8 -15
- data/golden/roll/expected/schema_ruby.rb +13 -48
- data/golden/schema_imports_broadcasting_with_imports/expected/ast.txt +26 -0
- data/golden/schema_imports_broadcasting_with_imports/expected/input_plan.txt +5 -0
- data/golden/schema_imports_broadcasting_with_imports/expected/lir_00_unoptimized.txt +20 -0
- data/golden/schema_imports_broadcasting_with_imports/expected/lir_01_hoist_scalar_references.txt +20 -0
- data/golden/schema_imports_broadcasting_with_imports/expected/lir_02_inlined.txt +22 -0
- data/golden/schema_imports_broadcasting_with_imports/expected/lir_03_cse.txt +21 -0
- data/golden/schema_imports_broadcasting_with_imports/expected/lir_04_1_loop_fusion.txt +21 -0
- data/golden/schema_imports_broadcasting_with_imports/expected/lir_04_loop_invcm.txt +21 -0
- data/golden/schema_imports_broadcasting_with_imports/expected/lir_06_const_prop.txt +21 -0
- data/golden/schema_imports_broadcasting_with_imports/expected/nast.txt +12 -0
- data/golden/schema_imports_broadcasting_with_imports/expected/schema_javascript.mjs +22 -0
- data/golden/schema_imports_broadcasting_with_imports/expected/schema_ruby.rb +24 -0
- data/golden/schema_imports_broadcasting_with_imports/expected/snast.txt +12 -0
- data/golden/schema_imports_broadcasting_with_imports/expected.json +4 -0
- data/golden/schema_imports_broadcasting_with_imports/input.json +7 -0
- data/golden/schema_imports_broadcasting_with_imports/schema.kumi +14 -0
- data/golden/schema_imports_complex_order_calc/expected/ast.txt +82 -0
- data/golden/schema_imports_complex_order_calc/expected/input_plan.txt +16 -0
- data/golden/schema_imports_complex_order_calc/expected/lir_00_unoptimized.txt +94 -0
- data/golden/schema_imports_complex_order_calc/expected/lir_01_hoist_scalar_references.txt +94 -0
- data/golden/schema_imports_complex_order_calc/expected/lir_02_inlined.txt +187 -0
- data/golden/schema_imports_complex_order_calc/expected/lir_03_cse.txt +131 -0
- data/golden/schema_imports_complex_order_calc/expected/lir_04_1_loop_fusion.txt +131 -0
- data/golden/schema_imports_complex_order_calc/expected/lir_04_loop_invcm.txt +131 -0
- data/golden/schema_imports_complex_order_calc/expected/lir_06_const_prop.txt +131 -0
- data/golden/schema_imports_complex_order_calc/expected/nast.txt +56 -0
- data/golden/schema_imports_complex_order_calc/expected/schema_javascript.mjs +147 -0
- data/golden/schema_imports_complex_order_calc/expected/schema_ruby.rb +149 -0
- data/golden/schema_imports_complex_order_calc/expected/snast.txt +56 -0
- data/golden/schema_imports_complex_order_calc/expected.json +12 -0
- data/golden/schema_imports_complex_order_calc/input.json +20 -0
- data/golden/schema_imports_complex_order_calc/schema.kumi +33 -0
- data/golden/schema_imports_composed_order/expected/ast.txt +33 -0
- data/golden/schema_imports_composed_order/expected/input_plan.txt +3 -0
- data/golden/schema_imports_composed_order/expected/lir_00_unoptimized.txt +25 -0
- data/golden/schema_imports_composed_order/expected/lir_01_hoist_scalar_references.txt +25 -0
- data/golden/schema_imports_composed_order/expected/lir_02_inlined.txt +33 -0
- data/golden/schema_imports_composed_order/expected/lir_03_cse.txt +33 -0
- data/golden/schema_imports_composed_order/expected/lir_04_1_loop_fusion.txt +33 -0
- data/golden/schema_imports_composed_order/expected/lir_04_loop_invcm.txt +33 -0
- data/golden/schema_imports_composed_order/expected/lir_06_const_prop.txt +33 -0
- data/golden/schema_imports_composed_order/expected/nast.txt +25 -0
- data/golden/schema_imports_composed_order/expected/schema_javascript.mjs +35 -0
- data/golden/schema_imports_composed_order/expected/schema_ruby.rb +33 -0
- data/golden/schema_imports_composed_order/expected/snast.txt +25 -0
- data/golden/schema_imports_composed_order/expected.json +6 -0
- data/golden/schema_imports_composed_order/input.json +5 -0
- data/golden/schema_imports_composed_order/schema.kumi +15 -0
- data/golden/schema_imports_discount_with_tax/expected/ast.txt +37 -0
- data/golden/schema_imports_discount_with_tax/expected/input_plan.txt +2 -0
- data/golden/schema_imports_discount_with_tax/expected/lir_00_unoptimized.txt +30 -0
- data/golden/schema_imports_discount_with_tax/expected/lir_01_hoist_scalar_references.txt +30 -0
- data/golden/schema_imports_discount_with_tax/expected/lir_02_inlined.txt +37 -0
- data/golden/schema_imports_discount_with_tax/expected/lir_03_cse.txt +34 -0
- data/golden/schema_imports_discount_with_tax/expected/lir_04_1_loop_fusion.txt +34 -0
- data/golden/schema_imports_discount_with_tax/expected/lir_04_loop_invcm.txt +34 -0
- data/golden/schema_imports_discount_with_tax/expected/lir_06_const_prop.txt +34 -0
- data/golden/schema_imports_discount_with_tax/expected/nast.txt +30 -0
- data/golden/schema_imports_discount_with_tax/expected/schema_javascript.mjs +37 -0
- data/golden/schema_imports_discount_with_tax/expected/schema_ruby.rb +34 -0
- data/golden/schema_imports_discount_with_tax/expected/snast.txt +30 -0
- data/golden/schema_imports_discount_with_tax/expected.json +7 -0
- data/golden/schema_imports_discount_with_tax/input.json +4 -0
- data/golden/schema_imports_discount_with_tax/schema.kumi +15 -0
- data/golden/schema_imports_line_items/expected/ast.txt +35 -0
- data/golden/schema_imports_line_items/expected/input_plan.txt +8 -0
- data/golden/schema_imports_line_items/expected/lir_00_unoptimized.txt +19 -0
- data/golden/schema_imports_line_items/expected/lir_01_hoist_scalar_references.txt +19 -0
- data/golden/schema_imports_line_items/expected/lir_02_inlined.txt +24 -0
- data/golden/schema_imports_line_items/expected/lir_03_cse.txt +22 -0
- data/golden/schema_imports_line_items/expected/lir_04_1_loop_fusion.txt +22 -0
- data/golden/schema_imports_line_items/expected/lir_04_loop_invcm.txt +22 -0
- data/golden/schema_imports_line_items/expected/lir_06_const_prop.txt +22 -0
- data/golden/schema_imports_line_items/expected/nast.txt +19 -0
- data/golden/schema_imports_line_items/expected/schema_javascript.mjs +23 -0
- data/golden/schema_imports_line_items/expected/schema_ruby.rb +22 -0
- data/golden/schema_imports_line_items/expected/snast.txt +19 -0
- data/golden/schema_imports_line_items/expected.json +5 -0
- data/golden/schema_imports_line_items/input.json +13 -0
- data/golden/schema_imports_line_items/schema.kumi +17 -0
- data/golden/schema_imports_multiple/expected/ast.txt +35 -0
- data/golden/schema_imports_multiple/expected/input_plan.txt +2 -0
- data/golden/schema_imports_multiple/expected/lir_00_unoptimized.txt +29 -0
- data/golden/schema_imports_multiple/expected/lir_01_hoist_scalar_references.txt +29 -0
- data/golden/schema_imports_multiple/expected/lir_02_inlined.txt +41 -0
- data/golden/schema_imports_multiple/expected/lir_03_cse.txt +37 -0
- data/golden/schema_imports_multiple/expected/lir_04_1_loop_fusion.txt +37 -0
- data/golden/schema_imports_multiple/expected/lir_04_loop_invcm.txt +37 -0
- data/golden/schema_imports_multiple/expected/lir_06_const_prop.txt +37 -0
- data/golden/schema_imports_multiple/expected/nast.txt +28 -0
- data/golden/schema_imports_multiple/expected/schema_javascript.mjs +40 -0
- data/golden/schema_imports_multiple/expected/schema_ruby.rb +37 -0
- data/golden/schema_imports_multiple/expected/snast.txt +28 -0
- data/golden/schema_imports_multiple/expected.json +7 -0
- data/golden/schema_imports_multiple/input.json +4 -0
- data/golden/schema_imports_multiple/schema.kumi +15 -0
- data/golden/schema_imports_nested_expressions/expected/ast.txt +31 -0
- data/golden/schema_imports_nested_expressions/expected/input_plan.txt +3 -0
- data/golden/schema_imports_nested_expressions/expected/lir_00_unoptimized.txt +22 -0
- data/golden/schema_imports_nested_expressions/expected/lir_01_hoist_scalar_references.txt +22 -0
- data/golden/schema_imports_nested_expressions/expected/lir_02_inlined.txt +32 -0
- data/golden/schema_imports_nested_expressions/expected/lir_03_cse.txt +32 -0
- data/golden/schema_imports_nested_expressions/expected/lir_04_1_loop_fusion.txt +32 -0
- data/golden/schema_imports_nested_expressions/expected/lir_04_loop_invcm.txt +32 -0
- data/golden/schema_imports_nested_expressions/expected/lir_06_const_prop.txt +28 -0
- data/golden/schema_imports_nested_expressions/expected/nast.txt +23 -0
- data/golden/schema_imports_nested_expressions/expected/schema_javascript.mjs +29 -0
- data/golden/schema_imports_nested_expressions/expected/schema_ruby.rb +28 -0
- data/golden/schema_imports_nested_expressions/expected/snast.txt +23 -0
- data/golden/schema_imports_nested_expressions/expected.json +5 -0
- data/golden/schema_imports_nested_expressions/input.json +5 -0
- data/golden/schema_imports_nested_expressions/schema.kumi +13 -0
- data/golden/schema_imports_nested_with_reductions/expected/ast.txt +47 -0
- data/golden/schema_imports_nested_with_reductions/expected/input_plan.txt +12 -0
- data/golden/schema_imports_nested_with_reductions/expected/lir_00_unoptimized.txt +31 -0
- data/golden/schema_imports_nested_with_reductions/expected/lir_01_hoist_scalar_references.txt +31 -0
- data/golden/schema_imports_nested_with_reductions/expected/lir_02_inlined.txt +58 -0
- data/golden/schema_imports_nested_with_reductions/expected/lir_03_cse.txt +49 -0
- data/golden/schema_imports_nested_with_reductions/expected/lir_04_1_loop_fusion.txt +51 -0
- data/golden/schema_imports_nested_with_reductions/expected/lir_04_loop_invcm.txt +49 -0
- data/golden/schema_imports_nested_with_reductions/expected/lir_06_const_prop.txt +49 -0
- data/golden/schema_imports_nested_with_reductions/expected/nast.txt +23 -0
- data/golden/schema_imports_nested_with_reductions/expected/schema_javascript.mjs +49 -0
- data/golden/schema_imports_nested_with_reductions/expected/schema_ruby.rb +52 -0
- data/golden/schema_imports_nested_with_reductions/expected/snast.txt +23 -0
- data/golden/schema_imports_nested_with_reductions/expected.json +6 -0
- data/golden/schema_imports_nested_with_reductions/input.json +16 -0
- data/golden/schema_imports_nested_with_reductions/schema.kumi +23 -0
- data/golden/schema_imports_with_imports/expected/ast.txt +19 -0
- data/golden/schema_imports_with_imports/expected/input_plan.txt +1 -0
- data/golden/schema_imports_with_imports/expected/lir_00_unoptimized.txt +13 -0
- data/golden/schema_imports_with_imports/expected/lir_01_hoist_scalar_references.txt +13 -0
- data/golden/schema_imports_with_imports/expected/lir_02_inlined.txt +14 -0
- data/golden/schema_imports_with_imports/expected/lir_03_cse.txt +13 -0
- data/golden/schema_imports_with_imports/expected/lir_04_1_loop_fusion.txt +13 -0
- data/golden/schema_imports_with_imports/expected/lir_04_loop_invcm.txt +13 -0
- data/golden/schema_imports_with_imports/expected/lir_06_const_prop.txt +13 -0
- data/golden/schema_imports_with_imports/expected/nast.txt +13 -0
- data/golden/schema_imports_with_imports/expected/schema_javascript.mjs +13 -0
- data/golden/schema_imports_with_imports/expected/schema_ruby.rb +13 -0
- data/golden/schema_imports_with_imports/expected/snast.txt +13 -0
- data/golden/schema_imports_with_imports/expected.json +4 -0
- data/golden/schema_imports_with_imports/input.json +3 -0
- data/golden/schema_imports_with_imports/schema.kumi +10 -0
- data/golden/shift/expected/lir_06_const_prop.txt +18 -30
- data/golden/shift/expected/schema_javascript.mjs +18 -30
- data/golden/shift/expected/schema_ruby.rb +25 -67
- data/golden/shift_2d/expected/lir_06_const_prop.txt +36 -60
- data/golden/shift_2d/expected/schema_javascript.mjs +36 -60
- data/golden/shift_2d/expected/schema_ruby.rb +49 -109
- data/golden/simple_math/expected/lir_06_const_prop.txt +3 -6
- data/golden/simple_math/expected/schema_javascript.mjs +3 -6
- data/golden/simple_math/expected/schema_ruby.rb +8 -39
- data/golden/streaming_basics/expected/lir_06_const_prop.txt +6 -12
- data/golden/streaming_basics/expected/schema_javascript.mjs +6 -12
- data/golden/streaming_basics/expected/schema_ruby.rb +14 -51
- data/golden/tuples/expected/lir_06_const_prop.txt +5 -22
- data/golden/tuples/expected/schema_javascript.mjs +5 -22
- data/golden/tuples/expected/schema_ruby.rb +11 -57
- data/golden/tuples_and_arrays/expected/lir_06_const_prop.txt +4 -8
- data/golden/tuples_and_arrays/expected/schema_javascript.mjs +4 -8
- data/golden/tuples_and_arrays/expected/schema_ruby.rb +9 -41
- data/golden/us_tax_2024/expected/lir_06_const_prop.txt +94 -171
- data/golden/us_tax_2024/expected/schema_javascript.mjs +13 -21
- data/golden/us_tax_2024/expected/schema_ruby.rb +15 -48
- data/golden/with_constants/expected/lir_06_const_prop.txt +3 -8
- data/golden/with_constants/expected/schema_javascript.mjs +3 -8
- data/golden/with_constants/expected/schema_ruby.rb +5 -35
- data/lib/kumi/analyzer.rb +8 -7
- data/lib/kumi/configuration.rb +7 -6
- data/lib/kumi/core/analyzer/passes/attach_anchors_pass.rb +1 -1
- data/lib/kumi/core/analyzer/passes/attach_terminal_info_pass.rb +1 -1
- data/lib/kumi/core/analyzer/passes/codegen/js/declaration_emitter.rb +20 -0
- data/lib/kumi/core/analyzer/passes/codegen/ruby/declaration_emitter.rb +16 -7
- data/lib/kumi/core/analyzer/passes/codegen/ruby/output_buffer.rb +3 -35
- data/lib/kumi/core/analyzer/passes/dependency_resolver.rb +6 -0
- data/lib/kumi/core/analyzer/passes/import_analysis_pass.rb +90 -0
- data/lib/kumi/core/analyzer/passes/lir/constant_propagation_pass.rb +77 -36
- data/lib/kumi/core/analyzer/passes/lir/lower_pass.rb +26 -11
- data/lib/kumi/core/analyzer/passes/name_indexer.rb +20 -2
- data/lib/kumi/core/analyzer/passes/nast_dimensional_analyzer_pass.rb +44 -0
- data/lib/kumi/core/analyzer/passes/normalize_to_nast_pass.rb +30 -0
- data/lib/kumi/core/analyzer/passes/semantic_constraint_validator.rb +5 -1
- data/lib/kumi/core/analyzer/passes/snast_pass.rb +15 -0
- data/lib/kumi/core/lir/build.rb +27 -0
- data/lib/kumi/core/lir/peephole.rb +164 -0
- data/lib/kumi/core/nast.rb +16 -0
- data/lib/kumi/core/ruby_parser/build_context.rb +3 -1
- data/lib/kumi/core/ruby_parser/parser.rb +1 -1
- data/lib/kumi/core/ruby_parser/schema_builder.rb +33 -3
- data/lib/kumi/dev/golden/result.rb +9 -3
- data/lib/kumi/dev/golden/runtime_test.rb +16 -1
- data/lib/kumi/dev/golden.rb +18 -20
- data/lib/kumi/dev/golden_schema_modules.rb +8 -0
- data/lib/kumi/dev/golden_schema_wrapper.rb +116 -0
- data/lib/kumi/dev/support/kumi_runner.mjs +18 -0
- data/lib/kumi/schema.rb +44 -2
- data/lib/kumi/support/lir_printer.rb +21 -5
- data/lib/kumi/support/nast_printer.rb +11 -0
- data/lib/kumi/support/s_expression_printer.rb +9 -0
- data/lib/kumi/support/snast_printer.rb +6 -0
- data/lib/kumi/syntax/import_call.rb +11 -0
- data/lib/kumi/syntax/import_declaration.rb +11 -0
- data/lib/kumi/syntax/root.rb +2 -2
- data/lib/kumi/test_shared_schemas/compound.rb +21 -0
- data/lib/kumi/test_shared_schemas/discount.rb +19 -0
- data/lib/kumi/test_shared_schemas/price.rb +19 -0
- data/lib/kumi/test_shared_schemas/subtotal.rb +22 -0
- data/lib/kumi/test_shared_schemas/tax.rb +18 -0
- data/lib/kumi/version.rb +1 -1
- data/lib/kumi.rb +19 -4
- metadata +176 -3
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
(LIR
|
|
2
|
+
(Declaration order_subtotals
|
|
3
|
+
%t1 = load_input "orders" :: array
|
|
4
|
+
loop orders id=L1 in %t1 as el=%orders_el_2, idx=%orders_i_3
|
|
5
|
+
%t4 = load_field orders_el_2["items"] :: array
|
|
6
|
+
%t5 = importschemacall %t4 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
7
|
+
yield %t5
|
|
8
|
+
end_loop
|
|
9
|
+
)
|
|
10
|
+
(Declaration order_with_shipping
|
|
11
|
+
%t6 = load_input "orders" :: array
|
|
12
|
+
loop orders id=L2 in %t6 as el=%orders_el_7, idx=%orders_i_8
|
|
13
|
+
%t60 = load_field orders_el_7["items"] :: array
|
|
14
|
+
%t10 = load_field orders_el_7["shipping_cost"] :: decimal
|
|
15
|
+
%t61 = importschemacall %t60 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
16
|
+
%t11 = call core.add(%t61, %t10) :: integer
|
|
17
|
+
yield %t11
|
|
18
|
+
end_loop
|
|
19
|
+
)
|
|
20
|
+
(Declaration order_discounted
|
|
21
|
+
%t12 = load_input "orders" :: array
|
|
22
|
+
loop orders id=L3 in %t12 as el=%orders_el_13, idx=%orders_i_14
|
|
23
|
+
%t67 = load_field orders_el_13["items"] :: array
|
|
24
|
+
%t64 = load_field orders_el_13["shipping_cost"] :: decimal
|
|
25
|
+
%t16 = load_input "global_discount_rate" :: decimal
|
|
26
|
+
%t68 = importschemacall %t67 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
27
|
+
%t65 = call core.add(%t68, %t64) :: integer
|
|
28
|
+
%t17 = importschemacall %t65, %t16 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
29
|
+
yield %t17
|
|
30
|
+
end_loop
|
|
31
|
+
)
|
|
32
|
+
(Declaration order_tax
|
|
33
|
+
%t18 = load_input "orders" :: array
|
|
34
|
+
loop orders id=L4 in %t18 as el=%orders_el_19, idx=%orders_i_20
|
|
35
|
+
%t78 = load_field orders_el_19["items"] :: array
|
|
36
|
+
%t75 = load_field orders_el_19["shipping_cost"] :: decimal
|
|
37
|
+
%t71 = load_input "global_discount_rate" :: decimal
|
|
38
|
+
%t79 = importschemacall %t78 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
39
|
+
%t76 = call core.add(%t79, %t75) :: integer
|
|
40
|
+
%t72 = importschemacall %t76, %t71 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
41
|
+
%t22 = importschemacall %t72 fn_name="tax" source_module="Kumi::TestSharedSchemas::Tax" input_mapping_keys=["amount"] :: float
|
|
42
|
+
yield %t22
|
|
43
|
+
end_loop
|
|
44
|
+
)
|
|
45
|
+
(Declaration order_totals
|
|
46
|
+
%t23 = load_input "orders" :: array
|
|
47
|
+
loop orders id=L5 in %t23 as el=%orders_el_24, idx=%orders_i_25
|
|
48
|
+
%t89 = load_field orders_el_24["items"] :: array
|
|
49
|
+
%t86 = load_field orders_el_24["shipping_cost"] :: decimal
|
|
50
|
+
%t82 = load_input "global_discount_rate" :: decimal
|
|
51
|
+
%t90 = importschemacall %t89 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
52
|
+
%t87 = call core.add(%t90, %t86) :: integer
|
|
53
|
+
%t83 = importschemacall %t87, %t82 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
54
|
+
%t93 = importschemacall %t83 fn_name="tax" source_module="Kumi::TestSharedSchemas::Tax" input_mapping_keys=["amount"] :: float
|
|
55
|
+
%t28 = call core.add(%t83, %t93) :: float
|
|
56
|
+
yield %t28
|
|
57
|
+
end_loop
|
|
58
|
+
)
|
|
59
|
+
(Declaration discount_per_order
|
|
60
|
+
%t29 = load_input "orders" :: array
|
|
61
|
+
loop orders id=L6 in %t29 as el=%orders_el_30, idx=%orders_i_31
|
|
62
|
+
%t110 = load_field orders_el_30["items"] :: array
|
|
63
|
+
%t107 = load_field orders_el_30["shipping_cost"] :: decimal
|
|
64
|
+
%t114 = load_input "global_discount_rate" :: decimal
|
|
65
|
+
%t111 = importschemacall %t110 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
66
|
+
%t108 = call core.add(%t111, %t107) :: integer
|
|
67
|
+
%t115 = importschemacall %t108, %t114 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
68
|
+
%t34 = call core.sub(%t108, %t115) :: float
|
|
69
|
+
yield %t34
|
|
70
|
+
end_loop
|
|
71
|
+
)
|
|
72
|
+
(Declaration total_orders
|
|
73
|
+
%acc_35 = decl_acc :: integer
|
|
74
|
+
%t36 = load_input "orders" :: array
|
|
75
|
+
loop orders id=L7 in %t36 as el=%orders_el_37, idx=%orders_i_38
|
|
76
|
+
%t39 = load_field orders_el_37["id"] :: string
|
|
77
|
+
%acc_35 = acc_add agg.count(%acc_35, %t39) :: integer
|
|
78
|
+
end_loop
|
|
79
|
+
%t40 = acc_load %acc_35 :: integer
|
|
80
|
+
yield %t40
|
|
81
|
+
)
|
|
82
|
+
(Declaration total_revenue
|
|
83
|
+
%acc_41 = decl_acc :: float
|
|
84
|
+
%t42 = load_input "orders" :: array
|
|
85
|
+
loop orders id=L8 in %t42 as el=%orders_el_43, idx=%orders_i_44
|
|
86
|
+
%t136 = load_field orders_el_43["items"] :: array
|
|
87
|
+
%t133 = load_field orders_el_43["shipping_cost"] :: decimal
|
|
88
|
+
%t129 = load_input "global_discount_rate" :: decimal
|
|
89
|
+
%t137 = importschemacall %t136 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
90
|
+
%t134 = call core.add(%t137, %t133) :: integer
|
|
91
|
+
%t130 = importschemacall %t134, %t129 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
92
|
+
%t140 = importschemacall %t130 fn_name="tax" source_module="Kumi::TestSharedSchemas::Tax" input_mapping_keys=["amount"] :: float
|
|
93
|
+
%t126 = call core.add(%t130, %t140) :: float
|
|
94
|
+
%acc_41 = acc_add agg.sum(%acc_41, %t126) :: float
|
|
95
|
+
end_loop
|
|
96
|
+
%t46 = acc_load %acc_41 :: float
|
|
97
|
+
yield %t46
|
|
98
|
+
)
|
|
99
|
+
(Declaration total_tax_collected
|
|
100
|
+
%acc_47 = decl_acc :: float
|
|
101
|
+
%t48 = load_input "orders" :: array
|
|
102
|
+
loop orders id=L9 in %t48 as el=%orders_el_49, idx=%orders_i_50
|
|
103
|
+
%t164 = load_field orders_el_49["items"] :: array
|
|
104
|
+
%t161 = load_field orders_el_49["shipping_cost"] :: decimal
|
|
105
|
+
%t157 = load_input "global_discount_rate" :: decimal
|
|
106
|
+
%t165 = importschemacall %t164 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
107
|
+
%t162 = call core.add(%t165, %t161) :: integer
|
|
108
|
+
%t158 = importschemacall %t162, %t157 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
109
|
+
%t154 = importschemacall %t158 fn_name="tax" source_module="Kumi::TestSharedSchemas::Tax" input_mapping_keys=["amount"] :: float
|
|
110
|
+
%acc_47 = acc_add agg.sum(%acc_47, %t154) :: float
|
|
111
|
+
end_loop
|
|
112
|
+
%t52 = acc_load %acc_47 :: float
|
|
113
|
+
yield %t52
|
|
114
|
+
)
|
|
115
|
+
(Declaration total_discount_given
|
|
116
|
+
%acc_53 = decl_acc :: float
|
|
117
|
+
%t54 = load_input "orders" :: array
|
|
118
|
+
loop orders id=L10 in %t54 as el=%orders_el_55, idx=%orders_i_56
|
|
119
|
+
%t175 = load_field orders_el_55["items"] :: array
|
|
120
|
+
%t172 = load_field orders_el_55["shipping_cost"] :: decimal
|
|
121
|
+
%t179 = load_input "global_discount_rate" :: decimal
|
|
122
|
+
%t176 = importschemacall %t175 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
123
|
+
%t173 = call core.add(%t176, %t172) :: integer
|
|
124
|
+
%t180 = importschemacall %t173, %t179 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
125
|
+
%t169 = call core.sub(%t173, %t180) :: float
|
|
126
|
+
%acc_53 = acc_add agg.sum(%acc_53, %t169) :: float
|
|
127
|
+
end_loop
|
|
128
|
+
%t58 = acc_load %acc_53 :: float
|
|
129
|
+
yield %t58
|
|
130
|
+
)
|
|
131
|
+
)
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
(LIR
|
|
2
|
+
(Declaration order_subtotals
|
|
3
|
+
%t1 = load_input "orders" :: array
|
|
4
|
+
loop orders id=L1 in %t1 as el=%orders_el_2, idx=%orders_i_3
|
|
5
|
+
%t4 = load_field orders_el_2["items"] :: array
|
|
6
|
+
%t5 = importschemacall %t4 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
7
|
+
yield %t5
|
|
8
|
+
end_loop
|
|
9
|
+
)
|
|
10
|
+
(Declaration order_with_shipping
|
|
11
|
+
%t6 = load_input "orders" :: array
|
|
12
|
+
loop orders id=L2 in %t6 as el=%orders_el_7, idx=%orders_i_8
|
|
13
|
+
%t60 = load_field orders_el_7["items"] :: array
|
|
14
|
+
%t10 = load_field orders_el_7["shipping_cost"] :: decimal
|
|
15
|
+
%t61 = importschemacall %t60 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
16
|
+
%t11 = call core.add(%t61, %t10) :: integer
|
|
17
|
+
yield %t11
|
|
18
|
+
end_loop
|
|
19
|
+
)
|
|
20
|
+
(Declaration order_discounted
|
|
21
|
+
%t12 = load_input "orders" :: array
|
|
22
|
+
loop orders id=L3 in %t12 as el=%orders_el_13, idx=%orders_i_14
|
|
23
|
+
%t67 = load_field orders_el_13["items"] :: array
|
|
24
|
+
%t64 = load_field orders_el_13["shipping_cost"] :: decimal
|
|
25
|
+
%t16 = load_input "global_discount_rate" :: decimal
|
|
26
|
+
%t68 = importschemacall %t67 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
27
|
+
%t65 = call core.add(%t68, %t64) :: integer
|
|
28
|
+
%t17 = importschemacall %t65, %t16 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
29
|
+
yield %t17
|
|
30
|
+
end_loop
|
|
31
|
+
)
|
|
32
|
+
(Declaration order_tax
|
|
33
|
+
%t18 = load_input "orders" :: array
|
|
34
|
+
loop orders id=L4 in %t18 as el=%orders_el_19, idx=%orders_i_20
|
|
35
|
+
%t78 = load_field orders_el_19["items"] :: array
|
|
36
|
+
%t75 = load_field orders_el_19["shipping_cost"] :: decimal
|
|
37
|
+
%t71 = load_input "global_discount_rate" :: decimal
|
|
38
|
+
%t79 = importschemacall %t78 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
39
|
+
%t76 = call core.add(%t79, %t75) :: integer
|
|
40
|
+
%t72 = importschemacall %t76, %t71 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
41
|
+
%t22 = importschemacall %t72 fn_name="tax" source_module="Kumi::TestSharedSchemas::Tax" input_mapping_keys=["amount"] :: float
|
|
42
|
+
yield %t22
|
|
43
|
+
end_loop
|
|
44
|
+
)
|
|
45
|
+
(Declaration order_totals
|
|
46
|
+
%t23 = load_input "orders" :: array
|
|
47
|
+
loop orders id=L5 in %t23 as el=%orders_el_24, idx=%orders_i_25
|
|
48
|
+
%t89 = load_field orders_el_24["items"] :: array
|
|
49
|
+
%t86 = load_field orders_el_24["shipping_cost"] :: decimal
|
|
50
|
+
%t82 = load_input "global_discount_rate" :: decimal
|
|
51
|
+
%t90 = importschemacall %t89 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
52
|
+
%t87 = call core.add(%t90, %t86) :: integer
|
|
53
|
+
%t83 = importschemacall %t87, %t82 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
54
|
+
%t93 = importschemacall %t83 fn_name="tax" source_module="Kumi::TestSharedSchemas::Tax" input_mapping_keys=["amount"] :: float
|
|
55
|
+
%t28 = call core.add(%t83, %t93) :: float
|
|
56
|
+
yield %t28
|
|
57
|
+
end_loop
|
|
58
|
+
)
|
|
59
|
+
(Declaration discount_per_order
|
|
60
|
+
%t29 = load_input "orders" :: array
|
|
61
|
+
loop orders id=L6 in %t29 as el=%orders_el_30, idx=%orders_i_31
|
|
62
|
+
%t110 = load_field orders_el_30["items"] :: array
|
|
63
|
+
%t107 = load_field orders_el_30["shipping_cost"] :: decimal
|
|
64
|
+
%t114 = load_input "global_discount_rate" :: decimal
|
|
65
|
+
%t111 = importschemacall %t110 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
66
|
+
%t108 = call core.add(%t111, %t107) :: integer
|
|
67
|
+
%t115 = importschemacall %t108, %t114 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
68
|
+
%t34 = call core.sub(%t108, %t115) :: float
|
|
69
|
+
yield %t34
|
|
70
|
+
end_loop
|
|
71
|
+
)
|
|
72
|
+
(Declaration total_orders
|
|
73
|
+
%acc_35 = decl_acc :: integer
|
|
74
|
+
%t36 = load_input "orders" :: array
|
|
75
|
+
loop orders id=L7 in %t36 as el=%orders_el_37, idx=%orders_i_38
|
|
76
|
+
%t39 = load_field orders_el_37["id"] :: string
|
|
77
|
+
%acc_35 = acc_add agg.count(%acc_35, %t39) :: integer
|
|
78
|
+
end_loop
|
|
79
|
+
%t40 = acc_load %acc_35 :: integer
|
|
80
|
+
yield %t40
|
|
81
|
+
)
|
|
82
|
+
(Declaration total_revenue
|
|
83
|
+
%acc_41 = decl_acc :: float
|
|
84
|
+
%t42 = load_input "orders" :: array
|
|
85
|
+
loop orders id=L8 in %t42 as el=%orders_el_43, idx=%orders_i_44
|
|
86
|
+
%t136 = load_field orders_el_43["items"] :: array
|
|
87
|
+
%t133 = load_field orders_el_43["shipping_cost"] :: decimal
|
|
88
|
+
%t129 = load_input "global_discount_rate" :: decimal
|
|
89
|
+
%t137 = importschemacall %t136 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
90
|
+
%t134 = call core.add(%t137, %t133) :: integer
|
|
91
|
+
%t130 = importschemacall %t134, %t129 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
92
|
+
%t140 = importschemacall %t130 fn_name="tax" source_module="Kumi::TestSharedSchemas::Tax" input_mapping_keys=["amount"] :: float
|
|
93
|
+
%t126 = call core.add(%t130, %t140) :: float
|
|
94
|
+
%acc_41 = acc_add agg.sum(%acc_41, %t126) :: float
|
|
95
|
+
end_loop
|
|
96
|
+
%t46 = acc_load %acc_41 :: float
|
|
97
|
+
yield %t46
|
|
98
|
+
)
|
|
99
|
+
(Declaration total_tax_collected
|
|
100
|
+
%acc_47 = decl_acc :: float
|
|
101
|
+
%t48 = load_input "orders" :: array
|
|
102
|
+
loop orders id=L9 in %t48 as el=%orders_el_49, idx=%orders_i_50
|
|
103
|
+
%t164 = load_field orders_el_49["items"] :: array
|
|
104
|
+
%t161 = load_field orders_el_49["shipping_cost"] :: decimal
|
|
105
|
+
%t157 = load_input "global_discount_rate" :: decimal
|
|
106
|
+
%t165 = importschemacall %t164 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
107
|
+
%t162 = call core.add(%t165, %t161) :: integer
|
|
108
|
+
%t158 = importschemacall %t162, %t157 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
109
|
+
%t154 = importschemacall %t158 fn_name="tax" source_module="Kumi::TestSharedSchemas::Tax" input_mapping_keys=["amount"] :: float
|
|
110
|
+
%acc_47 = acc_add agg.sum(%acc_47, %t154) :: float
|
|
111
|
+
end_loop
|
|
112
|
+
%t52 = acc_load %acc_47 :: float
|
|
113
|
+
yield %t52
|
|
114
|
+
)
|
|
115
|
+
(Declaration total_discount_given
|
|
116
|
+
%acc_53 = decl_acc :: float
|
|
117
|
+
%t54 = load_input "orders" :: array
|
|
118
|
+
loop orders id=L10 in %t54 as el=%orders_el_55, idx=%orders_i_56
|
|
119
|
+
%t175 = load_field orders_el_55["items"] :: array
|
|
120
|
+
%t172 = load_field orders_el_55["shipping_cost"] :: decimal
|
|
121
|
+
%t179 = load_input "global_discount_rate" :: decimal
|
|
122
|
+
%t176 = importschemacall %t175 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
123
|
+
%t173 = call core.add(%t176, %t172) :: integer
|
|
124
|
+
%t180 = importschemacall %t173, %t179 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
125
|
+
%t169 = call core.sub(%t173, %t180) :: float
|
|
126
|
+
%acc_53 = acc_add agg.sum(%acc_53, %t169) :: float
|
|
127
|
+
end_loop
|
|
128
|
+
%t58 = acc_load %acc_53 :: float
|
|
129
|
+
yield %t58
|
|
130
|
+
)
|
|
131
|
+
)
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
(LIR
|
|
2
|
+
(Declaration order_subtotals
|
|
3
|
+
%t1 = load_input "orders" :: array
|
|
4
|
+
loop orders id=L1 in %t1 as el=%orders_el_2, idx=%orders_i_3
|
|
5
|
+
%t4 = load_field orders_el_2["items"] :: array
|
|
6
|
+
%t5 = importschemacall %t4 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
7
|
+
yield %t5
|
|
8
|
+
end_loop
|
|
9
|
+
)
|
|
10
|
+
(Declaration order_with_shipping
|
|
11
|
+
%t6 = load_input "orders" :: array
|
|
12
|
+
loop orders id=L2 in %t6 as el=%orders_el_7, idx=%orders_i_8
|
|
13
|
+
%t60 = load_field orders_el_7["items"] :: array
|
|
14
|
+
%t10 = load_field orders_el_7["shipping_cost"] :: decimal
|
|
15
|
+
%t61 = importschemacall %t60 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
16
|
+
%t11 = call core.add(%t61, %t10) :: integer
|
|
17
|
+
yield %t11
|
|
18
|
+
end_loop
|
|
19
|
+
)
|
|
20
|
+
(Declaration order_discounted
|
|
21
|
+
%t12 = load_input "orders" :: array
|
|
22
|
+
%t16 = load_input "global_discount_rate" :: decimal
|
|
23
|
+
loop orders id=L3 in %t12 as el=%orders_el_13, idx=%orders_i_14
|
|
24
|
+
%t67 = load_field orders_el_13["items"] :: array
|
|
25
|
+
%t64 = load_field orders_el_13["shipping_cost"] :: decimal
|
|
26
|
+
%t68 = importschemacall %t67 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
27
|
+
%t65 = call core.add(%t68, %t64) :: integer
|
|
28
|
+
%t17 = importschemacall %t65, %t16 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
29
|
+
yield %t17
|
|
30
|
+
end_loop
|
|
31
|
+
)
|
|
32
|
+
(Declaration order_tax
|
|
33
|
+
%t18 = load_input "orders" :: array
|
|
34
|
+
%t71 = load_input "global_discount_rate" :: decimal
|
|
35
|
+
loop orders id=L4 in %t18 as el=%orders_el_19, idx=%orders_i_20
|
|
36
|
+
%t78 = load_field orders_el_19["items"] :: array
|
|
37
|
+
%t75 = load_field orders_el_19["shipping_cost"] :: decimal
|
|
38
|
+
%t79 = importschemacall %t78 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
39
|
+
%t76 = call core.add(%t79, %t75) :: integer
|
|
40
|
+
%t72 = importschemacall %t76, %t71 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
41
|
+
%t22 = importschemacall %t72 fn_name="tax" source_module="Kumi::TestSharedSchemas::Tax" input_mapping_keys=["amount"] :: float
|
|
42
|
+
yield %t22
|
|
43
|
+
end_loop
|
|
44
|
+
)
|
|
45
|
+
(Declaration order_totals
|
|
46
|
+
%t23 = load_input "orders" :: array
|
|
47
|
+
%t82 = load_input "global_discount_rate" :: decimal
|
|
48
|
+
loop orders id=L5 in %t23 as el=%orders_el_24, idx=%orders_i_25
|
|
49
|
+
%t89 = load_field orders_el_24["items"] :: array
|
|
50
|
+
%t86 = load_field orders_el_24["shipping_cost"] :: decimal
|
|
51
|
+
%t90 = importschemacall %t89 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
52
|
+
%t87 = call core.add(%t90, %t86) :: integer
|
|
53
|
+
%t83 = importschemacall %t87, %t82 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
54
|
+
%t93 = importschemacall %t83 fn_name="tax" source_module="Kumi::TestSharedSchemas::Tax" input_mapping_keys=["amount"] :: float
|
|
55
|
+
%t28 = call core.add(%t83, %t93) :: float
|
|
56
|
+
yield %t28
|
|
57
|
+
end_loop
|
|
58
|
+
)
|
|
59
|
+
(Declaration discount_per_order
|
|
60
|
+
%t29 = load_input "orders" :: array
|
|
61
|
+
%t114 = load_input "global_discount_rate" :: decimal
|
|
62
|
+
loop orders id=L6 in %t29 as el=%orders_el_30, idx=%orders_i_31
|
|
63
|
+
%t110 = load_field orders_el_30["items"] :: array
|
|
64
|
+
%t107 = load_field orders_el_30["shipping_cost"] :: decimal
|
|
65
|
+
%t111 = importschemacall %t110 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
66
|
+
%t108 = call core.add(%t111, %t107) :: integer
|
|
67
|
+
%t115 = importschemacall %t108, %t114 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
68
|
+
%t34 = call core.sub(%t108, %t115) :: float
|
|
69
|
+
yield %t34
|
|
70
|
+
end_loop
|
|
71
|
+
)
|
|
72
|
+
(Declaration total_orders
|
|
73
|
+
%acc_35 = decl_acc :: integer
|
|
74
|
+
%t36 = load_input "orders" :: array
|
|
75
|
+
loop orders id=L7 in %t36 as el=%orders_el_37, idx=%orders_i_38
|
|
76
|
+
%t39 = load_field orders_el_37["id"] :: string
|
|
77
|
+
%acc_35 = acc_add agg.count(%acc_35, %t39) :: integer
|
|
78
|
+
end_loop
|
|
79
|
+
%t40 = acc_load %acc_35 :: integer
|
|
80
|
+
yield %t40
|
|
81
|
+
)
|
|
82
|
+
(Declaration total_revenue
|
|
83
|
+
%acc_41 = decl_acc :: float
|
|
84
|
+
%t42 = load_input "orders" :: array
|
|
85
|
+
%t129 = load_input "global_discount_rate" :: decimal
|
|
86
|
+
loop orders id=L8 in %t42 as el=%orders_el_43, idx=%orders_i_44
|
|
87
|
+
%t136 = load_field orders_el_43["items"] :: array
|
|
88
|
+
%t133 = load_field orders_el_43["shipping_cost"] :: decimal
|
|
89
|
+
%t137 = importschemacall %t136 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
90
|
+
%t134 = call core.add(%t137, %t133) :: integer
|
|
91
|
+
%t130 = importschemacall %t134, %t129 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
92
|
+
%t140 = importschemacall %t130 fn_name="tax" source_module="Kumi::TestSharedSchemas::Tax" input_mapping_keys=["amount"] :: float
|
|
93
|
+
%t126 = call core.add(%t130, %t140) :: float
|
|
94
|
+
%acc_41 = acc_add agg.sum(%acc_41, %t126) :: float
|
|
95
|
+
end_loop
|
|
96
|
+
%t46 = acc_load %acc_41 :: float
|
|
97
|
+
yield %t46
|
|
98
|
+
)
|
|
99
|
+
(Declaration total_tax_collected
|
|
100
|
+
%acc_47 = decl_acc :: float
|
|
101
|
+
%t48 = load_input "orders" :: array
|
|
102
|
+
%t157 = load_input "global_discount_rate" :: decimal
|
|
103
|
+
loop orders id=L9 in %t48 as el=%orders_el_49, idx=%orders_i_50
|
|
104
|
+
%t164 = load_field orders_el_49["items"] :: array
|
|
105
|
+
%t161 = load_field orders_el_49["shipping_cost"] :: decimal
|
|
106
|
+
%t165 = importschemacall %t164 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
107
|
+
%t162 = call core.add(%t165, %t161) :: integer
|
|
108
|
+
%t158 = importschemacall %t162, %t157 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
109
|
+
%t154 = importschemacall %t158 fn_name="tax" source_module="Kumi::TestSharedSchemas::Tax" input_mapping_keys=["amount"] :: float
|
|
110
|
+
%acc_47 = acc_add agg.sum(%acc_47, %t154) :: float
|
|
111
|
+
end_loop
|
|
112
|
+
%t52 = acc_load %acc_47 :: float
|
|
113
|
+
yield %t52
|
|
114
|
+
)
|
|
115
|
+
(Declaration total_discount_given
|
|
116
|
+
%acc_53 = decl_acc :: float
|
|
117
|
+
%t54 = load_input "orders" :: array
|
|
118
|
+
%t179 = load_input "global_discount_rate" :: decimal
|
|
119
|
+
loop orders id=L10 in %t54 as el=%orders_el_55, idx=%orders_i_56
|
|
120
|
+
%t175 = load_field orders_el_55["items"] :: array
|
|
121
|
+
%t172 = load_field orders_el_55["shipping_cost"] :: decimal
|
|
122
|
+
%t176 = importschemacall %t175 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
123
|
+
%t173 = call core.add(%t176, %t172) :: integer
|
|
124
|
+
%t180 = importschemacall %t173, %t179 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
125
|
+
%t169 = call core.sub(%t173, %t180) :: float
|
|
126
|
+
%acc_53 = acc_add agg.sum(%acc_53, %t169) :: float
|
|
127
|
+
end_loop
|
|
128
|
+
%t58 = acc_load %acc_53 :: float
|
|
129
|
+
yield %t58
|
|
130
|
+
)
|
|
131
|
+
)
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
(LIR
|
|
2
|
+
(Declaration order_subtotals
|
|
3
|
+
%t1 = load_input "orders" :: array
|
|
4
|
+
loop orders id=L1 in %t1 as el=%orders_el_2, idx=%orders_i_3
|
|
5
|
+
%t4 = load_field orders_el_2["items"] :: array
|
|
6
|
+
%t5 = importschemacall %t4 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
7
|
+
yield %t5
|
|
8
|
+
end_loop
|
|
9
|
+
)
|
|
10
|
+
(Declaration order_with_shipping
|
|
11
|
+
%t6 = load_input "orders" :: array
|
|
12
|
+
loop orders id=L2 in %t6 as el=%orders_el_7, idx=%orders_i_8
|
|
13
|
+
%t60 = load_field orders_el_7["items"] :: array
|
|
14
|
+
%t10 = load_field orders_el_7["shipping_cost"] :: decimal
|
|
15
|
+
%t61 = importschemacall %t60 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
16
|
+
%t11 = call core.add(%t61, %t10) :: integer
|
|
17
|
+
yield %t11
|
|
18
|
+
end_loop
|
|
19
|
+
)
|
|
20
|
+
(Declaration order_discounted
|
|
21
|
+
%t12 = load_input "orders" :: array
|
|
22
|
+
%t16 = load_input "global_discount_rate" :: decimal
|
|
23
|
+
loop orders id=L3 in %t12 as el=%orders_el_13, idx=%orders_i_14
|
|
24
|
+
%t67 = load_field orders_el_13["items"] :: array
|
|
25
|
+
%t64 = load_field orders_el_13["shipping_cost"] :: decimal
|
|
26
|
+
%t68 = importschemacall %t67 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
27
|
+
%t65 = call core.add(%t68, %t64) :: integer
|
|
28
|
+
%t17 = importschemacall %t65, %t16 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
29
|
+
yield %t17
|
|
30
|
+
end_loop
|
|
31
|
+
)
|
|
32
|
+
(Declaration order_tax
|
|
33
|
+
%t18 = load_input "orders" :: array
|
|
34
|
+
%t71 = load_input "global_discount_rate" :: decimal
|
|
35
|
+
loop orders id=L4 in %t18 as el=%orders_el_19, idx=%orders_i_20
|
|
36
|
+
%t78 = load_field orders_el_19["items"] :: array
|
|
37
|
+
%t75 = load_field orders_el_19["shipping_cost"] :: decimal
|
|
38
|
+
%t79 = importschemacall %t78 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
39
|
+
%t76 = call core.add(%t79, %t75) :: integer
|
|
40
|
+
%t72 = importschemacall %t76, %t71 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
41
|
+
%t22 = importschemacall %t72 fn_name="tax" source_module="Kumi::TestSharedSchemas::Tax" input_mapping_keys=["amount"] :: float
|
|
42
|
+
yield %t22
|
|
43
|
+
end_loop
|
|
44
|
+
)
|
|
45
|
+
(Declaration order_totals
|
|
46
|
+
%t23 = load_input "orders" :: array
|
|
47
|
+
%t82 = load_input "global_discount_rate" :: decimal
|
|
48
|
+
loop orders id=L5 in %t23 as el=%orders_el_24, idx=%orders_i_25
|
|
49
|
+
%t89 = load_field orders_el_24["items"] :: array
|
|
50
|
+
%t86 = load_field orders_el_24["shipping_cost"] :: decimal
|
|
51
|
+
%t90 = importschemacall %t89 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
52
|
+
%t87 = call core.add(%t90, %t86) :: integer
|
|
53
|
+
%t83 = importschemacall %t87, %t82 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
54
|
+
%t93 = importschemacall %t83 fn_name="tax" source_module="Kumi::TestSharedSchemas::Tax" input_mapping_keys=["amount"] :: float
|
|
55
|
+
%t28 = call core.add(%t83, %t93) :: float
|
|
56
|
+
yield %t28
|
|
57
|
+
end_loop
|
|
58
|
+
)
|
|
59
|
+
(Declaration discount_per_order
|
|
60
|
+
%t29 = load_input "orders" :: array
|
|
61
|
+
%t114 = load_input "global_discount_rate" :: decimal
|
|
62
|
+
loop orders id=L6 in %t29 as el=%orders_el_30, idx=%orders_i_31
|
|
63
|
+
%t110 = load_field orders_el_30["items"] :: array
|
|
64
|
+
%t107 = load_field orders_el_30["shipping_cost"] :: decimal
|
|
65
|
+
%t111 = importschemacall %t110 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
66
|
+
%t108 = call core.add(%t111, %t107) :: integer
|
|
67
|
+
%t115 = importschemacall %t108, %t114 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
68
|
+
%t34 = call core.sub(%t108, %t115) :: float
|
|
69
|
+
yield %t34
|
|
70
|
+
end_loop
|
|
71
|
+
)
|
|
72
|
+
(Declaration total_orders
|
|
73
|
+
%acc_35 = decl_acc :: integer
|
|
74
|
+
%t36 = load_input "orders" :: array
|
|
75
|
+
loop orders id=L7 in %t36 as el=%orders_el_37, idx=%orders_i_38
|
|
76
|
+
%t39 = load_field orders_el_37["id"] :: string
|
|
77
|
+
%acc_35 = acc_add agg.count(%acc_35, %t39) :: integer
|
|
78
|
+
end_loop
|
|
79
|
+
%t40 = acc_load %acc_35 :: integer
|
|
80
|
+
yield %t40
|
|
81
|
+
)
|
|
82
|
+
(Declaration total_revenue
|
|
83
|
+
%acc_41 = decl_acc :: float
|
|
84
|
+
%t42 = load_input "orders" :: array
|
|
85
|
+
%t129 = load_input "global_discount_rate" :: decimal
|
|
86
|
+
loop orders id=L8 in %t42 as el=%orders_el_43, idx=%orders_i_44
|
|
87
|
+
%t136 = load_field orders_el_43["items"] :: array
|
|
88
|
+
%t133 = load_field orders_el_43["shipping_cost"] :: decimal
|
|
89
|
+
%t137 = importschemacall %t136 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
90
|
+
%t134 = call core.add(%t137, %t133) :: integer
|
|
91
|
+
%t130 = importschemacall %t134, %t129 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
92
|
+
%t140 = importschemacall %t130 fn_name="tax" source_module="Kumi::TestSharedSchemas::Tax" input_mapping_keys=["amount"] :: float
|
|
93
|
+
%t126 = call core.add(%t130, %t140) :: float
|
|
94
|
+
%acc_41 = acc_add agg.sum(%acc_41, %t126) :: float
|
|
95
|
+
end_loop
|
|
96
|
+
%t46 = acc_load %acc_41 :: float
|
|
97
|
+
yield %t46
|
|
98
|
+
)
|
|
99
|
+
(Declaration total_tax_collected
|
|
100
|
+
%acc_47 = decl_acc :: float
|
|
101
|
+
%t48 = load_input "orders" :: array
|
|
102
|
+
%t157 = load_input "global_discount_rate" :: decimal
|
|
103
|
+
loop orders id=L9 in %t48 as el=%orders_el_49, idx=%orders_i_50
|
|
104
|
+
%t164 = load_field orders_el_49["items"] :: array
|
|
105
|
+
%t161 = load_field orders_el_49["shipping_cost"] :: decimal
|
|
106
|
+
%t165 = importschemacall %t164 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
107
|
+
%t162 = call core.add(%t165, %t161) :: integer
|
|
108
|
+
%t158 = importschemacall %t162, %t157 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
109
|
+
%t154 = importschemacall %t158 fn_name="tax" source_module="Kumi::TestSharedSchemas::Tax" input_mapping_keys=["amount"] :: float
|
|
110
|
+
%acc_47 = acc_add agg.sum(%acc_47, %t154) :: float
|
|
111
|
+
end_loop
|
|
112
|
+
%t52 = acc_load %acc_47 :: float
|
|
113
|
+
yield %t52
|
|
114
|
+
)
|
|
115
|
+
(Declaration total_discount_given
|
|
116
|
+
%acc_53 = decl_acc :: float
|
|
117
|
+
%t54 = load_input "orders" :: array
|
|
118
|
+
%t179 = load_input "global_discount_rate" :: decimal
|
|
119
|
+
loop orders id=L10 in %t54 as el=%orders_el_55, idx=%orders_i_56
|
|
120
|
+
%t175 = load_field orders_el_55["items"] :: array
|
|
121
|
+
%t172 = load_field orders_el_55["shipping_cost"] :: decimal
|
|
122
|
+
%t176 = importschemacall %t175 fn_name="subtotal" source_module="Kumi::TestSharedSchemas::Subtotal" input_mapping_keys=["items"] :: integer
|
|
123
|
+
%t173 = call core.add(%t176, %t172) :: integer
|
|
124
|
+
%t180 = importschemacall %t173, %t179 fn_name="discounted" source_module="Kumi::TestSharedSchemas::Discount" input_mapping_keys=["price", "rate"] :: float
|
|
125
|
+
%t169 = call core.sub(%t173, %t180) :: float
|
|
126
|
+
%acc_53 = acc_add agg.sum(%acc_53, %t169) :: float
|
|
127
|
+
end_loop
|
|
128
|
+
%t58 = acc_load %acc_53 :: float
|
|
129
|
+
yield %t58
|
|
130
|
+
)
|
|
131
|
+
)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
(NAST
|
|
2
|
+
(VALUE order_subtotals
|
|
3
|
+
(ImportCall :subtotal
|
|
4
|
+
(items (InputRef [:orders, :order, :items]))
|
|
5
|
+
)
|
|
6
|
+
)
|
|
7
|
+
(VALUE order_with_shipping
|
|
8
|
+
(Call :add
|
|
9
|
+
(Ref order_subtotals)
|
|
10
|
+
(InputRef [:orders, :order, :shipping_cost])
|
|
11
|
+
)
|
|
12
|
+
)
|
|
13
|
+
(VALUE order_discounted
|
|
14
|
+
(ImportCall :discounted
|
|
15
|
+
(price (Ref order_with_shipping))
|
|
16
|
+
(rate (InputRef [:global_discount_rate]))
|
|
17
|
+
)
|
|
18
|
+
)
|
|
19
|
+
(VALUE order_tax
|
|
20
|
+
(ImportCall :tax
|
|
21
|
+
(amount (Ref order_discounted))
|
|
22
|
+
)
|
|
23
|
+
)
|
|
24
|
+
(VALUE order_totals
|
|
25
|
+
(Call :add
|
|
26
|
+
(Ref order_discounted)
|
|
27
|
+
(Ref order_tax)
|
|
28
|
+
)
|
|
29
|
+
)
|
|
30
|
+
(VALUE discount_per_order
|
|
31
|
+
(Call :subtract
|
|
32
|
+
(Ref order_with_shipping)
|
|
33
|
+
(Ref order_discounted)
|
|
34
|
+
)
|
|
35
|
+
)
|
|
36
|
+
(VALUE total_orders
|
|
37
|
+
(Call :count
|
|
38
|
+
(InputRef [:orders, :order, :id])
|
|
39
|
+
)
|
|
40
|
+
)
|
|
41
|
+
(VALUE total_revenue
|
|
42
|
+
(Call :sum
|
|
43
|
+
(Ref order_totals)
|
|
44
|
+
)
|
|
45
|
+
)
|
|
46
|
+
(VALUE total_tax_collected
|
|
47
|
+
(Call :sum
|
|
48
|
+
(Ref order_tax)
|
|
49
|
+
)
|
|
50
|
+
)
|
|
51
|
+
(VALUE total_discount_given
|
|
52
|
+
(Call :sum
|
|
53
|
+
(Ref discount_per_order)
|
|
54
|
+
)
|
|
55
|
+
)
|
|
56
|
+
)
|