using System;
using dodohold.core;

namespace molilian.core
{
    [Table("track_links")]
    public class TrackLinkDTO
    {
        [Key]
        public int id { get; set; }
        public string event_type { get; set; } = string.Empty;
        public string platform { get; set; } = string.Empty;
        public string typename { get; set; } = string.Empty;
        public string scene { get; set; } = string.Empty;
        public string unique_id { get; set; } = string.Empty;
        public string path { get; set; } = string.Empty;
        public string description { get; set; } = string.Empty;
        public DateTime create_time { get; set; } = DateTime.Now;
        public DateTime update_time { get; set; } = DateTime.Now;
    }

    [Table("track_daily_report")]
    public class TrackDailyReportDTO
    {
        [Key]
        public int id { get; set; }
        public DateTime report_date { get; set; } = DateTime.Now.Date;
        public string event_type { get; set; } = string.Empty;
        public string platform { get; set; } = string.Empty;
        public string typename { get; set; } = string.Empty;
        public string scene { get; set; } = string.Empty;
        public string unique_id { get; set; } = string.Empty;
        public int track_link_id { get; set; } = 0;
        public int account_id { get; set; } = 0;
        public int event_count { get; set; } = 0;
        public DateTime create_time { get; set; } = DateTime.Now;
        public DateTime update_time { get; set; } = DateTime.Now;
    }

    public class TrackHourlyReportDTO
    {
        public int track_link_id { get; set; } = 0;
        public string event_type { get; set; } = string.Empty;
        public string platform { get; set; } = string.Empty;
        public string typename { get; set; } = string.Empty;
        public string scene { get; set; } = string.Empty;
        public string unique_id { get; set; } = string.Empty;
        public int account_id { get; set; } = 0;
        public DateTime report_date { get; set; } = DateTime.Now.Date;
        public int hour { get; set; } = 0;
        public string hour_label => $"{hour:00}:00";
        public int event_count { get; set; } = 0;
        public int call_count { get; set; } = 0;
    }

    [Table("track_request_logs")]
    public class TrackRequestLogDTO
    {
        [Key]
        public long id { get; set; }
        public int track_id { get; set; } = 0;
        public int account_id { get; set; } = 0;
        public string event_type { get; set; } = string.Empty;
        public string platform { get; set; } = string.Empty;
        public string typename { get; set; } = string.Empty;
        public string scene { get; set; } = string.Empty;
        public string unique_id { get; set; } = string.Empty;
        public string ip { get; set; } = string.Empty;
        public string user_agent { get; set; } = string.Empty;
        public string referer { get; set; } = string.Empty;
        public DateTime create_time { get; set; } = DateTime.Now;
    }
}
