Refactor customer domain structure and implement core entities, services, and handlers

- 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.
This commit is contained in:
n.nakhostin
2025-08-02 11:26:35 +03:30
parent ddf29efb4a
commit 3e9877574c
14 changed files with 337 additions and 1327 deletions
+24
View File
@@ -0,0 +1,24 @@
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)"`
}