Skip to content

fix: resolve issues #282 #283 #285 — grooming/emergency validation - #356

Merged
iam-mercy merged 2 commits into
iam-mercy:mainfrom
chibeike-AI:fix/issues-282-283-285-grooming-emergency-validation
Oct 20, 2026
Merged

iam-mercy merged 2 commits into
iam-mercy:mainfrom
chibeike-AI:fix/issues-282-283-285-grooming-emergency-validation

Conversation

@chibeike-AI

Copy link
Copy Markdown
Contributor

#282 — EmergencyContact phone OR email required

  • validate_emergency_contacts now accepts contacts with email only (previously required phone unconditionally)
  • Condition updated: name must be non-empty AND at least one of phone or email must be non-empty
  • Renamed test_contact_with_empty_phone_rejected → test_contact_with_email_only_accepted (now a positive test)
  • Added test_contact_with_blank_phone_and_email_rejected for the actual rejection case

#283 — Enforce 90-day advance booking window in book_grooming_slot

  • Added MAX_ADVANCE_BOOKING_SECS constant (90 * 86_400 seconds)
  • book_grooming_slot now panics with InvalidInput when start_time > current_time + MAX_ADVANCE_BOOKING_SECS
  • Added three tests in test_grooming_slot_booking.rs:
    • test_booking_180_days_in_advance_rejected
    • test_booking_at_90_day_boundary_accepted
    • test_booking_one_second_past_90_day_limit_rejected

#285 — Validate rating score range 1–5 in rate_groomer

  • Validation was already implemented (!(1..=5).contains(&score))
  • Added missing unit tests in test_grooming.rs:
    • test_rate_groomer_score_zero_rejected (score=0 panics)
    • test_rate_groomer_score_six_rejected (score=6 panics)
    • test_rate_groomer_valid_scores_accepted (1–5 all pass)

Bonus fix: add GroomerNotVerified = 172 to ContractError enum (was referenced in book_grooming_slot but missing from enum, causing a pre-existing compile error)

.gitignore: deduplicate and clean up redundant entries

closes
closes #282
closes #283
closes #285

…ing/emergency validation

iam-mercy#282 — EmergencyContact phone OR email required
- validate_emergency_contacts now accepts contacts with email only
  (previously required phone unconditionally)
- Condition updated: name must be non-empty AND at least one of
  phone or email must be non-empty
- Renamed test_contact_with_empty_phone_rejected →
  test_contact_with_email_only_accepted (now a positive test)
- Added test_contact_with_blank_phone_and_email_rejected for
  the actual rejection case

iam-mercy#283 — Enforce 90-day advance booking window in book_grooming_slot
- Added MAX_ADVANCE_BOOKING_SECS constant (90 * 86_400 seconds)
- book_grooming_slot now panics with InvalidInput when
  start_time > current_time + MAX_ADVANCE_BOOKING_SECS
- Added three tests in test_grooming_slot_booking.rs:
  - test_booking_180_days_in_advance_rejected
  - test_booking_at_90_day_boundary_accepted
  - test_booking_one_second_past_90_day_limit_rejected

iam-mercy#285 — Validate rating score range 1–5 in rate_groomer
- Validation was already implemented (!(1..=5).contains(&score))
- Added missing unit tests in test_grooming.rs:
  - test_rate_groomer_score_zero_rejected (score=0 panics)
  - test_rate_groomer_score_six_rejected  (score=6 panics)
  - test_rate_groomer_valid_scores_accepted (1–5 all pass)

Bonus fix: add GroomerNotVerified = 172 to ContractError enum
(was referenced in book_grooming_slot but missing from enum,
causing a pre-existing compile error)

.gitignore: deduplicate and clean up redundant entries
@drips-wave

drips-wave Bot commented Oct 20, 2026

Copy link
Copy Markdown

@chibeike-AI Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@iam-mercy
iam-mercy merged commit 9e06f43 into iam-mercy:main Oct 20, 2026
0 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants