Fix false-positive 'source quote was modified' banner after job conversion

The banner fires when quote.UpdatedAt > job.QuoteSnapshotUpdatedAt. The
snapshot was captured before saving quote.ConvertedToJobId, so the EF
interceptor's automatic UpdatedAt stamp on that save always made the quote
appear newer than the snapshot — triggering the banner on every freshly
converted job even with no actual changes.

Fix: after saving ConvertedToJobId, re-stamp QuoteSnapshotUpdatedAt to the
quote's final UpdatedAt value and save the job once more. The snapshot now
includes the conversion write, so the comparison is equal (not "after") and
the banner stays hidden until the quote genuinely changes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-06 14:46:39 -04:00
parent ecb285657a
commit 9c4c20e8bd
@@ -3146,6 +3146,13 @@ public class QuotesController : Controller
quote.ConvertedDate = DateTime.UtcNow;
await _unitOfWork.SaveChangesAsync();
// The interceptor just bumped quote.UpdatedAt as part of the ConvertedToJobId write.
// Advance the job's snapshot past that update — otherwise the comparison
// job.Quote.UpdatedAt > job.QuoteSnapshotUpdatedAt is immediately true and the
// "source quote was modified" banner fires on every newly-converted job.
job.QuoteSnapshotUpdatedAt = quote.UpdatedAt ?? quote.CreatedAt;
await _unitOfWork.SaveChangesAsync();
// Copy all quote photos to job (leave originals on the quote)
// AI analysis photos are copied with IsAiAnalysisPhoto=true so they don't count against subscription limits
try