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

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

export interface Group {
  /** Group sort that determines the type of group that is indicated. This is a code. For possible values, please see [here](#tag/Reference-codes/Group-types) */
  groupType: string;
  /** Sequence number of the collo within the complete shipment (e.g. collo 2 of 4) Mandatory for multicollo shipments */
  groupSequence?: number;
  /** Total number of colli in the shipment (in case of multicolli shipments) Mandatory for multicollo shipments */
  groupCount?: number;
  /** Main barcode for the shipment (in case of multicolli shipments) Mandatory for multicollo shipments */
  mainBarcode: string;
}

export const groupSchema: Schema<Group> = object({
  groupType: ['GroupType', string()],
  groupSequence: ['GroupSequence', optional(number())],
  groupCount: ['GroupCount', optional(number())],
  mainBarcode: ['MainBarcode', string()],
});
