feat: implement split history view, jira tickets and description

This commit is contained in:
Jose Luis Montañes Ojados
2026-01-28 16:37:31 +01:00
parent d33b4e8676
commit 0b091c93db
9 changed files with 266 additions and 29 deletions

View File

@@ -40,10 +40,12 @@ func GetServices() ([]models.Service, error) {
return services, nil
}
func LockService(serviceName, user string) error {
func LockService(serviceName, user, jiraTickets, description string) error {
reqBody := models.LockRequest{
ServiceName: serviceName,
User: user,
JiraTickets: jiraTickets,
Description: description,
}
data, _ := json.Marshal(reqBody)

View File

@@ -4,16 +4,20 @@ import "time"
// Service represents a microservice that can be locked.
type Service struct {
Name string `json:"name"`
IsLocked bool `json:"is_locked"`
LockedBy string `json:"locked_by,omitempty"`
LockedAt time.Time `json:"locked_at,omitempty"`
Name string `json:"name"`
IsLocked bool `json:"is_locked"`
LockedBy string `json:"locked_by,omitempty"`
LockedAt time.Time `json:"locked_at,omitempty"`
JiraTickets string `json:"jira_tickets,omitempty"`
Description string `json:"description,omitempty"`
}
// LockRequest is the payload to lock a service.
type LockRequest struct {
ServiceName string `json:"service_name"`
User string `json:"user"`
JiraTickets string `json:"jira_tickets"`
Description string `json:"description"`
}
// UnlockRequest is the payload to unlock a service.
@@ -28,4 +32,6 @@ type HistoryEntry struct {
Action string `json:"action"` // "LOCK" or "UNLOCK"
User string `json:"user"`
Timestamp time.Time `json:"timestamp"`
JiraTickets string `json:"jira_tickets,omitempty"`
Description string `json:"description,omitempty"`
}