readEntity method
Read canonical entity merged with patches, or null if absent.
Implementation
Map<String, Object?>? readEntity(String type, String id) {
final base = _entities[type]?[id];
if (base == null) return null;
final patch = _patches[type]?[id];
if (patch == null || patch.isEmpty) return Map.unmodifiable(base);
return Map.unmodifiable({...base, ...patch});
}