Background:
addMedicalRecord (celo-contracts/contracts/PetChainRegistry.sol) writes a MedicalRecord that can never be modified afterward — there is no update/correction function of any kind.
Problem:
A vet who makes a data-entry mistake (wrong diagnosis text, wrong date) has no way to correct it; the only option is leaving permanently incorrect medical history on-chain.
What "done" looks like:
- A
correctMedicalRecord(uint256 recordId, string calldata diagnosis, string calldata treatment, string calldata notes) function, restricted to the original recording vet (or admin), updates the record and emits a MedicalRecordCorrected event preserving the original values in the event log for auditability.
- Tests cover authorized and unauthorized correction attempts.
Implementation guidelines:
- Key file:
celo-contracts/contracts/PetChainRegistry.sol.
PR must include:
- New function + event
- Tests
- Passing Hardhat test run
Background:
addMedicalRecord(celo-contracts/contracts/PetChainRegistry.sol) writes aMedicalRecordthat can never be modified afterward — there is no update/correction function of any kind.Problem:
A vet who makes a data-entry mistake (wrong diagnosis text, wrong date) has no way to correct it; the only option is leaving permanently incorrect medical history on-chain.
What "done" looks like:
correctMedicalRecord(uint256 recordId, string calldata diagnosis, string calldata treatment, string calldata notes)function, restricted to the original recording vet (or admin), updates the record and emits aMedicalRecordCorrectedevent preserving the original values in the event log for auditability.Implementation guidelines:
celo-contracts/contracts/PetChainRegistry.sol.PR must include: