forked from ebhomengo/niki
1
0
Fork 0
niki/adapter/storage/action_piggy_bank_request.go

31 lines
945 B
Go
Raw Normal View History

2023-12-16 06:09:50 +00:00
package storage
import (
storage "git.gocasts.ir/ebhomengo/niki/adapter/storage/models"
entitypiggybank "git.gocasts.ir/ebhomengo/niki/entity/piggy_bank"
)
func (d *DBMS) AddPiggyBank([]entitypiggybank.PiggyBank) error {
return nil
}
func (d *DBMS) EditPiggyBank(piggyID uint, piggyBankInput entitypiggybank.PiggyBank) error {
return nil
}
func (d *DBMS) DeletePiggyBank(piggyID uint) error {
return nil
}
func (d *DBMS) GetAllPiggyBank() ([]entitypiggybank.PiggyBank, error) {
var storeResponse []storage.PiggyBank
if err := d.db.Find(&storeResponse).Error; err != nil {
return nil, err
}
actionsEntities := make([]entitypiggybank.PiggyBank, len(storeResponse))
for i := range storeResponse {
actionsEntities[i] = storage.MapActionsStoreToEntity(storeResponse[i])
}
return actionsEntities, nil
}
func (d *DBMS) GetPiggyBankByID(piggyBankID uint) (entitypiggybank.PiggyBank, error) {
return entitypiggybank.PiggyBank{}, nil
}