fixed code documentation

This commit is contained in:
Fran Jurmanović
2021-08-29 10:51:29 +02:00
parent 0682252859
commit f441f46494
35 changed files with 674 additions and 70 deletions

View File

@@ -12,7 +12,16 @@ type TransactionTypeService struct {
Db *pg.DB
}
// Inserts new row to transaction type table.
/*
New
Inserts new row to transaction type table.
Args:
context.Context: Application context
*models.NewTransactionTypeBody: object to create
Returns:
*models.TransactionType: Transaction Type object from database.
*/
func (as *TransactionTypeService) New(ctx context.Context, body *models.NewTransactionTypeBody) *models.TransactionType {
db := as.Db.WithContext(ctx)
@@ -27,7 +36,16 @@ func (as *TransactionTypeService) New(ctx context.Context, body *models.NewTrans
return tm
}
// Gets all rows from transaction type table.
/*
GetAll
Gets all rows from transaction type table.
Args:
context.Context: Application context
string: Relations to embed
Returns:
*[]models.TransactionType: List of Transaction type objects from database.
*/
func (as *TransactionTypeService) GetAll(ctx context.Context, embed string) *[]models.TransactionType {
db := as.Db.WithContext(ctx)