Documentation ¶
Index ¶
- Variables
- func DeleteAccountBalance(success bool) bool
- func DeleteBranch(success bool) bool
- func DeleteCharityMrys(success bool) bool
- func DeleteReceiptLunar(success bool) bool
- func DeleteReceiptLunarDetail(success bool) bool
- func IsValidUUID(uuid string) bool
- func NewUUID() string
- type Account
- type AccountID
- type AccountRepository
- type Branch
- type BranchAll
- type BranchPagination
- type BranchRepository
- type CharityMrys
- type CharityMrysAll
- type CharityMrysPagination
- type CharityMrysRepository
- type DeleteMessage
- type MetaPagination
- type Money
- type ReceiptLunar
- type ReceiptLunarAll
- type ReceiptLunarDetail
- type ReceiptLunarDetailAll
- type ReceiptLunarDetailRepository
- type ReceiptLunarPagination
- type ReceiptLunarRepository
- type Transfer
- type TransferID
- type TransferRepository
- type UserJwt
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAccountNotFound = errors.New("account not found") ErrAccountOriginNotFound = errors.New("account origin not found") ErrAccountDestinationNotFound = errors.New("account destination not found") ErrInsufficientBalance = errors.New("origin account does not have sufficient Balance") )
View Source
var (
ErrBranchNotFound = errors.New("Branch not found")
)
View Source
var (
ErrCharityMrysNotFound = errors.New("CharityMrys not found")
)
View Source
var (
ErrReceiptLunarDetailNotFound = errors.New("ReceiptLunarDetail not found")
)
View Source
var (
ErrReceiptLunarNotFound = errors.New("ReceiptLunar not found")
)
Functions ¶
func DeleteAccountBalance ¶
func DeleteBranch ¶
func DeleteCharityMrys ¶
func DeleteReceiptLunar ¶
func IsValidUUID ¶
Types ¶
type Account ¶
type Account struct { Id AccountID `json:"id" example:"1"` Name string `json:"name" example:"Leo Messi"` Cpf string `json:"Cpf" example:"00.00.111.11"` Balance Money `json:"Balance" example:"40000"` CreatedAt time.Time `json:"created_at" example:"2019-11-09T21:21:46+00:00"` }
func NewAccount ¶
func NewAccountBalance ¶
type AccountRepository ¶
type AccountRepository interface { Create(context.Context, Account) (Account, error) UpdateBalance(context.Context, AccountID, Money) error FindAll(context.Context) ([]Account, error) FindByID(context.Context, AccountID) (Account, error) DeleteByID(context.Context, AccountID) (bool, error) FindBalance(context.Context, AccountID) (Account, error) }
type Branch ¶
type Branch struct { Id string `gorm:"primaryKey" json:"id" example:"953c294b-4535-4656-9fd8-be58zzd0402a9a1x"` Code string `json:"code" example:"PTK"` Name string `json:"name" example:"Pontianak"` Address string `json:"address" example:"Pontianak"` Description string `json:"Description" example:"description"` CreatedAt time.Time `json:"created_at" example:"2019-11-09T21:21:46+00:00"` }
type BranchPagination ¶
type BranchPagination struct { Data []Branch `json:"data"` Meta MetaPagination `json:"meta"` }
type BranchRepository ¶
type BranchRepository interface { Create(context.Context, Branch) (Branch, error) Update(context.Context, Branch, string) (Branch, error) FindPagination(context.Context, int, int, string, string) (BranchPagination, error) FindAll(context.Context) (BranchAll, error) FindByID(context.Context, string) (Branch, error) DeleteByID(context.Context, string) (bool, error) }
type CharityMrys ¶
type CharityMrys struct { Id string `gorm:"primaryKey" json:"id" example:"1"` Name string `json:"name" example:"Leo Messi"` Amount Money `json:"Amount" example:"40000"` Month int32 `json:"Month" example:"1"` Year int32 `json:"Year" example:"2021"` Description string `json:"Description" example:"description"` UserID string `json:"user_id" example:"1"` Username string `json:"Userame" example:"usename"` BranchId string `json:"-"` Branch Branch `json:"branch" gorm:"foreignKey:BranchId;branch:ID"` CreatedAt time.Time `json:"created_at" example:"2019-11-09T21:21:46+00:00"` }
type CharityMrysAll ¶
type CharityMrysAll struct {
Data []CharityMrys `json:"data"`
}
type CharityMrysPagination ¶
type CharityMrysPagination struct { Data []CharityMrys `json:"data"` Meta MetaPagination `json:"meta"` }
type CharityMrysRepository ¶
type CharityMrysRepository interface { CreateBulk(context.Context, []CharityMrys) ([]CharityMrys, error) Create(context.Context, CharityMrys) (CharityMrys, error) Update(context.Context, CharityMrys, string) (CharityMrys, error) FindPagination(context.Context, int, int, string, string) (CharityMrysPagination, error) FindAll(context.Context, *UserJwt) (CharityMrysAll, error) FindByID(context.Context, string) (CharityMrys, error) DeleteByID(context.Context, string) (bool, error) }
type DeleteMessage ¶
type MetaPagination ¶
type ReceiptLunar ¶
type ReceiptLunar struct { Id string `gorm:"primaryKey" json:"id" example:"1"` InternationalDate time.Time `json:"internation_date" example:"2021-08-04"` LunarDate string `json:"lunar_date" example:"2021-08-04"` Description string `json:"description"` Total Money `json:"total" example:"40000"` UserID string `json:"user_id" example:"1"` Username string `json:"username" example:"username"` BranchId string `json:"-"` Branch Branch `json:"branch" gorm:"foreignKey:BranchId;branch:ID"` ReceiptLunarDetail []ReceiptLunarDetail `json:"receipt_lunar_detail"` CreatedAt time.Time `json:"created_at" example:"2019-11-09T21:21:46+00:00"` }
func NewReceiptLunar ¶
func NewReceiptLunar(Id string, InternationalDate time.Time, LunarDate string, Description string, Branch Branch, ReceiptLunarDetail []ReceiptLunarDetail, createdAt time.Time) ReceiptLunar
func (ReceiptLunar) ProcessDetail ¶
func (r ReceiptLunar) ProcessDetail(ReceiptLunarDetailList []ReceiptLunarDetail) ReceiptLunar
type ReceiptLunarAll ¶
type ReceiptLunarAll struct {
Data []ReceiptLunar `json:"data"`
}
type ReceiptLunarDetail ¶
type ReceiptLunarDetail struct { Id string `gorm:"primaryKey" json:"id" example:"1"` Name string `json:"name"` Description string `json:"description"` Total Money `json:"total" example:"40000"` ReceiptLunarId string `json:"-"` ReceiptLunar ReceiptLunar `json:"receipt_lunar" gorm:"foreignKey:ReceiptLunarId;receipt_lunar:ID"` CreatedAt time.Time `json:"created_at" example:"2019-11-09T21:21:46+00:00"` }
func NewReceiptLunarDetail ¶
func NewReceiptLunarDetail(Id string, Name string, Description string, Total Money, ReceiptLunar ReceiptLunar, createdAt time.Time) ReceiptLunarDetail
type ReceiptLunarDetailAll ¶
type ReceiptLunarDetailAll struct {
Data []ReceiptLunarDetail `json:"data"`
}
type ReceiptLunarDetailRepository ¶
type ReceiptLunarDetailRepository interface { CreateBulk(context.Context, []ReceiptLunarDetail) ([]ReceiptLunarDetail, error) DeleteByReceiptLunarId(context.Context, string) (bool, error) }
type ReceiptLunarPagination ¶
type ReceiptLunarPagination struct { Data []ReceiptLunar `json:"data"` Meta MetaPagination `json:"meta"` }
type ReceiptLunarRepository ¶
type ReceiptLunarRepository interface { Create(context.Context, ReceiptLunar) (ReceiptLunar, error) // Update(context.Context, ReceiptLunar, string) (ReceiptLunar, error) FindPagination(context.Context, int, int, string, string) (ReceiptLunarPagination, error) FindByID(context.Context, string) (ReceiptLunar, error) }
type Transfer ¶
type Transfer struct {
// contains filtered or unexported fields
}
func NewTransfer ¶
func (Transfer) AccountDestinationID ¶
func (Transfer) AccountOriginID ¶
func (Transfer) ID ¶
func (t Transfer) ID() TransferID
type TransferID ¶
type TransferID string
func (TransferID) String ¶
func (t TransferID) String() string
type TransferRepository ¶
Click to show internal directories.
Click to hide internal directories.