/**
 * Shell Card Management APIsLib
 *
 * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
 */

import { boolean, number, object, optional, Schema, string } from '../schema';

export interface UpdateCardGroupRequest {
  /**
   * Collecting Company Code (Shell Code) of the selected payer.
   * Mandatory for serviced OUs such as Romania, Latvia, Lithuania, Estonia, Ukraine etc. It is optional for other countries if ColCoID is provided.
   * Example:
   * 86-Philippines
   * 5-UK
   */
  colCoCode?: number;
  /**
   * Collecting Company Id  of the selected payer.
   * Optional if ColCoCode is passed else Mandatory.
   * Example:
   * 1-Philippines
   * 5-UK
   */
  colCoId?: number;
  /**
   * Payer Number of the selected payer.
   * Optional if PayerId is passed else Mandatory
   */
  payerNumber?: string;
  /**
   * Payer Id (i.e., Customer Id of the Payment Customer) of the selected payer.
   * Optional if PayerNumber is passed else Mandatory
   * Example: 123456
   */
  payerId?: number;
  /** Account ID of the card-group to be updated/terminated. */
  accountId?: number;
  /** Account Number of the card-group to be updated/terminated. */
  accountNumber?: string;
  /** Unique Id of the card group that needs to be updated or terminated. */
  cardGroupId?: number;
  /**
   * New name for the card group if it needs to be updated. Set this field to ‘null’ if no change required to the current card group name.
   * Optional
   * Minimum length: 1 (Configurable)
   * Maximum length: 40 (Configurable)
   * Allowed characters (Configurable) are: - A-Z 0-9, / ‘. & Ä Ö Ü Å Æ É Ø
   * Note: The card group name has to be unique for customer. Else an error with error code 9015 is returned.
   */
  cardGroupName?: string;
  /**
   * Whether to emboss the card group name on the cards.
   * Populate this field only if the value needs to be updated. Otherwise set to ‘null’.
   */
  printOnCard?: boolean;
  /**
   * Card Type ID of the card group.
   * Populate this field if the value needs to be updated. Otherwise set to ‘null’.
   * Optional
   * Note:
   * 1)    If a card type is passed, the cardgorup will allow cards with same card type to be moved in to the card group.
   * 2)    Pass ‘-1’ to remove the card type from the card group.
   */
  cardTypeId?: number;
  /**
   * Whether to terminate the card group.
   * When set to true, the card group will be terminated by setting current date as it’s termination date.
   * Optional, False by default .
   */
  terminateCardGroup?: boolean;
  /**
   * Whether to move the cards from this CardGroup in to a different or a new CardGroup.
   * Optional
   * When the value is set to ‘False’ or ‘null’, the cards that are currently in the card-group will remain under the same card-group.
   */
  moveCards?: boolean;
  /**
   * Account ID of the new/target card-group.
   * Either TargetAccountId or TargetAccountNumber is mandatory when MoveCards is set to True.
   */
  targetAccountId?: number;
  /**
   * Account Number of the new/target card-group.
   * Either TargetAccountId or TargetAccountNumber is mandatory when MoveCards is set to True.
   */
  targetAccountNumber?: string;
  /**
   * Name of the new card group if the cards in the existing card-group have to be moved to a new card-group.
   * Mandatory when MoveCards parameter is True and TargetCardGroupId is null.
   * Minimum length: 1 (Configurable)
   * Maximum length: 30 (Configurable)
   */
  targetNewCardGroupName?: string;
  /**
   * ID of the card group if the cards in the existing card-group have to be moved to another existing card-group.
   * Mandatory when MoveCards parameter is True and TargetNewCardGroupName is null.
   * If the value is “-1” then the cards will be moved out of the current CardGroup.
   */
  targetCardGroupId?: number;
}

export const updateCardGroupRequestSchema: Schema<UpdateCardGroupRequest> = object(
  {
    colCoCode: ['ColCoCode', optional(number())],
    colCoId: ['ColCoId', optional(number())],
    payerNumber: ['PayerNumber', optional(string())],
    payerId: ['PayerId', optional(number())],
    accountId: ['AccountId', optional(number())],
    accountNumber: ['AccountNumber', optional(string())],
    cardGroupId: ['CardGroupId', optional(number())],
    cardGroupName: ['CardGroupName', optional(string())],
    printOnCard: ['PrintOnCard', optional(boolean())],
    cardTypeId: ['CardTypeId', optional(number())],
    terminateCardGroup: ['TerminateCardGroup', optional(boolean())],
    moveCards: ['MoveCards', optional(boolean())],
    targetAccountId: ['TargetAccountId', optional(number())],
    targetAccountNumber: ['TargetAccountNumber', optional(string())],
    targetNewCardGroupName: ['TargetNewCardGroupName', optional(string())],
    targetCardGroupId: ['TargetCardGroupId', optional(number())],
  }
);
