Refactor customer domain by removing obsolete files and updating main application structure

- Deleted customer domain files including entities, services, handlers, and forms to streamline the codebase.
- Removed customer-related routes and service initializations from the main application.
- Updated Swagger documentation to reflect the removal of customer endpoints and definitions.
- Cleaned up the project structure to enhance maintainability and focus on user management functionality.
This commit is contained in:
n.nakhostin
2025-08-10 19:05:46 +03:30
parent c89041812a
commit dbcc2d1d4a
13 changed files with 60 additions and 5283 deletions
-32
View File
@@ -1,32 +0,0 @@
package customer
import (
"time"
"github.com/asaskevich/govalidator"
)
// init registers custom validators
func init() {
// Register custom validators
govalidator.CustomTypeTagMap.Set("unix_timestamp", govalidator.CustomTypeValidator(func(i interface{}, context interface{}) bool {
switch v := i.(type) {
case int64:
// Check if timestamp is reasonable (not too old, not in the future)
now := time.Now().Unix()
minTimestamp := now - (100 * 365 * 24 * 60 * 60) // 100 years ago
maxTimestamp := now + (10 * 365 * 24 * 60 * 60) // 10 years in future
return v >= minTimestamp && v <= maxTimestamp
case *int64:
if v == nil {
return true // nil is valid for optional fields
}
now := time.Now().Unix()
minTimestamp := now - (100 * 365 * 24 * 60 * 60) // 100 years ago
maxTimestamp := now + (10 * 365 * 24 * 60 * 60) // 10 years in future
return *v >= minTimestamp && *v <= maxTimestamp
default:
return false
}
}))
}