Актив с именем Contract
имеет свойства contract_start_date
и contract_end_date
в файле модели. Я хочу создать событие после contract_end_date
.
Файл модели:
asset Contract identified by contractId {
o String contractId
o DateTime contract_start_date
o DateTime contract_end_date
}
transaction set_Dates {
--> Contract contract
o DateTime start_date
o DateTime end_date
}
event end_Date_Reached {
o String message
}
/**
* In the logic.js file
*/
async function setDate (tx) {
tx.contract.contract_start_date = tx.start_date;
tx.contract.contract_end_date = tx.end_date;
// get the Contract asset from registry
let contractRegistry = await getAssetRegistry('org.test.sample.Contract');
await contractRegistry.update(tx.contract); // update the registry
}
Как создать событие end_Date_Reached
, проверив значение свойства contract_end_date
? Любая помощь будет оценена!