29 lines
667 B
Go
29 lines
667 B
Go
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, req model.UpdateBudgetRequest) (*model.Budget, error) {
|
|
return s.repo.Update(ctx, req)
|
|
}
|
|
|
|
func (s *BudgetService) Delete(ctx context.Context, req model.DeleteBudgetRequest) error {
|
|
return s.repo.Delete(ctx, req)
|
|
}
|