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
DPMMA-2550 Point Groups API #13517
DPMMA-2550 Point Groups API #13517
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 5.x #13517 +/- ##
============================================
+ Coverage 61.43% 61.50% +0.07%
- Complexity 34050 34067 +17
============================================
Files 2240 2241 +1
Lines 101773 101850 +77
============================================
+ Hits 62520 62639 +119
+ Misses 39253 39211 -42
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested all endpoints (thank you SO MUCH for the awesome documentation in the PR @patrykgruszka it really helps testers when you provide both the path and the snippet!).
All working as expected. Thanks for the great work! 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks great! I have a few small suggestions. The functional tests are testing the happy paths. It would be great to have tests that check also 404s, xss and similar. But happy path tests are still way better than none 👍
app/bundles/PointBundle/Controller/Api/PointGroupsApiController.php
Outdated
Show resolved
Hide resolved
app/bundles/PointBundle/Tests/Controller/Api/PointGroupsApiControllerTest.php
Show resolved
Hide resolved
app/bundles/PointBundle/Tests/Controller/Api/PointGroupsApiControllerTest.php
Outdated
Show resolved
Hide resolved
Thanks! I've updated the code and added some extra tests :) Would you have some time to look at the related PR in the API library? mautic/api-library#322 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see no issue in the code. The Point group/score is covered with functional tests 👍
Description:
This PR adds API endpoints for Point Groups management.
Steps to test this PR:
Open this PR on Gitpod or pull down for testing locally (see docs on testing PRs here)
Create a new point group:
POST https://your-api-host.com/api/points/groups/new
Retrieve all point groups:
GET https://your-api-host.com/api/points/groups
Update the created point group:
PATCH https://your-api-host.com/api/points/groups/{id}/edit
Delete the created point group:
DELETE https://your-api-host.com/api/points/groups/{id}/delete
Get contact group points:
GET https://your-api-host.com/api/contacts/{leadId}/points/groups
Adjust contact group points:
POST https://your-api-host.com/api/contacts/{leadId}/points/groups/{groupId}/plus/{value}
POST https://your-api-host.com/api/contacts/{leadId}/points/groups/{groupId}/minus/{value}
POST https://your-api-host.com/api/contacts/{leadId}/points/groups/{groupId}/set/{value}
POST https://your-api-host.com/api/contacts/{leadId}/points/groups/{groupId}/divide/{value}
POST https://your-api-host.com/api/contacts/{leadId}/points/groups/{groupId}/times/{value}
When testing these endpoints, ensure that you replace placeholders such as
{leadId}
,{groupId}
, and{value}
with actual IDs and values as required for your specific test cases. Additionally, for endpoints that require a request body, provide the appropriate JSON payload with the necessary fields and values.