Files

13 lines
510 B
PHP
Raw Permalink Normal View History

<?php
declare( strict_types=1 );
namespace StreamGoals\Rules;
/** Persistence for sg_rule_events; UNIQUE(rule_id, donation_id) provides idempotency. */
interface EventStore {
/** Insert the event. Returns false if (rule, donation) already exists (replay). */
public function record( int $ruleId, int $donationId, int $delta ): bool;
/** Atomically flag as reversed. Returns the original delta, or null if absent/already reversed. */
public function markReversed( int $ruleId, int $donationId ): ?int;
}