In Daml finance, InstrumentQuantity is a common type that’s used for capturing both the unit and amount, like in case of issuance request to specify the requested quantity. I want to use a variable of that type in a service and make checks like if the requested quantity is above a certain value. I tried the following.
CreateAuditedIssuanceRequest{id; description; account; quantity; quantityAudited} <- fetchAndArchive createAuditedIssuanceRequestCid
assert quantity.amount > quantityAudited.amount
assert quantity.unit.id == quantityAudited.unit.id
assert quantity.amount > 100
assert quantity >100
both quantityAudited and quantity are of type InstrumentQuantity.
I got a lot of errors related to trying to access nonexistent field. and type mismatch. Can you point me in the right direction