Documentation ¶
Index ¶
- type CostCategoryRepo
- type CostCategoryRepository
- func (ccr *CostCategoryRepository) CreateCostCategory(ctx context.Context, costCategory *models.CostCategorySchema) *models.ExpenseServiceError
- func (ccr *CostCategoryRepository) DeleteCostCategory(ctx context.Context, uuid *uuid.UUID) *models.ExpenseServiceError
- func (ccr *CostCategoryRepository) GetCostCategoriesByTripID(ctx context.Context, tripId *uuid.UUID) ([]models.CostCategorySchema, *models.ExpenseServiceError)
- func (ccr *CostCategoryRepository) GetCostCategoryByID(ctx context.Context, uuid *uuid.UUID) (*models.CostCategorySchema, *models.ExpenseServiceError)
- func (ccr *CostCategoryRepository) GetCostCategoryByTripIdAndName(ctx context.Context, tripId *uuid.UUID, name string) (*models.CostCategorySchema, *models.ExpenseServiceError)
- func (ccr *CostCategoryRepository) UpdateCostCategory(ctx context.Context, costCategory *models.CostCategorySchema) *models.ExpenseServiceError
- type CostRepo
- type CostRepository
- func (cr *CostRepository) AddCostContributor(ctx context.Context, contributor *models.CostContributionSchema) *models.ExpenseServiceError
- func (*CostRepository) AddCostContributorTx(ctx context.Context, tx pgx.Tx, contributor *models.CostContributionSchema) *models.ExpenseServiceError
- func (*CostRepository) AddTx(ctx context.Context, tx pgx.Tx, cost *models.CostSchema) *models.ExpenseServiceError
- func (*CostRepository) DeleteCostContributionTx(ctx context.Context, tx pgx.Tx, contributorId *uuid.UUID, costId *uuid.UUID) *models.ExpenseServiceError
- func (cr *CostRepository) DeleteCostContributions(ctx context.Context, costId *uuid.UUID) *models.ExpenseServiceError
- func (*CostRepository) DeleteTx(ctx context.Context, tx pgx.Tx, costId *uuid.UUID) *models.ExpenseServiceError
- func (cr *CostRepository) GetCostByID(ctx context.Context, costId *uuid.UUID) (*models.CostSchema, *models.ExpenseServiceError)
- func (cr *CostRepository) GetCostContributors(ctx context.Context, costId *uuid.UUID) ([]*models.CostContributionSchema, *models.ExpenseServiceError)
- func (cr *CostRepository) GetCostCreditor(ctx context.Context, id *uuid.UUID) (*models.UserSchema, *models.ExpenseServiceError)
- func (cr *CostRepository) GetCostOverview(ctx context.Context, userId *uuid.UUID) (*models.CostOverviewDTO, *models.ExpenseServiceError)
- func (cr *CostRepository) GetCostsByContributorID(ctx context.Context, contributorId *uuid.UUID) ([]*models.CostSchema, *models.ExpenseServiceError)
- func (cr *CostRepository) GetCostsByCostCategoryID(ctx context.Context, costCategoryId *uuid.UUID) ([]*models.CostSchema, *models.ExpenseServiceError)
- func (cr *CostRepository) GetCostsByCostCategoryIDAndContributorID(ctx context.Context, costCategoryId *uuid.UUID, contributorId *uuid.UUID) ([]*models.CostSchema, *models.ExpenseServiceError)
- func (cr *CostRepository) GetCostsByTripID(ctx context.Context, tripId *uuid.UUID) ([]*models.CostSchema, *models.ExpenseServiceError)
- func (cr *CostRepository) GetCostsByTripIDAndContributorID(ctx context.Context, tripId *uuid.UUID, contributorId *uuid.UUID) ([]*models.CostSchema, *models.ExpenseServiceError)
- func (cr *CostRepository) GetTotalCostByCostCategoryID(ctx context.Context, costCategoryId *uuid.UUID) (*decimal.Decimal, *models.ExpenseServiceError)
- func (cr *CostRepository) GetTotalCostByTripID(ctx context.Context, tripId *uuid.UUID) (*decimal.Decimal, *models.ExpenseServiceError)
- func (cr *CostRepository) UpdateCostContributor(ctx context.Context, contributor *models.CostContributionSchema) *models.ExpenseServiceError
- func (*CostRepository) UpdateTx(ctx context.Context, tx pgx.Tx, cost *models.CostSchema) *models.ExpenseServiceError
- type DebtRepo
- type DebtRepository
- func (*DebtRepository) AddTx(ctx context.Context, tx pgx.Tx, debt *models.DebtSchema) *models.ExpenseServiceError
- func (dr *DebtRepository) CalculateDebt(ctx context.Context, tx pgx.Tx, creditorId *uuid.UUID, debtorId *uuid.UUID, ...) *models.ExpenseServiceError
- func (*DebtRepository) DeleteTx(ctx context.Context, tx pgx.Tx, debtId *uuid.UUID) *models.ExpenseServiceError
- func (dr *DebtRepository) GetCumulativeCreditByUserIDAndTripID(ctx context.Context, userId *uuid.UUID, tripId *uuid.UUID) (decimal.Decimal, *models.ExpenseServiceError)
- func (dr *DebtRepository) GetCumulativeDebtByUserIDAndTripID(ctx context.Context, userId *uuid.UUID, tripId *uuid.UUID) (decimal.Decimal, *models.ExpenseServiceError)
- func (dr *DebtRepository) GetDebtByCreditorId(ctx context.Context, creditorId *uuid.UUID) (*models.DebtSchema, *models.ExpenseServiceError)
- func (*DebtRepository) GetDebtByCreditorIdAndDebtorIdAndTripIdTx(ctx context.Context, tx pgx.Tx, creditorId *uuid.UUID, debtorId *uuid.UUID, ...) (*models.DebtSchema, *models.ExpenseServiceError)
- func (dr *DebtRepository) GetDebtById(ctx context.Context, debtId *uuid.UUID) (*models.DebtSchema, *models.ExpenseServiceError)
- func (dr *DebtRepository) GetDebtEntries(ctx context.Context, userId *uuid.UUID) ([]*models.DebtDTO, *models.ExpenseServiceError)
- func (dr *DebtRepository) GetDebtEntriesByTripId(ctx context.Context, tripId *uuid.UUID) ([]*models.DebtSchema, *models.ExpenseServiceError)
- func (*DebtRepository) UpdateTx(ctx context.Context, tx pgx.Tx, debt *models.DebtSchema) *models.ExpenseServiceError
- type TransactionRepo
- type TransactionRepository
- func (*TransactionRepository) AddTx(ctx context.Context, tx pgx.Tx, transaction *models.TransactionSchema) *models.ExpenseServiceError
- func (*TransactionRepository) DeleteTx(ctx context.Context, tx pgx.Tx, transactionId *uuid.UUID) *models.ExpenseServiceError
- func (tr *TransactionRepository) GetAllTransactions(ctx context.Context, userId *uuid.UUID) ([]*models.TransactionSchema, *models.ExpenseServiceError)
- func (tr *TransactionRepository) GetTransactionById(ctx context.Context, id *uuid.UUID) (*models.TransactionSchema, *models.ExpenseServiceError)
- func (tr *TransactionRepository) GetTransactionsByTripIdAndUserId(ctx context.Context, tripId *uuid.UUID, userId *uuid.UUID) ([]*models.TransactionSchema, *models.ExpenseServiceError)
- func (*TransactionRepository) UpdateTx(ctx context.Context, tx pgx.Tx, transaction *models.TransactionSchema) *models.ExpenseServiceError
- type TripRepo
- type TripRepository
- func (tr *TripRepository) AcceptTripInvite(ctx context.Context, tripId *uuid.UUID, userId *uuid.UUID) *models.ExpenseServiceError
- func (tr *TripRepository) AddUserToTrip(ctx context.Context, trip *models.TripSchema, invitedUserId *uuid.UUID, ...) *models.ExpenseServiceError
- func (tr *TripRepository) CheckIfUserIsInvited(ctx context.Context, tripId *uuid.UUID, userId *uuid.UUID) (bool, *models.ExpenseServiceError)
- func (tr *TripRepository) CreateTrip(ctx context.Context, trip *models.TripSchema) *models.ExpenseServiceError
- func (tr *TripRepository) DeclineTripInvite(ctx context.Context, tripId *uuid.UUID, userId *uuid.UUID) *models.ExpenseServiceError
- func (tr *TripRepository) DeleteTrip(ctx context.Context, tripId *uuid.UUID) *models.ExpenseServiceError
- func (tr *TripRepository) GetAcceptedTripParticipants(ctx context.Context, tripId *uuid.UUID) ([]*models.UserTripSchema, *models.ExpenseServiceError)
- func (tr *TripRepository) GetTripById(ctx context.Context, tripId *uuid.UUID) (*models.TripSchema, *models.ExpenseServiceError)
- func (tr *TripRepository) GetTripParticipant(ctx context.Context, tripId *uuid.UUID, userId *uuid.UUID) (*models.UserTripSchema, *models.ExpenseServiceError)
- func (tr *TripRepository) GetTripParticipants(ctx context.Context, tripId *uuid.UUID) ([]*models.UserTripSchema, *models.ExpenseServiceError)
- func (tr *TripRepository) GetTripsByUserId(ctx context.Context, userId *uuid.UUID) ([]*models.TripSchema, *models.ExpenseServiceError)
- func (tr *TripRepository) UpdateTrip(ctx context.Context, trip *models.TripSchema) *models.ExpenseServiceError
- func (tr *TripRepository) UpdateTripParticipant(ctx context.Context, userTrip *models.UserTripSchema) *models.ExpenseServiceError
- func (*TripRepository) UpdateTripParticipantTx(ctx context.Context, tx pgx.Tx, userTrip *models.UserTripSchema) *models.ExpenseServiceError
- func (tr *TripRepository) ValidateIfTripExists(ctx context.Context, tripId *uuid.UUID) *models.ExpenseServiceError
- func (tr *TripRepository) ValidateIfUserHasAccepted(ctx context.Context, tripId *uuid.UUID, userId *uuid.UUID) *models.ExpenseServiceError
- type UserRepo
- type UserRepository
- func (ur *UserRepository) ActivateUser(ctx context.Context, userId *uuid.UUID) *models.ExpenseServiceError
- func (ur *UserRepository) ConfirmTokenByType(ctx context.Context, userId *uuid.UUID, tokenType string) *models.ExpenseServiceError
- func (ur *UserRepository) CreateTokenByUserIdAndType(ctx context.Context, userId *uuid.UUID, tokenType string) (*models.TokenSchema, *models.ExpenseServiceError)
- func (ur *UserRepository) CreateUser(ctx context.Context, user *models.UserSchema) *models.ExpenseServiceError
- func (ur *UserRepository) DeleteTokenByUserIdAndType(ctx context.Context, userId *uuid.UUID, tokenType string) (int64, *models.ExpenseServiceError)
- func (ur *UserRepository) DeleteUser(ctx context.Context, userId *uuid.UUID) *models.ExpenseServiceError
- func (ur *UserRepository) FindUsersLikeUsername(ctx context.Context, username string) ([]*models.UserSchema, *models.ExpenseServiceError)
- func (ur *UserRepository) GetTokenByTokenAndType(ctx context.Context, token, tokenType string) (*models.TokenSchema, *models.ExpenseServiceError)
- func (ur *UserRepository) GetTokenByUserIdAndType(ctx context.Context, userId *uuid.UUID, tokenType string) (*models.TokenSchema, *models.ExpenseServiceError)
- func (ur *UserRepository) GetUserByContext(ctx context.Context) (*models.UserSchema, *models.ExpenseServiceError)
- func (ur *UserRepository) GetUserById(ctx context.Context, userId *uuid.UUID) (*models.UserSchema, *models.ExpenseServiceError)
- func (ur *UserRepository) GetUserBySchema(ctx context.Context, request *models.UserSchema) (*models.UserSchema, *models.ExpenseServiceError)
- func (ur *UserRepository) UpdatePassword(ctx context.Context, userId *uuid.UUID, newPassword string) *models.ExpenseServiceError
- func (ur *UserRepository) UpdateUser(ctx context.Context, user *models.UserSchema) *models.ExpenseServiceError
- func (ur *UserRepository) ValidateEmailExistence(ctx context.Context, email string) *models.ExpenseServiceError
- func (ur *UserRepository) ValidateIfUserExists(ctx context.Context, userId *uuid.UUID) *models.ExpenseServiceError
- func (ur *UserRepository) ValidateIfUserIsActivated(ctx context.Context, userId *uuid.UUID) *models.ExpenseServiceError
- func (ur *UserRepository) ValidateUsernameExistence(ctx context.Context, username string) *models.ExpenseServiceError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CostCategoryRepo ¶
type CostCategoryRepo interface { CreateCostCategory(ctx context.Context, costCategory *models.CostCategorySchema) *models.ExpenseServiceError GetCostCategoryByID(ctx context.Context, uuid *uuid.UUID) (*models.CostCategorySchema, *models.ExpenseServiceError) GetCostCategoriesByTripID(ctx context.Context, uuid *uuid.UUID) ([]models.CostCategorySchema, *models.ExpenseServiceError) UpdateCostCategory(ctx context.Context, costCategory *models.CostCategorySchema) *models.ExpenseServiceError DeleteCostCategory(ctx context.Context, uuid *uuid.UUID) *models.ExpenseServiceError GetCostCategoryByTripIdAndName(ctx context.Context, tripId *uuid.UUID, name string) (*models.CostCategorySchema, *models.ExpenseServiceError) }
type CostCategoryRepository ¶
type CostCategoryRepository struct {
DatabaseMgr managers.DatabaseMgr
}
func (*CostCategoryRepository) CreateCostCategory ¶
func (ccr *CostCategoryRepository) CreateCostCategory(ctx context.Context, costCategory *models.CostCategorySchema) *models.ExpenseServiceError
func (*CostCategoryRepository) DeleteCostCategory ¶
func (ccr *CostCategoryRepository) DeleteCostCategory(ctx context.Context, uuid *uuid.UUID) *models.ExpenseServiceError
func (*CostCategoryRepository) GetCostCategoriesByTripID ¶
func (ccr *CostCategoryRepository) GetCostCategoriesByTripID(ctx context.Context, tripId *uuid.UUID) ([]models.CostCategorySchema, *models.ExpenseServiceError)
func (*CostCategoryRepository) GetCostCategoryByID ¶
func (ccr *CostCategoryRepository) GetCostCategoryByID(ctx context.Context, uuid *uuid.UUID) (*models.CostCategorySchema, *models.ExpenseServiceError)
func (*CostCategoryRepository) GetCostCategoryByTripIdAndName ¶
func (ccr *CostCategoryRepository) GetCostCategoryByTripIdAndName(ctx context.Context, tripId *uuid.UUID, name string) (*models.CostCategorySchema, *models.ExpenseServiceError)
func (*CostCategoryRepository) UpdateCostCategory ¶
func (ccr *CostCategoryRepository) UpdateCostCategory(ctx context.Context, costCategory *models.CostCategorySchema) *models.ExpenseServiceError
type CostRepo ¶
type CostRepo interface { GetCostByID(ctx context.Context, costId *uuid.UUID) (*models.CostSchema, *models.ExpenseServiceError) AddTx(ctx context.Context, tx pgx.Tx, cost *models.CostSchema) *models.ExpenseServiceError UpdateTx(ctx context.Context, tx pgx.Tx, cost *models.CostSchema) *models.ExpenseServiceError DeleteTx(ctx context.Context, tx pgx.Tx, costId *uuid.UUID) *models.ExpenseServiceError GetCostsByTripID(ctx context.Context, tripId *uuid.UUID) ([]*models.CostSchema, *models.ExpenseServiceError) GetCostsByTripIDAndContributorID(ctx context.Context, tripId *uuid.UUID, contributorId *uuid.UUID) ([]*models.CostSchema, *models.ExpenseServiceError) GetCostsByContributorID(ctx context.Context, contributorId *uuid.UUID) ([]*models.CostSchema, *models.ExpenseServiceError) GetCostsByCostCategoryID(ctx context.Context, costCategoryId *uuid.UUID) ([]*models.CostSchema, *models.ExpenseServiceError) GetCostContributors(ctx context.Context, costId *uuid.UUID) ([]*models.CostContributionSchema, *models.ExpenseServiceError) AddCostContributor(ctx context.Context, contributor *models.CostContributionSchema) *models.ExpenseServiceError UpdateCostContributor(ctx context.Context, contributor *models.CostContributionSchema) *models.ExpenseServiceError GetCostCreditor(ctx context.Context, id *uuid.UUID) (*models.UserSchema, *models.ExpenseServiceError) AddCostContributorTx(ctx context.Context, tx pgx.Tx, contributor *models.CostContributionSchema) *models.ExpenseServiceError DeleteCostContributionTx(ctx context.Context, tx pgx.Tx, contributorId *uuid.UUID, costId *uuid.UUID) *models.ExpenseServiceError GetTotalCostByTripID(ctx context.Context, tripId *uuid.UUID) (*decimal.Decimal, *models.ExpenseServiceError) GetTotalCostByCostCategoryID(ctx context.Context, costCategoryId *uuid.UUID) (*decimal.Decimal, *models.ExpenseServiceError) DeleteCostContributions(ctx context.Context, costId *uuid.UUID) *models.ExpenseServiceError GetCostsByCostCategoryIDAndContributorID(ctx context.Context, costCategoryId *uuid.UUID, userId *uuid.UUID) ([]*models.CostSchema, *models.ExpenseServiceError) GetCostOverview(ctx context.Context, userId *uuid.UUID) (*models.CostOverviewDTO, *models.ExpenseServiceError) }
type CostRepository ¶
type CostRepository struct {
DatabaseMgr managers.DatabaseMgr
}
func (*CostRepository) AddCostContributor ¶
func (cr *CostRepository) AddCostContributor(ctx context.Context, contributor *models.CostContributionSchema) *models.ExpenseServiceError
AddCostContributor adds a cost contributor to the database table user_cost_association
func (*CostRepository) AddCostContributorTx ¶
func (*CostRepository) AddCostContributorTx(ctx context.Context, tx pgx.Tx, contributor *models.CostContributionSchema) *models.ExpenseServiceError
func (*CostRepository) AddTx ¶
func (*CostRepository) AddTx(ctx context.Context, tx pgx.Tx, cost *models.CostSchema) *models.ExpenseServiceError
func (*CostRepository) DeleteCostContributionTx ¶
func (*CostRepository) DeleteCostContributionTx(ctx context.Context, tx pgx.Tx, contributorId *uuid.UUID, costId *uuid.UUID) *models.ExpenseServiceError
func (*CostRepository) DeleteCostContributions ¶
func (cr *CostRepository) DeleteCostContributions(ctx context.Context, costId *uuid.UUID) *models.ExpenseServiceError
DeleteCostContributions deletes all cost contributions associated with a cost
func (*CostRepository) DeleteTx ¶
func (*CostRepository) DeleteTx(ctx context.Context, tx pgx.Tx, costId *uuid.UUID) *models.ExpenseServiceError
func (*CostRepository) GetCostByID ¶
func (cr *CostRepository) GetCostByID(ctx context.Context, costId *uuid.UUID) (*models.CostSchema, *models.ExpenseServiceError)
GetCostByID returns a cost by its id
func (*CostRepository) GetCostContributors ¶
func (cr *CostRepository) GetCostContributors(ctx context.Context, costId *uuid.UUID) ([]*models.CostContributionSchema, *models.ExpenseServiceError)
GetCostContributors returns all cost contributors associated with a cost
func (*CostRepository) GetCostCreditor ¶
func (cr *CostRepository) GetCostCreditor(ctx context.Context, id *uuid.UUID) (*models.UserSchema, *models.ExpenseServiceError)
func (*CostRepository) GetCostOverview ¶
func (cr *CostRepository) GetCostOverview(ctx context.Context, userId *uuid.UUID) (*models.CostOverviewDTO, *models.ExpenseServiceError)
GetCostOverview returns an overview of all costs
func (*CostRepository) GetCostsByContributorID ¶
func (cr *CostRepository) GetCostsByContributorID(ctx context.Context, contributorId *uuid.UUID) ([]*models.CostSchema, *models.ExpenseServiceError)
GetCostsByContributorID returns all costs associated with a contributor
func (*CostRepository) GetCostsByCostCategoryID ¶
func (cr *CostRepository) GetCostsByCostCategoryID(ctx context.Context, costCategoryId *uuid.UUID) ([]*models.CostSchema, *models.ExpenseServiceError)
GetCostsByCostCategoryID returns all costs associated with a cost category
func (*CostRepository) GetCostsByCostCategoryIDAndContributorID ¶
func (cr *CostRepository) GetCostsByCostCategoryIDAndContributorID(ctx context.Context, costCategoryId *uuid.UUID, contributorId *uuid.UUID) ([]*models.CostSchema, *models.ExpenseServiceError)
GetCostsByCostCategoryIDAndContributorID returns all costs associated with a cost category and a contributor
func (*CostRepository) GetCostsByTripID ¶
func (cr *CostRepository) GetCostsByTripID(ctx context.Context, tripId *uuid.UUID) ([]*models.CostSchema, *models.ExpenseServiceError)
GetCostsByTripID returns all costs associated with a trip through the cost_category database table
func (*CostRepository) GetCostsByTripIDAndContributorID ¶
func (cr *CostRepository) GetCostsByTripIDAndContributorID(ctx context.Context, tripId *uuid.UUID, contributorId *uuid.UUID) ([]*models.CostSchema, *models.ExpenseServiceError)
GetCostsByTripIDAndContributorID returns all costs associated with a trip and a contributor
func (*CostRepository) GetTotalCostByCostCategoryID ¶
func (cr *CostRepository) GetTotalCostByCostCategoryID(ctx context.Context, costCategoryId *uuid.UUID) (*decimal.Decimal, *models.ExpenseServiceError)
GetTotalCostByCostCategoryID returns the total cost of a cost category
func (*CostRepository) GetTotalCostByTripID ¶
func (cr *CostRepository) GetTotalCostByTripID(ctx context.Context, tripId *uuid.UUID) (*decimal.Decimal, *models.ExpenseServiceError)
GetTotalCostByTripID returns the total cost of a trip
func (*CostRepository) UpdateCostContributor ¶
func (cr *CostRepository) UpdateCostContributor(ctx context.Context, contributor *models.CostContributionSchema) *models.ExpenseServiceError
UpdateCostContributor updates a cost contributor in the database table user_cost_association
func (*CostRepository) UpdateTx ¶
func (*CostRepository) UpdateTx(ctx context.Context, tx pgx.Tx, cost *models.CostSchema) *models.ExpenseServiceError
type DebtRepo ¶
type DebtRepo interface { GetDebtById(ctx context.Context, debtId *uuid.UUID) (*models.DebtSchema, *models.ExpenseServiceError) AddTx(ctx context.Context, tx pgx.Tx, debt *models.DebtSchema) *models.ExpenseServiceError UpdateTx(ctx context.Context, tx pgx.Tx, debt *models.DebtSchema) *models.ExpenseServiceError DeleteTx(ctx context.Context, tx pgx.Tx, debtId *uuid.UUID) *models.ExpenseServiceError GetDebtByCreditorId(ctx context.Context, creditorId *uuid.UUID) (*models.DebtSchema, *models.ExpenseServiceError) GetDebtByCreditorIdAndDebtorIdAndTripIdTx(ctx context.Context, tx pgx.Tx, creditorId *uuid.UUID, debtorId *uuid.UUID, tripId *uuid.UUID) (*models.DebtSchema, *models.ExpenseServiceError) GetDebtEntriesByTripId(ctx context.Context, tripId *uuid.UUID) ([]*models.DebtSchema, *models.ExpenseServiceError) GetCumulativeDebtByUserIDAndTripID(ctx context.Context, userId *uuid.UUID, tripId *uuid.UUID) (decimal.Decimal, *models.ExpenseServiceError) GetCumulativeCreditByUserIDAndTripID(ctx context.Context, userId *uuid.UUID, tripId *uuid.UUID) (decimal.Decimal, *models.ExpenseServiceError) CalculateDebt(ctx context.Context, tx pgx.Tx, creditorId *uuid.UUID, debtorId *uuid.UUID, tripId *uuid.UUID, amountToAdd decimal.Decimal) *models.ExpenseServiceError GetDebtEntries(ctx context.Context, id *uuid.UUID) ([]*models.DebtDTO, *models.ExpenseServiceError) }
type DebtRepository ¶
type DebtRepository struct {
DatabaseMgr *managers.DatabaseManager
}
func (*DebtRepository) AddTx ¶
func (*DebtRepository) AddTx(ctx context.Context, tx pgx.Tx, debt *models.DebtSchema) *models.ExpenseServiceError
func (*DebtRepository) CalculateDebt ¶
func (*DebtRepository) DeleteTx ¶
func (*DebtRepository) DeleteTx(ctx context.Context, tx pgx.Tx, debtId *uuid.UUID) *models.ExpenseServiceError
func (*DebtRepository) GetCumulativeCreditByUserIDAndTripID ¶
func (*DebtRepository) GetCumulativeDebtByUserIDAndTripID ¶
func (*DebtRepository) GetDebtByCreditorId ¶
func (dr *DebtRepository) GetDebtByCreditorId(ctx context.Context, creditorId *uuid.UUID) (*models.DebtSchema, *models.ExpenseServiceError)
func (*DebtRepository) GetDebtByCreditorIdAndDebtorIdAndTripIdTx ¶
func (*DebtRepository) GetDebtByCreditorIdAndDebtorIdAndTripIdTx(ctx context.Context, tx pgx.Tx, creditorId *uuid.UUID, debtorId *uuid.UUID, tripId *uuid.UUID) (*models.DebtSchema, *models.ExpenseServiceError)
func (*DebtRepository) GetDebtById ¶
func (dr *DebtRepository) GetDebtById(ctx context.Context, debtId *uuid.UUID) (*models.DebtSchema, *models.ExpenseServiceError)
func (*DebtRepository) GetDebtEntries ¶
func (dr *DebtRepository) GetDebtEntries(ctx context.Context, userId *uuid.UUID) ([]*models.DebtDTO, *models.ExpenseServiceError)
func (*DebtRepository) GetDebtEntriesByTripId ¶
func (dr *DebtRepository) GetDebtEntriesByTripId(ctx context.Context, tripId *uuid.UUID) ([]*models.DebtSchema, *models.ExpenseServiceError)
func (*DebtRepository) UpdateTx ¶
func (*DebtRepository) UpdateTx(ctx context.Context, tx pgx.Tx, debt *models.DebtSchema) *models.ExpenseServiceError
type TransactionRepo ¶
type TransactionRepo interface { AddTx(ctx context.Context, tx pgx.Tx, transaction *models.TransactionSchema) *models.ExpenseServiceError UpdateTx(ctx context.Context, tx pgx.Tx, transaction *models.TransactionSchema) *models.ExpenseServiceError DeleteTx(ctx context.Context, tx pgx.Tx, transactionId *uuid.UUID) *models.ExpenseServiceError GetAllTransactions(ctx context.Context, userId *uuid.UUID) ([]*models.TransactionSchema, *models.ExpenseServiceError) GetTransactionsByTripIdAndUserId(ctx context.Context, tripId *uuid.UUID, userId *uuid.UUID) ([]*models.TransactionSchema, *models.ExpenseServiceError) GetTransactionById(ctx context.Context, id *uuid.UUID) (*models.TransactionSchema, *models.ExpenseServiceError) }
type TransactionRepository ¶
type TransactionRepository struct {
DatabaseMgr managers.DatabaseMgr
}
func (*TransactionRepository) AddTx ¶
func (*TransactionRepository) AddTx(ctx context.Context, tx pgx.Tx, transaction *models.TransactionSchema) *models.ExpenseServiceError
func (*TransactionRepository) DeleteTx ¶
func (*TransactionRepository) DeleteTx(ctx context.Context, tx pgx.Tx, transactionId *uuid.UUID) *models.ExpenseServiceError
func (*TransactionRepository) GetAllTransactions ¶
func (tr *TransactionRepository) GetAllTransactions(ctx context.Context, userId *uuid.UUID) ([]*models.TransactionSchema, *models.ExpenseServiceError)
func (*TransactionRepository) GetTransactionById ¶
func (tr *TransactionRepository) GetTransactionById(ctx context.Context, id *uuid.UUID) (*models.TransactionSchema, *models.ExpenseServiceError)
func (*TransactionRepository) GetTransactionsByTripIdAndUserId ¶
func (tr *TransactionRepository) GetTransactionsByTripIdAndUserId(ctx context.Context, tripId *uuid.UUID, userId *uuid.UUID) ([]*models.TransactionSchema, *models.ExpenseServiceError)
func (*TransactionRepository) UpdateTx ¶
func (*TransactionRepository) UpdateTx(ctx context.Context, tx pgx.Tx, transaction *models.TransactionSchema) *models.ExpenseServiceError
type TripRepo ¶
type TripRepo interface { GetTripById(ctx context.Context, tripId *uuid.UUID) (*models.TripSchema, *models.ExpenseServiceError) GetTripsByUserId(ctx context.Context, userId *uuid.UUID) ([]*models.TripSchema, *models.ExpenseServiceError) CreateTrip(ctx context.Context, trip *models.TripSchema) *models.ExpenseServiceError UpdateTrip(ctx context.Context, trip *models.TripSchema) *models.ExpenseServiceError DeleteTrip(ctx context.Context, tripId *uuid.UUID) *models.ExpenseServiceError AddUserToTrip(ctx context.Context, trip *models.TripSchema, invitedUserId *uuid.UUID, isCreator bool) *models.ExpenseServiceError AcceptTripInvite(ctx context.Context, tripId *uuid.UUID, userId *uuid.UUID) *models.ExpenseServiceError DeclineTripInvite(ctx context.Context, tripId *uuid.UUID, userId *uuid.UUID) *models.ExpenseServiceError ValidateIfTripExists(ctx context.Context, tripId *uuid.UUID) *models.ExpenseServiceError ValidateIfUserHasAccepted(ctx context.Context, tripId *uuid.UUID, userId *uuid.UUID) *models.ExpenseServiceError GetTripParticipant(ctx context.Context, tripId *uuid.UUID, userId *uuid.UUID) (*models.UserTripSchema, *models.ExpenseServiceError) GetTripParticipants(ctx context.Context, tripId *uuid.UUID) ([]*models.UserTripSchema, *models.ExpenseServiceError) GetAcceptedTripParticipants(ctx context.Context, tripId *uuid.UUID) ([]*models.UserTripSchema, *models.ExpenseServiceError) UpdateTripParticipant(ctx context.Context, userTrip *models.UserTripSchema) *models.ExpenseServiceError UpdateTripParticipantTx(ctx context.Context, tx pgx.Tx, userTrip *models.UserTripSchema) *models.ExpenseServiceError }
type TripRepository ¶
type TripRepository struct {
DatabaseMgr managers.DatabaseMgr
}
func (*TripRepository) AcceptTripInvite ¶
func (tr *TripRepository) AcceptTripInvite(ctx context.Context, tripId *uuid.UUID, userId *uuid.UUID) *models.ExpenseServiceError
func (*TripRepository) AddUserToTrip ¶
func (tr *TripRepository) AddUserToTrip(ctx context.Context, trip *models.TripSchema, invitedUserId *uuid.UUID, isCreator bool) *models.ExpenseServiceError
func (*TripRepository) CheckIfUserIsInvited ¶
func (tr *TripRepository) CheckIfUserIsInvited(ctx context.Context, tripId *uuid.UUID, userId *uuid.UUID) (bool, *models.ExpenseServiceError)
func (*TripRepository) CreateTrip ¶
func (tr *TripRepository) CreateTrip(ctx context.Context, trip *models.TripSchema) *models.ExpenseServiceError
func (*TripRepository) DeclineTripInvite ¶
func (tr *TripRepository) DeclineTripInvite(ctx context.Context, tripId *uuid.UUID, userId *uuid.UUID) *models.ExpenseServiceError
func (*TripRepository) DeleteTrip ¶
func (tr *TripRepository) DeleteTrip(ctx context.Context, tripId *uuid.UUID) *models.ExpenseServiceError
func (*TripRepository) GetAcceptedTripParticipants ¶
func (tr *TripRepository) GetAcceptedTripParticipants(ctx context.Context, tripId *uuid.UUID) ([]*models.UserTripSchema, *models.ExpenseServiceError)
func (*TripRepository) GetTripById ¶
func (tr *TripRepository) GetTripById(ctx context.Context, tripId *uuid.UUID) (*models.TripSchema, *models.ExpenseServiceError)
func (*TripRepository) GetTripParticipant ¶
func (tr *TripRepository) GetTripParticipant(ctx context.Context, tripId *uuid.UUID, userId *uuid.UUID) (*models.UserTripSchema, *models.ExpenseServiceError)
func (*TripRepository) GetTripParticipants ¶
func (tr *TripRepository) GetTripParticipants(ctx context.Context, tripId *uuid.UUID) ([]*models.UserTripSchema, *models.ExpenseServiceError)
func (*TripRepository) GetTripsByUserId ¶
func (tr *TripRepository) GetTripsByUserId(ctx context.Context, userId *uuid.UUID) ([]*models.TripSchema, *models.ExpenseServiceError)
func (*TripRepository) UpdateTrip ¶
func (tr *TripRepository) UpdateTrip(ctx context.Context, trip *models.TripSchema) *models.ExpenseServiceError
func (*TripRepository) UpdateTripParticipant ¶
func (tr *TripRepository) UpdateTripParticipant(ctx context.Context, userTrip *models.UserTripSchema) *models.ExpenseServiceError
func (*TripRepository) UpdateTripParticipantTx ¶
func (*TripRepository) UpdateTripParticipantTx(ctx context.Context, tx pgx.Tx, userTrip *models.UserTripSchema) *models.ExpenseServiceError
func (*TripRepository) ValidateIfTripExists ¶
func (tr *TripRepository) ValidateIfTripExists(ctx context.Context, tripId *uuid.UUID) *models.ExpenseServiceError
func (*TripRepository) ValidateIfUserHasAccepted ¶
func (tr *TripRepository) ValidateIfUserHasAccepted(ctx context.Context, tripId *uuid.UUID, userId *uuid.UUID) *models.ExpenseServiceError
type UserRepo ¶
type UserRepo interface { GetUserById(ctx context.Context, userId *uuid.UUID) (*models.UserSchema, *models.ExpenseServiceError) GetUserBySchema(ctx context.Context, user *models.UserSchema) (*models.UserSchema, *models.ExpenseServiceError) GetUserByContext(ctx context.Context) (*models.UserSchema, *models.ExpenseServiceError) CreateUser(ctx context.Context, user *models.UserSchema) *models.ExpenseServiceError UpdateUser(ctx context.Context, user *models.UserSchema) *models.ExpenseServiceError DeleteUser(ctx context.Context, userId *uuid.UUID) *models.ExpenseServiceError UpdatePassword(ctx context.Context, userId *uuid.UUID, newPassword string) *models.ExpenseServiceError ValidateIfUserExists(ctx context.Context, userId *uuid.UUID) *models.ExpenseServiceError ValidateIfUserIsActivated(ctx context.Context, userId *uuid.UUID) *models.ExpenseServiceError ValidateEmailExistence(ctx context.Context, email string) *models.ExpenseServiceError ValidateUsernameExistence(ctx context.Context, username string) *models.ExpenseServiceError ActivateUser(ctx context.Context, userId *uuid.UUID) *models.ExpenseServiceError CreateTokenByUserIdAndType(ctx context.Context, userId *uuid.UUID, tokenType string) (*models.TokenSchema, *models.ExpenseServiceError) DeleteTokenByUserIdAndType(ctx context.Context, userId *uuid.UUID, tokenType string) (int64, *models.ExpenseServiceError) GetTokenByUserIdAndType(ctx context.Context, userId *uuid.UUID, tokenType string) (*models.TokenSchema, *models.ExpenseServiceError) GetTokenByTokenAndType(ctx context.Context, token, tokenType string) (*models.TokenSchema, *models.ExpenseServiceError) ConfirmTokenByType(ctx context.Context, userId *uuid.UUID, tokenType string) *models.ExpenseServiceError FindUsersLikeUsername(ctx context.Context, username string) ([]*models.UserSchema, *models.ExpenseServiceError) }
type UserRepository ¶
type UserRepository struct {
DatabaseMgr managers.DatabaseMgr
}
func (*UserRepository) ActivateUser ¶
func (ur *UserRepository) ActivateUser(ctx context.Context, userId *uuid.UUID) *models.ExpenseServiceError
func (*UserRepository) ConfirmTokenByType ¶
func (ur *UserRepository) ConfirmTokenByType(ctx context.Context, userId *uuid.UUID, tokenType string) *models.ExpenseServiceError
func (*UserRepository) CreateTokenByUserIdAndType ¶
func (ur *UserRepository) CreateTokenByUserIdAndType(ctx context.Context, userId *uuid.UUID, tokenType string) (*models.TokenSchema, *models.ExpenseServiceError)
func (*UserRepository) CreateUser ¶
func (ur *UserRepository) CreateUser(ctx context.Context, user *models.UserSchema) *models.ExpenseServiceError
func (*UserRepository) DeleteTokenByUserIdAndType ¶
func (ur *UserRepository) DeleteTokenByUserIdAndType(ctx context.Context, userId *uuid.UUID, tokenType string) (int64, *models.ExpenseServiceError)
func (*UserRepository) DeleteUser ¶
func (ur *UserRepository) DeleteUser(ctx context.Context, userId *uuid.UUID) *models.ExpenseServiceError
func (*UserRepository) FindUsersLikeUsername ¶
func (ur *UserRepository) FindUsersLikeUsername(ctx context.Context, username string) ([]*models.UserSchema, *models.ExpenseServiceError)
func (*UserRepository) GetTokenByTokenAndType ¶
func (ur *UserRepository) GetTokenByTokenAndType(ctx context.Context, token, tokenType string) (*models.TokenSchema, *models.ExpenseServiceError)
func (*UserRepository) GetTokenByUserIdAndType ¶
func (ur *UserRepository) GetTokenByUserIdAndType(ctx context.Context, userId *uuid.UUID, tokenType string) (*models.TokenSchema, *models.ExpenseServiceError)
func (*UserRepository) GetUserByContext ¶
func (ur *UserRepository) GetUserByContext(ctx context.Context) (*models.UserSchema, *models.ExpenseServiceError)
func (*UserRepository) GetUserById ¶
func (ur *UserRepository) GetUserById(ctx context.Context, userId *uuid.UUID) (*models.UserSchema, *models.ExpenseServiceError)
func (*UserRepository) GetUserBySchema ¶
func (ur *UserRepository) GetUserBySchema(ctx context.Context, request *models.UserSchema) (*models.UserSchema, *models.ExpenseServiceError)
func (*UserRepository) UpdatePassword ¶
func (ur *UserRepository) UpdatePassword(ctx context.Context, userId *uuid.UUID, newPassword string) *models.ExpenseServiceError
func (*UserRepository) UpdateUser ¶
func (ur *UserRepository) UpdateUser(ctx context.Context, user *models.UserSchema) *models.ExpenseServiceError
func (*UserRepository) ValidateEmailExistence ¶
func (ur *UserRepository) ValidateEmailExistence(ctx context.Context, email string) *models.ExpenseServiceError
func (*UserRepository) ValidateIfUserExists ¶
func (ur *UserRepository) ValidateIfUserExists(ctx context.Context, userId *uuid.UUID) *models.ExpenseServiceError
func (*UserRepository) ValidateIfUserIsActivated ¶
func (ur *UserRepository) ValidateIfUserIsActivated(ctx context.Context, userId *uuid.UUID) *models.ExpenseServiceError
func (*UserRepository) ValidateUsernameExistence ¶
func (ur *UserRepository) ValidateUsernameExistence(ctx context.Context, username string) *models.ExpenseServiceError