models

package
v0.0.0-...-ac17c7f Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChamaAccountProto

func ChamaAccountProto(db *ChamaAccount) (*transaction.ChamaAccount, error)

func ChamaMemberProto

func ChamaMemberProto(db *ChamaMember) (*chama.ChamaMember, error)

func ChamaProto

func ChamaProto(db *Chama) (*chama.Chama, error)

func LoanProductProto

func LoanProductProto(db *LoanProduct) (*loan.LoanProduct, error)

func LoanProto

func LoanProto(db *Loan) (*loan.Loan, error)

func TransactionProto

func TransactionProto(db *Transaction) (*transaction.Transaction, error)

Types

type Chama

type Chama struct {
	ID             uint      `gorm:"primaryKey;autoIncrement"`
	CreatorID      string    `gorm:"type:varchar(50);not null"`
	Name           string    `gorm:"type:varchar(50);not null"`
	Description    string    `gorm:"type:varchar(200)"`
	Status         string    `gorm:"type:varchar(100)"`
	AccountBalance float64   `gorm:"type:float(15)"`
	Active         bool      `gorm:"type:tinyint(1)"`
	UpdatedAt      time.Time `gorm:"autoUpdateTime"`
	CreatedAt      time.Time `gorm:"autoCreateTime"`
}

func ChamaModel

func ChamaModel(pb *chama.Chama) (*Chama, error)

func (*Chama) TableName

func (*Chama) TableName() string

type ChamaAccount

type ChamaAccount struct {
	ID                   uint      `gorm:"primaryKey;autoIncrement"`
	OwnerID              string    `gorm:"type:varchar(50);not null"`
	AccountName          string    `gorm:"type:varchar(50);not null"`
	AccountType          string    `gorm:"type:varchar(30);not null"`
	Withdrawable         bool      `gorm:"type:tinyint(1)"`
	TotalDepositedAmount float64   `gorm:"type:float(15)"`
	AvailableAmount      float64   `gorm:"type:float(15)"`
	TotalWithdrawnAmount float64   `gorm:"type:float(15)"`
	LastDepositedAmount  float64   `gorm:"type:float(15)"`
	LastWithdrawnAmount  float64   `gorm:"type:float(15)"`
	Active               bool      `gorm:"type:tinyint(1)"`
	UpdatedAt            time.Time `gorm:"autoUpdateTime"`
	CreatedAt            time.Time `gorm:"autoCreateTime"`
}

func ChamaAccountModel

func ChamaAccountModel(pb *transaction.ChamaAccount) (*ChamaAccount, error)

func (*ChamaAccount) TableName

func (*ChamaAccount) TableName() string

type ChamaMember

type ChamaMember struct {
	ID            uint      `gorm:"primaryKey;autoIncrement"`
	ChamaID       string    `gorm:"type:varchar(15);not null"`
	FirstName     string    `gorm:"type:varchar(30);not null"`
	LastName      string    `gorm:"type:varchar(30);not null"`
	Phone         string    `gorm:"type:varchar(15);not null"`
	IDNumber      string    `gorm:"type:varchar(10);not null"`
	Email         string    `gorm:"type:varchar(50)"`
	Residence     string    `gorm:"type:varchar(100)"`
	Status        string    `gorm:"type:varchar(100)"`
	Beneficiaries []byte    `gorm:"type:json"`
	Guarantees    []byte    `gorm:"type:json"`
	JobDetails    []byte    `gorm:"type:json"`
	KYC           []byte    `gorm:"type:json"`
	Active        bool      `gorm:"type:tinyint(1)"`
	UpdatedAt     time.Time `gorm:"autoUpdateTime"`
	CreatedAt     time.Time `gorm:"autoCreateTime"`
}

func ChamaMemberModel

func ChamaMemberModel(pb *chama.ChamaMember) (*ChamaMember, error)

func (*ChamaMember) TableName

func (*ChamaMember) TableName() string

type Loan

type Loan struct {
	ID            uint      `gorm:"primaryKey;autoIncrement"`
	ChamaID       string    `gorm:"type:varchar(15);not null"`
	ProductID     string    `gorm:"type:varchar(15);not null"`
	MemberID      string    `gorm:"type:varchar(15);not null"`
	LoaneeNames   string    `gorm:"type:varchar(30);not null"`
	LoaneePhone   string    `gorm:"type:varchar(15);not null"`
	NationalID    string    `gorm:"type:varchar(10);not null"`
	LoaneeEmail   string    `gorm:"type:varchar(50)"`
	Approved      bool      `gorm:"type:tinyint(1)"`
	DurationDays  int32     `gorm:"type:int(10)"`
	InterestRate  float32   `gorm:"type:float(3)"`
	LoanAmount    float64   `gorm:"type:float(15)"`
	SettledAmount float64   `gorm:"type:float(15)"`
	PenaltyAmount float64   `gorm:"type:float(15)"`
	UpdatedAt     time.Time `gorm:"autoUpdateTime"`
	CreatedAt     time.Time `gorm:"autoCreateTime"`
}

func LoanModel

func LoanModel(pb *loan.Loan) (*Loan, error)

type LoanProduct

type LoanProduct struct {
	ID                  uint      `gorm:"primaryKey;autoIncrement"`
	ChamaID             string    `gorm:"type:varchar(15);not null"`
	Name                string    `gorm:"type:varchar(50);not null"`
	Description         string    `gorm:"type:varchar(200)"`
	InterestRate        float32   `gorm:"type:float(3)"`
	LoanDurationDays    int32     `gorm:"type:int(10)"`
	LoanMinimumAmount   float64   `gorm:"type:float(15)"`
	LoanMaximumAmount   float64   `gorm:"type:float(15)"`
	LoanAccountBalance  float64   `gorm:"type:float(15)"`
	LoanInterestBalance float64   `gorm:"type:float(15)"`
	LoanSettledBalance  float64   `gorm:"type:float(15)"`
	SettledLoans        int32     `gorm:"type:int(10)"`
	ActiveLoans         int32     `gorm:"type:int(10)"`
	TotalLoans          int32     `gorm:"type:int(10)"`
	UpdatedAt           time.Time `gorm:"autoUpdateTime"`
	CreatedAt           time.Time `gorm:"autoCreateTime"`
}

func LoanProductModel

func LoanProductModel(pb *loan.LoanProduct) (*LoanProduct, error)

func (*LoanProduct) TableName

func (*LoanProduct) TableName() string

type Transaction

type Transaction struct {
	ID                uint      `gorm:"primaryKey;autoIncrement"`
	ActorID           string    `gorm:"type:varchar(50);not null"`
	AccountID         string    `gorm:"type:varchar(50);not null"`
	Description       string    `gorm:"type:varchar(200);not null"`
	TransactionType   string    `gorm:"type:varchar(30);not null"`
	TransactionAmount float64   `gorm:"type:float(15)"`
	CreatedAt         time.Time `gorm:"autoCreateTime"`
}

func TransactionModel

func TransactionModel(pb *transaction.Transaction) (*Transaction, error)

func (*Transaction) TableName

func (*Transaction) TableName() string

Jump to

Keyboard shortcuts

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