transaction

package
v0.0.0-...-2d1ab9f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateRequest

type CreateRequest struct {
	TenantID        string          `json:"-"`
	Amount          decimal.Decimal `json:"amount,omitempty"`
	Currency        string          `json:"currency,omitempty"`
	Date            time.Time       `json:"date,omitempty"`
	Description     *string         `json:"description,omitempty"`
	ReferenceID     string          `json:"referenceId,omitempty"`
	SourceAccountID string          `json:"sourceAccountId,omitempty"`
	TargetAccountID string          `json:"targetAccountId,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateRequest) HasDescription

func (lr *CreateRequest) HasDescription() bool

func (*CreateRequest) UnmarshalJSON

func (lr *CreateRequest) UnmarshalJSON(data []byte) error

type CreateResponse

type CreateResponse Transaction

type DeleteAllRequest

type DeleteAllRequest struct {
	TenantID string `json:"-"`
}

func (*DeleteAllRequest) UnmarshalFromRequest

func (lr *DeleteAllRequest) UnmarshalFromRequest(r *http.Request) error

type DeleteAllResponse

type DeleteAllResponse struct{}

type DeleteRequest

type DeleteRequest struct {
	TenantID string `json:"-"`
	ID       string `json:"id"`
}

func (*DeleteRequest) UnmarshalFromRequest

func (lr *DeleteRequest) UnmarshalFromRequest(r *http.Request) error

type DeleteResponse

type DeleteResponse struct{}

type GetRequest

type GetRequest struct {
	TenantID string  `json:"-"`
	ID       string  `json:"id"`
	Currency *string `url:"currency,omitempty"`
}

func (*GetRequest) UnmarshalFromRequest

func (lr *GetRequest) UnmarshalFromRequest(r *http.Request) error

type GetResponse

type GetResponse Transaction

type HandlerImpl

type HandlerImpl struct {
	AccountsHandler account.Handler
}

func (*HandlerImpl) Create

func (h *HandlerImpl) Create(ctx context.Context, req CreateRequest) (*CreateResponse, error)

func (*HandlerImpl) Delete

func (h *HandlerImpl) Delete(ctx context.Context, req DeleteRequest) error

func (*HandlerImpl) DeleteAll

func (h *HandlerImpl) DeleteAll(ctx context.Context, req DeleteAllRequest) error

func (*HandlerImpl) Get

func (h *HandlerImpl) Get(ctx context.Context, req GetRequest) (*GetResponse, error)

func (*HandlerImpl) List

func (h *HandlerImpl) List(ctx context.Context, req ListRequest) (*ListResponse, error)

func (*HandlerImpl) Patch

func (h *HandlerImpl) Patch(ctx context.Context, req PatchRequest) (*PatchResponse, error)

func (*HandlerImpl) Update

func (h *HandlerImpl) Update(ctx context.Context, req UpdateRequest) (*UpdateResponse, error)

type ListRequest

type ListRequest struct {
	TenantID        string
	Offset          *uint            `url:"_offset,omitempty"`
	Count           *uint            `url:"_count,omitempty"`
	Sort            []string         `url:"_sort,omitempty"`
	Currency        *string          `url:"currency,omitempty"`
	MinDate         *time.Time       `url:"minDate,omitempty"`
	MaxDate         *time.Time       `url:"maxDate,omitempty"`
	ReferenceID     *string          `url:"referenceId,omitempty"`
	MinAmount       *decimal.Decimal `url:"minAmount,omitempty"`
	MaxAmount       *decimal.Decimal `url:"maxAmount,omitempty"`
	Description     *string          `url:"description,omitempty"`
	SourceAccountID *string          `url:"sourceAccountId,omitempty"`
	TargetAccountID *string          `url:"targetAccountId,omitempty"`
	// contains filtered or unexported fields
}

func (*ListRequest) HasCurrency

func (lr *ListRequest) HasCurrency() bool

func (*ListRequest) HasDescription

func (lr *ListRequest) HasDescription() bool

func (*ListRequest) HasMaxAmount

func (lr *ListRequest) HasMaxAmount() bool

func (*ListRequest) HasMaxDate

func (lr *ListRequest) HasMaxDate() bool

func (*ListRequest) HasMinAmount

func (lr *ListRequest) HasMinAmount() bool

func (*ListRequest) HasMinDate

func (lr *ListRequest) HasMinDate() bool

func (*ListRequest) HasReferenceID

func (lr *ListRequest) HasReferenceID() bool

func (*ListRequest) HasSourceAccountID

func (lr *ListRequest) HasSourceAccountID() bool

func (*ListRequest) HasTargetAccountID

func (lr *ListRequest) HasTargetAccountID() bool

func (*ListRequest) UnmarshalFromRequest

func (lr *ListRequest) UnmarshalFromRequest(r *http.Request) error

type ListResponse

type ListResponse struct {
	TotalCount uint          `json:"totalCount"`
	Items      []Transaction `json:"items"`
}

type PatchRequest

type PatchRequest struct {
	TenantID        string           `json:"-"`
	ID              string           `json:"id"`
	Amount          *decimal.Decimal `json:"amount,omitempty"`
	ConvertedAmount *decimal.Decimal `json:"convertedAmount,omitempty"`
	Currency        *string          `json:"currency,omitempty"`
	Date            *time.Time       `json:"date,omitempty"`
	Description     *string          `json:"description,omitempty"`
	ReferenceID     *string          `json:"referenceId,omitempty"`
	SourceAccountID *string          `json:"sourceAccountId,omitempty"`
	TargetAccountID *string          `json:"targetAccountId,omitempty"`
	// contains filtered or unexported fields
}

func (*PatchRequest) HasAmount

func (lr *PatchRequest) HasAmount() bool

func (*PatchRequest) HasCurrency

func (lr *PatchRequest) HasCurrency() bool

func (*PatchRequest) HasDate

func (lr *PatchRequest) HasDate() bool

func (*PatchRequest) HasDescription

func (lr *PatchRequest) HasDescription() bool

func (*PatchRequest) HasReferenceID

func (lr *PatchRequest) HasReferenceID() bool

func (*PatchRequest) HasSourceAccountID

func (lr *PatchRequest) HasSourceAccountID() bool

func (*PatchRequest) HasTargetAccountID

func (lr *PatchRequest) HasTargetAccountID() bool

func (*PatchRequest) UnmarshalJSON

func (lr *PatchRequest) UnmarshalJSON(data []byte) error

type PatchResponse

type PatchResponse Transaction

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(pool *pgxpool.Pool, handler Handler) *Server

func (*Server) Create

func (s *Server) Create(w http.ResponseWriter, r *http.Request)

func (*Server) Delete

func (s *Server) Delete(w http.ResponseWriter, r *http.Request)

func (*Server) DeleteAll

func (s *Server) DeleteAll(w http.ResponseWriter, r *http.Request)

func (*Server) Get

func (s *Server) Get(w http.ResponseWriter, r *http.Request)

func (*Server) List

func (s *Server) List(w http.ResponseWriter, r *http.Request)

func (*Server) Patch

func (s *Server) Patch(w http.ResponseWriter, r *http.Request)

func (*Server) Register

func (s *Server) Register(mux *http.ServeMux)

func (*Server) Update

func (s *Server) Update(w http.ResponseWriter, r *http.Request)

type Transaction

type Transaction struct {
	ID              string          `json:"id"`
	CreatedAt       time.Time       `json:"createdAt"`
	UpdatedAt       time.Time       `json:"updatedAt"`
	Amount          decimal.Decimal `json:"amount"`
	ConvertedAmount decimal.Decimal `json:"convertedAmount"`
	Currency        string          `json:"currency"`
	Date            time.Time       `json:"date"`
	Description     *string         `json:"description"`
	ReferenceID     string          `json:"referenceId"`
	SourceAccountID string          `json:"sourceAccountId"`
	TargetAccountID string          `json:"targetAccountId"`
}

type UpdateRequest

type UpdateRequest struct {
	TenantID        string          `json:"-"`
	ID              string          `json:"id"`
	Amount          decimal.Decimal `json:"amount,omitempty"`
	Currency        string          `json:"currency,omitempty"`
	Date            time.Time       `json:"date,omitempty"`
	Description     *string         `json:"description,omitempty"`
	ReferenceID     string          `json:"referenceId,omitempty"`
	SourceAccountID string          `json:"sourceAccountId,omitempty"`
	TargetAccountID string          `json:"targetAccountId,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateRequest) HasDescription

func (lr *UpdateRequest) HasDescription() bool

func (*UpdateRequest) UnmarshalJSON

func (lr *UpdateRequest) UnmarshalJSON(data []byte) error

type UpdateResponse

type UpdateResponse Transaction

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL