Files
tm_back/internal/customer/entity.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

23 lines
846 B
Go

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
}