diff --git a/controllers/activityController.js b/controllers/activityController.js index 26e26cb..73db32e 100644 --- a/controllers/activityController.js +++ b/controllers/activityController.js @@ -3,7 +3,6 @@ const httpStatus = require("../helpers/httpStatus"); const { Activity } = require("../models"); class ActivityController { - static async getActivities(req, res) { try { const getAllAct = await Activity.findAll({ diff --git a/documentation/activityDocumentation.js b/documentation/activityDocumentation.js new file mode 100644 index 0000000..ee9fca3 --- /dev/null +++ b/documentation/activityDocumentation.js @@ -0,0 +1,278 @@ +/** + * @swagger + * components: + * schemas: + * Activities: + * type: object + * required: + * - name + * properties: + * id: + * type: string + * description: The auto-generated id of the Activity + * name: + * type: string + * description: Activity Name + * content: + * type: string + * description: Activity Content + * image: + * type: string + * description: image url + * example: + * id: 1 + * name: Support group + * content: Something about that + * image: some-url + * Errors: + * type: object + * required: + * - statusCode + * - message + * properties: + * statusCode: + * type: number + * description: Http Status Code + * message: + * type: string + * description: Message return to the User + * example: + * statusCode: 500 + * message: Something went wrong, the server was unable to complete your request + * + */ + +/** + * @swagger + * tags: + * name: Activities + * description: CRUD Routes of Activities, only available for Admin + */ + +/** + * @swagger + * /activities/all: + * get: + * summary: Returns the list of all activities + * tags: [Activities] + * security: + * responses: + * 200: + * description: OK + * content: + * application/json: + * schema: + * type: array + * items: + * $ref: '#/components/schemas/Activities' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + +/** + * @swagger + * /activities/{name}: + * get: + * summary: Obtain the activities by Name + * tags: [Activities] + * security: + * - bearerAuth: [] + * parameters: + * - in: path + * name: name + * schema: + * type: string + * required: true + * description: The activity name + * responses: + * 200: + * description: ok + * content: + * application/json: + * schema: + * type: object + * 401: + * description: Unauthorized + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + +/** + * @swagger + * /activities: + * post: + * summary: Create a new activity + * tags: [Activities] + * security: + * - bearerAuth: [] + * requestBody: + * required: true + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/Activities' + * responses: + * 200: + * description: The Activity was successfully created + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/Activities' + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 401: + * description: Unauthorized + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + +/** + * @swagger + * /activities/{id}: + * put: + * summary: Update the activity by the id + * tags: [Activities] + * security: + * - bearerAuth: [] + * parameters: + * - in: path + * name: id + * schema: + * type: number + * required: true + * description: The activity id + * requestBody: + * required: true + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/Activities' + * responses: + * 200: + * description: The activity was updated + * content: + * application/json: + * schema: + * type: object + * 404: + * description: The activity was not found + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 401: + * description: Unauthorized + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + +/** + * @swagger + * /activities/{name}: + * delete: + * summary: Remove the activity by Name + * tags: [Activities] + * security: + * - bearerAuth: [] + * parameters: + * - in: path + * name: name + * schema: + * type: string + * required: true + * description: The activity id + * + * responses: + * 200: + * description: The activity was deleted + * 404: + * description: The activity was not found + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 401: + * description: Unauthorized + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ diff --git a/documentation/authDocumentation.js b/documentation/authDocumentation.js new file mode 100644 index 0000000..efaffe9 --- /dev/null +++ b/documentation/authDocumentation.js @@ -0,0 +1,129 @@ +/** + * @swagger + * components: + * schemas: + * Auth: + * type: object + * required: + * - name + * properties: + * id: + * type: string + * description: The auto-generated id of the User + * firstName: + * type: string + * description: User Name + * lastName: + * type: string + * description: User surname + * email: + * type: string + * description: email + * password: + * type: string + * description: password account + * example: + * firstName: Usuario + * lastName: Apellido + * email: example@test.com + * password: 123456 + * Errors: + * type: object + * required: + * - statusCode + * - message + * properties: + * statusCode: + * type: number + * description: Http Status Code + * message: + * type: string + * description: Message return to the User + * example: + * statusCode: 500 + * message: Something went wrong, the server was unable to complete your request + * + */ + +/** + * @swagger + * tags: + * name: Users + * description: Authentication Routes of Users, only available for users + */ + +/** + * @swagger + * /auth/login: + * post: + * summary: authentication for user + * tags: [Auth] + * security: + * requestBody: + * required: true + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/Auth' + * responses: + * 200: + * description: The Authentication was successfully created + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/Auth' + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + +/** + * @swagger + * /auth/register: + * post: + * summary: Register for user + * tags: [Auth] + * security: + * requestBody: + * required: true + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/Auth' + * responses: + * 200: + * description: The Register was successfully created + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/Auth' + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ diff --git a/documentation/commentsDocumentation.js b/documentation/commentsDocumentation.js new file mode 100644 index 0000000..ab5e1b8 --- /dev/null +++ b/documentation/commentsDocumentation.js @@ -0,0 +1,101 @@ +/** + * @swagger + * components: + * schemas: + * Comments: + * type: object + * required: + * - name + * properties: + * id: + * type: string + * description: The auto-generated id of the Comment + * body: + * type: string + * description: contain comment + * newsId: + * type: number + * description: new id association + * example: + * id: 1 + * body: Comment + * newId: 1 + * Errors: + * type: object + * required: + * - statusCode + * - message + * properties: + * statusCode: + * type: number + * description: Http Status Code + * message: + * type: string + * description: Message return to the User + * example: + * statusCode: 500 + * message: Something went wrong, the server was unable to complete your request + * + */ + +/** + * @swagger + * tags: + * name: Comments + * description: Update one Comments + */ + +/** + * @swagger + * /comments: + * put: + * summary: Create a new Comment + * tags: [Comments] + * security: + * - bearerAuth: [] + * parameters: + * - in: path + * name: id + * schema: + * type: number + * required: true + * description: The comment id + * requestBody: + * required: true + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/Comments' + * responses: + * 200: + * description: The Comment was successfully created + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/Comments' + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 401: + * description: Unauthorized + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + diff --git a/documentation/contactsDocumentation.js b/documentation/contactsDocumentation.js new file mode 100644 index 0000000..6a6e18c --- /dev/null +++ b/documentation/contactsDocumentation.js @@ -0,0 +1,137 @@ +/** + * @swagger + * components: + * schemas: + * Contacts: + * type: object + * required: + * - name + * properties: + * id: + * type: string + * description: The auto-generated id of the Contact + * name: + * type: string + * description: contact Name + * phone: + * type: number + * description: contact number + * email: + * type: string + * description: contact email + * message: + * type: string + * description: content message + * example: + * id: 1 + * name: User name + * phone: 111111111 + * email : example@mail.com + * message : contenido del mensaje + * Errors: + * type: object + * required: + * - statusCode + * - message + * properties: + * statusCode: + * type: number + * description: Http Status Code + * message: + * type: string + * description: Message return to the User + * example: + * statusCode: 500 + * message: Something went wrong, the server was unable to complete your request + * + */ + +/** + * @swagger + * tags: + * name: Contacts + * description: Obtain all contacts and Create contact + */ + +/** + * @swagger + * /contacts: + * get: + * summary: Returns the list of all contacts + * tags: [Contacts] + * security: + * - bearerAuth: [] + * responses: + * 200: + * description: OK + * content: + * application/json: + * schema: + * type: array + * items: + * $ref: '#/components/schemas/Contacts' + * 401: + * description: Unauthorized + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + +/** + * @swagger + * /contacts: + * post: + * summary: Create a new contact + * tags: [Contacts] + * security: + * - bearerAuth: [] + * requestBody: + * required: true + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/Contacts' + * responses: + * 200: + * description: The Contact was successfully created + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/Contacts' + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 401: + * description: Unauthorized + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + diff --git a/documentation/membersDocumentation.js b/documentation/membersDocumentation.js new file mode 100644 index 0000000..61e4cdc --- /dev/null +++ b/documentation/membersDocumentation.js @@ -0,0 +1,264 @@ +/** + * @swagger + * components: + * schemas: + * Members: + * type: object + * required: + * - name + * properties: + * id: + * type: string + * description: The auto-generated id of the Member + * name: + * type: string + * description: name Member + * facebookUrl: + * type: string + * description: facebook url + * instagramUrl: + * type: string + * description: instagram url + * linkedinUrl: + * type: string + * description: linkedin url + * image: + * type: string + * description: image url + * description: + * type: string + * description: member description + * example: + * id: 1 + * name: name Member + * facebookUrl: url + * instagramUrl: url + * linkedirUrl: url + * image: url + * description: member is new + * Errors: + * type: object + * required: + * - statusCode + * - message + * properties: + * statusCode: + * type: number + * description: Http Status Code + * message: + * type: string + * description: Message return to the User + * example: + * statusCode: 500 + * message: Something went wrong, the server was unable to complete your request + * + */ + +/** + * @swagger + * tags: + * name: Members + * description: CRUD Routes of Members, only available for Admin + */ +/** + * @swagger + * /members: + * get: + * summary: Returns the list of all Members + * tags: [Members] + * security: + * - bearerAuth: [] + * responses: + * 200: + * description: OK + * content: + * application/json: + * schema: + * type: array + * items: + * $ref: '#/components/schemas/Members' + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + +/** + * @swagger + * /members/{id}: + * get: + * summary: Search the member by the id + * tags: [Members] + * security: + * - bearerAuth: [] + * parameters: + * - in: path + * name: id + * schema: + * type: number + * required: true + * description: The member id + * responses: + * 200: + * description: ok + * content: + * application/json: + * schema: + * type: object + * 404: + * description: The member was not found + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 401: + * description: Unauthorized + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + +/** + * @swagger + * /members/{id}: + * delete: + * summary: Delete the member by the id + * tags: [Members] + * security: + * - bearerAuth: [] + * parameters: + * - in: path + * name: id + * schema: + * type: number + * required: true + * description: The member id + * responses: + * 200: + * description: The member was deleted + * content: + * application/json: + * schema: + * type: object + * 404: + * description: The member was not found + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 401: + * description: Unauthorized + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + +/** + * @swagger + * /members: + * post: + * summary: Create the new member + * tags: [Members] + * security: + * - bearerAuth: [] + * requestBody: + * required: true + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/Members' + * responses: + * 200: + * description: The member was created + * content: + * application/json: + * schema: + * type: object + * 404: + * description: The member was not found + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 401: + * description: Unauthorized + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + diff --git a/documentation/newsDocumentation.js b/documentation/newsDocumentation.js new file mode 100644 index 0000000..75fbae8 --- /dev/null +++ b/documentation/newsDocumentation.js @@ -0,0 +1,328 @@ +/** + * @swagger + * components: + * schemas: + * News: + * type: object + * required: + * - name + * properties: + * id: + * type: string + * description: The auto-generated id of the New + * name: + * type: string + * description: New Name + * image: + * type: string + * description: image url + * content: + * type: string + * description: New Content + * categoryId: + * type: number + * description: Category id association + * type: + * type: string + * description: new type + * example: + * id: 1 + * name: new Notice + * image: some-url + * content: Something about that + * categoryId: 1 + * type: production + * Errors: + * type: object + * required: + * - statusCode + * - message + * properties: + * statusCode: + * type: number + * description: Http Status Code + * message: + * type: string + * description: Message return to the User + * example: + * statusCode: 500 + * message: Something went wrong, the server was unable to complete your request + * + */ + +/** + * @swagger + * tags: + * name: News + * description: CRUD Routes of News, only available for Admin + */ + +/** + * @swagger + * /news: + * get: + * summary: Returns the list of all News + * tags: [News] + * security: + * responses: + * 200: + * description: OK + * content: + * application/json: + * schema: + * type: array + * items: + * $ref: '#/components/schemas/News' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + +/** + * @swagger + * /news/{id}/comments: + * get: + * summary: Returns of News by id + * tags: [News] + * security: + * parameters: + * - in: path + * name: id + * schema: + * type: string + * required: true + * description: The new id + * responses: + * 200: + * description: OK + * content: + * application/json: + * schema: + * type: array + * items: + * $ref: '#/components/schemas/News' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + +/** + * @swagger + * /News/{id}: + * get: + * summary: Obtain the New by id + * tags: [News] + * security: + * - bearerAuth: [] + * parameters: + * - in: path + * name: id + * schema: + * type: string + * required: true + * description: The new id + * responses: + * 200: + * description: ok + * content: + * application/json: + * schema: + * type: object + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 401: + * description: Unauthorized + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + +/** + * @swagger + * /news: + * post: + * summary: Create a new news + * tags: [News] + * security: + * - bearerAuth: [] + * requestBody: + * required: true + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/News' + * responses: + * 200: + * description: The new was successfully created + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/News' + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 401: + * description: Unauthorized + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + +/** + * @swagger + * /news/{id}: + * put: + * summary: Update the New by the id + * tags: [News] + * security: + * - bearerAuth: [] + * parameters: + * - in: path + * name: id + * schema: + * type: number + * required: true + * description: The New id + * requestBody: + * required: true + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/News' + * responses: + * 200: + * description: The New was updated + * content: + * application/json: + * schema: + * type: object + * 404: + * description: The New was not found + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 401: + * description: Unauthorized + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + +/** + * @swagger + * /news/{id}: + * delete: + * summary: Remove the News by id + * tags: [News] + * security: + * - bearerAuth: [] + * parameters: + * - in: path + * name: id + * schema: + * type: string + * required: true + * description: The News id + * + * responses: + * 200: + * description: The News was deleted + * 404: + * description: The News was not found + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 401: + * description: Unauthorized + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + diff --git a/documentation/organizationDocumentation.js b/documentation/organizationDocumentation.js new file mode 100644 index 0000000..50ad6c0 --- /dev/null +++ b/documentation/organizationDocumentation.js @@ -0,0 +1,166 @@ +/** + * @swagger + * components: + * schemas: + * Organizations: + * type: object + * required: + * - name + * properties: + * id: + * type: number + * description: The auto-generated id of the Organization + * name: + * type: string + * description: Organization Name + * image: + * type: string + * description: image url + * address: + * type: string + * description: organization address + * phone: + * type: number + * description: Organization phone + * email: + * type: string + * description: Organization email + * welcomeText: + * type: string + * description: welcome text for organization + * aboutUsText: + * type: string + * description: organization message + * facebookUrl: + * type: string + * description: facebook url + * instagramUrl: + * type: string + * description: instagram url + * linkedinUrl: + * type: string + * description: linkedin url + * example: + * id: 1 + * name: Organization + * image: some-url + * address: street 123 + * phone: 111223344 + * email: organization@mail.com + * welcomeText: welcome + * aboutUsText: about + * facebookUrl: url + * instagramUrl: url + * linkedirUrl: url + * Errors: + * type: object + * required: + * - statusCode + * - message + * properties: + * statusCode: + * type: number + * description: Http Status Code + * message: + * type: string + * description: Message return to the User + * example: + * statusCode: 500 + * message: Something went wrong, the server was unable to complete your request + * + */ + +/** + * @swagger + * tags: + * name: Organizations + * description: CRUD Routes of Organizations, only available for Admin + */ + +/** + * @swagger + * /organizations/public: + * get: + * summary: Returns the list of organizations + * tags: [Organizations] + * security: + * responses: + * 200: + * description: OK + * content: + * application/json: + * schema: + * type: array + * items: + * $ref: '#/components/schemas/Organizations' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + +/** + * @swagger + * /organizations/public/{id}: + * post: + * summary: Update the organization by the id + * tags: [Organizations] + * security: + * - bearerAuth: [] + * parameters: + * - in: path + * name: id + * schema: + * type: number + * required: true + * description: The organization id + * requestBody: + * required: true + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/Organizations' + * responses: + * 200: + * description: The organization was updated + * content: + * application/json: + * schema: + * type: object + * 404: + * description: The organization was not found + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 401: + * description: Unauthorized + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ diff --git a/documentation/slidesDocumentation.js b/documentation/slidesDocumentation.js new file mode 100644 index 0000000..e7d8795 --- /dev/null +++ b/documentation/slidesDocumentation.js @@ -0,0 +1,253 @@ +/** + * @swagger + * components: + * schemas: + * Slides: + * type: object + * required: + * - name + * properties: + * id: + * type: string + * description: The auto-generated id of the Slides + * imageUrl: + * type: string + * description: image url + * text: + * type: string + * description: Slides description + * order: + * type: number + * description: Slides order + * organizationId: + * type: number + * description: organization id association + * example: + * id: 1 + * image: some-url + * text: Support group + * order: 1 + * organizationId: 1 + * Errors: + * type: object + * required: + * - statusCode + * - message + * properties: + * statusCode: + * type: number + * description: Http Status Code + * message: + * type: string + * description: Message return to the User + * example: + * statusCode: 500 + * message: Something went wrong, the server was unable to complete your request + * + */ + +/** + * @swagger + * tags: + * name: Slides + * description: CRUD Routes of Slides, only available for Admin + */ + +/** + * @swagger + * /slides/: + * get: + * summary: Obtain the slides + * tags: [Slides] + * security: + * - bearerAuth: [] + * responses: + * 200: + * description: ok + * content: + * application/json: + * schema: + * type: object + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 401: + * description: Unauthorized + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + +/** + * @swagger + * /slides/{id}: + * get: + * summary: Obtain one slides by id + * tags: [Slides] + * security: + * - bearerAuth: [] + * parameters: + * - in: path + * name: id + * schema: + * type: string + * required: true + * description: The slides id + * responses: + * 200: + * description: The Slides was successfully + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/Slides' + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 401: + * description: Unauthorized + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + +/** + * @swagger + * /slides: + * post: + * summary: Create a new slides + * tags: [Slides] + * security: + * - bearerAuth: [] + * requestBody: + * required: true + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/Slides' + * responses: + * 200: + * description: The Slides was successfully created + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/Slides' + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 401: + * description: Unauthorized + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + +/** + * @swagger + * /slides/{id}: + * put: + * summary: Update the slides by the id + * tags: [Slides] + * security: + * - bearerAuth: [] + * parameters: + * - in: path + * name: id + * schema: + * type: number + * required: true + * description: The slides id + * requestBody: + * required: true + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/Slides' + * responses: + * 200: + * description: The slides was updated + * content: + * application/json: + * schema: + * type: object + * 404: + * description: The slides was not found + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 401: + * description: Unauthorized + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + diff --git a/documentation/testimonialDocumentation.js b/documentation/testimonialDocumentation.js new file mode 100644 index 0000000..9baa894 --- /dev/null +++ b/documentation/testimonialDocumentation.js @@ -0,0 +1,293 @@ +/** + * @swagger + * components: + * schemas: + * Testimonials: + * type: object + * required: + * - name + * properties: + * id: + * type: string + * description: The auto-generated id of the Testimonials + * name: + * type: string + * description: testimonial name + * image: + * type: string + * description: image url + * content: + * type: string + * description: testimonial content + * example: + * id: 1 + * text: testimonial name + * image: some-url + * order: description + * Errors: + * type: object + * required: + * - statusCode + * - message + * properties: + * statusCode: + * type: number + * description: Http Status Code + * message: + * type: string + * description: Message return to the User + * example: + * statusCode: 500 + * message: Something went wrong, the server was unable to complete your request + * + */ + +/** + * @swagger + * tags: + * name: Testimonials + * description: CRUD Routes of Testimonials, only available for Admin + */ + +/** + * @swagger + * /testimonials/all: + * get: + * summary: Obtain the testimonials + * tags: [Testimonials] + * security: + * responses: + * 200: + * description: ok + * content: + * application/json: + * schema: + * type: object + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + +/** + * @swagger + * /testimonials/{id}: + * get: + * summary: Obtain one testimonials by id + * tags: [Testimonials] + * security: + * - bearerAuth: [] + * parameters: + * - in: path + * name: id + * schema: + * type: string + * required: true + * description: The testimonials id + * responses: + * 200: + * description: The Testimonials was successfully + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/Testimonials' + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 401: + * description: Unauthorized + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + +/** + * @swagger + * /testimonials/{id}: + * put: + * summary: Update the testimonials by the id + * tags: [Testimonials] + * security: + * - bearerAuth: [] + * parameters: + * - in: path + * name: id + * schema: + * type: number + * required: true + * description: The testimonials id + * requestBody: + * required: true + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/Testimonials' + * responses: + * 200: + * description: The testimonials was updated + * content: + * application/json: + * schema: + * type: object + * 404: + * description: The testimonials was not found + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 401: + * description: Unauthorized + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + +/** + * @swagger + * /testimonials: + * post: + * summary: Create a new testimonials + * tags: [Testimonials] + * security: + * - bearerAuth: [] + * requestBody: + * required: true + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/Testimonials' + * responses: + * 200: + * description: The Testimonials was successfully created + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/Testimonials' + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 401: + * description: Unauthorized + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + +/** + * @swagger + * /testimonials/{id}: + * delete: + * summary: Remove the activity by id + * tags: [Testimonials] + * security: + * - bearerAuth: [] + * parameters: + * - in: path + * name: id + * schema: + * type: string + * required: true + * description: The activity id + * + * responses: + * 200: + * description: The activity was deleted + * 404: + * description: The activity was not found + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 401: + * description: Unauthorized + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + diff --git a/documentation/userDocumentation.js b/documentation/userDocumentation.js new file mode 100644 index 0000000..51cc54a --- /dev/null +++ b/documentation/userDocumentation.js @@ -0,0 +1,210 @@ +/** + * @swagger + * components: + * schemas: + * Users: + * type: object + * required: + * - name + * properties: + * id: + * type: string + * description: The auto-generated id of the User + * firstName: + * type: string + * description: User Name + * lastName: + * type: string + * description: User surname + * email: + * type: string + * description: email + * password: + * type: string + * description: password account + * image: + * type: string + * description: image url + * roleId: + * type: number + * description: role id association + * example: + * id : 1, + * firstName: Usuario + * lastName: Apellido + * email: example@test.com + * password: $2a$10$CBpAvUuesFDoe5t7NTJazuLZ0PDYrK1mMXWofukuHP8eJkGX1MrhG + * image: some-url + * roleId: 1 + * Errors: + * type: object + * required: + * - statusCode + * - message + * properties: + * statusCode: + * type: number + * description: Http Status Code + * message: + * type: string + * description: Message return to the User + * example: + * statusCode: 500 + * message: Something went wrong, the server was unable to complete your request + * + */ + +/** + * @swagger + * tags: + * name: Users + * description: CRUD Routes of Users, only available for Admin + */ + +/** + * @swagger + * /users: + * get: + * summary: Obtain all users + * tags: [Users] + * security: + * - bearerAuth: [] + * responses: + * 200: + * description: ok + * content: + * application/json: + * schema: + * type: object + * 401: + * description: Unauthorized + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + +/** + * @swagger + * /users/{id}: + * delete: + * summary: Remove the user by id + * tags: [Users] + * security: + * - bearerAuth: [] + * parameters: + * - in: path + * name: id + * schema: + * type: number + * required: true + * description: The user id + * + * responses: + * 200: + * description: The user was deleted + * 404: + * description: The user was not found + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 401: + * description: Unauthorized + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ + +/** + * @swagger + * /users/{id}: + * path: + * summary: Update the users by the id + * tags: [Users] + * security: + * - bearerAuth: [] + * parameters: + * - in: path + * name: id + * schema: + * type: number + * required: true + * description: The user id + * requestBody: + * required: true + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/Users' + * responses: + * 200: + * description: The user was updated + * content: + * application/json: + * schema: + * type: object + * 404: + * description: The user was not found + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 400: + * description: Bad Request + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 401: + * description: Unauthorized + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + * 500: + * description: Internal Server Error + * content: + * application/json: + * schema: + * type: object + * items: + * $ref: '#/components/schemas/Errors' + */ \ No newline at end of file