Skip to content

[CT-11] Implement Multi-Booking Limit Validator per member tier in Rust #1028

@devwums

Description

@devwums

Problem

No on-chain enforcement prevents a member from holding more simultaneous active bookings than their tier permits. Members can bypass backend limits.

Proposed Solution

Create contracts/cntr/multi_booking.rs implementing pub fn get_booking_limit(tier: &str) -> u32 (Bronze: 2, Silver: 5, Gold: 10, Platinum: u32::MAX) and pub fn can_make_booking(tier: &str, current_active_bookings: u32) -> bool. Unknown tier strings default to Bronze limit. All implementation must live inside contracts/cntr/.

Acceptance Criteria

  • File at contracts/cntr/multi_booking.rs
  • Returns correct limits for all 4 known tier strings
  • Unknown tier strings return the Bronze limit (2)
  • can_make_booking returns false when current_active_bookings >= limit
  • can_make_booking returns true when current_active_bookings < limit
  • At least 6 unit tests
  • Compiles with cargo test

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions