Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
350cbc4
feat: add Application and Service models
noahmasoud May 19, 2026
a50a235
feat: add ApplicationRepository interface and implementation
noahmasoud May 19, 2026
695c0b3
Merge remote-tracking branch 'upstream/main' into feat/delete-app-end…
noahmasoud May 20, 2026
322f9b6
chore: cleanup and merge upstream
noahmasoud May 20, 2026
a64a247
feat: add UpdateStatus to ApplicationRepository
noahmasoud May 20, 2026
ba2f981
feat: add UpdateStatus to ApplicationRepository
noahmasoud May 20, 2026
c3eb275
feat: add DeleteApplication to ApplicationService
noahmasoud May 20, 2026
71aec27
feat: add DeleteApplication handler
noahmasoud May 20, 2026
ee7c4d1
feat: add DeleteApplication endpoint
noahmasoud May 20, 2026
67236c8
Merge branch 'main' into feat/delete-app-endpoint
noahmasoud May 21, 2026
a60dd7e
fix: correct UpdateStatus arg order, s.type->s.catalog_id, add servic…
noahmasoud May 21, 2026
1986ea0
feat: implement cascade delete with component orphan cleanup
noahmasoud May 21, 2026
57d7f21
Used ApplicationStatusDeleting enum for status message instead of a s…
noahmasoud May 21, 2026
72ec277
Merge upstream/main keeping delete endpoint implementation
noahmasoud May 26, 2026
0ae751a
fix: update buildServiceStatuses to use types.ApplicationService afte…
noahmasoud May 26, 2026
c24ac33
Merge branch 'main' into feat/delete-app-endpoint
noahmasoud May 26, 2026
531c94c
fix golangci-lint errors in application_service
noahmasoud May 26, 2026
a51684c
fix: remove duplicate DELETE swagger annotation and regenerate docs
noahmasoud May 26, 2026
b97f06d
fix: add blank lines before return/break for nlreturn linter
noahmasoud May 26, 2026
ac31e68
fix: add blank lines before return for nlreturn linter
noahmasoud May 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ai-services/cmd/ai-services/cmd/catalog/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,14 @@ func runAPIServer(port int, accessTTL, refreshTTL time.Duration, adminUser, admi

// Initialize application repository and service
applicationRepo := repository.NewApplicationRepository(pool)
serviceDependencyRepo := repository.NewServiceDependencyRepository(pool)
serviceRepo := repository.NewServiceRepository(pool)
depRepo := repository.NewServiceDependencyRepository(pool)
componentRepo := repository.NewComponentRepository(pool)
catalogProvider, err := catalog.NewCatalogProvider()
if err != nil {
return fmt.Errorf("failed to initialize catalog provider: %w", err)
}
applicationService := apirepository.NewApplicationService(applicationRepo, serviceDependencyRepo, componentRepo, catalogProvider)
applicationService := apirepository.NewApplicationService(applicationRepo, serviceRepo, depRepo, componentRepo, catalogProvider)

tokenMgr := auth.NewTokenManager(secretKey, accessTTL, refreshTTL)
authSvc := auth.NewAuthService(userRepo, tokenMgr, blacklist)
Expand Down
149 changes: 73 additions & 76 deletions ai-services/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,14 @@ const docTemplate = `{
"BearerAuth": []
}
],
"description": "Retrieves a single application by its unique identifier for the authenticated user",
"description": "Get detailed information about a specific application",
"produces": [
"application/json"
],
"tags": [
"Applications"
],
"summary": "Get application by ID",
"summary": "Get application details",
"parameters": [
{
"type": "string",
Expand All @@ -188,27 +188,17 @@ const docTemplate = `{
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/github_com_project-ai-services_ai-services_internal_pkg_catalog_types.Application"
}
},
"401": {
"description": "Unauthorized",
"description": "Application details",
"schema": {
"$ref": "#/definitions/internal_pkg_catalog_apiserver_handlers.ErrorResponse"
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Application not found",
"schema": {
"$ref": "#/definitions/internal_pkg_catalog_apiserver_handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/internal_pkg_catalog_apiserver_handlers.ErrorResponse"
"type": "object",
"additionalProperties": true
}
}
}
Expand All @@ -219,7 +209,7 @@ const docTemplate = `{
"BearerAuth": []
}
],
"description": "Updates the display name of an existing application",
"description": "Update an existing application's configuration",
"consumes": [
"application/json"
],
Expand All @@ -233,56 +223,25 @@ const docTemplate = `{
"parameters": [
{
"type": "string",
"description": "Application ID (UUID)",
"description": "Application ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Update request",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/internal_pkg_catalog_apiserver_handlers.UpdateApplicationRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/github_com_project-ai-services_ai-services_internal_pkg_catalog_types.Application"
}
},
"400": {
"description": "Invalid request body or name validation failed",
"description": "Application updated",
"schema": {
"$ref": "#/definitions/internal_pkg_catalog_apiserver_handlers.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/internal_pkg_catalog_apiserver_handlers.ErrorResponse"
}
},
"403": {
"description": "User doesn't own this application",
"schema": {
"$ref": "#/definitions/internal_pkg_catalog_apiserver_handlers.ErrorResponse"
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Application not found",
"schema": {
"$ref": "#/definitions/internal_pkg_catalog_apiserver_handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/internal_pkg_catalog_apiserver_handlers.ErrorResponse"
"type": "object",
"additionalProperties": true
}
}
}
Expand All @@ -293,33 +252,70 @@ const docTemplate = `{
"BearerAuth": []
}
],
"description": "Delete a specific application and all its resources",
"description": "Initiates async deletion of an application and all its associated resources",
"produces": [
"application/json"
],
"tags": [
"Applications"
],
"summary": "Delete application",
"parameters": [
{
"type": "string",
"description": "Application ID",
"description": "Application UUID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "boolean",
"description": "Skip infrastructure cleanup",
"name": "skip-cleanup",
"in": "query"
}
],
"responses": {
"200": {
"description": "Application deleted",
"202": {
"description": "Accepted",
"schema": {
"type": "object",
"additionalProperties": true
"$ref": "#/definitions/github_com_project-ai-services_ai-services_internal_pkg_catalog_apiserver_repository.DeleteApplicationResponse"
}
},
"400": {
"description": "Invalid application ID",
"schema": {
"$ref": "#/definitions/internal_pkg_catalog_apiserver_handlers.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/internal_pkg_catalog_apiserver_handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/internal_pkg_catalog_apiserver_handlers.ErrorResponse"
}
},
"404": {
"description": "Application not found",
"schema": {
"type": "object",
"additionalProperties": true
"$ref": "#/definitions/internal_pkg_catalog_apiserver_handlers.ErrorResponse"
}
},
"409": {
"description": "Application already being deleted",
"schema": {
"$ref": "#/definitions/internal_pkg_catalog_apiserver_handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/internal_pkg_catalog_apiserver_handlers.ErrorResponse"
}
}
}
Expand Down Expand Up @@ -988,6 +984,20 @@ const docTemplate = `{
}
}
},
"github_com_project-ai-services_ai-services_internal_pkg_catalog_apiserver_repository.DeleteApplicationResponse": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"message": {
"type": "string"
},
"status": {
"type": "string"
}
}
},
"github_com_project-ai-services_ai-services_internal_pkg_catalog_types.Application": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1417,19 +1427,6 @@ const docTemplate = `{
}
}
},
"internal_pkg_catalog_apiserver_handlers.UpdateApplicationRequest": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"maxLength": 100,
"minLength": 3
}
}
},
"internal_pkg_catalog_apiserver_handlers.loginReq": {
"type": "object",
"required": [
Expand Down
Loading
Loading