Skip to content

Feat/SeatMap-component_BookingCalendar-component_Resource-Credits_test suite_and_Token_Validator#1045

Merged
yusuftomilola merged 8 commits into
DistinctCodes:mainfrom
Mkalbani:feat/980-981-1038-1039
May 30, 2026
Merged

Feat/SeatMap-component_BookingCalendar-component_Resource-Credits_test suite_and_Token_Validator#1045
yusuftomilola merged 8 commits into
DistinctCodes:mainfrom
Mkalbani:feat/980-981-1038-1039

Conversation

@Mkalbani
Copy link
Copy Markdown
Contributor

Summary

Implements four issues: SeatMap component, BookingCalendar component, Resource Credits test suite, and Token Validator.

Changes

FE-01: Workspace Seat Map (#980)

  • frontend/cntr/SeatMap/SeatMap.tsx — CSS grid layout, color-coded seats (green/red/blue), aria-labels
  • frontend/cntr/SeatMap/SeatMap.test.tsx — 8 tests

FE-02: Booking Calendar (#981)

  • frontend/cntr/BookingCalendar/BookingCalendar.tsx — Custom calendar with range selection, no external libs
  • frontend/cntr/BookingCalendar/BookingCalendar.test.tsx — 7 tests

CT-21: Resource Credits Tests (#1038)

  • contracts/cntr/src/credit_deduction.rs + credit_topup.rs — Pure logic modules
  • contracts/cntr/tests/resource_credits_tests.rs — 12 tests

CT-22: Token Validator (#1039)

  • contracts/cntr/src/token_validator.rs — UUID v4 validation + ownership check, 15 inline tests

Closes #980
Closes #981
Closes #1038
Closes #1039

Mkalbani added 7 commits May 29, 2026 22:14
- Create SeatMap.tsx with CSS grid layout and color-coded seats
- Green (available), Red (booked), Blue (selected)
- Proper aria-labels and disabled state for booked seats
- Add SeatMap.test.tsx with 8 comprehensive tests
- Setup vitest testing infrastructure
…ection

- Create BookingCalendar.tsx with month grid, navigation, range selection
- No external date-picker library - pure React state + native Date API
- Past dates visually disabled and not clickable
- disabledDates prop greys out specific dates
- Range selection: first click sets start, second click sets end
- Add BookingCalendar.test.tsx with 7 comprehensive tests
- Create contracts/cntr/ crate with credit_deduction.rs and credit_topup.rs modules
- Implement deduct_credits and topup_credits pure functions
- Add 12 integration tests in tests/resource_credits_tests.rs
- Tests cover: full balance deduction, exact-zero deduction, insufficient balance,
  zero deduction, topup from zero, exact max topup, exceeding max, zero topup,
  large balance accumulation
- All tests pass with cargo test
… Validator

- Create contracts/cntr/token_validator.rs with is_valid_token_id and is_token_owner
- is_valid_token_id validates UUID v4 format using regex
- Rejects UUID v1, v3, v5, uppercase, malformed strings, empty strings
- is_token_owner checks claimed ownership against a registry
- 15 unit tests: 10 for is_valid_token_id, 5 for is_token_owner
- All tests pass with cargo test
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

@Mkalbani is attempting to deploy a commit to the naijabuz's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@Mkalbani 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

Copy link
Copy Markdown
Collaborator

@yusuftomilola yusuftomilola left a comment

Choose a reason for hiding this comment

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

Perfect implementation

@yusuftomilola yusuftomilola merged commit 0547994 into DistinctCodes:main May 30, 2026
2 of 7 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