/**
 * DeliverySettings constants for Test and Preview (SMS, Email, WhatsApp).
 * Aligned with cap-campaigns-v2 DeliverySettingsV2/ModifyDeliverySettings field names.
 */

import { CHANNELS } from '../constants';

/** Placeholder shown in summary when a value is empty */
export const SUMMARY_EMPTY_PLACEHOLDER = '—';

/** Channel names — use CHANNELS.SMS, CHANNELS.EMAIL, CHANNELS.WHATSAPP from parent constants */
export { CHANNELS } from '../constants';

/** Delivery settings object keys (for get(deliverySettings, key) / updateSetting(key, value)) */
export const DELIVERY_SETTING_KEY_DOMAIN_ID = 'domainId';
export const DELIVERY_SETTING_KEY_DOMAIN_GATEWAY_MAP_ID = 'domainGatewayMapId';
export const DELIVERY_SETTING_KEY_GSM_SENDER_ID = 'gsmSenderId';
export const DELIVERY_SETTING_KEY_CDMA_SENDER_ID = 'cdmaSenderId';
export const DELIVERY_SETTING_KEY_SENDER_EMAIL = 'senderEmail';
export const DELIVERY_SETTING_KEY_SENDER_LABEL = 'senderLabel';
export const DELIVERY_SETTING_KEY_SENDER_REPLY_TO = 'senderReplyTo';
export const DELIVERY_SETTING_KEY_SOURCE_ACCOUNT_IDENTIFIER = 'sourceAccountIdentifier';
export const DELIVERY_SETTING_KEY_SENDER_MOB_NUM = 'senderMobNum';

/** data-testid for delivery settings edit icon */
export const TEST_ID_DELIVERY_SETTINGS_EDIT = 'delivery-settings-edit';

/** Prefix for row keys in field list map */
export const ROW_KEY_PREFIX = 'row-';

export const CHANNELS_WITH_DELIVERY_SETTINGS = [
  CHANNELS.SMS,
  CHANNELS.EMAIL,
  CHANNELS.WHATSAPP,
];

/** Default empty delivery setting per channel (campaigns-style shape) */
export const DEFAULT_DELIVERY_SETTING_SMS = {
  domainId: null,
  domainGatewayMapId: null,
  gsmSenderId: '',
  cdmaSenderId: '',
};

export const DEFAULT_DELIVERY_SETTING_EMAIL = {
  domainId: null,
  domainGatewayMapId: null,
  senderEmail: '',
  senderLabel: '',
  senderReplyTo: '',
};

export const DEFAULT_DELIVERY_SETTING_WHATSAPP = {
  domainId: null,
  senderMobNum: '',
  sourceAccountIdentifier: '',
};

export const DEFAULT_DELIVERY_SETTINGS_BY_CHANNEL = {
  [CHANNELS.SMS]: DEFAULT_DELIVERY_SETTING_SMS,
  [CHANNELS.EMAIL]: DEFAULT_DELIVERY_SETTING_EMAIL,
  [CHANNELS.WHATSAPP]: DEFAULT_DELIVERY_SETTING_WHATSAPP,
};
