mirror of
https://github.com/FJurmanovic/wallet-go-api.git
synced 2026-02-06 14:18:12 +00:00
partial repository layer added
This commit is contained in:
13
pkg/filter/api.go
Normal file
13
pkg/filter/api.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package filter
|
||||
|
||||
import "wallet-api/pkg/model"
|
||||
|
||||
type ApiFilter struct {
|
||||
model.Params
|
||||
}
|
||||
|
||||
func NewApiFilter(params model.Params) *ApiFilter {
|
||||
return &ApiFilter{
|
||||
Params: params,
|
||||
}
|
||||
}
|
||||
27
pkg/filter/filter.go
Normal file
27
pkg/filter/filter.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package filter
|
||||
|
||||
import "go.uber.org/dig"
|
||||
|
||||
/*
|
||||
InitializeFilters
|
||||
|
||||
Initializes Dependency Injection modules for filters
|
||||
|
||||
Args:
|
||||
*dig.Container: Dig Container
|
||||
*/
|
||||
func InitializeFilters(c *dig.Container) {
|
||||
c.Provide(NewApiFilter)
|
||||
c.Provide(NewSubscriptionFilter)
|
||||
c.Provide(NewSubscriptionTypeFilter)
|
||||
c.Provide(NewTransactionFilter)
|
||||
c.Provide(NewTransactionStatusFilter)
|
||||
c.Provide(NewTransactionTypeFilter)
|
||||
c.Provide(NewUserFilter)
|
||||
c.Provide(NewWalletFilter)
|
||||
}
|
||||
|
||||
type BaseFilter struct {
|
||||
Id string
|
||||
WalletId string
|
||||
}
|
||||
14
pkg/filter/subscription.go
Normal file
14
pkg/filter/subscription.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package filter
|
||||
|
||||
import "wallet-api/pkg/model"
|
||||
|
||||
type SubscriptionFilter struct {
|
||||
model.Params
|
||||
BaseFilter
|
||||
}
|
||||
|
||||
func NewSubscriptionFilter(params model.Params) *SubscriptionFilter {
|
||||
return &SubscriptionFilter{
|
||||
Params: params,
|
||||
}
|
||||
}
|
||||
14
pkg/filter/subscriptionType.go
Normal file
14
pkg/filter/subscriptionType.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package filter
|
||||
|
||||
import "wallet-api/pkg/model"
|
||||
|
||||
type SubscriptionTypeFilter struct {
|
||||
model.Params
|
||||
BaseFilter
|
||||
}
|
||||
|
||||
func NewSubscriptionTypeFilter(params model.Params) *SubscriptionTypeFilter {
|
||||
return &SubscriptionTypeFilter{
|
||||
Params: params,
|
||||
}
|
||||
}
|
||||
16
pkg/filter/transaction.go
Normal file
16
pkg/filter/transaction.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package filter
|
||||
|
||||
import "wallet-api/pkg/model"
|
||||
|
||||
type TransactionFilter struct {
|
||||
model.Params
|
||||
BaseFilter
|
||||
NoPending bool
|
||||
TransactionStatusId string
|
||||
}
|
||||
|
||||
func NewTransactionFilter(params model.Params) *TransactionFilter {
|
||||
return &TransactionFilter{
|
||||
Params: params,
|
||||
}
|
||||
}
|
||||
15
pkg/filter/transactionStatus.go
Normal file
15
pkg/filter/transactionStatus.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package filter
|
||||
|
||||
import "wallet-api/pkg/model"
|
||||
|
||||
type TransactionStatusFilter struct {
|
||||
model.Params
|
||||
BaseFilter
|
||||
Status string
|
||||
}
|
||||
|
||||
func NewTransactionStatusFilter(params model.Params) *TransactionStatusFilter {
|
||||
return &TransactionStatusFilter{
|
||||
Params: params,
|
||||
}
|
||||
}
|
||||
14
pkg/filter/transactionType.go
Normal file
14
pkg/filter/transactionType.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package filter
|
||||
|
||||
import "wallet-api/pkg/model"
|
||||
|
||||
type TransactionTypeFilter struct {
|
||||
model.Params
|
||||
BaseFilter
|
||||
}
|
||||
|
||||
func NewTransactionTypeFilter(params model.Params) *TransactionTypeFilter {
|
||||
return &TransactionTypeFilter{
|
||||
Params: params,
|
||||
}
|
||||
}
|
||||
14
pkg/filter/user.go
Normal file
14
pkg/filter/user.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package filter
|
||||
|
||||
import "wallet-api/pkg/model"
|
||||
|
||||
type UserFilter struct {
|
||||
model.Params
|
||||
BaseFilter
|
||||
}
|
||||
|
||||
func NewUserFilter(params model.Params) *UserFilter {
|
||||
return &UserFilter{
|
||||
Params: params,
|
||||
}
|
||||
}
|
||||
14
pkg/filter/wallet-header.go
Normal file
14
pkg/filter/wallet-header.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package filter
|
||||
|
||||
import "wallet-api/pkg/model"
|
||||
|
||||
type WalletHeaderFilter struct {
|
||||
model.Params
|
||||
BaseFilter
|
||||
}
|
||||
|
||||
func NewWalletHeaderFilter(params model.Params) *WalletHeaderFilter {
|
||||
return &WalletHeaderFilter{
|
||||
Params: params,
|
||||
}
|
||||
}
|
||||
14
pkg/filter/wallet.go
Normal file
14
pkg/filter/wallet.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package filter
|
||||
|
||||
import "wallet-api/pkg/model"
|
||||
|
||||
type WalletFilter struct {
|
||||
model.Params
|
||||
BaseFilter
|
||||
}
|
||||
|
||||
func NewWalletFilter(params model.Params) *WalletFilter {
|
||||
return &WalletFilter{
|
||||
Params: params,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user