refactor(sp31): rename Match strategy 'auto' to 'pcn-exact' for audit clarity
This commit is contained in:
@@ -84,7 +84,7 @@ def match(
|
||||
matches.append(Match(
|
||||
claim=chosen,
|
||||
remittance=r,
|
||||
strategy="auto",
|
||||
strategy="pcn-exact",
|
||||
is_reversal=r.is_reversal,
|
||||
))
|
||||
used_claim_ids.add(chosen.id)
|
||||
|
||||
@@ -320,7 +320,7 @@ def test_create_match_and_activity_event():
|
||||
))
|
||||
m = Match(
|
||||
claim_id="CLM-1", remittance_id="CLP-1",
|
||||
strategy="auto", is_reversal=False,
|
||||
strategy="pcn-exact", is_reversal=False,
|
||||
matched_at=datetime(2026, 6, 19, 13, 0, tzinfo=timezone.utc),
|
||||
)
|
||||
s.add(m)
|
||||
@@ -335,7 +335,7 @@ def test_create_match_and_activity_event():
|
||||
with db.SessionLocal()() as s:
|
||||
loaded = s.get(Match, 1) # autoincrement id
|
||||
assert loaded is not None
|
||||
assert loaded.strategy == "auto"
|
||||
assert loaded.strategy == "pcn-exact"
|
||||
assert loaded.is_reversal is False
|
||||
|
||||
events = s.query(ActivityEvent).all()
|
||||
@@ -361,7 +361,7 @@ def test_match_multiple_rows_per_claim():
|
||||
status_code="1", received_at=datetime.now(timezone.utc)))
|
||||
s.add(Remittance(id="CLP-2", batch_id="b1", payer_claim_control_number="y",
|
||||
status_code="1", received_at=datetime.now(timezone.utc)))
|
||||
s.add(Match(claim_id="CLM-1", remittance_id="CLP-1", strategy="auto",
|
||||
s.add(Match(claim_id="CLM-1", remittance_id="CLP-1", strategy="pcn-exact",
|
||||
matched_at=datetime.now(timezone.utc)))
|
||||
s.add(Match(claim_id="CLM-1", remittance_id="CLP-2", strategy="manual",
|
||||
matched_at=datetime.now(timezone.utc),
|
||||
|
||||
@@ -55,7 +55,7 @@ def test_match_same_pcn_within_window_matches():
|
||||
assert len(matches) == 1
|
||||
assert matches[0].claim.id == "CLM-1"
|
||||
assert matches[0].remittance.id == "CLP-1"
|
||||
assert matches[0].strategy == "auto"
|
||||
assert matches[0].strategy == "pcn-exact"
|
||||
|
||||
|
||||
def test_match_dates_outside_window_unmatched():
|
||||
@@ -203,7 +203,7 @@ def test_apply_reversal_of_already_reversed_is_noop():
|
||||
def test_split_unmatched_partitions_by_match_set():
|
||||
claims = [FakeClaim("CLM-1", "A", None), FakeClaim("CLM-2", "B", None)]
|
||||
remits = [FakeRemit("CLP-1", "A", None), FakeRemit("CLP-2", "C", None)]
|
||||
matches = [ReconcileMatch(claim=claims[0], remittance=remits[0], strategy="auto", is_reversal=False)]
|
||||
matches = [ReconcileMatch(claim=claims[0], remittance=remits[0], strategy="pcn-exact", is_reversal=False)]
|
||||
unmatched_claims, unmatched_remits = reconcile.split_unmatched(claims, remits, matches)
|
||||
assert [c.id for c in unmatched_claims] == ["CLM-2"]
|
||||
assert [r.id for r in unmatched_remits] == ["CLP-2"]
|
||||
@@ -306,7 +306,7 @@ def test_run_reversal_flips_paid_to_reversed(fixture_835):
|
||||
# Match row already exists from prior reconcile.
|
||||
s.add(Match(
|
||||
claim_id="CLM-1", remittance_id="CLP-OLD:b1xxxxxx",
|
||||
strategy="auto", matched_at=datetime.now(timezone.utc),
|
||||
strategy="pcn-exact", matched_at=datetime.now(timezone.utc),
|
||||
is_reversal=False,
|
||||
))
|
||||
s.flush()
|
||||
|
||||
+2
-2
@@ -455,7 +455,7 @@ export interface Match {
|
||||
id: number;
|
||||
claim_id: string;
|
||||
remittance_id: string;
|
||||
strategy: "auto" | "manual";
|
||||
strategy: "pcn-exact" | "score-auto" | "manual";
|
||||
matched_at: string;
|
||||
prior_claim_state?: ClaimState | null;
|
||||
is_reversal: boolean;
|
||||
@@ -507,7 +507,7 @@ export interface UnmatchedResponse {
|
||||
|
||||
export interface MatchResponse {
|
||||
claim: UnmatchedClaim;
|
||||
match: { id: number; strategy: "auto" | "manual" };
|
||||
match: { id: number; strategy: "pcn-exact" | "score-auto" | "manual" };
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user