Skip to content
New issue

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

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

Already on GitHub? # to your account

Feature TR-4685 NRPS membership difference #136

Merged
merged 6 commits into from
Dec 9, 2022

Conversation

wazelin
Copy link
Member

@wazelin wazelin commented Nov 21, 2022

TR-4685

Screen.Recording.2022-11-21.at.16.17.18.mov

How to test

  1. Create a custom NRPS membership
  2. Call the platform's NRPS membership endpoint
  3. Verify the Link header has the rel="difference" value
  4. Call that link, make sure it returns an empty membership set
  5. Update the original membership
  6. Call the link again
  7. Make sure the differences are displayed

This PR aims to bring Membership Differences to the NRPS implementation in DevKit.

This feature is required to re-submit for the LTI Advantage Platform certification.

The validation with the IMS' test tool went well, will merge once the final confirmation from IMS has been received.

array_filter(
$membership->getMembers()->all(),
static function (MemberInterface $member) {
return $member->getStatus() !== MemberInterface::STATUS_DELETED;
Copy link

Choose a reason for hiding this comment

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

why you takes only deleted here?

Copy link
Member Author

Choose a reason for hiding this comment

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

That filters not deleted ones.

}

public function __invoke(Request $request, string $membershipIdentifier): Response
{
$membership = $this->repository->find($membershipIdentifier);
$membership = $this->service->findMembership($membershipIdentifier);
Copy link

@kilatib kilatib Nov 22, 2022

Choose a reason for hiding this comment

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

Here you take only
MemberInterface::STATUS_ACTIVE, MemberInterface::STATUS_INACTIVE

statuses end then the filter deletes, is it ok?

I think you coyuld provide second params and not doit any filtering

Copy link
Member Author

Choose a reason for hiding this comment

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

No, that retrieves all records regardless of their state if I'm not mistaken.

}

public function __invoke(Request $request, string $membershipIdentifier): Response
{
$membership = $this->repository->find($membershipIdentifier);
$membership = $this->service->findMembership($membershipIdentifier);
Copy link

Choose a reason for hiding this comment

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

Suggested change
$membership = $this->service->findMembership($membershipIdentifier);
$membership = $this->service->findMembership($membershipIdentifier, [MemberInterface::STATUS_DELETED]);

Copy link
Member Author

Choose a reason for hiding this comment

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

That would fetch only deleted ones. I don't think this would be intentional.

Copy link
Contributor

@poyuki poyuki left a comment

Choose a reason for hiding this comment

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

  • New code is covered by tests (if applicable)
  • Tests are running successfully (old and new ones) on my local machine (if applicable)
  • New code is respecting code style rules
  • New code is respecting best practices
  • New code is not subject to concurrency issues (if applicable)
  • Feature is working correctly on my local machine (if applicable)
  • Acceptance criteria are respected
  • Pull request title and description are meaningful
  • Pull request's target is not master
  • Commits are following conventional commits
  • Changelog is updated according to changes (if applicable)
  • Documentation is updated according to changes (if applicable)

@wazelin wazelin merged commit b6a4abe into develop Dec 9, 2022
@wazelin wazelin deleted the feature/TR-4685/nrps-membership-difference branch December 9, 2022 10:34
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants