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

BOOK02.zen 483B

123456789101112131415161718
  1. Scenario 'prosume'
  2. Scenario 'simple'
  3. rule check version 1.0.0
  4. Given I am 'Bob'
  5. and I have a valid 'public key' from 'Alice'
  6. and I have a valid 'booking'
  7. and I have a valid 'asset'
  8. When I verify the 'booking' is signed by 'Alice'
  9. and I set 'offer' to '100' as 'number'
  10. and number 'quantity' is more than 'offer'
  11. and I verify 'kind' is equal to 'kWh'
  12. and I set 'price' to '10' as 'number'
  13. and I create the order for '100'
  14. and I create the signature of 'order'
  15. Then print my 'order'