Skip to content

fix: remove 7-day limit on sale date entry - #95

Merged
rcastaneda-dev merged 2 commits into
mainfrom
fix/remove-sale-date-limit
May 22, 2026
Merged

fix: remove 7-day limit on sale date entry#95
rcastaneda-dev merged 2 commits into
mainfrom
fix/remove-sale-date-limit

Conversation

@rcastaneda-dev

Copy link
Copy Markdown
Owner

Summary

  • Removes the frontend-only validation that blocked sale dates more than 7 days in the past
  • Removes unused sales.dateCannotBeMoreThanWeekOld strings from EN/ES locales
  • Keeps max={today} on the sale date input so future dates are still blocked in the picker

Test plan

  • Register a sale with a date 35+ days in the past — saves without alert
  • Register a sale dated today — still works
  • Confirm date picker cannot select a future date
  • Edit an existing sale older than 7 days and save successfully

Made with Cursor

Allow backdated sales by removing the frontend-only one-week validation
and unused i18n strings. Future dates remain blocked via the date input max.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI review requested due to automatic review settings May 22, 2026 02:32
@vercel

vercel Bot commented May 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nanisessentials-inventory Ready Ready Preview, Comment May 22, 2026 2:37am

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the frontend-only restriction that prevented recording sales with dates more than 7 days in the past, while keeping the date picker constrained to not allow future dates.

Changes:

  • Removed the “older than 1 week” sale date validation/alert from the sale form save flow.
  • Deleted the now-unused sales.dateCannotBeMoreThanWeekOld i18n strings from EN/ES locale files.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/components/pages/sales/SaleForm.tsx Removes the 7-day “past date” guard so older sales can be saved.
src/i18n/locales/en.json Removes unused sale-date validation message key.
src/i18n/locales/es.json Removes unused sale-date validation message key.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Satisfies react-hooks/exhaustive-deps for save/remove purchase and sale callbacks.

Co-authored-by: Cursor <cursoragent@cursor.com>
@rcastaneda-dev
rcastaneda-dev merged commit 67f8f31 into main May 22, 2026
5 checks passed
@rcastaneda-dev
rcastaneda-dev deleted the fix/remove-sale-date-limit branch May 22, 2026 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants