Currently, the RuleLocal class/table doesn't contain a hash field. This means that users of this library have to manually also track the hash of each rule in a separate DB/table (which can cause inconsistency, etc.). It also means that efficiently syncing the backend with the database is more involved. The current DefaultRulesRepository doesn't even do a hash comparison.
With a hash field every RuleLocal could also store the corresponding hash to allow easy comparison and minimal updates.
Our implementation with hash comparison looks like this in case you want to reuse some of the code: https://github.com/Digitaler-Impfnachweis/covpass-android/blob/main/covpass-sdk/src/main/java/de/rki/covpass/sdk/rules/DefaultCovPassRulesRepository.kt
However that's based on an additional database for storing the hashes. We could do away with that extra complexity by simply having that extra field and if you reuse our sync algorithm we could also get rid of that extra code and this lib would be nicely usable out of the box (apart from all the dependencies issue as mentioned in #32 and the missing Maven Central or GitHub Packages publication mentioned in #12).
Currently, the
RuleLocalclass/table doesn't contain ahashfield. This means that users of this library have to manually also track the hash of each rule in a separate DB/table (which can cause inconsistency, etc.). It also means that efficiently syncing the backend with the database is more involved. The currentDefaultRulesRepositorydoesn't even do a hash comparison.With a
hashfield everyRuleLocalcould also store the corresponding hash to allow easy comparison and minimal updates.Our implementation with hash comparison looks like this in case you want to reuse some of the code: https://github.com/Digitaler-Impfnachweis/covpass-android/blob/main/covpass-sdk/src/main/java/de/rki/covpass/sdk/rules/DefaultCovPassRulesRepository.kt
However that's based on an additional database for storing the hashes. We could do away with that extra complexity by simply having that extra field and if you reuse our sync algorithm we could also get rid of that extra code and this lib would be nicely usable out of the box (apart from all the dependencies issue as mentioned in #32 and the missing Maven Central or GitHub Packages publication mentioned in #12).