{
  "openapi": "3.0.0",
  "info": {
    "title": "tdf-notification",
    "version": "0.0.1",
    "description": "tdf_notification",
    "contact": {
      "name": "Johana Zedron",
      "email": "johana.zedron@nomadesoft.com.ar"
    }
  },
  "paths": {
    "/internal/notifications/multiple": {
      "post": {
        "x-controller-name": "InternalNotificationsController",
        "x-operation-name": "createMultipleNotifications",
        "tags": [
          "InternalNotificationsController"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Create multiple notifications"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "source",
                  "type",
                  "title",
                  "channels",
                  "recipients"
                ],
                "properties": {
                  "source": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "channels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "recipients": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "user_id",
                        "name",
                        "lastname",
                        "email_enabled",
                        "sms_enabled",
                        "document_number",
                        "body"
                      ],
                      "properties": {
                        "user_id": {
                          "type": "number"
                        },
                        "email": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "lastname": {
                          "type": "string"
                        },
                        "email_enabled": {
                          "type": "boolean"
                        },
                        "sms_enabled": {
                          "type": "boolean"
                        },
                        "document_number": {
                          "type": "string"
                        },
                        "body": {
                          "type": "string"
                        },
                        "appointment": {
                          "type": "object"
                        }
                      }
                    }
                  },
                  "idempotency_key": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "required": true
        },
        "operationId": "InternalNotificationsController.createMultipleNotifications"
      }
    },
    "/internal/notifications/{page}/{limit}": {
      "get": {
        "x-controller-name": "InternalNotificationsController",
        "x-operation-name": "getAdminNotifications",
        "tags": [
          "InternalNotificationsController"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Paginated admin notifications"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "path",
            "schema": {
              "type": "number"
            },
            "required": true
          },
          {
            "name": "limit",
            "in": "path",
            "schema": {
              "type": "number"
            },
            "required": true
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "InternalNotificationsController.getAdminNotifications"
      }
    },
    "/internal/notifications": {
      "post": {
        "x-controller-name": "InternalNotificationsController",
        "x-operation-name": "createNotification",
        "tags": [
          "InternalNotificationsController"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Create notification"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "source",
                  "type",
                  "title",
                  "body",
                  "channels",
                  "recipients"
                ],
                "properties": {
                  "source": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "body": {
                    "type": "string"
                  },
                  "channels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "recipients": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "user_id",
                        "name",
                        "lastname",
                        "email_enabled",
                        "sms_enabled",
                        "document_number"
                      ],
                      "properties": {
                        "user_id": {
                          "type": "number"
                        },
                        "email": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "lastname": {
                          "type": "string"
                        },
                        "email_enabled": {
                          "type": "boolean"
                        },
                        "sms_enabled": {
                          "type": "boolean"
                        },
                        "document_number": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "attachments": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "path"
                      ],
                      "properties": {
                        "path": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "appointment": {
                    "type": "object"
                  },
                  "idempotency_key": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "required": true
        },
        "operationId": "InternalNotificationsController.createNotification"
      }
    },
    "/notifications/read-all": {
      "patch": {
        "x-controller-name": "NotificationsController",
        "x-operation-name": "markAllAsRead",
        "tags": [
          "NotificationsController"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Mark all notifications as read"
                }
              }
            }
          }
        },
        "operationId": "NotificationsController.markAllAsRead"
      }
    },
    "/notifications/unread-count": {
      "get": {
        "x-controller-name": "NotificationsController",
        "x-operation-name": "getUnreadCount",
        "tags": [
          "NotificationsController"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Unread notifications count"
                }
              }
            }
          }
        },
        "operationId": "NotificationsController.getUnreadCount"
      }
    },
    "/notifications/{recipientId}/read": {
      "patch": {
        "x-controller-name": "NotificationsController",
        "x-operation-name": "markAsRead",
        "tags": [
          "NotificationsController"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Mark notification as read"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "recipientId",
            "in": "path",
            "schema": {
              "type": "number"
            },
            "required": true
          }
        ],
        "operationId": "NotificationsController.markAsRead"
      }
    },
    "/notifications": {
      "get": {
        "x-controller-name": "NotificationsController",
        "x-operation-name": "getNotifications",
        "tags": [
          "NotificationsController"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "User notifications"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "number"
            }
          }
        ],
        "operationId": "NotificationsController.getNotifications"
      }
    }
  },
  "servers": [
    {
      "url": "http://notificationbackend.nomadesoft.com.ar"
    }
  ]
}