40 lines
1.4 KiB
Go
40 lines
1.4 KiB
Go
package dto
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/oklog/ulid/v2"
|
|
)
|
|
|
|
type UserDto struct {
|
|
ID ulid.ULID `json:"id"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
LastEditorID ulid.ULID `json:"lastEditorID"`
|
|
Username string `json:"username"`
|
|
Password string `json:"password"` // Note: In a real application, you would NEVER send the password in a DTO. This is just for demonstration.
|
|
Role string `json:"role"`
|
|
CompanyID int `json:"companyId"`
|
|
HourlyRate float64 `json:"hourlyRate"`
|
|
}
|
|
|
|
type UserCreateDto struct {
|
|
Username string `json:"username"`
|
|
Password string `json:"password"` // Note: In a real application, you would NEVER send the password in a DTO. This is just for demonstration.
|
|
Role string `json:"role"`
|
|
CompanyID int `json:"companyId"`
|
|
HourlyRate float64 `json:"hourlyRate"`
|
|
}
|
|
|
|
type UserUpdateDto struct {
|
|
ID ulid.ULID `json:"id"`
|
|
CreatedAt *time.Time `json:"createdAt"`
|
|
UpdatedAt *time.Time `json:"updatedAt"`
|
|
LastEditorID *ulid.ULID `json:"lastEditorID"`
|
|
Username *string `json:"username"`
|
|
Password *string `json:"password"` // Note: In a real application, you would NEVER send the password in a DTO. This is just for demonstration.
|
|
Role *string `json:"role"`
|
|
CompanyID *int `json:"companyId"`
|
|
HourlyRate *float64 `json:"hourlyRate"`
|
|
}
|