2020-12-29 13:46:58 +01:00
|
|
|
package db
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/google/uuid"
|
2021-01-02 11:56:24 +01:00
|
|
|
"github.com/jackc/pgx/v4/pgxpool"
|
2020-12-29 13:46:58 +01:00
|
|
|
)
|
|
|
|
|
2021-01-02 12:09:16 +01:00
|
|
|
// CreatedAccount is a newly created account in the system
|
|
|
|
type CreatedAccount struct {
|
2021-01-02 11:56:24 +01:00
|
|
|
ID uuid.UUID `json:"id"`
|
|
|
|
AccountName string `json:"accountName"`
|
|
|
|
APIKey string `json:"apiKey"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// AccountCreateInputFields yes
|
|
|
|
type AccountCreateInputFields struct {
|
|
|
|
Name string
|
|
|
|
Values []string
|
|
|
|
}
|
|
|
|
|
|
|
|
// AccountCreateInput is used as input struct for database creation of account
|
|
|
|
type AccountCreateInput struct {
|
|
|
|
ID uuid.UUID
|
|
|
|
AccountName string
|
|
|
|
APIKey string
|
|
|
|
Fields []AccountCreateInputFields
|
|
|
|
Password string
|
|
|
|
}
|
|
|
|
|
|
|
|
// Db struct
|
|
|
|
type Db struct {
|
|
|
|
DbPool *pgxpool.Pool
|
2020-12-29 13:46:58 +01:00
|
|
|
}
|