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

Pz/types 010 - loyalties members #238

Merged
merged 68 commits into from
Oct 12, 2023

Conversation

p-zielinski
Copy link
Contributor

@p-zielinski p-zielinski commented Sep 15, 2023


'@voucherify/sdk': minor

Add support for few endpoints of Loyalties API.

  • Added support for new endpoints: GET /loyalties/members/{memberId}, GET /loyalties/members/{memberId}/activities, GET /loyalties/members/{memberId}/rewards, POST /loyalties/{campaignId}/members/{memberId}/transfers, GET /loyalties/{campaignId}/members/{memberId}/points-expiration, GET /loyalties/members/{memberId}/transactions, GET /loyalties/{campaignId}/members/{memberId}/transactions, POST /loyalties/members/{memberId}/transactions/export and POST /loyalties/{campaignId}/members/{memberId}/transactions/export (examples of usage available in readme.md)
  • New exported types/interfaces: LoyaltiesTransferPointsResponseBody, LoyaltiesTransferPointsRequestBody, LoyaltiesListMemberRewardsRequestQuery, LoyaltiesListMemberRewardsResponseBody, LoyaltiesGetPointsExpirationRequestQuery, LoyaltiesGetPointsExpirationResponseBody, LoyaltiesListCardTransactionsRequestQuery, LoyaltiesListCardTransactionsResponseBody, LoyaltiesExportCardTransactionsRequestBody, LoyaltiesExportCardTransactionsResponseBody, LoyaltiesAddOrRemoveCardBalanceRequestBody, LoyaltiesAddOrRemoveCardBalanceResponseBody, LoyaltyCardTransaction, SimpleLoyaltyVoucher, LoyaltiesTransferPoints, LoyaltyCardTransactionsFields, LoyaltyCardTransactionsType, Reward, RewardTypeCampaign, RewardTypeCoin, RewardTypeMaterial, RewardType, RewardAssignment

Copy link
Contributor

@marcin-slezak marcin-slezak left a comment

Choose a reason for hiding this comment

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

Adjust type names to a new guideline

packages/sdk/README.md Show resolved Hide resolved
.changeset/tidy-comics-five.md Outdated Show resolved Hide resolved
@@ -1064,6 +1072,12 @@ client.loyalties.createMember(campaignId, member)
client.loyalties.getMember(campaignId, memberId)
```

#### [Get Loyalty Program Member Without CampaignId](https://docs.voucherify.io/reference/get-member-1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Few issues here:

  1. The header and method name suggest that we do not need a campaign ID, but you expect it in params and link to documentation where the campaign ID is required.
  2. I do not like naming. I understand that we have two similar endpoints, one that expects just member ID and the second one that needs campaign ID in addition. In documentation, both are described as Get Member. I guess (but we can confirm it) that the one that needs a campaign ID is a legacy one. We should give a name that will be intuitive for a developer who does not know about the context (legacy method). So, maybe getMemberById?

#### [Add Or Remove Loyalty Card Balance](https://docs.voucherify.io/reference/add-remove-loyalty-card-balance-1)

```javascript
client.loyalties.addOrRemoveLoyaltyCardBalance(memberId, balance, campaignId)
Copy link
Contributor

Choose a reason for hiding this comment

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

Naming: addOrRemoveLoyaltyCardBalance -> addOrRemoveCardBalance?

packages/sdk/README.md Outdated Show resolved Hide resolved
packages/sdk/README.md Outdated Show resolved Hide resolved
packages/sdk/README.md Outdated Show resolved Hide resolved
packages/sdk/README.md Outdated Show resolved Hide resolved
packages/sdk/README.md Outdated Show resolved Hide resolved
packages/sdk/src/types/Loyalties.ts Outdated Show resolved Hide resolved
packages/sdk/src/types/Loyalties.ts Outdated Show resolved Hide resolved
@marcin-slezak marcin-slezak merged commit 2d5b050 into voucherifyio:main Oct 12, 2023
1 check passed
@github-actions github-actions bot mentioned this pull request Oct 12, 2023
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