Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CategoryData ¶
type CategoryData interface { GetDataByID(projectId primitive.ObjectID, id primitive.ObjectID) models.Category GetCategories(projectId primitive.ObjectID) []models.Category AddCategory(userId primitive.ObjectID, projectId primitive.ObjectID, expense *models.Category) primitive.ObjectID UpdateCategory(projectId primitive.ObjectID, id primitive.ObjectID, category *models.Category) DeleteCategory(projectId primitive.ObjectID, id primitive.ObjectID) }
CategoryData main interface
type Database ¶
type Database interface { NewExpenseData() ExpenseData NewCategoryData() CategoryData NewUserData() UserData NewProjectData() ProjectData }
Database interface
func NewDatabase ¶
func NewDatabase(cfg *config.Configuration, client *mongo.Client) Database
NewDatabase creates connection to database
type ExpenseData ¶
type ExpenseData interface { GetLastHistory(projectId primitive.ObjectID, count int64, date time.Time) []models.Expense GetDataByID(projectId primitive.ObjectID, id primitive.ObjectID) models.Expense AddExpense(userId primitive.ObjectID, projectId primitive.ObjectID, expense *models.Expense) primitive.ObjectID DeleteExpense(projectId primitive.ObjectID, expenseId primitive.ObjectID) GetSummary(projectId primitive.ObjectID) []models.CategorySummary IsAnyInCategory(projectId primitive.ObjectID, categoryId primitive.ObjectID) bool }
ExpenseData main interface
type ProjectData ¶
type ProjectData interface { AddProject(ownerId primitive.ObjectID, project *models.Project) primitive.ObjectID GetProject(id primitive.ObjectID) models.Project GetAssignedProjects(userId primitive.ObjectID) []models.Project GetProjectsForOwner(ownerId primitive.ObjectID) []models.Project UpdateProject(ownerId primitive.ObjectID, id primitive.ObjectID, model *models.Project) models.Project DisableProject(projectId primitive.ObjectID) AssignUser(projectId primitive.ObjectID, userId primitive.ObjectID) UnAssignUser(projectId primitive.ObjectID, userId primitive.ObjectID) IsUserAssignedToProject(projectId primitive.ObjectID, userId primitive.ObjectID) bool IsOwnerOfProject(projectId primitive.ObjectID, userId primitive.ObjectID) bool }
Click to show internal directories.
Click to hide internal directories.