Files
tm_back/internal/customer/form.go
T
n.nakhostin 3e9877574c 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.
2025-08-02 11:26:35 +03:30

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)"`
}