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

Add CheckUserPassword Method to UserCommandPort #74

Closed
Feyzanrs opened this issue May 19, 2024 · 0 comments
Closed

Add CheckUserPassword Method to UserCommandPort #74

Feyzanrs opened this issue May 19, 2024 · 0 comments
Assignees
Labels
Be enhancement New feature or request feature Proposal or implementation of new features

Comments

@Feyzanrs
Copy link
Member

Feyzanrs commented May 19, 2024

This update introduces a new method CheckUserPassword to the UserCommandPort interface. This method is intended to facilitate checking the user's password in the service layer.

Path of the file to be changed

internal/application/presentation/port/command/user.go

Updated Code

package application

import (
    "context"

    me "github.com/octoposprime/op-be-user/internal/domain/model/entity"
)

// CommandPort is a port for Hexagonal Architecture Pattern.
// It is used to communicate with the application layer.
type UserCommandPort interface {
    // CreateUser sends the given user to the application layer for creating a new user.
    CreateUser(ctx context.Context, user me.User) (me.User, error)

    // UpdateUserBase sends the given base values of the user to the repository of the infrastructure layer for updating base values of user data.
    UpdateUserBase(ctx context.Context, user me.User) (me.User, error)

    // UpdateUserStatus sends the given status value of the user to the repository of the infrastructure layer for updating status of user data.
    UpdateUserStatus(ctx context.Context, user me.User) (me.User, error)

    // UpdateUserRole sends the given type value of the user to the repository of the infrastructure layer for updating role of user data.
    UpdateUserRole(ctx context.Context, user me.User) (me.User, error)

    // DeleteUser sends the given user to the application layer for deleting data.
    DeleteUser(ctx context.Context, user me.User) (me.User, error)

    // ChangePassword sends the given user password to the application layer for changing user password.
    ChangePassword(ctx context.Context, userPassword me.UserPassword) error

    // CheckUserPassword sends the given user to the user service and returns the result of the password check.
    CheckUserPassword(ctx context.Context, user me.User, userPassword me.UserPassword) (me.User, error) //new method
}

The "//new method" comment line has been added to make it easier for you to see the changes. Please remember to remove that part while you are working on your issue.

The changes will be merged into the enhance/team/66/implement-password-validation branch first. Therefore, set the base branch of the pull request as enhance/team/66/implement-password-validation.

@Feyzanrs Feyzanrs added enhancement New feature or request feature Proposal or implementation of new features labels May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Be enhancement New feature or request feature Proposal or implementation of new features
Projects
None yet
Development

No branches or pull requests

4 participants