@reventlessdev/online-shop-dcb-ordering 1.0.0-alpha.246 → 1.0.0-alpha.248
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/CHANGELOG.md +24 -0
- package/lib/bs/.compiler.log +2 -2
- package/lib/bs/OrderingPlugin.cmi +0 -0
- package/lib/bs/OrderingPlugin.cmt +0 -0
- package/lib/bs/OrderingPlugin.mlmap +2 -0
- package/lib/bs/compiler-info.json +1 -1
- package/lib/bs/src/CatalogProduct/StateChange/SyncCatalogProduct-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/CatalogProduct/StateChange/SyncCatalogProduct-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/CatalogProduct/StateChange/SyncCatalogProduct.ast +0 -0
- package/lib/bs/src/CatalogProduct/StateChange/SyncCatalogProduct.res +4 -4
- package/lib/bs/src/CatalogProduct/StateChange/SyncCatalogProduct.res.mjs +5 -4
- package/lib/bs/src/CatalogProduct/StateChange/SyncCatalogProduct_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/CatalogProduct/StateChange/SyncCatalogProduct_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/CatalogProduct/StateView/AvailableProducts-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/CatalogProduct/StateView/AvailableProducts-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/CatalogProduct/StateView/AvailableProducts.ast +0 -0
- package/lib/bs/src/CatalogProduct/StateView/AvailableProducts.res +6 -3
- package/lib/bs/src/CatalogProduct/StateView/AvailableProducts.res.mjs +7 -3
- package/lib/bs/src/CatalogProduct/StateView/AvailableProducts_Projection-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/CatalogProduct/StateView/AvailableProducts_Projection-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Customer/CustomerId-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Customer/CustomerId-OrderingPlugin.cmj +0 -0
- package/lib/bs/src/Customer/CustomerId-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Customer/CustomerId.ast +0 -0
- package/lib/bs/src/Customer/CustomerId.res +4 -0
- package/lib/bs/src/Customer/CustomerId.res.mjs +29 -0
- package/lib/bs/src/Customer/StateChange/ChangeAddress-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Customer/StateChange/ChangeAddress-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Customer/StateChange/ChangeAddress.ast +0 -0
- package/lib/bs/src/Customer/StateChange/ChangeAddress.res +2 -2
- package/lib/bs/src/Customer/StateChange/ChangeAddress.res.mjs +3 -2
- package/lib/bs/src/Customer/StateChange/ChangeAddress_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Customer/StateChange/ChangeAddress_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Customer/StateChange/ChangeEmail-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Customer/StateChange/ChangeEmail-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Customer/StateChange/ChangeEmail.ast +0 -0
- package/lib/bs/src/Customer/StateChange/ChangeEmail.res +2 -2
- package/lib/bs/src/Customer/StateChange/ChangeEmail.res.mjs +3 -2
- package/lib/bs/src/Customer/StateChange/ChangeEmail_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Customer/StateChange/ChangeEmail_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Customer/StateChange/DeactivateCustomer-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Customer/StateChange/DeactivateCustomer-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Customer/StateChange/DeactivateCustomer.ast +0 -0
- package/lib/bs/src/Customer/StateChange/DeactivateCustomer.res +2 -2
- package/lib/bs/src/Customer/StateChange/DeactivateCustomer.res.mjs +3 -2
- package/lib/bs/src/Customer/StateChange/DeactivateCustomer_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Customer/StateChange/DeactivateCustomer_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Customer/StateChange/RegisterCustomer-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Customer/StateChange/RegisterCustomer-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Customer/StateChange/RegisterCustomer.ast +0 -0
- package/lib/bs/src/Customer/StateChange/RegisterCustomer.res +2 -2
- package/lib/bs/src/Customer/StateChange/RegisterCustomer.res.mjs +3 -2
- package/lib/bs/src/Customer/StateChange/RegisterCustomer_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Customer/StateChange/RegisterCustomer_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Customer/StateView/Customers-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Customer/StateView/Customers-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Customer/StateView/Customers.ast +0 -0
- package/lib/bs/src/Customer/StateView/Customers.res +8 -5
- package/lib/bs/src/Customer/StateView/Customers.res.mjs +9 -5
- package/lib/bs/src/Customer/StateView/Customers_Projection-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Customer/StateView/Customers_Projection-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Extension/Products_Extension-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Extension/Products_Extension-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping.ast +0 -0
- package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping.res +29 -10
- package/lib/bs/src/ExtensionPoint/Orders_ExtensionPointMapping.res.mjs +32 -23
- package/lib/bs/src/LifecycleModel-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/LifecycleModel-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/Automation/AutoShipOrder-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/Automation/AutoShipOrder-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/Automation/AutoShipOrder.ast +0 -0
- package/lib/bs/src/Order/Automation/AutoShipOrder.res +2 -2
- package/lib/bs/src/Order/Automation/AutoShipOrder.res.mjs +3 -2
- package/lib/bs/src/Order/Automation/AutoShipOrder_Automation-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/Automation/AutoShipOrder_Automation-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/Automation/AutoShipOrder_Automation.ast +0 -0
- package/lib/bs/src/Order/Automation/AutoShipOrder_Automation.res +8 -5
- package/lib/bs/src/Order/Automation/AutoShipOrder_Automation.res.mjs +7 -6
- package/lib/bs/src/Order/OrderId-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/OrderId-OrderingPlugin.cmj +0 -0
- package/lib/bs/src/Order/OrderId-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/OrderId.ast +0 -0
- package/lib/bs/src/Order/OrderId.res +4 -0
- package/lib/bs/src/Order/OrderId.res.mjs +29 -0
- package/lib/bs/src/Order/OutboundTranslation/SendOrderConfirmation-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/OutboundTranslation/SendOrderConfirmation-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/OutboundTranslation/SendOrderConfirmation.ast +0 -0
- package/lib/bs/src/Order/OutboundTranslation/SendOrderConfirmation.res +2 -2
- package/lib/bs/src/Order/OutboundTranslation/SendOrderConfirmation.res.mjs +6 -4
- package/lib/bs/src/Order/OutboundTranslation/SendOrderConfirmation_Translation-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/OutboundTranslation/SendOrderConfirmation_Translation-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/OutboundTranslation/SendOrderConfirmation_Translation.ast +0 -0
- package/lib/bs/src/Order/OutboundTranslation/SendOrderConfirmation_Translation.res +5 -2
- package/lib/bs/src/Order/OutboundTranslation/SendOrderConfirmation_Translation.res.mjs +4 -2
- package/lib/bs/src/Order/StateChange/CancelOrder-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/StateChange/CancelOrder-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/StateChange/CancelOrder.ast +0 -0
- package/lib/bs/src/Order/StateChange/CancelOrder.res +3 -3
- package/lib/bs/src/Order/StateChange/CancelOrder.res.mjs +6 -4
- package/lib/bs/src/Order/StateChange/CancelOrder_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/StateChange/CancelOrder_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/StateChange/CancelOrder_Behavior.ast +0 -0
- package/lib/bs/src/Order/StateChange/CancelOrder_Behavior.res +6 -1
- package/lib/bs/src/Order/StateChange/PlaceOrder-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/StateChange/PlaceOrder-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/StateChange/PlaceOrder.ast +0 -0
- package/lib/bs/src/Order/StateChange/PlaceOrder.res +12 -7
- package/lib/bs/src/Order/StateChange/PlaceOrder.res.mjs +12 -9
- package/lib/bs/src/Order/StateChange/PlaceOrder_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/StateChange/PlaceOrder_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/StateChange/PlaceOrder_Behavior.ast +0 -0
- package/lib/bs/src/Order/StateChange/PlaceOrder_Behavior.res +1 -1
- package/lib/bs/src/Order/StateChange/ShipOrder-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/StateChange/ShipOrder-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/StateChange/ShipOrder.ast +0 -0
- package/lib/bs/src/Order/StateChange/ShipOrder.res +2 -2
- package/lib/bs/src/Order/StateChange/ShipOrder.res.mjs +3 -2
- package/lib/bs/src/Order/StateChange/ShipOrder_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/StateChange/ShipOrder_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/StateView/Orders-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/StateView/Orders-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Order/StateView/Orders.ast +0 -0
- package/lib/bs/src/Order/StateView/Orders.res +13 -6
- package/lib/bs/src/Order/StateView/Orders.res.mjs +14 -8
- package/lib/bs/src/Order/StateView/Orders_Projection-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Order/StateView/Orders_Projection-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Plugin-OrderingPlugin.cmi +0 -0
- package/lib/bs/src/Plugin-OrderingPlugin.cmt +0 -0
- package/lib/bs/src/Plugin.res.mjs +6 -8
- package/lib/bs/tests/CatalogProduct/StateChange/SyncCatalogProduct_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/CatalogProduct/StateChange/SyncCatalogProduct_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/CatalogProduct/StateChange/SyncCatalogProduct_GWT.ast +0 -0
- package/lib/bs/tests/CatalogProduct/StateChange/SyncCatalogProduct_GWT.res +8 -6
- package/lib/bs/tests/CatalogProduct/StateChange/SyncCatalogProduct_GWT.res.mjs +10 -6
- package/lib/bs/tests/CatalogProduct/StateView/AvailableProducts_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/CatalogProduct/StateView/AvailableProducts_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/CatalogProduct/StateView/AvailableProducts_GWT.ast +0 -0
- package/lib/bs/tests/CatalogProduct/StateView/AvailableProducts_GWT.res +7 -5
- package/lib/bs/tests/CatalogProduct/StateView/AvailableProducts_GWT.res.mjs +10 -5
- package/lib/bs/tests/Customer/StateChange/ChangeAddress_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Customer/StateChange/ChangeAddress_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Customer/StateChange/ChangeAddress_GWT.ast +0 -0
- package/lib/bs/tests/Customer/StateChange/ChangeAddress_GWT.res +7 -5
- package/lib/bs/tests/Customer/StateChange/ChangeAddress_GWT.res.mjs +9 -5
- package/lib/bs/tests/Customer/StateChange/ChangeEmail_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Customer/StateChange/ChangeEmail_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Customer/StateChange/ChangeEmail_GWT.ast +0 -0
- package/lib/bs/tests/Customer/StateChange/ChangeEmail_GWT.res +7 -5
- package/lib/bs/tests/Customer/StateChange/ChangeEmail_GWT.res.mjs +9 -5
- package/lib/bs/tests/Customer/StateChange/DeactivateCustomer_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Customer/StateChange/DeactivateCustomer_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Customer/StateChange/DeactivateCustomer_GWT.ast +0 -0
- package/lib/bs/tests/Customer/StateChange/DeactivateCustomer_GWT.res +6 -4
- package/lib/bs/tests/Customer/StateChange/DeactivateCustomer_GWT.res.mjs +8 -4
- package/lib/bs/tests/Customer/StateChange/RegisterCustomer_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Customer/StateChange/RegisterCustomer_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Customer/StateChange/RegisterCustomer_GWT.ast +0 -0
- package/lib/bs/tests/Customer/StateChange/RegisterCustomer_GWT.res +7 -3
- package/lib/bs/tests/Customer/StateChange/RegisterCustomer_GWT.res.mjs +7 -3
- package/lib/bs/tests/Customer/StateView/Customers_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Customer/StateView/Customers_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Customer/StateView/Customers_GWT.ast +0 -0
- package/lib/bs/tests/Customer/StateView/Customers_GWT.res +21 -11
- package/lib/bs/tests/Customer/StateView/Customers_GWT.res.mjs +16 -11
- package/lib/bs/tests/Extension/Products_Extension_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Extension/Products_Extension_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Extension/Products_Extension_GWT.ast +0 -0
- package/lib/bs/tests/Extension/Products_Extension_GWT.res +8 -4
- package/lib/bs/tests/Extension/Products_Extension_GWT.res.mjs +8 -4
- package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.ast +0 -0
- package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res +10 -2
- package/lib/bs/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res.mjs +19 -7
- package/lib/bs/tests/Order/Automation/AutoShipOrder_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/Automation/AutoShipOrder_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/Automation/AutoShipOrder_GWT.ast +0 -0
- package/lib/bs/tests/Order/Automation/AutoShipOrder_GWT.res +9 -7
- package/lib/bs/tests/Order/Automation/AutoShipOrder_GWT.res.mjs +11 -7
- package/lib/bs/tests/Order/OutboundTranslation/SendOrderConfirmation_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/OutboundTranslation/SendOrderConfirmation_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/OutboundTranslation/SendOrderConfirmation_GWT.ast +0 -0
- package/lib/bs/tests/Order/OutboundTranslation/SendOrderConfirmation_GWT.res +7 -4
- package/lib/bs/tests/Order/OutboundTranslation/SendOrderConfirmation_GWT.res.mjs +16 -8
- package/lib/bs/tests/Order/StateChange/CancelOrder_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/StateChange/CancelOrder_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/StateChange/CancelOrder_GWT.ast +0 -0
- package/lib/bs/tests/Order/StateChange/CancelOrder_GWT.res +11 -8
- package/lib/bs/tests/Order/StateChange/CancelOrder_GWT.res.mjs +19 -11
- package/lib/bs/tests/Order/StateChange/PlaceOrder_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/StateChange/PlaceOrder_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/StateChange/PlaceOrder_GWT.ast +0 -0
- package/lib/bs/tests/Order/StateChange/PlaceOrder_GWT.res +19 -13
- package/lib/bs/tests/Order/StateChange/PlaceOrder_GWT.res.mjs +42 -30
- package/lib/bs/tests/Order/StateChange/ShipOrder_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/StateChange/ShipOrder_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/StateChange/ShipOrder_GWT.ast +0 -0
- package/lib/bs/tests/Order/StateChange/ShipOrder_GWT.res +7 -5
- package/lib/bs/tests/Order/StateChange/ShipOrder_GWT.res.mjs +9 -5
- package/lib/bs/tests/Order/StateView/Orders_GWT-OrderingPlugin.cmi +0 -0
- package/lib/bs/tests/Order/StateView/Orders_GWT-OrderingPlugin.cmt +0 -0
- package/lib/bs/tests/Order/StateView/Orders_GWT.ast +0 -0
- package/lib/bs/tests/Order/StateView/Orders_GWT.res +19 -8
- package/lib/bs/tests/Order/StateView/Orders_GWT.res.mjs +35 -22
- package/lib/ocaml/.compiler.log +2 -2
- package/lib/ocaml/AutoShipOrder-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/AutoShipOrder-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/AutoShipOrder.ast +0 -0
- package/lib/ocaml/AutoShipOrder.res +2 -2
- package/lib/ocaml/AutoShipOrder_Automation-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/AutoShipOrder_Automation-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/AutoShipOrder_Automation.ast +0 -0
- package/lib/ocaml/AutoShipOrder_Automation.res +8 -5
- package/lib/ocaml/AutoShipOrder_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/AutoShipOrder_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/AutoShipOrder_GWT.ast +0 -0
- package/lib/ocaml/AutoShipOrder_GWT.res +9 -7
- package/lib/ocaml/AvailableProducts-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/AvailableProducts-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/AvailableProducts.ast +0 -0
- package/lib/ocaml/AvailableProducts.res +6 -3
- package/lib/ocaml/AvailableProducts_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/AvailableProducts_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/AvailableProducts_GWT.ast +0 -0
- package/lib/ocaml/AvailableProducts_GWT.res +7 -5
- package/lib/ocaml/AvailableProducts_Projection-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/AvailableProducts_Projection-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/CancelOrder-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/CancelOrder-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/CancelOrder.ast +0 -0
- package/lib/ocaml/CancelOrder.res +3 -3
- package/lib/ocaml/CancelOrder_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/CancelOrder_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/CancelOrder_Behavior.ast +0 -0
- package/lib/ocaml/CancelOrder_Behavior.res +6 -1
- package/lib/ocaml/CancelOrder_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/CancelOrder_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/CancelOrder_GWT.ast +0 -0
- package/lib/ocaml/CancelOrder_GWT.res +11 -8
- package/lib/ocaml/ChangeAddress-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/ChangeAddress-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/ChangeAddress.ast +0 -0
- package/lib/ocaml/ChangeAddress.res +2 -2
- package/lib/ocaml/ChangeAddress_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/ChangeAddress_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/ChangeAddress_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/ChangeAddress_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/ChangeAddress_GWT.ast +0 -0
- package/lib/ocaml/ChangeAddress_GWT.res +7 -5
- package/lib/ocaml/ChangeEmail-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/ChangeEmail-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/ChangeEmail.ast +0 -0
- package/lib/ocaml/ChangeEmail.res +2 -2
- package/lib/ocaml/ChangeEmail_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/ChangeEmail_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/ChangeEmail_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/ChangeEmail_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/ChangeEmail_GWT.ast +0 -0
- package/lib/ocaml/ChangeEmail_GWT.res +7 -5
- package/lib/ocaml/CustomerId-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/CustomerId-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/CustomerId-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/CustomerId.ast +0 -0
- package/lib/ocaml/CustomerId.res +4 -0
- package/lib/ocaml/Customers-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Customers-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Customers.ast +0 -0
- package/lib/ocaml/Customers.res +8 -5
- package/lib/ocaml/Customers_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Customers_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Customers_GWT.ast +0 -0
- package/lib/ocaml/Customers_GWT.res +21 -11
- package/lib/ocaml/Customers_Projection-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Customers_Projection-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/DeactivateCustomer-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/DeactivateCustomer-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/DeactivateCustomer.ast +0 -0
- package/lib/ocaml/DeactivateCustomer.res +2 -2
- package/lib/ocaml/DeactivateCustomer_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/DeactivateCustomer_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/DeactivateCustomer_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/DeactivateCustomer_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/DeactivateCustomer_GWT.ast +0 -0
- package/lib/ocaml/DeactivateCustomer_GWT.res +6 -4
- package/lib/ocaml/LifecycleModel-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/LifecycleModel-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/OrderId-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/OrderId-OrderingPlugin.cmj +0 -0
- package/lib/ocaml/OrderId-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/OrderId.ast +0 -0
- package/lib/ocaml/OrderId.res +4 -0
- package/lib/ocaml/OrderingPlugin.cmi +0 -0
- package/lib/ocaml/OrderingPlugin.cmt +0 -0
- package/lib/ocaml/OrderingPlugin.mlmap +2 -0
- package/lib/ocaml/Orders-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Orders-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Orders.ast +0 -0
- package/lib/ocaml/Orders.res +13 -6
- package/lib/ocaml/Orders_ExtensionPointMapping-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Orders_ExtensionPointMapping-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Orders_ExtensionPointMapping.ast +0 -0
- package/lib/ocaml/Orders_ExtensionPointMapping.res +29 -10
- package/lib/ocaml/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Orders_ExtensionPointMapping_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Orders_ExtensionPointMapping_GWT.ast +0 -0
- package/lib/ocaml/Orders_ExtensionPointMapping_GWT.res +10 -2
- package/lib/ocaml/Orders_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Orders_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Orders_GWT.ast +0 -0
- package/lib/ocaml/Orders_GWT.res +19 -8
- package/lib/ocaml/Orders_Projection-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Orders_Projection-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/PlaceOrder-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/PlaceOrder-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/PlaceOrder.ast +0 -0
- package/lib/ocaml/PlaceOrder.res +12 -7
- package/lib/ocaml/PlaceOrder_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/PlaceOrder_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/PlaceOrder_Behavior.ast +0 -0
- package/lib/ocaml/PlaceOrder_Behavior.res +1 -1
- package/lib/ocaml/PlaceOrder_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/PlaceOrder_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/PlaceOrder_GWT.ast +0 -0
- package/lib/ocaml/PlaceOrder_GWT.res +19 -13
- package/lib/ocaml/Plugin-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Plugin-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Products_Extension-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Products_Extension-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Products_Extension_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/Products_Extension_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/Products_Extension_GWT.ast +0 -0
- package/lib/ocaml/Products_Extension_GWT.res +8 -4
- package/lib/ocaml/RegisterCustomer-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/RegisterCustomer-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/RegisterCustomer.ast +0 -0
- package/lib/ocaml/RegisterCustomer.res +2 -2
- package/lib/ocaml/RegisterCustomer_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/RegisterCustomer_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/RegisterCustomer_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/RegisterCustomer_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/RegisterCustomer_GWT.ast +0 -0
- package/lib/ocaml/RegisterCustomer_GWT.res +7 -3
- package/lib/ocaml/SendOrderConfirmation-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/SendOrderConfirmation-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/SendOrderConfirmation.ast +0 -0
- package/lib/ocaml/SendOrderConfirmation.res +2 -2
- package/lib/ocaml/SendOrderConfirmation_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/SendOrderConfirmation_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/SendOrderConfirmation_GWT.ast +0 -0
- package/lib/ocaml/SendOrderConfirmation_GWT.res +7 -4
- package/lib/ocaml/SendOrderConfirmation_Translation-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/SendOrderConfirmation_Translation-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/SendOrderConfirmation_Translation.ast +0 -0
- package/lib/ocaml/SendOrderConfirmation_Translation.res +5 -2
- package/lib/ocaml/ShipOrder-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/ShipOrder-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/ShipOrder.ast +0 -0
- package/lib/ocaml/ShipOrder.res +2 -2
- package/lib/ocaml/ShipOrder_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/ShipOrder_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/ShipOrder_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/ShipOrder_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/ShipOrder_GWT.ast +0 -0
- package/lib/ocaml/ShipOrder_GWT.res +7 -5
- package/lib/ocaml/SyncCatalogProduct-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/SyncCatalogProduct-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/SyncCatalogProduct.ast +0 -0
- package/lib/ocaml/SyncCatalogProduct.res +4 -4
- package/lib/ocaml/SyncCatalogProduct_Behavior-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/SyncCatalogProduct_Behavior-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/SyncCatalogProduct_GWT-OrderingPlugin.cmi +0 -0
- package/lib/ocaml/SyncCatalogProduct_GWT-OrderingPlugin.cmt +0 -0
- package/lib/ocaml/SyncCatalogProduct_GWT.ast +0 -0
- package/lib/ocaml/SyncCatalogProduct_GWT.res +8 -6
- package/package.json +8 -8
- package/src/CatalogProduct/StateChange/SyncCatalogProduct.res +4 -4
- package/src/CatalogProduct/StateChange/SyncCatalogProduct.res.mjs +5 -4
- package/src/CatalogProduct/StateView/AvailableProducts.res +6 -3
- package/src/CatalogProduct/StateView/AvailableProducts.res.mjs +7 -3
- package/src/Customer/CustomerId.res +4 -0
- package/src/Customer/CustomerId.res.mjs +29 -0
- package/src/Customer/StateChange/ChangeAddress.res +2 -2
- package/src/Customer/StateChange/ChangeAddress.res.mjs +3 -2
- package/src/Customer/StateChange/ChangeEmail.res +2 -2
- package/src/Customer/StateChange/ChangeEmail.res.mjs +3 -2
- package/src/Customer/StateChange/DeactivateCustomer.res +2 -2
- package/src/Customer/StateChange/DeactivateCustomer.res.mjs +3 -2
- package/src/Customer/StateChange/RegisterCustomer.res +2 -2
- package/src/Customer/StateChange/RegisterCustomer.res.mjs +3 -2
- package/src/Customer/StateView/Customers.res +8 -5
- package/src/Customer/StateView/Customers.res.mjs +9 -5
- package/src/ExtensionPoint/Orders_ExtensionPointMapping.res +29 -10
- package/src/ExtensionPoint/Orders_ExtensionPointMapping.res.mjs +32 -23
- package/src/Order/Automation/AutoShipOrder.res +2 -2
- package/src/Order/Automation/AutoShipOrder.res.mjs +3 -2
- package/src/Order/Automation/AutoShipOrder_Automation.res +8 -5
- package/src/Order/Automation/AutoShipOrder_Automation.res.mjs +7 -6
- package/src/Order/OrderId.res +4 -0
- package/src/Order/OrderId.res.mjs +29 -0
- package/src/Order/OutboundTranslation/SendOrderConfirmation.res +2 -2
- package/src/Order/OutboundTranslation/SendOrderConfirmation.res.mjs +6 -4
- package/src/Order/OutboundTranslation/SendOrderConfirmation_Translation.res +5 -2
- package/src/Order/OutboundTranslation/SendOrderConfirmation_Translation.res.mjs +4 -2
- package/src/Order/StateChange/CancelOrder.res +3 -3
- package/src/Order/StateChange/CancelOrder.res.mjs +6 -4
- package/src/Order/StateChange/CancelOrder_Behavior.res +6 -1
- package/src/Order/StateChange/PlaceOrder.res +12 -7
- package/src/Order/StateChange/PlaceOrder.res.mjs +12 -9
- package/src/Order/StateChange/PlaceOrder_Behavior.res +1 -1
- package/src/Order/StateChange/ShipOrder.res +2 -2
- package/src/Order/StateChange/ShipOrder.res.mjs +3 -2
- package/src/Order/StateView/Orders.res +13 -6
- package/src/Order/StateView/Orders.res.mjs +14 -8
- package/src/Plugin.res.mjs +6 -8
- package/tests/CatalogProduct/StateChange/SyncCatalogProduct_GWT.res +8 -6
- package/tests/CatalogProduct/StateChange/SyncCatalogProduct_GWT.res.mjs +10 -6
- package/tests/CatalogProduct/StateView/AvailableProducts_GWT.res +7 -5
- package/tests/CatalogProduct/StateView/AvailableProducts_GWT.res.mjs +10 -5
- package/tests/Customer/StateChange/ChangeAddress_GWT.res +7 -5
- package/tests/Customer/StateChange/ChangeAddress_GWT.res.mjs +9 -5
- package/tests/Customer/StateChange/ChangeEmail_GWT.res +7 -5
- package/tests/Customer/StateChange/ChangeEmail_GWT.res.mjs +9 -5
- package/tests/Customer/StateChange/DeactivateCustomer_GWT.res +6 -4
- package/tests/Customer/StateChange/DeactivateCustomer_GWT.res.mjs +8 -4
- package/tests/Customer/StateChange/RegisterCustomer_GWT.res +7 -3
- package/tests/Customer/StateChange/RegisterCustomer_GWT.res.mjs +7 -3
- package/tests/Customer/StateView/Customers_GWT.res +21 -11
- package/tests/Customer/StateView/Customers_GWT.res.mjs +16 -11
- package/tests/Extension/Products_Extension_GWT.res +8 -4
- package/tests/Extension/Products_Extension_GWT.res.mjs +8 -4
- package/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res +10 -2
- package/tests/ExtensionPoint/Orders_ExtensionPointMapping_GWT.res.mjs +19 -7
- package/tests/Order/Automation/AutoShipOrder_GWT.res +9 -7
- package/tests/Order/Automation/AutoShipOrder_GWT.res.mjs +11 -7
- package/tests/Order/OutboundTranslation/SendOrderConfirmation_GWT.res +7 -4
- package/tests/Order/OutboundTranslation/SendOrderConfirmation_GWT.res.mjs +16 -8
- package/tests/Order/StateChange/CancelOrder_GWT.res +11 -8
- package/tests/Order/StateChange/CancelOrder_GWT.res.mjs +19 -11
- package/tests/Order/StateChange/PlaceOrder_GWT.res +19 -13
- package/tests/Order/StateChange/PlaceOrder_GWT.res.mjs +42 -30
- package/tests/Order/StateChange/ShipOrder_GWT.res +7 -5
- package/tests/Order/StateChange/ShipOrder_GWT.res.mjs +9 -5
- package/tests/Order/StateView/Orders_GWT.res +19 -8
- package/tests/Order/StateView/Orders_GWT.res.mjs +35 -22
|
@@ -12,21 +12,24 @@ module SendOrderConfirmationSlice = {
|
|
|
12
12
|
|
|
13
13
|
@@reventless.gwt
|
|
14
14
|
|
|
15
|
+
let cid = CustomerId.make
|
|
16
|
+
let oid = OrderId.make
|
|
17
|
+
|
|
15
18
|
describe("SendOrderConfirmation OutboundTranslationSlice", () => {
|
|
16
19
|
testSync("collect: OrderPlaced queues an outbound TODO", () =>
|
|
17
|
-
givenEvent(OrderPlaced({orderId: "o1", customerId: "c1"}))
|
|
20
|
+
givenEvent(OrderPlaced({orderId: oid("o1"), customerId: cid("c1")}))
|
|
18
21
|
->whenCollect
|
|
19
|
-
->thenTodos([("o1", {orderId: "o1", customerId: "c1"})])
|
|
22
|
+
->thenTodos([("o1", {orderId: oid("o1"), customerId: cid("c1")})])
|
|
20
23
|
)
|
|
21
24
|
|
|
22
25
|
test("translate success marks the TODO Completed", () =>
|
|
23
|
-
givenTodo("o1", {orderId: "o1", customerId: "c1"})
|
|
26
|
+
givenTodo("o1", {orderId: oid("o1"), customerId: cid("c1")})
|
|
24
27
|
->whenTranslateMocked((_id, _item) => Promise.resolve(Ok(None)))
|
|
25
28
|
->thenTodoStatus("o1", #Completed)
|
|
26
29
|
)
|
|
27
30
|
|
|
28
31
|
test("translate failure leaves the TODO Pending for retry", () =>
|
|
29
|
-
givenTodo("o1", {orderId: "o1", customerId: "c1"})
|
|
32
|
+
givenTodo("o1", {orderId: oid("o1"), customerId: cid("c1")})
|
|
30
33
|
->whenTranslateMocked((_id, _item) => Promise.resolve(Error("smtp down")))
|
|
31
34
|
->thenTodoStatus("o1", #Pending)
|
|
32
35
|
)
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
+
import * as OrderId$OrderingPlugin from "../../../src/Order/OrderId.res.mjs";
|
|
4
|
+
import * as CustomerId$OrderingPlugin from "../../../src/Customer/CustomerId.res.mjs";
|
|
3
5
|
import * as SendOrderConfirmation$OrderingPlugin from "../../../src/Order/OutboundTranslation/SendOrderConfirmation.res.mjs";
|
|
4
6
|
import * as OutboundTranslation_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/OutboundTranslation_GWT.res.mjs";
|
|
5
7
|
import * as SendOrderConfirmation_Translation$OrderingPlugin from "../../../src/Order/OutboundTranslation/SendOrderConfirmation_Translation.res.mjs";
|
|
@@ -50,25 +52,25 @@ let thenTodoStatus = include.thenTodoStatus;
|
|
|
50
52
|
describe("SendOrderConfirmation OutboundTranslationSlice", () => {
|
|
51
53
|
testSync("collect: OrderPlaced queues an outbound TODO", () => thenTodos(whenCollect(givenEvent({
|
|
52
54
|
TAG: "OrderPlaced",
|
|
53
|
-
orderId: "o1",
|
|
54
|
-
customerId: "c1"
|
|
55
|
+
orderId: OrderId$OrderingPlugin.make("o1"),
|
|
56
|
+
customerId: CustomerId$OrderingPlugin.make("c1")
|
|
55
57
|
}), undefined), [[
|
|
56
58
|
"o1",
|
|
57
59
|
{
|
|
58
|
-
orderId: "o1",
|
|
59
|
-
customerId: "c1"
|
|
60
|
+
orderId: OrderId$OrderingPlugin.make("o1"),
|
|
61
|
+
customerId: CustomerId$OrderingPlugin.make("c1")
|
|
60
62
|
}
|
|
61
63
|
]]));
|
|
62
64
|
test("translate success marks the TODO Completed", undefined, () => thenTodoStatus(whenTranslateMocked(givenTodo("o1", {
|
|
63
|
-
orderId: "o1",
|
|
64
|
-
customerId: "c1"
|
|
65
|
+
orderId: OrderId$OrderingPlugin.make("o1"),
|
|
66
|
+
customerId: CustomerId$OrderingPlugin.make("c1")
|
|
65
67
|
}), (_id, _item) => Promise.resolve({
|
|
66
68
|
TAG: "Ok",
|
|
67
69
|
_0: undefined
|
|
68
70
|
})), "o1", "Completed"));
|
|
69
71
|
test("translate failure leaves the TODO Pending for retry", undefined, () => thenTodoStatus(whenTranslateMocked(givenTodo("o1", {
|
|
70
|
-
orderId: "o1",
|
|
71
|
-
customerId: "c1"
|
|
72
|
+
orderId: OrderId$OrderingPlugin.make("o1"),
|
|
73
|
+
customerId: CustomerId$OrderingPlugin.make("c1")
|
|
72
74
|
}), (_id, _item) => Promise.resolve({
|
|
73
75
|
TAG: "Error",
|
|
74
76
|
_0: "smtp down"
|
|
@@ -85,6 +87,10 @@ let thenNoCommand = include.thenNoCommand;
|
|
|
85
87
|
|
|
86
88
|
let thenRetryRecorded = include.thenRetryRecorded;
|
|
87
89
|
|
|
90
|
+
let cid = CustomerId$OrderingPlugin.make;
|
|
91
|
+
|
|
92
|
+
let oid = OrderId$OrderingPlugin.make;
|
|
93
|
+
|
|
88
94
|
export {
|
|
89
95
|
SendOrderConfirmationSlice,
|
|
90
96
|
Spec,
|
|
@@ -101,5 +107,7 @@ export {
|
|
|
101
107
|
thenNoCommand,
|
|
102
108
|
thenRetryRecorded,
|
|
103
109
|
thenTodoStatus,
|
|
110
|
+
cid,
|
|
111
|
+
oid,
|
|
104
112
|
}
|
|
105
113
|
/* include Not a pure module */
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
@@reventless.gwt
|
|
2
2
|
|
|
3
|
+
let oid = OrderId.make
|
|
4
|
+
let pid = CatalogSpec.ProductId.make
|
|
5
|
+
|
|
3
6
|
describe("CancelOrder StateChangeSlice", () => {
|
|
4
7
|
test("non-existent order returns OrderNotFound", () =>
|
|
5
8
|
givenEvents([])
|
|
6
|
-
->whenCmd(CancelOrder({orderId: "o1"}))
|
|
9
|
+
->whenCmd(CancelOrder({orderId: oid("o1")}))
|
|
7
10
|
->thenError(OrderNotFound)
|
|
8
11
|
)
|
|
9
12
|
|
|
10
13
|
test("placed order produces OrderCancelled with productIds carried over", () =>
|
|
11
|
-
givenEvents([OrderPlaced({productIds: ["p1", "p2"]})])
|
|
12
|
-
->whenCmd(CancelOrder({orderId: "o1"}))
|
|
13
|
-
->thenEvent(OrderCancelled({orderId: "o1", productIds: ["p1", "p2"]}))
|
|
14
|
+
givenEvents([OrderPlaced({productIds: [pid("p1"), pid("p2")]})])
|
|
15
|
+
->whenCmd(CancelOrder({orderId: oid("o1")}))
|
|
16
|
+
->thenEvent(OrderCancelled({orderId: oid("o1"), productIds: [pid("p1"), pid("p2")]}))
|
|
14
17
|
)
|
|
15
18
|
|
|
16
19
|
test("already cancelled order produces no events (idempotent)", () =>
|
|
17
|
-
givenEvents([OrderPlaced({productIds: ["p1"]}), OrderCancelled])
|
|
18
|
-
->whenCmd(CancelOrder({orderId: "o1"}))
|
|
20
|
+
givenEvents([OrderPlaced({productIds: [pid("p1")]}), OrderCancelled])
|
|
21
|
+
->whenCmd(CancelOrder({orderId: oid("o1")}))
|
|
19
22
|
->thenNoEvent
|
|
20
23
|
)
|
|
21
24
|
|
|
22
25
|
test("shipped order returns OrderAlreadyShipped", () =>
|
|
23
|
-
givenEvents([OrderPlaced({productIds: ["p1"]}), OrderShipped])
|
|
24
|
-
->whenCmd(CancelOrder({orderId: "o1"}))
|
|
26
|
+
givenEvents([OrderPlaced({productIds: [pid("p1")]}), OrderShipped])
|
|
27
|
+
->whenCmd(CancelOrder({orderId: oid("o1")}))
|
|
25
28
|
->thenError(OrderAlreadyShipped)
|
|
26
29
|
)
|
|
27
30
|
})
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
+
import * as ProductId$CatalogSpec from "@reventlessdev/online-shop-dcb-catalog-spec/src/ProductId.res.mjs";
|
|
4
|
+
import * as OrderId$OrderingPlugin from "../../../src/Order/OrderId.res.mjs";
|
|
3
5
|
import * as Behavior_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/Behavior_GWT.res.mjs";
|
|
4
6
|
import * as CancelOrder$OrderingPlugin from "../../../src/Order/StateChange/CancelOrder.res.mjs";
|
|
5
7
|
import * as CancelOrder_Behavior$OrderingPlugin from "../../../src/Order/StateChange/CancelOrder_Behavior.res.mjs";
|
|
@@ -33,44 +35,44 @@ let thenError = include.thenError;
|
|
|
33
35
|
describe("CancelOrder StateChangeSlice", () => {
|
|
34
36
|
test("non-existent order returns OrderNotFound", () => thenError(whenCmd(givenEvents([]), {
|
|
35
37
|
TAG: "CancelOrder",
|
|
36
|
-
orderId: "o1"
|
|
38
|
+
orderId: OrderId$OrderingPlugin.make("o1")
|
|
37
39
|
}), "OrderNotFound"));
|
|
38
40
|
test("placed order produces OrderCancelled with productIds carried over", () => thenEvent(whenCmd(givenEvents([{
|
|
39
41
|
TAG: "OrderPlaced",
|
|
40
42
|
productIds: [
|
|
41
|
-
"p1",
|
|
42
|
-
"p2"
|
|
43
|
+
ProductId$CatalogSpec.make("p1"),
|
|
44
|
+
ProductId$CatalogSpec.make("p2")
|
|
43
45
|
]
|
|
44
46
|
}]), {
|
|
45
47
|
TAG: "CancelOrder",
|
|
46
|
-
orderId: "o1"
|
|
48
|
+
orderId: OrderId$OrderingPlugin.make("o1")
|
|
47
49
|
}), {
|
|
48
50
|
TAG: "OrderCancelled",
|
|
49
|
-
orderId: "o1",
|
|
51
|
+
orderId: OrderId$OrderingPlugin.make("o1"),
|
|
50
52
|
productIds: [
|
|
51
|
-
"p1",
|
|
52
|
-
"p2"
|
|
53
|
+
ProductId$CatalogSpec.make("p1"),
|
|
54
|
+
ProductId$CatalogSpec.make("p2")
|
|
53
55
|
]
|
|
54
56
|
}));
|
|
55
57
|
test("already cancelled order produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([
|
|
56
58
|
{
|
|
57
59
|
TAG: "OrderPlaced",
|
|
58
|
-
productIds: ["p1"]
|
|
60
|
+
productIds: [ProductId$CatalogSpec.make("p1")]
|
|
59
61
|
},
|
|
60
62
|
"OrderCancelled"
|
|
61
63
|
]), {
|
|
62
64
|
TAG: "CancelOrder",
|
|
63
|
-
orderId: "o1"
|
|
65
|
+
orderId: OrderId$OrderingPlugin.make("o1")
|
|
64
66
|
})));
|
|
65
67
|
test("shipped order returns OrderAlreadyShipped", () => thenError(whenCmd(givenEvents([
|
|
66
68
|
{
|
|
67
69
|
TAG: "OrderPlaced",
|
|
68
|
-
productIds: ["p1"]
|
|
70
|
+
productIds: [ProductId$CatalogSpec.make("p1")]
|
|
69
71
|
},
|
|
70
72
|
"OrderShipped"
|
|
71
73
|
]), {
|
|
72
74
|
TAG: "CancelOrder",
|
|
73
|
-
orderId: "o1"
|
|
75
|
+
orderId: OrderId$OrderingPlugin.make("o1")
|
|
74
76
|
}), "OrderAlreadyShipped"));
|
|
75
77
|
});
|
|
76
78
|
|
|
@@ -88,6 +90,10 @@ let thenAppendsConditionedOn = include.thenAppendsConditionedOn;
|
|
|
88
90
|
|
|
89
91
|
let thenAppendsConditionedOnExactly = include.thenAppendsConditionedOnExactly;
|
|
90
92
|
|
|
93
|
+
let oid = OrderId$OrderingPlugin.make;
|
|
94
|
+
|
|
95
|
+
let pid = ProductId$CatalogSpec.make;
|
|
96
|
+
|
|
91
97
|
export {
|
|
92
98
|
Spec,
|
|
93
99
|
describe,
|
|
@@ -103,5 +109,7 @@ export {
|
|
|
103
109
|
thenError,
|
|
104
110
|
thenAppendsConditionedOn,
|
|
105
111
|
thenAppendsConditionedOnExactly,
|
|
112
|
+
oid,
|
|
113
|
+
pid,
|
|
106
114
|
}
|
|
107
115
|
/* include Not a pure module */
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,33 +1,39 @@
|
|
|
1
1
|
@@reventless.gwt
|
|
2
2
|
|
|
3
|
+
let cid = CustomerId.make
|
|
4
|
+
let oid = OrderId.make
|
|
5
|
+
let pid = CatalogSpec.ProductId.make
|
|
6
|
+
|
|
3
7
|
describe("PlaceOrder StateChangeSlice", () => {
|
|
4
8
|
test("requires referenced products to be synced first", () =>
|
|
5
9
|
givenEvents([])
|
|
6
|
-
->whenCmd(PlaceOrder({orderId: "o1", customerId: "c1", productIds: ["p1"]}))
|
|
7
|
-
->thenError(ProductsNotAvailable({missing: ["p1"]}))
|
|
10
|
+
->whenCmd(PlaceOrder({orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1")]}))
|
|
11
|
+
->thenError(ProductsNotAvailable({missing: [pid("p1")]}))
|
|
8
12
|
)
|
|
9
13
|
|
|
10
14
|
test("placement succeeds when products are available", () =>
|
|
11
|
-
givenEvents([CatalogProductSynced({productId: "p1"})])
|
|
12
|
-
->whenCmd(PlaceOrder({orderId: "o1", customerId: "c1", productIds: ["p1"]}))
|
|
13
|
-
->thenEvent(OrderPlaced({orderId: "o1", customerId: "c1", productIds: ["p1"]}))
|
|
15
|
+
givenEvents([CatalogProductSynced({productId: pid("p1")})])
|
|
16
|
+
->whenCmd(PlaceOrder({orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1")]}))
|
|
17
|
+
->thenEvent(OrderPlaced({orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1")]}))
|
|
14
18
|
)
|
|
15
19
|
|
|
16
20
|
test("partial product availability returns ProductsNotAvailable with missing list", () =>
|
|
17
|
-
givenEvents([CatalogProductSynced({productId: "p1"})])
|
|
18
|
-
->whenCmd(
|
|
19
|
-
|
|
21
|
+
givenEvents([CatalogProductSynced({productId: pid("p1")})])
|
|
22
|
+
->whenCmd(
|
|
23
|
+
PlaceOrder({orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1"), pid("p2")]}),
|
|
24
|
+
)
|
|
25
|
+
->thenError(ProductsNotAvailable({missing: [pid("p2")]}))
|
|
20
26
|
)
|
|
21
27
|
|
|
22
28
|
test("re-placing the same orderId returns OrderAlreadyPlaced", () =>
|
|
23
|
-
givenEvents([CatalogProductSynced({productId: "p1"}), OrderPlaced({orderId: "o1"})])
|
|
24
|
-
->whenCmd(PlaceOrder({orderId: "o1", customerId: "c1", productIds: ["p1"]}))
|
|
29
|
+
givenEvents([CatalogProductSynced({productId: pid("p1")}), OrderPlaced({orderId: oid("o1")})])
|
|
30
|
+
->whenCmd(PlaceOrder({orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1")]}))
|
|
25
31
|
->thenError(OrderAlreadyPlaced)
|
|
26
32
|
)
|
|
27
33
|
|
|
28
34
|
test("a sibling OrderPlaced for a different orderId does not block placement", () =>
|
|
29
|
-
givenEvents([CatalogProductSynced({productId: "p1"}), OrderPlaced({orderId: "o2"})])
|
|
30
|
-
->whenCmd(PlaceOrder({orderId: "o1", customerId: "c1", productIds: ["p1"]}))
|
|
31
|
-
->thenEvent(OrderPlaced({orderId: "o1", customerId: "c1", productIds: ["p1"]}))
|
|
35
|
+
givenEvents([CatalogProductSynced({productId: pid("p1")}), OrderPlaced({orderId: oid("o2")})])
|
|
36
|
+
->whenCmd(PlaceOrder({orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1")]}))
|
|
37
|
+
->thenEvent(OrderPlaced({orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1")]}))
|
|
32
38
|
)
|
|
33
39
|
})
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
+
import * as ProductId$CatalogSpec from "@reventlessdev/online-shop-dcb-catalog-spec/src/ProductId.res.mjs";
|
|
4
|
+
import * as OrderId$OrderingPlugin from "../../../src/Order/OrderId.res.mjs";
|
|
5
|
+
import * as CustomerId$OrderingPlugin from "../../../src/Customer/CustomerId.res.mjs";
|
|
3
6
|
import * as PlaceOrder$OrderingPlugin from "../../../src/Order/StateChange/PlaceOrder.res.mjs";
|
|
4
7
|
import * as Behavior_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/Behavior_GWT.res.mjs";
|
|
5
8
|
import * as PlaceOrder_Behavior$OrderingPlugin from "../../../src/Order/StateChange/PlaceOrder_Behavior.res.mjs";
|
|
@@ -31,76 +34,76 @@ let thenError = include.thenError;
|
|
|
31
34
|
describe("PlaceOrder StateChangeSlice", () => {
|
|
32
35
|
test("requires referenced products to be synced first", () => thenError(whenCmd(givenEvents([]), {
|
|
33
36
|
TAG: "PlaceOrder",
|
|
34
|
-
orderId: "o1",
|
|
35
|
-
customerId: "c1",
|
|
36
|
-
productIds: ["p1"]
|
|
37
|
+
orderId: OrderId$OrderingPlugin.make("o1"),
|
|
38
|
+
customerId: CustomerId$OrderingPlugin.make("c1"),
|
|
39
|
+
productIds: [ProductId$CatalogSpec.make("p1")]
|
|
37
40
|
}), {
|
|
38
41
|
TAG: "ProductsNotAvailable",
|
|
39
|
-
missing: ["p1"]
|
|
42
|
+
missing: [ProductId$CatalogSpec.make("p1")]
|
|
40
43
|
}));
|
|
41
44
|
test("placement succeeds when products are available", () => thenEvent(whenCmd(givenEvents([{
|
|
42
45
|
TAG: "CatalogProductSynced",
|
|
43
|
-
productId: "p1"
|
|
46
|
+
productId: ProductId$CatalogSpec.make("p1")
|
|
44
47
|
}]), {
|
|
45
48
|
TAG: "PlaceOrder",
|
|
46
|
-
orderId: "o1",
|
|
47
|
-
customerId: "c1",
|
|
48
|
-
productIds: ["p1"]
|
|
49
|
+
orderId: OrderId$OrderingPlugin.make("o1"),
|
|
50
|
+
customerId: CustomerId$OrderingPlugin.make("c1"),
|
|
51
|
+
productIds: [ProductId$CatalogSpec.make("p1")]
|
|
49
52
|
}), {
|
|
50
53
|
TAG: "OrderPlaced",
|
|
51
|
-
orderId: "o1",
|
|
52
|
-
customerId: "c1",
|
|
53
|
-
productIds: ["p1"]
|
|
54
|
+
orderId: OrderId$OrderingPlugin.make("o1"),
|
|
55
|
+
customerId: CustomerId$OrderingPlugin.make("c1"),
|
|
56
|
+
productIds: [ProductId$CatalogSpec.make("p1")]
|
|
54
57
|
}));
|
|
55
58
|
test("partial product availability returns ProductsNotAvailable with missing list", () => thenError(whenCmd(givenEvents([{
|
|
56
59
|
TAG: "CatalogProductSynced",
|
|
57
|
-
productId: "p1"
|
|
60
|
+
productId: ProductId$CatalogSpec.make("p1")
|
|
58
61
|
}]), {
|
|
59
62
|
TAG: "PlaceOrder",
|
|
60
|
-
orderId: "o1",
|
|
61
|
-
customerId: "c1",
|
|
63
|
+
orderId: OrderId$OrderingPlugin.make("o1"),
|
|
64
|
+
customerId: CustomerId$OrderingPlugin.make("c1"),
|
|
62
65
|
productIds: [
|
|
63
|
-
"p1",
|
|
64
|
-
"p2"
|
|
66
|
+
ProductId$CatalogSpec.make("p1"),
|
|
67
|
+
ProductId$CatalogSpec.make("p2")
|
|
65
68
|
]
|
|
66
69
|
}), {
|
|
67
70
|
TAG: "ProductsNotAvailable",
|
|
68
|
-
missing: ["p2"]
|
|
71
|
+
missing: [ProductId$CatalogSpec.make("p2")]
|
|
69
72
|
}));
|
|
70
73
|
test("re-placing the same orderId returns OrderAlreadyPlaced", () => thenError(whenCmd(givenEvents([
|
|
71
74
|
{
|
|
72
75
|
TAG: "CatalogProductSynced",
|
|
73
|
-
productId: "p1"
|
|
76
|
+
productId: ProductId$CatalogSpec.make("p1")
|
|
74
77
|
},
|
|
75
78
|
{
|
|
76
79
|
TAG: "OrderPlaced",
|
|
77
|
-
orderId: "o1"
|
|
80
|
+
orderId: OrderId$OrderingPlugin.make("o1")
|
|
78
81
|
}
|
|
79
82
|
]), {
|
|
80
83
|
TAG: "PlaceOrder",
|
|
81
|
-
orderId: "o1",
|
|
82
|
-
customerId: "c1",
|
|
83
|
-
productIds: ["p1"]
|
|
84
|
+
orderId: OrderId$OrderingPlugin.make("o1"),
|
|
85
|
+
customerId: CustomerId$OrderingPlugin.make("c1"),
|
|
86
|
+
productIds: [ProductId$CatalogSpec.make("p1")]
|
|
84
87
|
}), "OrderAlreadyPlaced"));
|
|
85
88
|
test("a sibling OrderPlaced for a different orderId does not block placement", () => thenEvent(whenCmd(givenEvents([
|
|
86
89
|
{
|
|
87
90
|
TAG: "CatalogProductSynced",
|
|
88
|
-
productId: "p1"
|
|
91
|
+
productId: ProductId$CatalogSpec.make("p1")
|
|
89
92
|
},
|
|
90
93
|
{
|
|
91
94
|
TAG: "OrderPlaced",
|
|
92
|
-
orderId: "o2"
|
|
95
|
+
orderId: OrderId$OrderingPlugin.make("o2")
|
|
93
96
|
}
|
|
94
97
|
]), {
|
|
95
98
|
TAG: "PlaceOrder",
|
|
96
|
-
orderId: "o1",
|
|
97
|
-
customerId: "c1",
|
|
98
|
-
productIds: ["p1"]
|
|
99
|
+
orderId: OrderId$OrderingPlugin.make("o1"),
|
|
100
|
+
customerId: CustomerId$OrderingPlugin.make("c1"),
|
|
101
|
+
productIds: [ProductId$CatalogSpec.make("p1")]
|
|
99
102
|
}), {
|
|
100
103
|
TAG: "OrderPlaced",
|
|
101
|
-
orderId: "o1",
|
|
102
|
-
customerId: "c1",
|
|
103
|
-
productIds: ["p1"]
|
|
104
|
+
orderId: OrderId$OrderingPlugin.make("o1"),
|
|
105
|
+
customerId: CustomerId$OrderingPlugin.make("c1"),
|
|
106
|
+
productIds: [ProductId$CatalogSpec.make("p1")]
|
|
104
107
|
}));
|
|
105
108
|
});
|
|
106
109
|
|
|
@@ -120,6 +123,12 @@ let thenAppendsConditionedOn = include.thenAppendsConditionedOn;
|
|
|
120
123
|
|
|
121
124
|
let thenAppendsConditionedOnExactly = include.thenAppendsConditionedOnExactly;
|
|
122
125
|
|
|
126
|
+
let cid = CustomerId$OrderingPlugin.make;
|
|
127
|
+
|
|
128
|
+
let oid = OrderId$OrderingPlugin.make;
|
|
129
|
+
|
|
130
|
+
let pid = ProductId$CatalogSpec.make;
|
|
131
|
+
|
|
123
132
|
export {
|
|
124
133
|
Spec,
|
|
125
134
|
describe,
|
|
@@ -135,5 +144,8 @@ export {
|
|
|
135
144
|
thenError,
|
|
136
145
|
thenAppendsConditionedOn,
|
|
137
146
|
thenAppendsConditionedOnExactly,
|
|
147
|
+
cid,
|
|
148
|
+
oid,
|
|
149
|
+
pid,
|
|
138
150
|
}
|
|
139
151
|
/* include Not a pure module */
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
@@reventless.gwt
|
|
2
2
|
|
|
3
|
+
let oid = OrderId.make
|
|
4
|
+
|
|
3
5
|
describe("ShipOrder StateChangeSlice", () => {
|
|
4
6
|
test("non-existent order returns OrderNotFound", () =>
|
|
5
7
|
givenEvents([])
|
|
6
|
-
->whenCmd(ShipOrder({orderId: "o1"}))
|
|
8
|
+
->whenCmd(ShipOrder({orderId: oid("o1")}))
|
|
7
9
|
->thenError(OrderNotFound)
|
|
8
10
|
)
|
|
9
11
|
|
|
10
12
|
test("placed order produces OrderShipped", () =>
|
|
11
13
|
givenEvents([OrderPlaced])
|
|
12
|
-
->whenCmd(ShipOrder({orderId: "o1"}))
|
|
13
|
-
->thenEvent(OrderShipped({orderId: "o1"}))
|
|
14
|
+
->whenCmd(ShipOrder({orderId: oid("o1")}))
|
|
15
|
+
->thenEvent(OrderShipped({orderId: oid("o1")}))
|
|
14
16
|
)
|
|
15
17
|
|
|
16
18
|
test("already shipped order produces no events (idempotent)", () =>
|
|
17
19
|
givenEvents([OrderPlaced, OrderShipped])
|
|
18
|
-
->whenCmd(ShipOrder({orderId: "o1"}))
|
|
20
|
+
->whenCmd(ShipOrder({orderId: oid("o1")}))
|
|
19
21
|
->thenNoEvent
|
|
20
22
|
)
|
|
21
23
|
|
|
22
24
|
test("cancelled order returns OrderAlreadyCancelled", () =>
|
|
23
25
|
givenEvents([OrderPlaced, OrderCancelled])
|
|
24
|
-
->whenCmd(ShipOrder({orderId: "o1"}))
|
|
26
|
+
->whenCmd(ShipOrder({orderId: oid("o1")}))
|
|
25
27
|
->thenError(OrderAlreadyCancelled)
|
|
26
28
|
)
|
|
27
29
|
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
+
import * as OrderId$OrderingPlugin from "../../../src/Order/OrderId.res.mjs";
|
|
3
4
|
import * as ShipOrder$OrderingPlugin from "../../../src/Order/StateChange/ShipOrder.res.mjs";
|
|
4
5
|
import * as Behavior_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/Behavior_GWT.res.mjs";
|
|
5
6
|
import * as ShipOrder_Behavior$OrderingPlugin from "../../../src/Order/StateChange/ShipOrder_Behavior.res.mjs";
|
|
@@ -33,28 +34,28 @@ let thenError = include.thenError;
|
|
|
33
34
|
describe("ShipOrder StateChangeSlice", () => {
|
|
34
35
|
test("non-existent order returns OrderNotFound", () => thenError(whenCmd(givenEvents([]), {
|
|
35
36
|
TAG: "ShipOrder",
|
|
36
|
-
orderId: "o1"
|
|
37
|
+
orderId: OrderId$OrderingPlugin.make("o1")
|
|
37
38
|
}), "OrderNotFound"));
|
|
38
39
|
test("placed order produces OrderShipped", () => thenEvent(whenCmd(givenEvents(["OrderPlaced"]), {
|
|
39
40
|
TAG: "ShipOrder",
|
|
40
|
-
orderId: "o1"
|
|
41
|
+
orderId: OrderId$OrderingPlugin.make("o1")
|
|
41
42
|
}), {
|
|
42
43
|
TAG: "OrderShipped",
|
|
43
|
-
orderId: "o1"
|
|
44
|
+
orderId: OrderId$OrderingPlugin.make("o1")
|
|
44
45
|
}));
|
|
45
46
|
test("already shipped order produces no events (idempotent)", () => thenNoEvent(whenCmd(givenEvents([
|
|
46
47
|
"OrderPlaced",
|
|
47
48
|
"OrderShipped"
|
|
48
49
|
]), {
|
|
49
50
|
TAG: "ShipOrder",
|
|
50
|
-
orderId: "o1"
|
|
51
|
+
orderId: OrderId$OrderingPlugin.make("o1")
|
|
51
52
|
})));
|
|
52
53
|
test("cancelled order returns OrderAlreadyCancelled", () => thenError(whenCmd(givenEvents([
|
|
53
54
|
"OrderPlaced",
|
|
54
55
|
"OrderCancelled"
|
|
55
56
|
]), {
|
|
56
57
|
TAG: "ShipOrder",
|
|
57
|
-
orderId: "o1"
|
|
58
|
+
orderId: OrderId$OrderingPlugin.make("o1")
|
|
58
59
|
}), "OrderAlreadyCancelled"));
|
|
59
60
|
});
|
|
60
61
|
|
|
@@ -72,6 +73,8 @@ let thenAppendsConditionedOn = include.thenAppendsConditionedOn;
|
|
|
72
73
|
|
|
73
74
|
let thenAppendsConditionedOnExactly = include.thenAppendsConditionedOnExactly;
|
|
74
75
|
|
|
76
|
+
let oid = OrderId$OrderingPlugin.make;
|
|
77
|
+
|
|
75
78
|
export {
|
|
76
79
|
Spec,
|
|
77
80
|
describe,
|
|
@@ -87,5 +90,6 @@ export {
|
|
|
87
90
|
thenError,
|
|
88
91
|
thenAppendsConditionedOn,
|
|
89
92
|
thenAppendsConditionedOnExactly,
|
|
93
|
+
oid,
|
|
90
94
|
}
|
|
91
95
|
/* include Not a pure module */
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,30 +1,41 @@
|
|
|
1
1
|
@@reventless.gwt
|
|
2
2
|
|
|
3
|
+
let cid = CustomerId.make
|
|
4
|
+
let oid = OrderId.make
|
|
5
|
+
let pid = CatalogSpec.ProductId.make
|
|
6
|
+
|
|
3
7
|
describe("Orders StateViewSlice", () => {
|
|
4
8
|
test("OrderPlaced creates a row with status Placed", () =>
|
|
5
9
|
givenEvents([])
|
|
6
|
-
->whenEvent(
|
|
10
|
+
->whenEvent(
|
|
11
|
+
OrderPlaced({orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1"), pid("p2")]}),
|
|
12
|
+
)
|
|
7
13
|
->thenStateWithId(
|
|
8
14
|
"o1",
|
|
9
|
-
{
|
|
15
|
+
{
|
|
16
|
+
orderId: oid("o1"),
|
|
17
|
+
customerId: cid("c1"),
|
|
18
|
+
productIds: [pid("p1"), pid("p2")],
|
|
19
|
+
lifecycle: Placed,
|
|
20
|
+
},
|
|
10
21
|
)
|
|
11
22
|
)
|
|
12
23
|
|
|
13
24
|
test("OrderShipped updates status to Shipped", () =>
|
|
14
|
-
givenEvents([OrderPlaced({orderId: "o1", customerId: "c1", productIds: ["p1"]})])
|
|
15
|
-
->whenEvent(OrderShipped({orderId: "o1"}))
|
|
25
|
+
givenEvents([OrderPlaced({orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1")]})])
|
|
26
|
+
->whenEvent(OrderShipped({orderId: oid("o1")}))
|
|
16
27
|
->thenStateWithId(
|
|
17
28
|
"o1",
|
|
18
|
-
{orderId: "o1", customerId: "c1", productIds: ["p1"], lifecycle: Shipped},
|
|
29
|
+
{orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1")], lifecycle: Shipped},
|
|
19
30
|
)
|
|
20
31
|
)
|
|
21
32
|
|
|
22
33
|
test("OrderCancelled updates status to Cancelled", () =>
|
|
23
|
-
givenEvents([OrderPlaced({orderId: "o1", customerId: "c1", productIds: ["p1"]})])
|
|
24
|
-
->whenEvent(OrderCancelled({orderId: "o1"}))
|
|
34
|
+
givenEvents([OrderPlaced({orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1")]})])
|
|
35
|
+
->whenEvent(OrderCancelled({orderId: oid("o1")}))
|
|
25
36
|
->thenStateWithId(
|
|
26
37
|
"o1",
|
|
27
|
-
{orderId: "o1", customerId: "c1", productIds: ["p1"], lifecycle: Cancelled},
|
|
38
|
+
{orderId: oid("o1"), customerId: cid("c1"), productIds: [pid("p1")], lifecycle: Cancelled},
|
|
28
39
|
)
|
|
29
40
|
)
|
|
30
41
|
})
|