Sindbad~EG File Manager
/**
* @swagger
* components:
* schemas:
* Address:
* type: object
* required:
* - street
* - city
* - province
* - country
* - zip_code
* - address_type
* - primary_address
* - user_id
* properties:
* street:
* type: string
* description: The street address
* city:
* type: string
* description: The city of the address
* province:
* type: string
* description: The province of the address
* country:
* type: string
* description: The country of the address
* zip_code:
* type: number
* description: The zip code of the address
* address_type:
* type: string
* description: The type of address (e.g., default, billing, shipping)
* primary_address:
* type: boolean
* description: primary_address will be false by default
* comments:
* type: string
* description: Additional comments about the address
* contact_id:
* type: string
* description: The ID of the user to whom the address belongs
* user_id:
* type: string
* description: The ID of the user to whom the address belongs
* example:
* street: "Address Test1"
* city: "Testing Done."
* province: "KPK"
* country: "Khorsan"
* zip_code: 40010
* address_type: "default"
* comments: "None"
* contact_id: "666a1adb4a817baa96f0387a"
* user_id: "666a1adb4a817baa96f0387a"
* UpdateResponse:
* type: object
* properties:
* message:
* type: string
* example: "Data updated successfully"
* DeleteResponse:
* type: object
* properties:
* message:
* type: string
* example: "entry_name and related data deleted successfully"
* securitySchemes:
* bearerAuth:
* type: http
* scheme: bearer
* bearerFormat: JWT
*/
/**
* @swagger
* tags:
* - name: Address
* description: Address related operations
*/
/**
* @swagger
* /address/list:
* get:
* summary: Returns the list of addresses. NOTE *contact_id is only required for CONTACT/CUSTOMER*
* tags: [Address]
* security:
* - bearerAuth: []
* parameters:
* - in: query
* name: contact_id
* schema:
* type: string
* required: false
* description: ID of the contact
* responses:
* 200:
* description: The list of addresses
* content:
* application/json:
* schema:
* type: array
* items:
* $ref: '#/components/schemas/Address'
*/
/**
* @swagger
* /address/add:
* post:
* summary: Create a new address.
* description: |
* - To add address 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.
* tags: [Address]
* security:
* - bearerAuth: []
* requestBody:
* required: true
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/Address'
* responses:
* 201:
* description: The address was successfully created
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/Address'
*/
/**
* @swagger
* /address/edit/{id}:
* put:
* summary: Update the address by ID
* tags: [Address]
* security:
* - bearerAuth: []
* parameters:
* - in: path
* name: id
* schema:
* type: string
* required: true
* description: The address ID
* requestBody:
* required: true
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/Address'
* responses:
* 200:
* description: The address was successfully updated
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/UpdateResponse'
*/
/**
* @swagger
* /address/delete/{id}:
* delete:
* summary: Delete the address by ID
* tags: [Address]
* security:
* - bearerAuth: []
* parameters:
* - in: path
* name: id
* schema:
* type: string
* required: true
* description: The address ID
* responses:
* 200:
* description: The address was successfully deleted
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/DeleteResponse'
*/
"use strict";
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists