Documentation ¶
Index ¶
- Constants
- Variables
- func ErrorCode(err error) string
- type AdministrativeStatus
- type ClientProfile
- type ClientSession
- type CreateClientProfileParams
- type CreateSessionParams
- type DBTX
- type GetClientPasswordByIdRow
- type KycStatus
- type NullAdministrativeStatus
- type NullKycStatus
- type Querier
- type Queries
- func (q *Queries) CreateClientProfile(ctx context.Context, arg CreateClientProfileParams) (uuid.UUID, error)
- func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) (ClientSession, error)
- func (q *Queries) DeleteClientProfile(ctx context.Context, id uuid.UUID) error
- func (q *Queries) GetClientPasswordById(ctx context.Context, id uuid.UUID) (GetClientPasswordByIdRow, error)
- func (q *Queries) GetClientProfile(ctx context.Context, id uuid.UUID) (ClientProfile, error)
- func (q *Queries) GetClientProfileByEmail(ctx context.Context, email string) (ClientProfile, error)
- func (q *Queries) GetSession(ctx context.Context, id uuid.UUID) (ClientSession, error)
- func (q *Queries) UpdateClientPassword(ctx context.Context, arg UpdateClientPasswordParams) error
- func (q *Queries) UpdateClientProfile(ctx context.Context, arg UpdateClientProfileParams) error
- func (q *Queries) UpdateClientStatus(ctx context.Context, arg UpdateClientStatusParams) error
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type SQLStore
- type Store
- type UpdateClientPasswordParams
- type UpdateClientProfileParams
- type UpdateClientStatusParams
Constants ¶
View Source
const (
UniqueViolation = "23505"
)
Variables ¶
View Source
var ErrRecordNotFound = pgx.ErrNoRows
View Source
var ErrUniqueViolation = &pgconn.PgError{ Code: UniqueViolation, }
Functions ¶
Types ¶
type AdministrativeStatus ¶
type AdministrativeStatus string
const ( AdministrativeStatusAdmActive AdministrativeStatus = "adm:active" AdministrativeStatusAdmBlocked AdministrativeStatus = "adm:blocked" AdministrativeStatusAdmSuspended AdministrativeStatus = "adm:suspended" AdministrativeStatusAdmProcessed AdministrativeStatus = "adm:processed" )
func (*AdministrativeStatus) Scan ¶
func (e *AdministrativeStatus) Scan(src interface{}) error
type ClientProfile ¶
type ClientProfile struct { ID uuid.UUID `json:"id"` // Client status set by the system admin Adm AdministrativeStatus `json:"adm"` // Client status from security service (Know Your Client) Kyc KycStatus `json:"kyc"` Name string `json:"name"` Surname string `json:"surname"` Updated time.Time `json:"updated"` Created time.Time `json:"created"` Password string `json:"password"` Email string `json:"email"` PasswordUpdated time.Time `json:"password_updated"` }
Account holders profile
type ClientSession ¶
type CreateSessionParams ¶
type KycStatus ¶
type KycStatus string
const ( KycStatusKycUnconfirmed KycStatus = "kyc:unconfirmed" KycStatusKycConfirmed KycStatus = "kyc:confirmed" KycStatusKycPending KycStatus = "kyc:pending" KycStatusKycRejected KycStatus = "kyc:rejected" KycStatusKycResubmission KycStatus = "kyc:resubmission" KycStatusKycInitiated KycStatus = "kyc:initiated" )
type NullAdministrativeStatus ¶
type NullAdministrativeStatus struct { AdministrativeStatus AdministrativeStatus `json:"administrative_status"` Valid bool `json:"valid"` // Valid is true if AdministrativeStatus is not NULL }
func (*NullAdministrativeStatus) Scan ¶
func (ns *NullAdministrativeStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullKycStatus ¶
type NullKycStatus struct { KycStatus KycStatus `json:"kyc_status"` Valid bool `json:"valid"` // Valid is true if KycStatus is not NULL }
func (*NullKycStatus) Scan ¶
func (ns *NullKycStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type Querier ¶
type Querier interface { CreateClientProfile(ctx context.Context, arg CreateClientProfileParams) (uuid.UUID, error) CreateSession(ctx context.Context, arg CreateSessionParams) (ClientSession, error) DeleteClientProfile(ctx context.Context, id uuid.UUID) error GetClientPasswordById(ctx context.Context, id uuid.UUID) (GetClientPasswordByIdRow, error) GetClientProfile(ctx context.Context, id uuid.UUID) (ClientProfile, error) GetClientProfileByEmail(ctx context.Context, email string) (ClientProfile, error) GetSession(ctx context.Context, id uuid.UUID) (ClientSession, error) UpdateClientPassword(ctx context.Context, arg UpdateClientPasswordParams) error UpdateClientProfile(ctx context.Context, arg UpdateClientProfileParams) error UpdateClientStatus(ctx context.Context, arg UpdateClientStatusParams) error }
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CreateClientProfile ¶
func (*Queries) CreateSession ¶
func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) (ClientSession, error)
func (*Queries) DeleteClientProfile ¶
func (*Queries) GetClientPasswordById ¶
func (*Queries) GetClientProfile ¶
func (*Queries) GetClientProfileByEmail ¶
func (*Queries) GetSession ¶
func (*Queries) UpdateClientPassword ¶
func (q *Queries) UpdateClientPassword(ctx context.Context, arg UpdateClientPasswordParams) error
func (*Queries) UpdateClientProfile ¶
func (q *Queries) UpdateClientProfile(ctx context.Context, arg UpdateClientProfileParams) error
func (*Queries) UpdateClientStatus ¶
func (q *Queries) UpdateClientStatus(ctx context.Context, arg UpdateClientStatusParams) error
type Store ¶
type Store interface { Querier }
Store defines all functions to execute db queries and transactions
type UpdateClientStatusParams ¶
type UpdateClientStatusParams struct { ID uuid.UUID `json:"id"` Adm NullAdministrativeStatus `json:"adm"` Kyc NullKycStatus `json:"kyc"` }
Click to show internal directories.
Click to hide internal directories.