diff --git a/open-api.json b/open-api.json index 99e9b15..592076d 100644 --- a/open-api.json +++ b/open-api.json @@ -489,7 +489,45 @@ "tags": ["organization"], "responses": { "200": { - "description": "Returns the list of all organizations" + "description": "Returns the list of all organizations", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "uuid": { + "type": "string", + "example": "f9339c7a-749a-408e-a03e-a22cd87fe3a1" + }, + "username": { + "type": "string", + "example": "org-username" + }, + "primary_name": { + "type": "string", + "example": "Primary Organization Name" + }, + "profile_image": { + "type": "string", + "nullable": true, + "example": "http://example.com/image.jpg" + }, + "established_date": { + "type": "string", + "format": "date", + "example": "2024-01-01" + }, + "national_id": { + "type": "string", + "example": "123456789" + } + } + } + } + } + } } } }, @@ -501,6 +539,7 @@ } ], "requestBody": { + "required": true, "content": { "application/json": { "schema": { @@ -529,6 +568,7 @@ }, "profile_image": { "type": "string", + "nullable": true, "description": "The url of a profile image", "example": "https://..." }, @@ -548,6 +588,7 @@ "required": [ "username", "name", + "primary_name", "established_date", "national_id" ] @@ -577,14 +618,51 @@ "required": true, "name": "organization_uuid", "schema": { - "type": "string" + "type": "string", + "description": "The UUID of the organization to view" } } ], "tags": ["organization"], "responses": { "200": { - "description": "Returns the organization with id you specified" + "description": "Returns the organization with id you specified", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "username": { + "type": "string", + "description": "The unique username of the organization", + "example": "github" + }, + "name": { + "type": "string", + "description": "The full name of the organization", + "example": "GitHub Organization" + }, + "profile_image": { + "type": "string", + "nullable": true, + "description": "The URL of the organization's profile image", + "example": "https://assets.natiq.com/example-profile-image.jpg" + }, + "established_date": { + "type": "string", + "format": "date", + "description": "The established date of the organization", + "example": "2008-04-10" + }, + "national_id": { + "type": "string", + "description": "The national ID of the organization", + "example": "12345678911" + } + } + } + } + } } } }, @@ -601,11 +679,15 @@ "required": true, "name": "organization_uuid", "schema": { - "type": "string" - } + "type": "string", + "format": "uuid", + "example": "e0e1f46b-3b8c-4f9b-8c6f-467d31c60987" + }, + "description": "The unique identifier of the organization to be edited" } ], "requestBody": { + "required": true, "content": { "application/json": { "schema": { @@ -627,11 +709,14 @@ }, "profile_image": { "type": "string", + "format": "url", + "nullable": true, "description": "The url of a profile image", "example": "https://..." }, "established_date": { "type": "string", + "format": "date", "description": "The established date of organization(company), minYear is 200 year past", "example": "1988-03-12" }, @@ -642,7 +727,13 @@ "maxLength": 11, "example": "12345678911" } - } + }, + "required": [ + "username", + "name", + "established_date", + "national_id" + ] } } } @@ -667,19 +758,93 @@ "required": true, "name": "organization_uuid", "schema": { - "type": "string" - } + "type": "string", + "format": "uuid" + }, + "description": "The unique identifier (UUID) of the organization to be deleted" } ], "tags": ["organization"], "responses": { "200": { - "description": "The organization with id you specified deleted" + "description": "Mushaf deleted successfully", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Deleted" + } + } + } + }, + "404": { + "description": "Organization not found", + "content": { + "application/json": { + "example": { + "error": "NOT_FOUND", + "message": "Not found!." + } + } + } } } } }, "/organization/name": { + "get": { + "description": "Returns the list of organization names for the specified organization UUID", + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": ["organization"], + "responses": { + "200": { + "description": "Returns the list of organization names for the specified UUID", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The organization name", + "example": "Example Organization" + }, + "language": { + "type": "string", + "description": "Language of the organization name", + "example": "en" + }, + "uuid": { + "type": "string", + "format": "uuid", + "description": "UUID of the name entry", + "example": "123e4567-e89b-12d3-a456-426614174001" + } + } + } + } + } + } + }, + "404": { + "description": "Organization not found", + "content": { + "application/json": { + "example": { + "error": "NOT_FOUND", + "message": "Not found!." + } + } + } + } + } + }, "post": { "description": "Add the organization name in another language", "security": [ @@ -688,6 +853,7 @@ } ], "requestBody": { + "required": true, "content": { "application/json": { "schema": { @@ -695,19 +861,20 @@ "properties": { "name": { "type": "string", - "description": "New name", + "description": "The new name of the organization", "example": "ali", "minLength": 1, "maxLength": 16 }, "language": { "type": "string", - "description": "Language", + "description": "The language code for the name (2 characters, e.g., 'en' or 'ar')", "minLength": 2, "maxLength": 2, "example": "en" } - } + }, + "required": ["name", "language"] } } } @@ -715,7 +882,20 @@ "tags": ["organization"], "responses": { "200": { - "description": "Organization name in another language added" + "description": "The organization name in another language has been successfully added", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Edited" + } + } + } + } + } } } } @@ -734,14 +914,40 @@ "required": true, "name": "name_uuid", "schema": { - "type": "string" + "type": "string", + "format": "uuid" } } ], "tags": ["organization"], "responses": { "200": { - "description": "Returns the organization name in another language with id you specified" + "description": "Returns the organization name in another language with the specified ID", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The organization name", + "example": "Example Organization" + }, + "language": { + "type": "string", + "description": "Language of the organization name", + "example": "en" + }, + "uuid": { + "type": "string", + "format": "uuid", + "description": "UUID of the organization name entry", + "example": "123e4567-e89b-12d3-a456-426614174000" + } + } + } + } + } } } }, @@ -758,11 +964,13 @@ "required": true, "name": "name_uuid", "schema": { - "type": "string" + "type": "string", + "format": "uuid" } } ], "requestBody": { + "required": true, "content": { "application/json": { "schema": { @@ -775,7 +983,8 @@ "minLength": 1, "maxLength": 16 } - } + }, + "required": ["name"] } } } @@ -783,7 +992,20 @@ "tags": ["organization"], "responses": { "200": { - "description": "The organization name in another language with id you specified edited" + "description": "The organization name in another language with the specified ID has been edited successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "example": "Edited" + } + } + } + } + } } } }, @@ -808,6 +1030,17 @@ "responses": { "200": { "description": "The organization name in another language with id you specified deleted" + }, + "404": { + "description": "Organization not found", + "content": { + "application/json": { + "example": { + "error": "NOT_FOUND", + "message": "Not found!." + } + } + } } } } @@ -1097,11 +1330,6 @@ "type": "string", "description": "The source of the mushaf's text.", "example": "tanzil" - }, - "bismillah_text": { - "type": "string", - "description": "Optional custom text for Bismillah.", - "example": "In the name of Allah, the Most Gracious, the Most Merciful" } } } @@ -1164,10 +1392,6 @@ "source": { "type": "string", "description": "Source of the mushaf" - }, - "bismillah_text": { - "type": "string", - "description": "The Bismillah text in the mushaf" } } }, @@ -1175,8 +1399,7 @@ "uuid": "ccbd8806-53e8-4658-8281-3aed10b50898", "short_name": "hafs", "name": "Hafs an Asem", - "source": "tanzil", - "bismillah_text": "بِسْمِ ٱللَّهِ ٱلرَّحْمَـٰنِ ٱلرَّحِيمِ" + "source": "tanzil" } } } @@ -1235,11 +1458,6 @@ "type": "string", "description": "The source of the mushaf's text.", "example": "tanzil" - }, - "bismillah_text": { - "type": "string", - "description": "Optional custom text for Bismillah.", - "example": "بسم الله الرحمن الرحيم" } }, "required": ["short_name", "name", "source"] @@ -1971,7 +2189,31 @@ "tags": ["quran"], "responses": { "200": { - "description": "Returns the ayahs list" + "description": "Returns the ayahs list", + "content": { + "application/json": { + "example": [ + { + "number": 1, + "uuid": "123e4567-e89b-12d3-a456-426614174000", + "sajdah": null, + "text": "In the name of Allah, the Most Gracious, the Most Merciful.", + "words": ["In", "the", "name", "of", "Allah", "..."] + } + ] + } + } + }, + "404": { + "description": "Ayah not found", + "content": { + "application/json": { + "example": { + "error": "NOT_FOUND", + "message": "Not found!." + } + } + } } } }, @@ -1983,14 +2225,15 @@ } ], "requestBody": { + "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { - "surah_id": { + "surah_uuid": { "type": "string", - "description": "The surah_uuid", + "description": "The UUID of the target surah", "example": "f9339c7a-749a-408e-a03e-a22cd87fe3a1" }, "sajdeh": { @@ -1998,12 +2241,13 @@ "description": "Ayah have sajdeh or no", "example": "vajib | mustahab | null" }, - "ayah_number": { - "type": "number", - "description": "Number of ayah", - "example": 1 + "text": { + "type": "string", + "description": "The text of the ayah.", + "example": "In the name of Allah, the Most Gracious, the Most Merciful." } - } + }, + "required": ["surah_uuid", "text"] } } } @@ -2032,7 +2276,33 @@ "tags": ["quran"], "responses": { "200": { - "description": "Returns the single ayah" + "description": "Returns the single ayah", + "content": { + "application/json": { + "example": { + "uuid": "ae819d56-5071-4ca1-b964-9e170fac1118", + "mushaf": "uuid-of-mushaf", + "surah": "uuid-of-surah", + "ayah_number": 1, + "sajdah": null, + "text": "هُدًى وَبُشْرَىٰ لِلْمُؤْمِنِينَ", + "words": [ + { + "uuid": "5743e20c-ed23-443c-be2d-7ee41fa1032e", + "word": "هُدًى" + }, + { + "uuid": "e3d68b7c-ef58-4598-9c4a-c96fdfe8f7b4", + "word": "وَبُشْرَىٰ" + }, + { + "uuid": "b1088c7c-8eae-42a7-9741-5c37b3d11526", + "word": "لِلْمُؤْمِنِينَ" + } + ] + } + } + } } } }, @@ -2049,30 +2319,27 @@ "required": true, "name": "ayah_uuid", "schema": { - "type": "string" + "type": "string", + "description": "The unique identifier for the ayah" } } ], "requestBody": { + "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { - "surah_id": { - "type": "string", - "description": "The surah_uuid", - "example": "f9339c7a-749a-408e-a03e-a22cd87fe3a1" + "ayah_number": { + "type": "integer", + "description": "Number of ayah", + "example": 1 }, "sajdeh": { "type": "string", "description": "Ayah have sajdeh or no", "example": "vajib | mustahab | null" - }, - "ayah_number": { - "type": "number", - "description": "Number of ayah", - "example": 1 } } } @@ -2284,7 +2551,8 @@ "required": false, "name": "from", "schema": { - "type": "number" + "type": "integer", + "format": "int64" } }, @@ -2758,7 +3026,8 @@ "required": false, "name": "from", "schema": { - "type": "number" + "type": "integer", + "format": "int64" } },