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

BUX-538: Create Paymail add description #190

Merged
merged 9 commits into from
Feb 21, 2024
2 changes: 2 additions & 0 deletions paymail_addresses.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
)

// NewPaymail will create a new paymail
//
// paymailAddress: The paymail address to create (e.g., [email protected])
func (b *BuxClient) NewPaymail(ctx context.Context, rawXPub, paymailAddress, avatar, publicName string, metadata *buxmodels.Metadata) transports.ResponseError {
return b.transport.NewPaymail(ctx, rawXPub, paymailAddress, avatar, publicName, metadata)
}
3 changes: 3 additions & 0 deletions transports/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ type AdminService interface {
AdminGetPaymail(ctx context.Context, address string) (*buxmodels.PaymailAddress, ResponseError)
AdminGetPaymails(ctx context.Context, conditions map[string]interface{}, metadata *buxmodels.Metadata, queryParams *QueryParams) ([]*buxmodels.PaymailAddress, ResponseError)
AdminGetPaymailsCount(ctx context.Context, conditions map[string]interface{}, metadata *buxmodels.Metadata) (int64, ResponseError)
// AdminCreatePaymail Create a paymail.
//
// Paymail address (ie. [email protected])
Comment on lines +73 to +75
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure why the comment is necessary for the AdminCreatePaymail when, at the same time, other methods (also public) are without a comment.

Besides that, the multiline comment looks to me like a separator between two groups of methods.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment should show an example of paymail address. Removed new line

Copy link
Contributor

Choose a reason for hiding this comment

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

But, as I see in the whole AdminService package documentation - not only the AdminCreatePaymail gets an address as string which should be a paymail.

So maybe an example how paymailAddress looks like would be in the AdminService description, like that:

// AdminService is the admin related requests
//
// Note: A Paymail address is a unique identifier for receiving payments in the
// form of a readable email-like address (e.g., [email protected]). 

https://pkg.go.dev/github.com/BuxOrg/[email protected]/transports#AdminService

image

Copy link
Contributor Author

@Nazarii-4chain Nazarii-4chain Feb 8, 2024

Choose a reason for hiding this comment

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

I've added this to show an example for users how paymail should look like.
Screenshot 2024-02-08 at 2 45 43 PM

Copy link
Contributor

Choose a reason for hiding this comment

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

Because of the task is about just adding a comment/desc to AdminCreatePaymail - agreed, it's ok πŸ‘

But I'm seeing some inconsistency, why some methods are commented and other not. But maybe it will be resolved by next tasks in the future.

AdminCreatePaymail(ctx context.Context, xPubID string, address string, publicName string, avatar string) (*buxmodels.PaymailAddress, ResponseError)
AdminDeletePaymail(ctx context.Context, address string) (*buxmodels.PaymailAddress, ResponseError)
AdminGetTransactions(ctx context.Context, conditions map[string]interface{}, metadata *buxmodels.Metadata, queryParams *QueryParams) ([]*buxmodels.Transaction, ResponseError)
Expand Down
Loading