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

import {
  array,
  boolean,
  lazy,
  number,
  object,
  optional,
  Schema,
  string,
} from '../schema';
import { ProductAllOf0, productAllOf0Schema } from './productAllOf0';

export interface ProductGroup {
  /**
   * Referenced Purchase Category Id
   * Example: 123, 124
   */
  referenceId?: number;
  /** Product group ID */
  productGroupId?: string;
  /** Product group name */
  name?: string;
  /**
   * Indicates whether this is a default Product Group at ColCo level or not.
   * Note: The Customer level default settings are not considered here.
   */
  isDefault?: boolean;
  /**
   * Identifies the type of Product group.
   * true - if it is a Fuel type Product group
   * false - if it is Non-Fuel type
   */
  isFuelType?: boolean;
  products?: ProductAllOf0[];
}

export const productGroupSchema: Schema<ProductGroup> = object({
  referenceId: ['ReferenceId', optional(number())],
  productGroupId: ['ProductGroupId', optional(string())],
  name: ['Name', optional(string())],
  isDefault: ['IsDefault', optional(boolean())],
  isFuelType: ['IsFuelType', optional(boolean())],
  products: ['Products', optional(array(lazy(() => productAllOf0Schema)))],
});
