Changeset 0.8.2 (#45)

This commit is contained in:
2026-02-22 01:56:58 +00:00
parent c0d95fd7f5
commit 5111d595f7
14 changed files with 642 additions and 6 deletions

View File

@@ -138,6 +138,7 @@ func (h *TeamHandler) CreateTeam(c *gin.Context) {
}
c.JSON(http.StatusCreated, gin.H{"id": id, "name": req.Name})
AuditLog(c, "team.create", "team", id, map[string]interface{}{"name": req.Name})
}
// ── Admin: Get Team ─────────────────────────
@@ -246,6 +247,7 @@ func (h *TeamHandler) UpdateTeam(c *gin.Context) {
}
c.JSON(http.StatusOK, gin.H{"ok": true})
AuditLog(c, "team.update", "team", teamID, nil)
}
// ── Admin: Delete Team ──────────────────────
@@ -264,6 +266,7 @@ func (h *TeamHandler) DeleteTeam(c *gin.Context) {
}
c.JSON(http.StatusOK, gin.H{"ok": true})
AuditLog(c, "team.delete", "team", teamID, nil)
}
// ── Members: List ───────────────────────────
@@ -351,6 +354,9 @@ func (h *TeamHandler) AddMember(c *gin.Context) {
}
c.JSON(http.StatusCreated, gin.H{"id": id})
AuditLog(c, "team.add_member", "team", getTeamID(c), map[string]interface{}{
"user_id": req.UserID, "role": req.Role,
})
}
// ── Members: Update Role ────────────────────
@@ -377,6 +383,9 @@ func (h *TeamHandler) UpdateMember(c *gin.Context) {
}
c.JSON(http.StatusOK, gin.H{"ok": true})
AuditLog(c, "team.update_member", "team", getTeamID(c), map[string]interface{}{
"member_id": memberID, "role": req.Role,
})
}
// ── Members: Remove ─────────────────────────
@@ -395,6 +404,9 @@ func (h *TeamHandler) RemoveMember(c *gin.Context) {
}
c.JSON(http.StatusOK, gin.H{"ok": true})
AuditLog(c, "team.remove_member", "team", getTeamID(c), map[string]interface{}{
"member_id": memberID,
})
}
// ── User: My Teams ──────────────────────────