// firmware/upgrade/operations/cancelUpgrade.descriptions.ts - FIXED
import { INodeProperties } from 'n8n-workflow';

/**
 * Parameters for the cancelUpgrade operation
 */
export const cancelUpgradeDescription: INodeProperties[] = [
	{
		displayName: 'Device Type',
		name: 'deviceType',
		type: 'options',
		required: true,
		default: 'IAP',
		description: 'Type of device for which to cancel the upgrade',
		options: [
			{
				name: 'Access Points (IAP)',
				value: 'IAP',
			},
			{
				name: 'MAS Switches',
				value: 'MAS',
			},
			{
				name: 'Aruba Switches',
				value: 'HP',
			},
			{
				name: 'CX Switches',
				value: 'CX',
			},
			{
				name: 'Controllers',
				value: 'CONTROLLER',
			},
		],
		displayOptions: {
			show: {
				operation: ['cancelUpgrade'],
				resource: ['upgrade'],
				domain: ['firmware'],
			},
		},
	},
	{
		displayName: 'Target Type',
		name: 'targetType',
		type: 'options',
		options: [
			{
				name: 'Device Serial',
				value: 'serial',
				description: 'Cancel upgrade for a specific device by serial number',
			},
			{
				name: 'Swarm ID',
				value: 'swarm_id',
				description: 'Cancel upgrade for a specific swarm by ID',
			},
			{
				name: 'Group',
				value: 'group',
				description: 'Cancel upgrade for all devices in a group',
			},
		],
		default: 'serial',
		required: true,
		description: 'Type of target for which to cancel the upgrade',
		displayOptions: {
			show: {
				operation: ['cancelUpgrade'],
				resource: ['upgrade'],
				domain: ['firmware'],
			},
		},
	},
	{
		displayName: 'Target Value',
		name: 'targetValue',
		type: 'string',
		default: '',
		required: true,
		description: 'Value of the target (serial number, swarm ID, or group name)',
		displayOptions: {
			show: {
				operation: ['cancelUpgrade'],
				resource: ['upgrade'],
				domain: ['firmware'],
			},
		},
	},
];
