mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-25 07:45:44 +00:00
Feat[BE-261]: creating Entity and repository for each table expenses
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
package repository
|
||||
|
||||
import (
|
||||
entity "gitlab.com/mbugroup/lti-api.git/internal/entities"
|
||||
"context"
|
||||
|
||||
"gitlab.com/mbugroup/lti-api.git/internal/common/repository"
|
||||
entity "gitlab.com/mbugroup/lti-api.git/internal/entities"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type ExpenseRepository interface {
|
||||
repository.BaseRepository[entity.Expense]
|
||||
IdExists(ctx context.Context, id uint64) (bool, error)
|
||||
}
|
||||
|
||||
type ExpenseRepositoryImpl struct {
|
||||
@@ -19,3 +22,7 @@ func NewExpenseRepository(db *gorm.DB) ExpenseRepository {
|
||||
BaseRepositoryImpl: repository.NewBaseRepository[entity.Expense](db),
|
||||
}
|
||||
}
|
||||
|
||||
func (r *ExpenseRepositoryImpl) IdExists(ctx context.Context, id uint64) (bool, error) {
|
||||
return repository.Exists[entity.Expense](ctx, r.DB(), uint(id))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user