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:
@@ -0,0 +1,22 @@
|
||||
package customer
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
// Customer represents a mobile app user (customer)
|
||||
type Customer struct {
|
||||
ID uuid.UUID `bson:"_id"`
|
||||
Email string `bson:"email"`
|
||||
Password string `bson:"password"` // Never serialize password
|
||||
FirstName string `bson:"first_name"`
|
||||
LastName string `bson:"last_name"`
|
||||
Mobile string `bson:"mobile"`
|
||||
CompanyID uuid.UUID `bson:"company_id"`
|
||||
IsActive bool `bson:"is_active"`
|
||||
IsVerified bool `bson:"is_verified"`
|
||||
DeviceTokens []string `bson:"device_tokens"` // For push notifications
|
||||
LastLoginAt *int64 `bson:"last_login_at,omitempty"` // Unix timestamp
|
||||
CreatedAt int64 `bson:"created_at"` // Unix timestamp
|
||||
UpdatedAt int64 `bson:"updated_at"` // Unix timestamp
|
||||
}
|
||||
Reference in New Issue
Block a user