refactor(sp31): rename Match strategy 'auto' to 'pcn-exact' for audit clarity

This commit is contained in:
Nora
2026-07-02 14:59:49 -06:00
parent 6624a0bafd
commit 75a2800a9d
4 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ def match(
matches.append(Match( matches.append(Match(
claim=chosen, claim=chosen,
remittance=r, remittance=r,
strategy="auto", strategy="pcn-exact",
is_reversal=r.is_reversal, is_reversal=r.is_reversal,
)) ))
used_claim_ids.add(chosen.id) used_claim_ids.add(chosen.id)
+3 -3
View File
@@ -320,7 +320,7 @@ def test_create_match_and_activity_event():
)) ))
m = Match( m = Match(
claim_id="CLM-1", remittance_id="CLP-1", 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), matched_at=datetime(2026, 6, 19, 13, 0, tzinfo=timezone.utc),
) )
s.add(m) s.add(m)
@@ -335,7 +335,7 @@ def test_create_match_and_activity_event():
with db.SessionLocal()() as s: with db.SessionLocal()() as s:
loaded = s.get(Match, 1) # autoincrement id loaded = s.get(Match, 1) # autoincrement id
assert loaded is not None assert loaded is not None
assert loaded.strategy == "auto" assert loaded.strategy == "pcn-exact"
assert loaded.is_reversal is False assert loaded.is_reversal is False
events = s.query(ActivityEvent).all() 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))) status_code="1", received_at=datetime.now(timezone.utc)))
s.add(Remittance(id="CLP-2", batch_id="b1", payer_claim_control_number="y", s.add(Remittance(id="CLP-2", batch_id="b1", payer_claim_control_number="y",
status_code="1", received_at=datetime.now(timezone.utc))) 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))) matched_at=datetime.now(timezone.utc)))
s.add(Match(claim_id="CLM-1", remittance_id="CLP-2", strategy="manual", s.add(Match(claim_id="CLM-1", remittance_id="CLP-2", strategy="manual",
matched_at=datetime.now(timezone.utc), matched_at=datetime.now(timezone.utc),
+3 -3
View File
@@ -55,7 +55,7 @@ def test_match_same_pcn_within_window_matches():
assert len(matches) == 1 assert len(matches) == 1
assert matches[0].claim.id == "CLM-1" assert matches[0].claim.id == "CLM-1"
assert matches[0].remittance.id == "CLP-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(): 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(): def test_split_unmatched_partitions_by_match_set():
claims = [FakeClaim("CLM-1", "A", None), FakeClaim("CLM-2", "B", None)] claims = [FakeClaim("CLM-1", "A", None), FakeClaim("CLM-2", "B", None)]
remits = [FakeRemit("CLP-1", "A", None), FakeRemit("CLP-2", "C", 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) unmatched_claims, unmatched_remits = reconcile.split_unmatched(claims, remits, matches)
assert [c.id for c in unmatched_claims] == ["CLM-2"] assert [c.id for c in unmatched_claims] == ["CLM-2"]
assert [r.id for r in unmatched_remits] == ["CLP-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. # Match row already exists from prior reconcile.
s.add(Match( s.add(Match(
claim_id="CLM-1", remittance_id="CLP-OLD:b1xxxxxx", 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, is_reversal=False,
)) ))
s.flush() s.flush()
+2 -2
View File
@@ -455,7 +455,7 @@ export interface Match {
id: number; id: number;
claim_id: string; claim_id: string;
remittance_id: string; remittance_id: string;
strategy: "auto" | "manual"; strategy: "pcn-exact" | "score-auto" | "manual";
matched_at: string; matched_at: string;
prior_claim_state?: ClaimState | null; prior_claim_state?: ClaimState | null;
is_reversal: boolean; is_reversal: boolean;
@@ -507,7 +507,7 @@ export interface UnmatchedResponse {
export interface MatchResponse { export interface MatchResponse {
claim: UnmatchedClaim; claim: UnmatchedClaim;
match: { id: number; strategy: "auto" | "manual" }; match: { id: number; strategy: "pcn-exact" | "score-auto" | "manual" };
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------