This commit is contained in:
2026-10-11 16:00:18 +07:00
parent 504b49f7cc
commit 030ca56900
77 changed files with 793 additions and 638 deletions
+6 -6
View File
@@ -29,7 +29,7 @@ func NewApplicationsRepo(pool *pgxpool.Pool) *ApplicationsRepo {
// AddApplication stores an application for a team.
func (r *ApplicationsRepo) AddApplication(
ctx context.Context,
teamID int,
teamID string,
name string,
image string,
fileType string,
@@ -55,9 +55,9 @@ func (r *ApplicationsRepo) AddApplication(
// GetApplicationsByTeamIDsAndState returns applications matching team IDs and state.
func (r *ApplicationsRepo) GetApplicationsByTeamIDsAndState(
ctx context.Context,
teamIDs []int,
teamIDs []string,
state string,
) (map[int][]*repos.Application, error) {
) (map[string][]*repos.Application, error) {
rows, err := r.pool.Query(
ctx,
`SELECT
@@ -75,7 +75,7 @@ func (r *ApplicationsRepo) GetApplicationsByTeamIDsAndState(
}
defer rows.Close()
res := make(map[int][]*repos.Application, len(teamIDs))
res := make(map[string][]*repos.Application, len(teamIDs))
for rows.Next() {
application := &repos.Application{}
err := rows.Scan(
@@ -99,7 +99,7 @@ func (r *ApplicationsRepo) GetApplicationsByTeamIDsAndState(
// UpdateApplicationStatus changes an application's status.
func (r *ApplicationsRepo) UpdateApplicationStatus(
ctx context.Context,
teamID int,
teamID string,
name string,
status string,
) error {
@@ -123,7 +123,7 @@ func (r *ApplicationsRepo) UpdateApplicationStatus(
}
// DeleteApplicationByTeamIDAndName removes an application by team and name.
func (r *ApplicationsRepo) DeleteApplicationByTeamIDAndName(ctx context.Context, teamID int, name string) error {
func (r *ApplicationsRepo) DeleteApplicationByTeamIDAndName(ctx context.Context, teamID string, name string) error {
tag, err := r.pool.Exec(
ctx,
`DELETE FROM applications