Add configuration file and update server settings
- Introduced a new `config.yaml` file for managing server, database, cache, queue, AI, scraping, logging, and rate limiting configurations. - Updated `docker-compose.yml` to reflect the new server port (8081) and adjusted health check endpoints accordingly. - Modified `Dockerfile` to expose the new server port. - Updated `README.md` to reflect changes in server configuration and added documentation for the new configuration structure. - Added test scripts for server and Swagger documentation testing. - Refactored customer domain structure to align with new configuration settings and improve maintainability.
This commit is contained in:
+50
-13
@@ -4,19 +4,56 @@ import (
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
// Gender represents user gender
|
||||
type Gender string
|
||||
|
||||
const (
|
||||
GenderMale Gender = "male"
|
||||
GenderFemale Gender = "female"
|
||||
GenderOther Gender = "other"
|
||||
)
|
||||
|
||||
// CustomerStatus represents customer account status
|
||||
type CustomerStatus string
|
||||
|
||||
const (
|
||||
CustomerStatusActive CustomerStatus = "active"
|
||||
CustomerStatusInactive CustomerStatus = "inactive"
|
||||
)
|
||||
|
||||
// DeviceType represents the type of device
|
||||
type DeviceType string
|
||||
|
||||
const (
|
||||
DeviceTypeAndroid DeviceType = "android"
|
||||
DeviceTypeIOS DeviceType = "ios"
|
||||
)
|
||||
|
||||
// DeviceToken represents a device token for push notifications
|
||||
type DeviceToken struct {
|
||||
Token string `bson:"token"`
|
||||
DeviceType DeviceType `bson:"device_type"`
|
||||
CreatedAt int64 `bson:"created_at"` // Unix timestamp
|
||||
UpdatedAt int64 `bson:"updated_at"` // Unix timestamp
|
||||
}
|
||||
|
||||
// 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
|
||||
ID uuid.UUID `bson:"_id"`
|
||||
FullName string `bson:"full_name"`
|
||||
Username string `bson:"username"`
|
||||
Email string `bson:"email"`
|
||||
Mobile string `bson:"mobile"`
|
||||
Password string `bson:"password"` // Never serialize password
|
||||
NationalID *string `bson:"national_id,omitempty"`
|
||||
Gender *Gender `bson:"gender,omitempty"`
|
||||
Birthdate *int64 `bson:"birthdate,omitempty"` // Unix timestamp
|
||||
ProfileImage *string `bson:"profile_image,omitempty"`
|
||||
Status CustomerStatus `bson:"status"`
|
||||
CompanyID *uuid.UUID `bson:"company_id,omitempty"`
|
||||
IsVerified bool `bson:"is_verified"`
|
||||
DeviceTokens []DeviceToken `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