My Main.daml code is as follows:
daml 1.2
module Main where
type CarId = ContractId Car -- for return type on controller actions
template Car
with
dealer : Party
insurer : Party
vin: Text
date_vehicle_added: Date
daily_insurance_rate: Decimal
daily_rate_APD: Decimal
covered: Bool --initialize to false and set to true when added
observers : [Party]
where
signatory dealer
agreement
toText dealer <> " agrees to pay " <> toText insurer <> " at daily rate of "
controller dealer can
Add_Car : CarId
with
startCoverage: Date
do
-- Return this car with the start date provided by the dealer
create this with date_vehicle_added = startCoverage, covered = True
Remove_Car
do
archive this
setup = scenario do
dealer1 <- getParty "Clevland_Heights"
insurance1 <- getParty "Ins"
car1AddCid <- submit dealer1 do
carCid <- create Car with
dealer = dealer1
insurer = insurance1
vin = "1A"
daily_insurance_rate = 1.5
daily_rate_APD = 0.16
covered = False
observers = [insurance1]
date_vehicle_added = "date 1970 Jan 1" -- must be initialized
exercise carCid Add_Car with startCoverage = "date 2019 Apr 5"
submit dealer1 do
exercise car1AddCid Remove_Car
I am seeing two errors in the 'PROBLEMS' window"
1. error: parse error on input 'do' (43,9).
This is the line right after the "Remove_Car" choice.
2. error: Data contructor not in scope:Remove_Car
This is the last line of the program.
I tried to pattern the syntax and spacing in my code after Main.daml and Ion.daml of the quickstart application. What is causing these errors?