20 lines
551 B
Go
20 lines
551 B
Go
package domain
|
|
|
|
import "time"
|
|
|
|
// Credential é a credencial PontoMais de um usuário. A senha fica cifrada.
|
|
type Credential struct {
|
|
UserID int64
|
|
APIEmail string
|
|
EncryptedPassword []byte
|
|
KeyVersion int16
|
|
LastValidatedAt *time.Time
|
|
LastError *string
|
|
ConsecutiveFailures int
|
|
LastFailureAt *time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
// IsValidated indica que a credencial já autenticou com sucesso na PontoMais.
|
|
func (c Credential) IsValidated() bool { return c.LastValidatedAt != nil }
|