Skip to content

request_refund() does not check is_student_blocked_internal(), unlike enroll(), batch_enroll(), and re_enroll() #261

Description

@SYLVIANNORUKA

Description
validate_enrollment() (used by enroll() and batch_enroll()) and re_enroll() both reject a blocked student with "student is blocked". request_refund() performs no such check -- a student who has been banned via block_student() after enrolling can still call request_refund() and have their request processed normally, which is inconsistent with the platform-wide ban's evident intent of restricting a blocked student's ability to transact on the platform.

Affected modules: contracts/hamplard/src/lib.rs

A platform-banned student retains full ability to request and receive refunds, unlike their ability to enroll.

Expected Behavior
Decide whether a blocked student should retain refund rights for pre-existing enrollments; if not, request_refund() should check is_student_blocked_internal() consistent with the other student-facing entry points.

Tasks

Decide the intended policy for blocked students' access to request_refund().

Implement the check (or explicitly document the exception) accordingly.

Add a test covering the decided behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions