module Final where
import Daml.Script
data Agent = Agent with
name : Text
email : Text
phone_number : Text
regulator : Party
deriving (Eq, Show)
template Cases
with
casenum : Text
timestamp : Text
claiment : Agent
respondent : Agent
casetype : Text
regulator : Party
where
signatory regulator
-- key (email,name) : (Text,Text)
-- maintainer key._1
choice Updatecase : ContractId Cases
with
ncasenum : Text
ntimestamp : Text
nclaiment : Agent
nrespondent : Agent
ncasetype : Text
controller regulator
do create this with
casenum = ncasenum
timestamp = ntimestamp
claiment = nclaiment
respondent = nrespondent
casetype = ncasetype
template Document
with
regulator : Party
caseid : Text
doctype : Text
docname : Text
dochash : Text
timestamp : Text
uploadedby : Agent
where
signatory regulator
choice Updatedoc : ContractId Document
with
ndoctype : Text
ndocname : Text
ndochash : Text
ntimestamp : Text
nuploadedby : Agent
controller regulator
do create this with
doctype = ndoctype
docname = ndocname
dochash = ndochash
timestamp = ntimestamp
uploadedby = nuploadedby
setup = script do
alice <- allocatePartyWithHint "Alice" (PartyIdHint "Alice")
-- submit alice do
-- createCmd Asset with
-- respondent = alice
-- claiment = alice
-- casenum = "7890"
-- filename = "Text"
-- filehash = "Text"
-- timestamp = "Text"
-- uploadedby = "Text"
cases<- submit alice do
createCmd Cases with
casenum = "124"
timestamp = "Time"
claiment = Agent with
name = "Nikhil"
email = "nikhil@gmail.com"
phone_number = "8323832938"
regulator = alice
respondent = Agent with
name = "Nikhil"
email = "nikhil@gmail.com"
phone_number = "8323832938"
regulator = alice
casetype = "Text"
regulator = alice
submit alice do
createCmd Document with
regulator = alice
caseid = "124"
doctype = "agreement"
docname = "testcases"
dochash = "2azxwe34qwdaw1234raasr"
timestamp = "Text"
uploadedby = Agent with
name = "Nikhil"
email = "nikhil@gmail.com"
phone_number = "8323832938"
regulator = alice
In Scenario How can add Real Timestamp for cases contract ( line number 100)
In Scenarios How can I fetch the caseid(Documents Template) value which is equal to casenum( Cases Template)