mirror of
https://github.com/FJurmanovic/wallet-go-api.git
synced 2026-11-11 07:41:10 +00:00
fixed code documentation
This commit is contained in:
@@ -12,6 +12,11 @@ type BaseModel struct {
|
||||
DateUpdated time.Time `json:"dateUpdated" pg:"date_updated"`
|
||||
}
|
||||
|
||||
/*
|
||||
Init
|
||||
|
||||
Initializes base model with DateCreated, DateUpdated, and Id values.
|
||||
*/
|
||||
func (cm *BaseModel) Init() {
|
||||
date := time.Now()
|
||||
cm.Id = uuid.NewString()
|
||||
|
||||
@@ -16,6 +16,13 @@ type UserReturnInfo struct {
|
||||
Email string `json:"email"`
|
||||
}
|
||||
|
||||
/*
|
||||
Payload
|
||||
|
||||
Maps User object to UserReturnInfo object.
|
||||
Returns:
|
||||
*UserReturnInfo: mapped UserReturnInfo object
|
||||
*/
|
||||
func (um *User) Payload() *UserReturnInfo {
|
||||
payload := new(UserReturnInfo)
|
||||
payload.BaseModel = um.BaseModel
|
||||
|
||||
@@ -49,6 +49,13 @@ type SubscriptionEnd struct {
|
||||
Id string `json:"id" form:"id"`
|
||||
}
|
||||
|
||||
/*
|
||||
ToTrans
|
||||
|
||||
Maps Subscription object to Transaction object.
|
||||
Returns:
|
||||
*Transaction: mapped Transaction object
|
||||
*/
|
||||
func (cm *Subscription) ToTrans() *Transaction {
|
||||
trans := new(Transaction)
|
||||
trans.Init()
|
||||
@@ -63,6 +70,13 @@ func (cm *Subscription) ToTrans() *Transaction {
|
||||
return trans
|
||||
}
|
||||
|
||||
/*
|
||||
HasNew
|
||||
|
||||
Checks if Subscription reached new transaction interval.
|
||||
Returns:
|
||||
bool: Is new transaction interval reached
|
||||
*/
|
||||
func (cm *Subscription) HasNew() bool {
|
||||
trans := cm.TransactionType
|
||||
if trans != nil {
|
||||
|
||||
Reference in New Issue
Block a user