Add Device Token Support for Customer and User Entities

- Introduced a new DeviceToken field in both Customer and User entities to store device tokens for authentication and notifications.
- Updated LoginForm structures for both Customer and User to include an optional DeviceToken field, allowing clients to send device tokens during login.
- Enhanced the Login methods in the customer and user services to append the device token to the respective entities if it does not already exist, improving user session management and notification capabilities.
- Ensured proper validation and structured responses for the new DeviceToken field in the forms, maintaining compliance with best practices for API design.
This commit is contained in:
n.nakhostin
2025-09-20 10:11:36 +03:30
parent 00ad7e136d
commit dfcdef60d6
9 changed files with 48 additions and 7 deletions
+3 -2
View File
@@ -33,8 +33,9 @@ type UpdateUserForm struct {
// LoginForm represents the credentials required for user authentication
type LoginForm struct {
Username string `json:"username" valid:"required" example:"admin"` // Username or email address
Password string `json:"password" valid:"required" example:"Admin!1234"` // User password
Username string `json:"username" valid:"required" example:"admin"` // Username or email address
Password string `json:"password" valid:"required" example:"Admin!1234"` // User password
DeviceToken string `json:"device_token" valid:"optional" example:"device_token"` // Device token
}
// RefreshTokenForm represents the refresh token required to generate new access tokens