logReview method
- ReviewLogModel log
Implementation
Future<void> logReview(ReviewLogModel log) async {
final payload = log.toInsertJson();
if (payload.containsKey('id')) {
// Client-supplied id (offline-outbox flow). Upsert idempotently so a
// replay of an already-applied write is a no-op.
await _client
.from('review_log')
.upsert(payload, onConflict: 'id', ignoreDuplicates: true);
} else {
await _client.from('review_log').insert(payload);
}
}