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

DEVEXP-321: Add sub methods for messages and events #35

Merged

Conversation

asein-sinch
Copy link
Collaborator

  • Messages: add submethods for different kinds of messages for different kinds of recipients
  • Events: add submethods for different kinds of events for different kinds of recipients
  • Capability: handle different kinds of recipients
  • Channel Profile: handle different kinds of recipients

Interface refactoring:

  • QueryCapabilityResponse -> LookupCapabilityResponse
  • LookupCapability -> LookupCapabilityRequest

Refactor mocks for tests

@asein-sinch asein-sinch requested a review from a team March 11, 2024 21:31
} else if ('choice_message' in translation) {
return {
type: MessageType.CHOICE,
content: translation.choice_message,
};
} else if ('carousel_message' in translation) {
} else if ('contact_info_message' in translation) {

Choose a reason for hiding this comment

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

OAS file do not contains contact_info_message
Did we sent feedback ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

They did an update in the conversation file but not yet in the template file. I hope it will follow soon

@@ -3,7 +3,7 @@ import { Recipient } from '../recipient';
/**
* An CapabilityResponse contains the identity of the recipient for which will be perform a capability lookup.
*/
export interface QueryCapabilityResponse {
export interface LookupCapabilityResponse {

Choose a reason for hiding this comment

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

My own interest here 😇
We could imagine having a mapping table to share same naming across SDKs (oas generator tool could be a good location)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, as soon as it is ready, it will be more convenient than a confluence page 👍

*/
public async getChannelProfile(data: GetChannelProfileRequestData): Promise<GetChannelProfileResponse> {
public async getChannelProfile(data: GetChannelProfileRequestData<Recipient>): Promise<GetChannelProfileResponse> {

Choose a reason for hiding this comment

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

No dedicated function name usage? (getChannelProfileByContactId and getChannelProfileByChannelIdentity)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No indeed. I've used instead another pattern for the recipient type with the type parameter <Recipient>.
As this API defines other more important variations for messages and events, it's better not to create too many methods

@asein-sinch asein-sinch requested a review from a team March 18, 2024 14:19
@asein-sinch asein-sinch merged commit c77ac00 into main Mar 22, 2024
2 checks passed
@asein-sinch asein-sinch deleted the DEVEXP-321_Derivate-methods-according-to-recipient-categories branch March 22, 2024 10:26
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