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

/**
 * Represents a remission return receipt containing multiple receipt items.
 * Extends the base ReceiptDTO with additional properties for local processing.
 * 
 * @interface Receipt
 * @extends {ReceiptDTO}
 * 
 * @example
 * const receipt: Receipt = {
 *   id: 1001,
 *   receiptNumber: 'RR-2024-001',
 *   items: [
 *     { id: 123, data: receiptItem1 }, // When eager loading is active
 *     { id: 124, data: undefined }     // When only ID is available
 *   ],
 *   // ... other ReceiptDTO properties
 * };
 */
export interface Receipt extends ReceiptDTO {
  /**
   * Unique identifier for the receipt.
   * @type {number}
   */
  id: number;
  
  /**
   * The receipt number used for tracking and reference.
   * Typically follows a standardized format (e.g., 'RR-YYYY-###').
   * @type {string}
   */
  receiptNumber: string;
  
  /**
   * Collection of receipt items wrapped in EntityContainer.
   * Each container holds an ID and optionally the resolved ReceiptItem data
   * when eager loading is active.
   * @type {EntityContainer<ReceiptItem>[]}
   */
  items: EntityContainer<ReceiptItem>[];
}
