//+------------------------------------------------------------------+
//|                                                CalendarTypes.mqh |
//+------------------------------------------------------------------+
#ifndef CALENDARTYPES_MQH
#define CALENDARTYPES_MQH

//+------------------------------------------------------------------+
//| CDealSample                                                      |
//| A minimal, reduced representation of one relevant closed deal.   |
//| Only the two fields required by daily aggregation are kept: the  |
//| close time of the deal and its net profit contribution. No other |
//| deal properties are retained because nothing downstream needs    |
//| them, and keeping the sample minimal makes the aggregation stage |
//| simple to reason about and simple to unit test.                  |
//+------------------------------------------------------------------+
class CDealSample
  {
public:
   datetime          m_close_time;   // server-time close timestamp of the deal
   double            m_net_profit;   // profit + swap + commission for this deal
                     CDealSample(void);
  };

//+------------------------------------------------------------------+
//| Constructor                                                      |
//| Initializes a deal sample to a neutral, explicit default state so|
//| that an uninitialized sample can never be mistaken for a deal    |
//| that genuinely closed at time zero with a real profit value.     |
//+------------------------------------------------------------------+
CDealSample::CDealSample(void)
  {
   m_close_time = 0;
   m_net_profit = 0.0;
  }

//+------------------------------------------------------------------+
//| CDailyRecord                                                     |
//| The analytical output of the aggregation stage: exactly one      |
//| record per distinct calendar date. The date is stored already    |
//| normalized to midnight so that it can be used directly as a      |
//| grouping key and as a coordinate-mapping input, without repeating|
//| the normalization step in every downstream component.            |
//+------------------------------------------------------------------+
class CDailyRecord
  {
public:
   datetime          m_date;         // normalized calendar date (midnight, server time)
   double            m_daily_pnl;    // sum of net profit for every deal closed on m_date
   int               m_trade_count;  // number of deals closed on m_date
                     CDailyRecord(void);
  };

//+-------------------------------------------------------------------+
//| Constructor                                                       |
//| Initializes a daily record to an explicit, unambiguous zero state.|
//| Because zero is a legitimate and meaningful daily P&L value, the  |
//| constructor must not use any sentinel other than a genuine zero;  |
//| callers are expected to test m_trade_count to know whether a      |
//| record actually represents observed trading activity.             |
//+-------------------------------------------------------------------+
CDailyRecord::CDailyRecord(void)
  {
   m_date        = 0;
   m_daily_pnl   = 0.0;
   m_trade_count = 0;
  }

#endif // CALENDARTYPES_MQH
//+------------------------------------------------------------------+