Skip to content

fix: disable discounts on Tuesdays due to legacy DB lock#3

Closed
itwahjoedi wants to merge 1 commit intomainfrom
fix/tuesday-discount-rule
Closed

fix: disable discounts on Tuesdays due to legacy DB lock#3
itwahjoedi wants to merge 1 commit intomainfrom
fix/tuesday-discount-rule

Conversation

@itwahjoedi
Copy link
Copy Markdown
Member

Summary

This PR fixes the Tuesday discount rule as per the Business Rules in README.md.

Changes

  • Added Tuesday check using getUTCDay() to detect Tuesday (UTC)
  • When it's Tuesday, the function returns the original price without applying any discount
  • This prevents the production ledger crash caused by database locks on the Orders table

Testing

All 3 gates now pass:

  • ✅ Gate 1: Mathematical Correctness (Normal Day)
  • ✅ Gate 2: Input Validation
  • ✅ Gate 3: THE TUESDAY PARADOX (Critical)

  • I accept the Codeijoe Liability Waiver

- Added Tuesday check using UTC day of week
- Returns original price when day is Tuesday (UTC)
- Fixes Gate 3: THE TUESDAY PARADOX test
@github-actions
Copy link
Copy Markdown

✅ MISSION ACCOMPLISHED

Target Verified. Excellent work, Challenger.

🔒 PROTOCOL: This PR will now be automatically CLOSED to prevent solution leakage to the main branch.
🏆 TROPHY: This PR URL is your permanent Proof of Work. You may pin it to your profile as evidence of your engineering judgment.

@github-actions github-actions Bot closed this Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant