{
  "schemes": [
    "https"
  ],
  "swagger": "2.0",
  "info": {
    "description": "Dashboard statistics and search.",
    "title": "Search API",
    "contact": {},
    "version": "1.0.0"
  },
  "host": "api.catazenta.com",
  "basePath": "/v1",
  "paths": {
    "/dashboards/activity": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Get recent sync history and next scheduled sync",
        "produces": [
          "application/json"
        ],
        "tags": [
          "dashboard"
        ],
        "summary": "Get dashboard sync activity",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "allOf": [
                {
                  "$ref": "#/definitions/response.SuccessResponse"
                },
                {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/definitions/DashboardActivityResponse"
                    }
                  }
                }
              ]
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/response.ErrorResponse"
            }
          }
        }
      }
    },
    "/dashboards/my-tasks": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Get tasks assigned to the authenticated user",
        "produces": [
          "application/json"
        ],
        "tags": [
          "dashboard"
        ],
        "summary": "Get current user's tasks",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "allOf": [
                {
                  "$ref": "#/definitions/response.SuccessResponse"
                },
                {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/definitions/MyTasksResponse"
                    }
                  }
                }
              ]
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/response.ErrorResponse"
            }
          }
        }
      }
    },
    "/dashboards/stats": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Get aggregated statistics for all entities",
        "produces": [
          "application/json"
        ],
        "tags": [
          "dashboard"
        ],
        "summary": "Get dashboard statistics",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "allOf": [
                {
                  "$ref": "#/definitions/response.SuccessResponse"
                },
                {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/definitions/DashboardStatsResponse"
                    }
                  }
                }
              ]
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/response.ErrorResponse"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "response.Error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "field": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "response.ErrorResponse": {
      "type": "object",
      "properties": {
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/response.Error"
          }
        },
        "message": {
          "type": "string"
        },
        "success": {
          "type": "boolean"
        }
      }
    },
    "response.SuccessResponse": {
      "type": "object",
      "properties": {
        "data": {},
        "success": {
          "type": "boolean"
        }
      }
    },
    "AssetTypeDTO": {
      "type": "object",
      "properties": {
        "color": {
          "type": "string"
        },
        "count": {
          "type": "integer"
        },
        "label": {
          "type": "string"
        },
        "storageBytes": {
          "type": "integer"
        },
        "type": {
          "type": "string"
        }
      }
    },
    "ChannelReadinessDTO": {
      "type": "object",
      "properties": {
        "channelId": {
          "type": "string"
        },
        "channelName": {
          "type": "string"
        },
        "percentage": {
          "type": "number"
        }
      }
    },
    "CompletenessRangeDTO": {
      "type": "object",
      "properties": {
        "color": {
          "type": "string"
        },
        "count": {
          "type": "integer"
        },
        "label": {
          "type": "string"
        },
        "max": {
          "type": "integer"
        },
        "min": {
          "type": "integer"
        }
      }
    },
    "CountStatsDTO": {
      "type": "object",
      "properties": {
        "total": {
          "type": "integer"
        }
      }
    },
    "DashboardActivityResponse": {
      "type": "object",
      "properties": {
        "errors": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "nextScheduledSync": {
          "type": "string"
        },
        "syncHistory": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SyncHistoryDTO"
          }
        }
      }
    },
    "DashboardStatsDTO": {
      "type": "object",
      "properties": {
        "attributes": {
          "$ref": "#/definitions/CountStatsDTO"
        },
        "catalogCompleteness": {
          "type": "number"
        },
        "catalogCompletenessChange": {
          "type": "number"
        },
        "categories": {
          "$ref": "#/definitions/CountStatsDTO"
        },
        "channelReadiness": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ChannelReadinessDTO"
          }
        },
        "channels": {
          "$ref": "#/definitions/CountStatsDTO"
        },
        "digitalAssets": {
          "$ref": "#/definitions/DigitalAssetStatsDTO"
        },
        "jobs": {
          "$ref": "#/definitions/JobStatsDTO"
        },
        "productFamily": {
          "$ref": "#/definitions/CountStatsDTO"
        },
        "productHealth": {
          "$ref": "#/definitions/ProductHealthStatsDTO"
        },
        "products": {
          "$ref": "#/definitions/ProductStatsDTO"
        },
        "syncSuccessRate": {
          "type": "number"
        },
        "syncSuccessRateChange": {
          "type": "number"
        },
        "tasks": {
          "$ref": "#/definitions/TaskStatsDTO"
        },
        "translationCoverage": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TranslationCoverageDTO"
          }
        },
        "variants": {
          "$ref": "#/definitions/VariantStatsDTO"
        }
      }
    },
    "DashboardStatsResponse": {
      "type": "object",
      "properties": {
        "errors": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "stats": {
          "$ref": "#/definitions/DashboardStatsDTO"
        }
      }
    },
    "DigitalAssetStatsDTO": {
      "type": "object",
      "properties": {
        "breakdown": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AssetTypeDTO"
          }
        },
        "totalStorageBytes": {
          "type": "integer"
        },
        "usedStorageBytes": {
          "type": "integer"
        }
      }
    },
    "DonutSegmentDTO": {
      "type": "object",
      "properties": {
        "color": {
          "type": "string"
        },
        "percentage": {
          "type": "number"
        }
      }
    },
    "JobStatsDTO": {
      "type": "object",
      "properties": {
        "import": {
          "type": "integer"
        },
        "total": {
          "type": "integer"
        }
      }
    },
    "MissingAttributeDTO": {
      "type": "object",
      "properties": {
        "color": {
          "type": "string"
        },
        "count": {
          "type": "integer"
        },
        "label": {
          "type": "string"
        }
      }
    },
    "MyTasksResponse": {
      "type": "object",
      "properties": {
        "errors": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "myTasks": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TaskItemDTO"
          }
        }
      }
    },
    "ProductHealthCardDTO": {
      "type": "object",
      "properties": {
        "activePercentage": {
          "type": "number"
        },
        "completenessDistribution": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CompletenessRangeDTO"
          }
        },
        "donutSegments": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DonutSegmentDTO"
          }
        },
        "topMissingAttributes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/MissingAttributeDTO"
          }
        }
      }
    },
    "ProductHealthStatsDTO": {
      "type": "object",
      "properties": {
        "product": {
          "$ref": "#/definitions/ProductHealthCardDTO"
        },
        "variant": {
          "$ref": "#/definitions/ProductHealthCardDTO"
        }
      }
    },
    "ProductStatsDTO": {
      "type": "object",
      "properties": {
        "approved": {
          "type": "integer"
        },
        "archived": {
          "type": "integer"
        },
        "draft": {
          "type": "integer"
        },
        "inReview": {
          "type": "integer"
        },
        "thisMonth": {
          "type": "integer"
        },
        "total": {
          "type": "integer"
        }
      }
    },
    "SyncHistoryDTO": {
      "type": "object",
      "properties": {
        "channelName": {
          "type": "string"
        },
        "failedCount": {
          "type": "integer"
        },
        "id": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "timeAgo": {
          "type": "string"
        }
      }
    },
    "TaskItemDTO": {
      "type": "object",
      "properties": {
        "category": {
          "type": "string"
        },
        "dueDate": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "priority": {
          "type": "string"
        },
        "title": {
          "type": "string"
        }
      }
    },
    "TaskStatsDTO": {
      "type": "object",
      "properties": {
        "overdue": {
          "type": "integer"
        },
        "total": {
          "type": "integer"
        }
      }
    },
    "TranslationCoverageDTO": {
      "type": "object",
      "properties": {
        "flagCode": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "locale": {
          "type": "string"
        },
        "percentage": {
          "type": "number"
        }
      }
    },
    "VariantStatsDTO": {
      "type": "object",
      "properties": {
        "approved": {
          "type": "integer"
        },
        "archived": {
          "type": "integer"
        },
        "draft": {
          "type": "integer"
        },
        "inReview": {
          "type": "integer"
        },
        "total": {
          "type": "integer"
        }
      }
    }
  },
  "securityDefinitions": {
    "BearerAuth": {
      "type": "apiKey",
      "name": "Authorization",
      "in": "header"
    }
  }
}