Sindbad~EG File Manager

Current Path : /home/infinitibizsol/.trash/docs.2/common/
Upload File :
Current File : /home/infinitibizsol/.trash/docs.2/common/basicContactInfo.js

/**
 * @swagger
 * components:
 *   schemas:
 *     PhoneNumber:
 *       type: object
 *       properties:
 *         _id:
 *           type: string
 *           description: The _id automatically generated
 *         phone_no:
 *           type: string
 *           description: The phone number value
 *         type:
 *           type: string
 *           description: Type of the phone number (e.g., Cell, Home)
 *         is_primary:
 *           type: boolean
 *           description: Indicates if this is the primary phone number
 *       required:
 *         - phone_no
 *         - type
 *         - is_primary
 *
 *     Email:
 *       type: object
 *       properties:
 *         _id:
 *           type: string
 *           description: The _id automatically generated
 *         email_address:
 *           type: string
 *           description: The email address value
 *         type:
 *           type: string
 *           description: Type of the email address (e.g., HOME, WORK)
 *         is_primary:
 *           type: boolean
 *           description: Indicates if this is the primary email address
 *       required:
 *         - email_address
 *         - type
 *         - is_primary
 *
 *     BasicContactInfo:
 *       type: object
 *       properties:
 *         phone_numbers:
 *           type: array
 *           items:
 *             $ref: '#/components/schemas/PhoneNumber'
 *           description: List of phone numbers
 *         emails:
 *           type: array
 *           items:
 *             $ref: '#/components/schemas/Email'
 *           description: List of email addresses
 *         contact_preference:
 *           type: string
 *           description: The current status of the contact (e.g., Phone, Mail, Email, Text)
 *       required:
 *         - phone_numbers
 *         - emails
 *       example:
 *         phone_numbers:
 *           type: "Work"
 *           phone_no: "5050-6060-7070"
 *           is_primary: true
 *         emails:
 *           type: "Home"
 *           email_address: "testjohndoe@workplace.com"
 *           is_primary: false
 *         contact_preference: "Phone"
 *     EditBasicContactInfo:
 *       type: object
 *       properties:
 *         phone_numbers:
 *           $ref: '#/components/schemas/PhoneNumber'
 *           description: Object of phone numbers
 *         emails:
 *           $ref: '#/components/schemas/Email'
 *           description: Object of email addresses
 *       required:
 *         - phone_numbers
 *         - emails
 *       example:
 *         phone_numbers:
 *           _id: "66a01276cb4d06db5b77b016"
 *           phone_no: "123-456-7890"
 *           type: "WORK"
 *           is_primary: false
 *         emails:
 *           _id: "66a01276cb4d06db5b77b018"
 *           email_address: "muhammad.awais@example.com"
 *           type: "WORK"
 *           is_primary: true
 *
 *     DeleteBasicContactInfo:
 *       type: object
 *       properties:
 *         phone_numbers:
 *           type: object
 *           properties:
 *             phone_id:
 *               type: string
 *               description: The ID of the phone number to be deleted
 *             phone_no:
 *               type: string
 *               description: The phone number value to be deleted
 *         emails:
 *           type: object
 *           properties:
 *             email_id:
 *               type: string
 *               description: The ID of the email address to be deleted
 *             email_address:
 *               type: string
 *               description: The email address value to be deleted
 *       required:
 *         - phone_numbers
 *         - emails
 *       example:
 *         phone_numbers:
 *           phone_id: "66a0b0cf9fd2befce733e9ab"
 *           phone_no: "5050-6060-7070"
 *         emails:
 *           email_id: "66a0b0cf9fd2befce733e9ac"
 *           email_address: "testjohndoe@workplace.com"
 *
 *     UpdateBasicContactResponse:
 *       type: object
 *       properties:
 *         message:
 *           type: string
 *           example: "Data updated successfully"
 *
 *     DeleteResponse:
 *       type: object
 *       properties:
 *         message:
 *           type: string
 *           example: "BasicContactInfo and related data deleted successfully"
 *
 * tags:
 *   - name: BasicContactInfo
 *     description: Operations related to Basic Contact Info
 *
 * paths:
 *   /basic-contact-info/list:
 *     get:
 *       summary: Returns the list of Basic-Contact-Info entries contact_id is only required for CONTACT/CUSTOMER list
 *       tags: [BasicContactInfo]
 *       security:
 *         - bearerAuth: []
 *       parameters:
 *         - in: query
 *           name: contact_id
 *           schema:
 *             type: string
 *           required: false
 *           description: ID of the contact
 *       responses:
 *         200:
 *           description: The list of Basic Contact Info entries
 *           content:
 *             application/json:
 *               schema:
 *                 type: array
 *                 items:
 *                   $ref: '#/components/schemas/BasicContactInfo'
 *
 *   /basic-contact-info/add:
 *     post:
 *       summary: Create a new Basic Contact Info entry
 *       tags: [BasicContactInfo]
 *       security:
 *         - bearerAuth: []
 *       requestBody:
 *         required: true
 *         content:
 *           application/json:
 *             schema:
 *               $ref: '#/components/schemas/BasicContactInfo'
 *       responses:
 *         201:
 *           description: The Basic Contact Info entry was successfully created
 *           content:
 *             application/json:
 *               schema:
 *                 $ref: '#/components/schemas/BasicContactInfo'
 *
 *   /basic-contact-info/edit:
 *     put:
 *       summary: Update the Basic Contact Info entry by userID,taken from JWT token
 *       tags: [BasicContactInfo]
 *       security:
 *         - bearerAuth: []
 *       requestBody:
 *         required: true
 *         content:
 *           application/json:
 *             schema:
 *               $ref: '#/components/schemas/EditBasicContactInfo'
 *       responses:
 *         200:
 *           description: The Basic Contact Info entry was successfully updated
 *           content:
 *             application/json:
 *               schema:
 *                 $ref: '#/components/schemas/UpdateBasicContactResponse'
 *
 *   /basic-contact-info/delete:
 *     delete:
 *       summary: Delete the Basic Contact Info entry by provided details
 *       tags: [BasicContactInfo]
 *       security:
 *         - bearerAuth: []
 *       requestBody:
 *         required: true
 *         content:
 *           application/json:
 *             schema:
 *               $ref: '#/components/schemas/DeleteBasicContactInfo'
 *       responses:
 *         200:
 *           description: The Basic Contact Info entry was successfully deleted
 *           content:
 *             application/json:
 *               schema:
 *                 $ref: '#/components/schemas/DeleteResponse'
 *
 *   /basic-contact-info/save:
 *     post:
 *       summary: Save or update contact information
 *       description: |
 *         - To save or update contact information, follow these guidelines:
 *           * For **Contact/Customer**, provide `contact_id`.
 *           * For **User/Agent**:
 *             - When accessing another agent's profile, provide `user_id` in request body.
 *             - For the logged-in agent, `user_id` will be automatically obtained from the JWT token.
 *         - **Note:** `_id` is not required in all cases. For User/Agent requests, remove `contact_id`.
 *       tags: [BasicContactInfo]
 *       security:
 *         - bearerAuth: []
 *       requestBody:
 *         required: true
 *         content:
 *           application/json:
 *             schema:
 *               type: object
 *               properties:
 *                 contact_id:
 *                   type: string
 *                   example: "601c3c8f9d1e8b3530a7d2b5"
 *                 user_id:
 *                   type: string
 *                   example: "601c3c8f9d1e8b3530a7d2b5"
 *                 contact_preference:
 *                   type: string
 *                   example: "Email"
 *                 phone_numbers:
 *                   type: array
 *                   items:
 *                     $ref: '#/components/schemas/PhoneNumber'
 *                 emails:
 *                   type: array
 *                   items:
 *                     $ref: '#/components/schemas/Email'
 *       responses:
 *         200:
 *           description: Contact information saved successfully
 *           content:
 *             application/json:
 *               schema:
 *                 type: object
 *                 properties:
 *                   success:
 *                     type: boolean
 *                     example: true
 *                   message:
 *                     type: string
 *                     example: 'Contact information saved successfully'
 *         500:
 *           description:
 */
"use strict";

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists