/**
 * @swagger
 * /migrate/master-entity/{uuid}:
 *   get:
 *     summary: Export a single master entity and all its related data
 *     description: |
 *       This API exports a specific Master Entity identified by its UUID, including:
 *       - The main master entity
 *       - Any header/footer master entities it references (recursively)
 *       - All line items belonging to these master entities
 *       - All permissions tied to these master entities
 *       - All menu items referencing any of these master entities or permissions,
 *         plus all ancestor menu items to preserve hierarchy
 *     tags:
 *       - Migration
 *     parameters:
 *       - in: path
 *         name: uuid
 *         schema:
 *           type: string
 *           format: uuid
 *         required: true
 *         description: UUID of the master entity to export
 *       - in: query
 *         name: companyId
 *         schema:
 *           type: integer
 *           example: 1
 *         required: false
 *         description: Company ID (defaults to 1)
 *       - in: query
 *         name: encrypt
 *         schema:
 *           type: boolean
 *           default: true
 *         required: false
 *         description: |
 *           If true (default), the JSON content is encrypted and stored as `data.enc` inside the ZIP.
 *           If false, the plain JSON file is included directly.
 *     responses:
 *       200:
 *         description: ZIP file containing the exported data (encrypted or plain)
 *         content:
 *           application/zip:
 *             schema:
 *               type: string
 *               format: binary
 *       400:
 *         description: Bad request (e.g., missing UUID)
 *         content:
 *           application/json:
 *             schema:
 *               type: object
 *               properties:
 *                 success:
 *                   type: boolean
 *                   example: false
 *                 message:
 *                   type: string
 *                 code:
 *                   type: integer
 *       500:
 *         description: Server error
 *         content:
 *           application/json:
 *             schema:
 *               $ref: '#/components/schemas/Error'
 *     security:
 *       - AccessToken: []
 */

/**
 * @swagger
 * /migrate/export-entity:
 *   post:
 *     summary: Export entities and related data
 *     tags: [Migration]
 *     parameters:
 *       - in: query
 *         name: export
 *         schema:
 *           type: boolean
 *           default: true
 *         required: false
 *         description: |
 *           If true (default), then export will be happened.
 *           If false, export will be saved.
 *     requestBody:
 *       required: true
 *       content:
 *         application/json:
 *           schema:
 *             type: object
 *             properties:
 *               encrypt:
 *                 type: boolean
 *                 default: true
 *                 description: Encrypt JSON inside ZIP
 *               companyId:
 *                 type: integer
 *                 default: 1
 *               type:
 *                 type: string
 *                 enum: [update, replace]
 *                 default: update
 *               includeMasters:
 *                 type: boolean
 *                 default: false
 *               includeThemes:
 *                 type: boolean
 *                 default: false
 *               includeConfigurations:
 *                 type: boolean
 *                 default: false
 *               includeLanguages:
 *                 type: boolean
 *                 default: false
 *               includeMasterEntities:
 *                 type: boolean
 *                 default: true
 *               includeUsers:
 *                 type: boolean
 *                 default: false
 *               includeNotifications:
 *                 type: boolean
 *                 default: false
 *               includeExportTemplates:
 *                 type: boolean
 *                 default: false
 *               includeImportTemplates:
 *                 type: boolean
 *                 default: false
 *               includeApprovalWorkflows:
 *                 type: boolean
 *                 default: false
 *               note:
 *                 type: string
 *                 maxLength: 500
 *               developer_name:
 *                 type: string
 *                 maxLength: 100
 *     responses:
 *       200:
 *         description: Export successful
 *     security:
 *       - AccessToken: []
 */

/**
 * @swagger
 * /migrate/import-entity:
 *   post:
 *     summary: Import entities from JSON or ZIP file
 *     description: |
 *       This API imports all Entity module data from an uploaded file.
 *       It **deletes all existing** entity data for the target company before importing.
 *       The file can be:
 *       - A JSON file (exported from the GET endpoint)
 *       - A ZIP archive containing a JSON file (with the same format)
 *     tags:
 *       - Migration
 *     parameters:
 *       - in: query
 *         name: preview
 *         schema:
 *           type: boolean
 *           default: false
 *         required: false
 *         description: |
 *           If false (default), then migration will be happened.
 *           If true, the JSON content will be validated but no data will be imported.
 *     requestBody:
 *       required: true
 *       content:
 *         multipart/form-data:
 *           schema:
 *             type: object
 *             properties:
 *               file:
 *                 type: string
 *                 format: binary
 *                 description: JSON file or ZIP archive containing a JSON file.
 *             required:
 *               - file
 *     responses:
 *       200:
 *         description: Import successful
 *         content:
 *           application/json:
 *             schema:
 *               type: object
 *               properties:
 *                 success:
 *                   type: boolean
 *                   example: true
 *                 data:
 *                   type: object
 *                   properties:
 *                     importedCounts:
 *                       type: object
 *                       properties:
 *                         masterEntities:
 *                           type: integer
 *                           example: 5
 *                         permissions:
 *                           type: integer
 *                           example: 12
 *                         lineItems:
 *                           type: integer
 *                           example: 45
 *                         menuItems:
 *                           type: integer
 *                           example: 8
 *       400:
 *         description: Bad request (e.g., invalid file format, missing companyId)
 *         content:
 *           application/json:
 *             schema:
 *               type: object
 *               properties:
 *                 success:
 *                   type: boolean
 *                   example: false
 *                 message:
 *                   type: string
 *                   example: "No file uploaded"
 *                 code:
 *                   type: integer
 *                   example: 400
 *       500:
 *         description: Server error
 *         content:
 *           application/json:
 *             schema:
 *               type: object
 *               properties:
 *                 success:
 *                   type: boolean
 *                   example: false
 *                 message:
 *                   type: string
 *                 code:
 *                   type: integer
 *                   example: 500
 *     security:
 *       - AccessToken: []
 */
