// SPDX-FileCopyrightText: 2025 Contributors to the CitrineOS Project
//
// SPDX-License-Identifier: Apache-2.0

/**
 * This file was automatically generated by json-schema-to-typescript.
 * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
 * and run json-schema-to-typescript to regenerate this file.
 */

import { AuthorizationStatusEnumType, MessageFormatEnumType } from '../enums/index.js';
import type { OcppResponse } from '../../../internal-types.js';

export interface TransactionEventResponse extends OcppResponse {
  /**
   * When _eventType_ of TransactionEventRequest is Updated, then this value contains the running cost. When _eventType_ of TransactionEventRequest is Ended, then this contains the final total cost of this transaction, including taxes, in the currency configured with the Configuration Variable: Currency. Absence of this value does not imply that the transaction was free. To indicate a free transaction, the CSMS SHALL send a value of 0.00.
   *
   */
  totalCost?: number | null;
  /**
   * Priority from a business point of view. Default priority is 0, The range is from -9 to 9. Higher values indicate a higher priority. The chargingPriority in &lt;&lt;transactioneventresponse,TransactionEventResponse&gt;&gt; is temporarily, so it may not be set in the &lt;&lt;cmn_idtokeninfotype,IdTokenInfoType&gt;&gt; afterwards. Also the chargingPriority in &lt;&lt;transactioneventresponse,TransactionEventResponse&gt;&gt; has a higher priority than the one in &lt;&lt;cmn_idtokeninfotype,IdTokenInfoType&gt;&gt;.
   *
   */
  chargingPriority?: number | null;
  idTokenInfo?: IdTokenInfoType | null;
  transactionLimit?: TransactionLimitType | null;
  updatedPersonalMessage?: MessageContentType | null;
  /**
   * @minItems 1
   * @maxItems 4
   */
  updatedPersonalMessageExtra?:
    | [MessageContentType]
    | [MessageContentType, MessageContentType]
    | [MessageContentType, MessageContentType, MessageContentType]
    | [MessageContentType, MessageContentType, MessageContentType, MessageContentType]
    | null;
  customData?: CustomDataType | null;
}
/**
 * Contains status information about an identifier.
 * It is advised to not stop charging for a token that expires during charging, as ExpiryDate is only used for caching purposes. If ExpiryDate is not given, the status has no end date.
 *
 */
export interface IdTokenInfoType {
  status: AuthorizationStatusEnumType;
  /**
   * Date and Time after which the token must be considered invalid.
   *
   */
  cacheExpiryDateTime?: string | null;
  /**
   * Priority from a business point of view. Default priority is 0, The range is from -9 to 9. Higher values indicate a higher priority. The chargingPriority in &lt;&lt;transactioneventresponse,TransactionEventResponse&gt;&gt; overrules this one.
   *
   */
  chargingPriority?: number | null;
  groupIdToken?: IdTokenType | null;
  /**
   * Preferred user interface language of identifier user. Contains a language code as defined in &lt;&lt;ref-RFC5646,[RFC5646]&gt;&gt;.
   *
   *
   */
  language1?: string | null;
  /**
   * Second preferred user interface language of identifier user. Don’t use when language1 is omitted, has to be different from language1. Contains a language code as defined in &lt;&lt;ref-RFC5646,[RFC5646]&gt;&gt;.
   *
   */
  language2?: string | null;
  /**
   * Only used when the IdToken is only valid for one or more specific EVSEs, not for the entire Charging Station.
   *
   *
   *
   * @minItems 1
   */
  evseId?: [number, ...number[]] | null;
  personalMessage?: MessageContentType | null;
  customData?: CustomDataType | null;
}
/**
 * Contains a case insensitive identifier to use for the authorization and the type of authorization to support multiple forms of identifiers.
 *
 */
export interface IdTokenType {
  /**
   * @minItems 1
   */
  additionalInfo?: [AdditionalInfoType, ...AdditionalInfoType[]] | null;
  /**
   * *(2.1)* IdToken is case insensitive. Might hold the hidden id of an RFID tag, but can for example also contain a UUID.
   *
   */
  idToken: string;
  /**
   * *(2.1)* Enumeration of possible idToken types. Values defined in Appendix as IdTokenEnumStringType.
   *
   */
  type: string;
  customData?: CustomDataType | null;
}
/**
 * Contains a case insensitive identifier to use for the authorization and the type of authorization to support multiple forms of identifiers.
 *
 */
export interface AdditionalInfoType {
  /**
   * *(2.1)* This field specifies the additional IdToken.
   *
   */
  additionalIdToken: string;
  /**
   * _additionalInfo_ can be used to send extra information to CSMS in addition to the regular authorization with _IdToken_. _AdditionalInfo_ contains one or more custom _types_, which need to be agreed upon by all parties involved. When the _type_ is not supported, the CSMS/Charging Station MAY ignore the _additionalInfo_.
   *
   *
   */
  type: string;
  customData?: CustomDataType | null;
}
/**
 * This class does not get 'AdditionalProperties = false' in the schema generation, so it can be extended with arbitrary JSON properties to allow adding custom data.
 */
export interface CustomDataType {
  vendorId: string;
  [k: string]: unknown;
}
/**
 * Contains message details, for a message to be displayed on a Charging Station.
 *
 *
 */
export interface MessageContentType {
  format: MessageFormatEnumType;
  /**
   * Message language identifier. Contains a language code as defined in &lt;&lt;ref-RFC5646,[RFC5646]&gt;&gt;.
   *
   */
  language?: string | null;
  /**
   * *(2.1)* Required. Message contents. +
   * Maximum length supported by Charging Station is given in OCPPCommCtrlr.FieldLength["MessageContentType.content"].
   *     Maximum length defaults to 1024.
   *
   *
   */
  content: string;
  customData?: CustomDataType | null;
}
/**
 * Cost, energy, time or SoC limit for a transaction.
 *
 */
export interface TransactionLimitType {
  /**
   * Maximum allowed cost of transaction in currency of tariff.
   *
   */
  maxCost?: number | null;
  /**
   * Maximum allowed energy in Wh to charge in transaction.
   *
   */
  maxEnergy?: number | null;
  /**
   * Maximum duration of transaction in seconds from start to end.
   *
   */
  maxTime?: number | null;
  /**
   * Maximum State of Charge of EV in percentage.
   *
   */
  maxSoC?: number | null;
  customData?: CustomDataType | null;
}
