Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement get_inspector_pending_approvals #206

Closed

Conversation

CollinsC1O
Copy link
Contributor

@CollinsC1O CollinsC1O commented Nov 30, 2024

Implement inspector pending approvals function with tests

Description

Added a new function get_inspector_pending_approvals to allow inspectors to view their pending land approvals filtered by date range. This enhancement helps inspectors better manage their workload by accessing only relevant pending approvals within specified time periods.

Implementation Details

  • Added get_inspector_pending_approvals function that takes start and end timestamps
  • Added authentication check to ensure only registered inspectors can access their pending approvals
  • Implemented date range filtering for land approvals
  • Added tests to verify functionality:
    • Unauthorized access test
    • Empty date range test

Tests Added

  • test_get_inspector_pending_approvals_unauthorized: Ensures unauthorized users cannot access pending approvals
  • test_get_inspector_pending_approvals_empty_range: Verifies correct handling of empty date ranges

Testing

All tests can be run using:

scarb test test_land_register

Note: Contract compiles successfully and all test cases pass successfully

@CollinsC1O
Copy link
Contributor Author

CollinsC1O commented Nov 30, 2024

Hello @fishonamos All contract compiles successfully and all test cases pass successfully.

Screenshot 2024-11-30 at 17 40 49 Screenshot 2024-11-30 at 17 41 04

@fishonamos fishonamos self-requested a review December 1, 2024 05:23
@fishonamos
Copy link
Member

The get inspector pending approvals functions should return list of lands that are pending approval for a specific inspector.

@CollinsC1O
Copy link
Contributor Author

CollinsC1O commented Dec 1, 2024

I will implement that right away

@fishonamos
Copy link
Member

We will close this for now.

@fishonamos fishonamos closed this Dec 4, 2024
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