Documentation
¶
Index ¶
- type DefaultBudgetService
- type DefaultCategoryService
- func (s *DefaultCategoryService) CreateCategory(category *models.Category) error
- func (s *DefaultCategoryService) DeleteCategory(categoryID uint) error
- func (s *DefaultCategoryService) GetCategories() ([]models.Category, error)
- func (s *DefaultCategoryService) UpdateCategory(category *models.Category) error
- type DefaultPaymentMethodService
- func (s *DefaultPaymentMethodService) AddPaymentMethod(paymentMethod *models.PaymentMethod) error
- func (s *DefaultPaymentMethodService) DeletePaymentMethod(paymentMethodID uint) error
- func (s *DefaultPaymentMethodService) GetPaymentMethodsByUser(userID uint) ([]models.PaymentMethod, error)
- func (s *DefaultPaymentMethodService) UpdatePaymentMethod(paymentMethod *models.PaymentMethod) error
- type DefaultTransactionService
- type DefaultUserService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultBudgetService ¶
type DefaultBudgetService struct {
// contains filtered or unexported fields
}
func NewBudgetService ¶
func NewBudgetService(budgetRepo repositories.BudgetRepository) *DefaultBudgetService
func (*DefaultBudgetService) CreateBudget ¶
func (s *DefaultBudgetService) CreateBudget(budget *models.Budget) error
CreateBudget validates and adds a budget
func (*DefaultBudgetService) DeleteBudget ¶
func (s *DefaultBudgetService) DeleteBudget(budgetID uint) error
DeleteBudget removes a budget
func (*DefaultBudgetService) GetBudgetsByUser ¶
func (s *DefaultBudgetService) GetBudgetsByUser(userID uint) ([]models.Budget, error)
GetBudgetsByUser retrieves budgets for a user
func (*DefaultBudgetService) UpdateBudget ¶
func (s *DefaultBudgetService) UpdateBudget(budget *models.Budget) error
UpdateBudget modifies an existing budget
type DefaultCategoryService ¶
type DefaultCategoryService struct {
// contains filtered or unexported fields
}
DefaultCategoryService is the default implementation of CategoryService
func NewCategoryService ¶
func NewCategoryService(categoryRepo repositories.CategoryRepository) DefaultCategoryService
NewCategoryService initializes a new DefaultCategoryService
func (*DefaultCategoryService) CreateCategory ¶
func (s *DefaultCategoryService) CreateCategory(category *models.Category) error
func (*DefaultCategoryService) DeleteCategory ¶
func (s *DefaultCategoryService) DeleteCategory(categoryID uint) error
func (*DefaultCategoryService) GetCategories ¶
func (s *DefaultCategoryService) GetCategories() ([]models.Category, error)
func (*DefaultCategoryService) UpdateCategory ¶
func (s *DefaultCategoryService) UpdateCategory(category *models.Category) error
type DefaultPaymentMethodService ¶
type DefaultPaymentMethodService struct {
// contains filtered or unexported fields
}
func NewPaymentMethodService ¶
func NewPaymentMethodService(paymentMethodRepo repositories.PaymentMethodRepository) *DefaultPaymentMethodService
func (*DefaultPaymentMethodService) AddPaymentMethod ¶
func (s *DefaultPaymentMethodService) AddPaymentMethod(paymentMethod *models.PaymentMethod) error
AddPaymentMethod creates a new payment method
func (*DefaultPaymentMethodService) DeletePaymentMethod ¶
func (s *DefaultPaymentMethodService) DeletePaymentMethod(paymentMethodID uint) error
DeletePaymentMethod removes a payment method
func (*DefaultPaymentMethodService) GetPaymentMethodsByUser ¶
func (s *DefaultPaymentMethodService) GetPaymentMethodsByUser(userID uint) ([]models.PaymentMethod, error)
GetPaymentMethodsByUser retrieves payment methods by user ID
func (*DefaultPaymentMethodService) UpdatePaymentMethod ¶
func (s *DefaultPaymentMethodService) UpdatePaymentMethod(paymentMethod *models.PaymentMethod) error
UpdatePaymentMethod modifies an existing payment method
type DefaultTransactionService ¶
type DefaultTransactionService struct {
// contains filtered or unexported fields
}
func NewTransactionService ¶
func NewTransactionService(transactionRepo repositories.TransactionRepository, budgetRepo repositories.BudgetRepository) *DefaultTransactionService
func (*DefaultTransactionService) AddTransaction ¶
func (s *DefaultTransactionService) AddTransaction(transaction *models.Transaction) error
AddTransaction validates and saves a transaction
func (*DefaultTransactionService) DeleteTransaction ¶
func (s *DefaultTransactionService) DeleteTransaction(transactionID uint) error
DeleteTransaction removes a transaction by ID
func (*DefaultTransactionService) GetTransactionsByUser ¶
func (s *DefaultTransactionService) GetTransactionsByUser(userID uint) ([]models.Transaction, error)
GetTransactionsByUser retrieves all transactions for a user
type DefaultUserService ¶
type DefaultUserService struct {
// contains filtered or unexported fields
}
func NewUserService ¶
func NewUserService(userRepo repositories.UserRepository) *DefaultUserService
func (*DefaultUserService) AuthenticateUser ¶
func (s *DefaultUserService) AuthenticateUser(email, password string) (*models.User, error)
AuthenticateUser checks email & password for login
func (*DefaultUserService) RegisterUser ¶
func (s *DefaultUserService) RegisterUser(name, email, password string) (*models.User, error)
RegisterUser creates a new user with a hashed password