basic online
This commit is contained in:
28
internal/service/bugdet-service.go
Normal file
28
internal/service/bugdet-service.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"Engine/internal/database"
|
||||
"Engine/internal/model"
|
||||
)
|
||||
|
||||
type BudgetService struct {
|
||||
repo *database.BudgetRepo
|
||||
}
|
||||
|
||||
func NewBudgetService(repo *database.BudgetRepo) *BudgetService {
|
||||
return &BudgetService{repo: repo}
|
||||
}
|
||||
|
||||
func (s *BudgetService) Create(ctx context.Context, req model.CreateBudgetRequest) (*model.Budget, error) {
|
||||
return s.repo.Create(ctx, req)
|
||||
}
|
||||
|
||||
func (s *BudgetService) Update(ctx context.Context, id int, amount float64, notes, changedBy string) (*model.Budget, error) {
|
||||
return s.repo.Update(ctx, id, amount, notes, changedBy)
|
||||
}
|
||||
|
||||
func (s *BudgetService) Delete(ctx context.Context, id int) error {
|
||||
return s.repo.Delete(ctx, id)
|
||||
}
|
||||
Reference in New Issue
Block a user