3e9877574c
- Introduced a flat structure for the customer domain, consolidating entities, aggregates, repositories, services, forms, and handlers into a single package. - Added core entities: Customer and CustomerAggregate. - Implemented request/response forms for customer authentication (Register, Login, Refresh Token, Change Password). - Created CustomerService to handle business logic and data access through the Repository interface. - Established CustomerHandler for HTTP request handling related to customer authentication. - Removed previous domain structure artifacts to streamline the codebase.
25 lines
821 B
Go
25 lines
821 B
Go
package customer
|
|
|
|
// Customer Authentication DTOs
|
|
type RegisterForm struct {
|
|
FirstName string `json:"first_name" valid:"required,alpha,length(2|50)"`
|
|
LastName string `json:"last_name" valid:"required,alpha,length(2|50)"`
|
|
Email string `json:"email" valid:"required,email"`
|
|
Mobile string `json:"mobile,omitempty" valid:"optional,length(10|15)"`
|
|
Password string `json:"password" valid:"required,length(8|128)"`
|
|
}
|
|
|
|
type LoginForm struct {
|
|
Email string `json:"email" valid:"required,email"`
|
|
Password string `json:"password" valid:"required"`
|
|
}
|
|
|
|
type RefreshTokenForm struct {
|
|
RefreshToken string `json:"refresh_token" valid:"required"`
|
|
}
|
|
|
|
type ChangePasswordForm struct {
|
|
OldPassword string `json:"old_password" valid:"required"`
|
|
NewPassword string `json:"new_password" valid:"required,length(8|128)"`
|
|
}
|