Documentation ¶
Index ¶
- Constants
- Variables
- func IsValidTokenPlaintext(tokenPlaintext string) (bool, error)
- func PasswordMatches(pwd Password) (bool, error)
- func ReadUUIDParam(c echo.Context) (uuid.UUID, error)
- type Admin
- type CreateAdminParams
- type CreateAdminRow
- type CreateHouseParams
- type CreatePaymentParams
- type CreateTenantParams
- type CreateTokenParams
- type DBTX
- type DeleteAllTokenParams
- type GetDetailedPaymentByIdRow
- type GetHashTokenForAdminParams
- type GetHashTokenForAdminRow
- type GetHouseByIdWithTenantRow
- type GetHousesRow
- type GetTenantByIdWithHouseRow
- type GetTenantsRow
- type House
- type HouseBulk
- type Password
- type Payment
- type Querier
- type Queries
- func (q *Queries) CreateAdmin(ctx context.Context, arg CreateAdminParams) (CreateAdminRow, error)
- func (q *Queries) CreateHouse(ctx context.Context, arg CreateHouseParams) (uuid.UUID, error)
- func (q *Queries) CreatePayment(ctx context.Context, arg CreatePaymentParams) error
- func (q *Queries) CreateTenant(ctx context.Context, arg CreateTenantParams) error
- func (q *Queries) CreateToken(ctx context.Context, arg CreateTokenParams) error
- func (q *Queries) DeleteAllToken(ctx context.Context, arg DeleteAllTokenParams) error
- func (q *Queries) DeletePayment(ctx context.Context, id uuid.UUID) error
- func (q *Queries) GetAdminByPhone(ctx context.Context, phone string) (Admin, error)
- func (q *Queries) GetAllPayments(ctx context.Context) ([]Payment, error)
- func (q *Queries) GetDetailedPaymentById(ctx context.Context, id uuid.UUID) (GetDetailedPaymentByIdRow, error)
- func (q *Queries) GetHashTokenForAdmin(ctx context.Context, arg GetHashTokenForAdminParams) (GetHashTokenForAdminRow, error)
- func (q *Queries) GetHouseById(ctx context.Context, id uuid.UUID) (House, error)
- func (q *Queries) GetHouseByIdWithTenant(ctx context.Context, id uuid.UUID) (GetHouseByIdWithTenantRow, error)
- func (q *Queries) GetHouses(ctx context.Context) ([]GetHousesRow, error)
- func (q *Queries) GetPaymentById(ctx context.Context, id uuid.UUID) (Payment, error)
- func (q *Queries) GetTenantById(ctx context.Context, id uuid.UUID) (Tenant, error)
- func (q *Queries) GetTenantByIdWithHouse(ctx context.Context, id uuid.UUID) (GetTenantByIdWithHouseRow, error)
- func (q *Queries) GetTenants(ctx context.Context) ([]GetTenantsRow, error)
- func (q *Queries) UpdateAdmin(ctx context.Context, arg UpdateAdminParams) (uuid.UUID, error)
- func (q *Queries) UpdateHouseById(ctx context.Context, arg UpdateHouseByIdParams) error
- func (q *Queries) UpdatePayment(ctx context.Context, arg UpdatePaymentParams) error
- func (q *Queries) UpdateTenant(ctx context.Context, arg UpdateTenantParams) error
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type SQLStore
- func (s *SQLStore) BulkInsert(ctx context.Context, houses []HouseBulk) error
- func (s *SQLStore) NewToken(id uuid.UUID, ttl time.Duration, scope string) (*TokenLoc, error)
- func (store *SQLStore) TxnCreateTenant(ctx context.Context, args CreateTenantParams) error
- func (store *SQLStore) TxnRemoveTenantHouse(ctx context.Context, args UpdateTenantParams) error
- func (store *SQLStore) TxnUpdateTenantHouse(ctx context.Context, args UpdateTenantParams, prev_house_id uuid.UUID) error
- type Store
- type Tenant
- type Token
- type TokenLoc
- type UpdateAdminParams
- type UpdateHouseByIdParams
- type UpdatePaymentParams
- type UpdateTenantParams
Constants ¶
View Source
const ( ScopeActivation = "activation" ScopeAuthentication = "authentication" ScopePasswordReset = "password-reset" )
Variables ¶
View Source
var (
DuplicatePhone = `pq: duplicate key value violates unique constraint "admin_phone_key"`
)
Functions ¶
func IsValidTokenPlaintext ¶
func PasswordMatches ¶
func ReadUUIDParam ¶
Types ¶
type CreateAdminParams ¶
type CreateAdminRow ¶
type CreateHouseParams ¶
type CreatePaymentParams ¶
type CreateTenantParams ¶
type CreateTenantParams struct { FirstName string `json:"first_name"` LastName string `json:"last_name"` HouseID uuid.UUID `json:"house_id"` Phone string `json:"phone"` PersonalIDType string `json:"personal_id_type"` PersonalID string `json:"personal_id"` Active bool `json:"active"` Sos time.Time `json:"sos"` }
type CreateTokenParams ¶
type DeleteAllTokenParams ¶
type GetDetailedPaymentByIdRow ¶
type GetDetailedPaymentByIdRow struct { ID uuid.UUID `json:"id"` TenantName interface{} `json:"tenant_name"` TenantID uuid.UUID `json:"tenant_id"` Amount int32 `json:"amount"` StartDate time.Time `json:"start_date"` EndDate time.Time `json:"end_date"` AdminPhone string `json:"admin_phone"` Location string `json:"location"` Block string `json:"block"` Partition int16 `json:"partition"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Version uuid.UUID `json:"version"` }
type GetHashTokenForAdminRow ¶
type GetHousesRow ¶
type GetTenantByIdWithHouseRow ¶
type GetTenantByIdWithHouseRow struct { ID uuid.UUID `json:"id"` FirstName string `json:"first_name"` LastName string `json:"last_name"` HouseID uuid.UUID `json:"house_id"` Location string `json:"location"` Block string `json:"block"` Partition int16 `json:"partition"` Phone string `json:"phone"` PersonalIDType string `json:"personal_id_type"` PersonalID string `json:"personal_id"` Active bool `json:"active"` Sos time.Time `json:"sos"` Version uuid.UUID `json:"version"` }
type GetTenantsRow ¶
type GetTenantsRow struct { ID uuid.UUID `json:"id"` FirstName string `json:"first_name"` LastName string `json:"last_name"` HouseID uuid.UUID `json:"house_id"` Phone string `json:"phone"` PersonalIDType string `json:"personal_id_type"` PersonalID string `json:"personal_id"` Active bool `json:"active"` Sos time.Time `json:"sos"` }
type Password ¶
func SetPassword ¶
type Payment ¶
type Payment struct { ID uuid.UUID `json:"id"` TenantID uuid.UUID `json:"tenant_id"` Amount int32 `json:"amount"` StartDate time.Time `json:"start_date"` EndDate time.Time `json:"end_date"` Version uuid.UUID `json:"version"` CreatedAt time.Time `json:"created_at"` CreatedBy uuid.UUID `json:"created_by"` UpdatedAt time.Time `json:"updated_at"` }
type Querier ¶
type Querier interface { CreateAdmin(ctx context.Context, arg CreateAdminParams) (CreateAdminRow, error) CreateHouse(ctx context.Context, arg CreateHouseParams) (uuid.UUID, error) CreatePayment(ctx context.Context, arg CreatePaymentParams) error CreateTenant(ctx context.Context, arg CreateTenantParams) error CreateToken(ctx context.Context, arg CreateTokenParams) error DeleteAllToken(ctx context.Context, arg DeleteAllTokenParams) error DeletePayment(ctx context.Context, id uuid.UUID) error GetAdminByPhone(ctx context.Context, phone string) (Admin, error) GetAllPayments(ctx context.Context) ([]Payment, error) GetDetailedPaymentById(ctx context.Context, id uuid.UUID) (GetDetailedPaymentByIdRow, error) GetHashTokenForAdmin(ctx context.Context, arg GetHashTokenForAdminParams) (GetHashTokenForAdminRow, error) GetHouseById(ctx context.Context, id uuid.UUID) (House, error) GetHouseByIdWithTenant(ctx context.Context, id uuid.UUID) (GetHouseByIdWithTenantRow, error) GetHouses(ctx context.Context) ([]GetHousesRow, error) GetPaymentById(ctx context.Context, id uuid.UUID) (Payment, error) GetTenantById(ctx context.Context, id uuid.UUID) (Tenant, error) GetTenantByIdWithHouse(ctx context.Context, id uuid.UUID) (GetTenantByIdWithHouseRow, error) GetTenants(ctx context.Context) ([]GetTenantsRow, error) UpdateAdmin(ctx context.Context, arg UpdateAdminParams) (uuid.UUID, error) UpdateHouseById(ctx context.Context, arg UpdateHouseByIdParams) error UpdatePayment(ctx context.Context, arg UpdatePaymentParams) error UpdateTenant(ctx context.Context, arg UpdateTenantParams) error }
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CreateAdmin ¶
func (q *Queries) CreateAdmin(ctx context.Context, arg CreateAdminParams) (CreateAdminRow, error)
func (*Queries) CreateHouse ¶
func (*Queries) CreatePayment ¶
func (q *Queries) CreatePayment(ctx context.Context, arg CreatePaymentParams) error
func (*Queries) CreateTenant ¶
func (q *Queries) CreateTenant(ctx context.Context, arg CreateTenantParams) error
func (*Queries) CreateToken ¶
func (q *Queries) CreateToken(ctx context.Context, arg CreateTokenParams) error
func (*Queries) DeleteAllToken ¶
func (q *Queries) DeleteAllToken(ctx context.Context, arg DeleteAllTokenParams) error
func (*Queries) DeletePayment ¶
func (*Queries) GetAdminByPhone ¶
func (*Queries) GetAllPayments ¶
func (*Queries) GetDetailedPaymentById ¶
func (*Queries) GetHashTokenForAdmin ¶
func (q *Queries) GetHashTokenForAdmin(ctx context.Context, arg GetHashTokenForAdminParams) (GetHashTokenForAdminRow, error)
func (*Queries) GetHouseById ¶
func (*Queries) GetHouseByIdWithTenant ¶
func (*Queries) GetHouses ¶
func (q *Queries) GetHouses(ctx context.Context) ([]GetHousesRow, error)
func (*Queries) GetPaymentById ¶
func (*Queries) GetTenantById ¶
func (*Queries) GetTenantByIdWithHouse ¶
func (*Queries) GetTenants ¶
func (q *Queries) GetTenants(ctx context.Context) ([]GetTenantsRow, error)
func (*Queries) UpdateAdmin ¶
func (*Queries) UpdateHouseById ¶
func (q *Queries) UpdateHouseById(ctx context.Context, arg UpdateHouseByIdParams) error
func (*Queries) UpdatePayment ¶
func (q *Queries) UpdatePayment(ctx context.Context, arg UpdatePaymentParams) error
func (*Queries) UpdateTenant ¶
func (q *Queries) UpdateTenant(ctx context.Context, arg UpdateTenantParams) error
type SQLStore ¶
type SQLStore struct { *Queries // contains filtered or unexported fields }
func (*SQLStore) BulkInsert ¶
func (*SQLStore) TxnCreateTenant ¶
func (store *SQLStore) TxnCreateTenant(ctx context.Context, args CreateTenantParams) error
func (*SQLStore) TxnRemoveTenantHouse ¶
func (store *SQLStore) TxnRemoveTenantHouse(ctx context.Context, args UpdateTenantParams) error
func (*SQLStore) TxnUpdateTenantHouse ¶
type Store ¶
type Store interface { Querier NewToken(id uuid.UUID, ttl time.Duration, scope string) (*TokenLoc, error) BulkInsert(ctx context.Context, houses []HouseBulk) error TxnCreateTenant(ctx context.Context, args CreateTenantParams) error TxnUpdateTenantHouse(ctx context.Context, args UpdateTenantParams, prev_house_id uuid.UUID) error TxnRemoveTenantHouse(ctx context.Context, args UpdateTenantParams) error }
type Tenant ¶
type Tenant struct { ID uuid.UUID `json:"id"` FirstName string `json:"first_name"` LastName string `json:"last_name"` Phone string `json:"phone"` HouseID uuid.UUID `json:"house_id"` PersonalIDType string `json:"personal_id_type"` PersonalID string `json:"personal_id"` Photo string `json:"photo"` Active bool `json:"active"` Sos time.Time `json:"sos"` Eos sql.NullTime `json:"eos"` Version uuid.UUID `json:"version"` }
type UpdateAdminParams ¶
type UpdateHouseByIdParams ¶
type UpdatePaymentParams ¶
type UpdateTenantParams ¶
type UpdateTenantParams struct { FirstName string `json:"first_name"` LastName string `json:"last_name"` HouseID uuid.UUID `json:"house_id"` Phone string `json:"phone"` PersonalIDType string `json:"personal_id_type"` PersonalID string `json:"personal_id"` Active bool `json:"active"` Sos time.Time `json:"sos"` Eos sql.NullTime `json:"eos"` ID uuid.UUID `json:"id"` Version uuid.UUID `json:"version"` }
Click to show internal directories.
Click to hide internal directories.