import { ReturnDTO } from '@generated/swagger/inventory-api';
import { EntityContainer } from '@isa/common/data-access';
import { Receipt } from './receipt';

/**
 * Represents a remission return containing multiple receipts.
 * A return groups related receipts together for processing and tracking.
 * 
 * @interface Return
 * @extends {ReturnDTO}
 * 
 * @example
 * const returnEntity: Return = {
 *   id: 5001,
 *   receipts: [
 *     { id: 101, data: receipt1 }, // When eager loading is active
 *     { id: 102, data: undefined } // When only ID is available
 *   ],
 *   // ... other ReturnDTO properties like status, date, supplier info
 * };
 */
export interface Return extends ReturnDTO {
  /**
   * Unique identifier for the return.
   * @type {number}
   */
  id: number;
  
  /**
   * Collection of receipts associated with this return.
   * Each container holds an ID and optionally the resolved Receipt data
   * when eager loading is active.
   * @type {EntityContainer<Receipt>[]}
   */
  receipts: EntityContainer<Receipt>[];
}
