/**
 * @openapi
 * /sync/sync-delivery:
 *   post:
 *     summary: Sync delivery notes from external systems
 *     description: >
 *       This endpoint receives a **delivery note payload** containing shipment and customer details,
 *       along with the list of delivery items.  
 *       Mandatory fields will be validated before processing.
 *     tags: 
 *       - Sync
 *     parameters:
 *       - in: path
 *         name: code
 *         required: true
 *         description: |
 *           Delivery Note payload code.
 *           
 *           ### Array of Delivery Notes
 *           Each payload item should include the following fields:
 *           
 *           - **delivery_note_number** (string, required): Unique delivery note identifier.  
 *             Example: `DN-2025-001`
 *           - **order_number** (string, required): Associated sales order number.  
 *             Example: `SO-45578`
 *           - **reference_number** (string, required): External reference number or PO number.  
 *             Example: `REF-9988`
 *           - **number_of_boxes** (integer, required): Total number of boxes.  
 *             Example: `10`
 *           - **number_of_bundles** (integer, required): Total number of bundles.  
 *             Example: `5`
 *           - **customer_delivery_contact_info** (string, required): Person receiving delivery.  
 *             Example: `John Doe`
 *           - **customer_delivery_address_code** (string, required): Internal delivery address code.  
 *             Example: `ADDR-556`
 *           - **shipment_type** (string, nullable): Shipment mode (Air, By Land, Sea).  
 *             Example: `By land`
 *           - **aluminium_profiles** (string, nullable): Type of aluminium profiles.  
 *             Example: `Powder Coating`
 *           - **alloy** (string, nullable): Alloy type for profiles.  
 *             Example: `6061`
 *           - **temper** (string, nullable): Temper value.  
 *             Example: `T6`
 *           - **color** (string, nullable): Colour of items.  
 *             Example: `Silver`
 *           - **customer_code** (string, nullable): Unique customer code.  
 *             Example: `CUST-101`
 *           - **customer_company_name** (string, nullable): Customer company.  
 *             Example: `ABC Constructions`
 *           - **customer_email** (string, nullable): Customer email address.  
 *             Example: `john.doe@company.com`
 *           - **customer_delivery_contact_number** (string, nullable): Delivery contact number.  
 *             Example: `+91-9876543210`
 *           - **customer_delivery_contact_name** (string, nullable): Delivery contact name.  
 *             Example: `John Doe`
 *           - **customer_delivery_contact_email** (string, nullable): Delivery contact email.  
 *             Example: `john.doe@company.com`
 *           - **date_of_issue** (string, required, format: date): Date of issue (YYYY-MM-DD).  
 *             Example: `2025-09-01`
 *           - **supply_agreement** (string, required): Supply agreement type.  
 *             Example: `CPT`
 *           - **customer_delivery_address** (string, nullable): Full delivery address.  
 *             Example: `123, Industrial Area, Bangalore`
 *           - **delivery_address_lat_long** (string, nullable): Latitude and Longitude of delivery address.
 *             Example: `12.9716,77.5946`
 *           
 *           ### Delivery Note Items
 *           - **item_code** (string, required): Unique item code.  
 *             Example: `ITEM-001`
 *           - **slip_number** (string, required): Slip/batch number.  
 *             Example: `SLIP-2025-10`
 *           - **section_number** (string, required): Section identifier.  
 *             Example: `SEC-11`
 *           - **quantity** (integer, required): Quantity delivered.  
 *             Example: `5`
 *           - **weight** (integer, required): Weight of the item.  
 *             Example: `10`
 *           - **item_description** (string, nullable): Description of item.  
 *             Example: `Aluminium bar`
 *           - **length_in_meters** (number, nullable): Length in meters.  
 *             Example: `7.190`
 *         schema:
 *           type: string
 *           example: "DN-2025-001"
 *     requestBody:
 *       required: true
 *       content:
 *         application/json:
 *           schema:
 *             type: array
 *             items:
 *               type: object
 *               required:
 *                 - delivery_note_number
 *                 - order_number
 *                 - reference_number
 *                 - number_of_boxes
 *                 - number_of_bundles
 *                 - customer_delivery_contact_info
 *                 - customer_delivery_address_code
 *                 - delivery_note_items
 *               properties:
 *                 delivery_note_number:
 *                   type: string
 *                   description: Unique delivery note identifier.
 *                   example: "DN-2025-001" 
 *                 order_number:
 *                   type: string
 *                   description: Associated sales order number.
 *                   example: "SO-45578"
 *                 reference_number:
 *                   type: string
 *                   description: External reference number or PO number.
 *                   example: "REF-9988"
 *                 number_of_boxes:
 *                   type: integer
 *                   description: Total number of boxes included in the delivery.
 *                   example: 10
 *                 number_of_bundles:
 *                   type: integer
 *                   description: Total number of bundles included in the delivery.
 *                   example: 5
 *                 customer_delivery_contact_info:
 *                   type: string
 *                   description: Name of the person receiving the delivery.
 *                   example: "John Doe"
 *                 customer_delivery_address_code:
 *                   type: string
 *                   description: Internal delivery address code for customer.
 *                   example: "ADDR-556"
 *                 shipment_type:
 *                   type: string
 *                   nullable: true
 *                   description: Shipment type (e.g., Air, Road, Sea).
 *                   example: "Air"
 *                 aluminium_profiles:
 *                   type: string
 *                   nullable: true
 *                   description: Type of aluminium profiles in the delivery.
 *                   example: "Powder Coating"
 *                 alloy:
 *                   type: string
 *                   nullable: true
 *                   description: Alloy type for the aluminium profiles.
 *                   example: "6061"
 *                 temper:
 *                   type: string
 *                   nullable: true
 *                   description: Temper value for the aluminium profiles.
 *                   example: "T6"
 *                 color:
 *                   type: string
 *                   nullable: true
 *                   description: Colour of the delivered items.
 *                   example: "Silver"
 *                 customer_code:
 *                   type: string
 *                   nullable: true
 *                   description: Unique customer code.
 *                   example: "CUST-101"
 *                 customer_company_name:
 *                   type: string
 *                   nullable: true
 *                   description: Customer’s company name.
 *                   example: "ABC Constructions"
 *                 customer_email:
 *                   type: string
 *                   nullable: true
 *                   description: Customer email address.
 *                   example: "john.doe@company.com"
 *                 customer_delivery_contact_number:
 *                   type: string
 *                   nullable: true
 *                   description: Contact number of the delivery person.
 *                   example: "+91-9876543210"
 *                 customer_delivery_contact_name:
 *                   type: string
 *                   nullable: true
 *                   description: Name of the delivery person.
 *                   example: "John Doe"
 *                 customer_delivery_contact_email:
 *                   type: string
 *                   nullable: true
 *                   description: Email of the delivery person.
 *                   example: "john.doe@company.com"
 *                 date_of_issue:
 *                   type: string
 *                   description: Date of issue.
 *                   example: "2025-09-01"
 *                 supply_agreement:
 *                   type: string
 *                   description: Supply Agreement.
 *                   example: "CPT"
 *                 customer_delivery_address:
 *                   type: string
 *                   nullable: true
 *                   description: Full delivery address.
 *                   example: "123, Industrial Area, Bangalore"
 *                 delivery_address_lat_long:
 *                   type: string
 *                   nullable: true
 *                   description: Latitude and Longitude of delivery address.
 *                   example: "12.9716,77.5946"
 *                 delivery_note_items:
 *                   type: array
 *                   minItems: 1
 *                   description: List of items included in the delivery.
 *                   items:
 *                     type: object
 *                     required:
 *                       - item_code
 *                       - slip_number
 *                       - section_number
 *                       - quantity
 *                       - weight
 *                     properties:
 *                       item_code:
 *                         type: string
 *                         description: Unique code for the item.
 *                         example: "ITEM-001"
 *                       slip_number:
 *                         type: string
 *                         description: Slip/Batch number for the item.
 *                         example: "SLIP-2025-10"
 *                       section_number:
 *                         type: string
 *                         description: Section identifier for the item.
 *                         example: "SEC-11"
 *                       quantity:
 *                         type: integer
 *                         description: Quantity of the item being delivered.
 *                         example: 5
 *                       weight:
 *                         type: integer
 *                         description: Weight of the item being delivered.
 *                         example: 10
 *                       item_description:
 *                         type: string
 *                         nullable: true
 *                         description: Item description.
 *                         example: "Aluminium bar"
 *                       length_in_meters:
 *                         type: number
 *                         nullable: true
 *                         description: Length of each item in meters.
 *                         example: 7.190 
 *     responses:
 *       200:
 *         description: Delivery note successfully synced.
 *       400:
 *         description: Validation error in request body.
 *       500:
 *         description: Internal server error.
 *     security:
 *       - Language: []
 */
