openapi: 3.1.0 info: title: Api version: 0.1.0 description: Couple Communication App API servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: couple description: Couple state operations - name: todos description: Heart todo operations paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check description: Returns server health status responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /couple/state: get: operationId: getCoupleState tags: [couple] summary: Get both partners' state responses: "200": description: Current couple state content: application/json: schema: $ref: "#/components/schemas/CoupleState" /couple/state/{partner}: put: operationId: updatePartnerState tags: [couple] summary: Update a partner's energy and mood parameters: - name: partner in: path required: true schema: type: string enum: [girlfriend, boyfriend] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdatePartnerStateRequest" responses: "200": description: Updated partner state content: application/json: schema: $ref: "#/components/schemas/PartnerState" /todos: get: operationId: getTodos tags: [todos] summary: Get all heart todos responses: "200": description: List of todos content: application/json: schema: type: array items: $ref: "#/components/schemas/Todo" post: operationId: createTodo tags: [todos] summary: Create a new heart todo requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateTodoRequest" responses: "201": description: Created todo content: application/json: schema: $ref: "#/components/schemas/Todo" /todos/{id}: patch: operationId: toggleTodo tags: [todos] summary: Toggle a todo's completed state parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ToggleTodoRequest" responses: "200": description: Updated todo content: application/json: schema: $ref: "#/components/schemas/Todo" delete: operationId: deleteTodo tags: [todos] summary: Delete a todo parameters: - name: id in: path required: true schema: type: integer responses: "204": description: Deleted components: schemas: HealthStatus: type: object properties: status: type: string required: - status PartnerState: type: object properties: partner: type: string enum: [girlfriend, boyfriend] energy: type: integer minimum: 0 maximum: 100 mood: type: string updatedAt: type: string format: date-time required: - partner - energy - mood - updatedAt CoupleState: type: object properties: girlfriend: $ref: "#/components/schemas/PartnerState" boyfriend: $ref: "#/components/schemas/PartnerState" required: - girlfriend - boyfriend UpdatePartnerStateRequest: type: object properties: energy: type: integer minimum: 0 maximum: 100 mood: type: string required: - energy - mood Todo: type: object properties: id: type: integer text: type: string completed: type: boolean completedBy: type: string nullable: true createdBy: type: string createdAt: type: string format: date-time completedAt: type: string format: date-time nullable: true required: - id - text - completed - completedBy - createdBy - createdAt - completedAt CreateTodoRequest: type: object properties: text: type: string createdBy: type: string enum: [girlfriend, boyfriend] required: - text - createdBy ToggleTodoRequest: type: object properties: completed: type: boolean completedBy: type: string nullable: true required: - completed - completedBy