Zencode PROSUME Scenario. Business Logic to implement in the Zenroom VM.

BOOK01.zen 506B

12345678910111213141516171819
  1. # Process: Check -> Booking -> Order -> Confirmation -> Settlement
  2. Scenario 'prosume'
  3. Scenario 'simple'
  4. Rule check version 1.0.0
  5. Given I am 'Alice'
  6. and I have my valid 'keypair'
  7. and I have a valid 'asset'
  8. and I have a 'quantity' inside 'asset'
  9. When I set 'offer' to '100' as 'number'
  10. and number 'quantity' is more than 'offer'
  11. and I verify 'type' is equal to 'kWh'
  12. and I set 'price' to '10' as 'number'
  13. and I create the booking for '100'
  14. and I create the signature of 'booking'
  15. Then print my 'booking'