using Infiniti.Models.Client; using Infiniti.Models.Transactions; using Infiniti.Models.Users; using Infiniti.Standard; using System; using System.Collections.Generic; using System.Text; using System.Threading; namespace Infiniti.Models.Shopify { public class ShopifySales { } // base requests and responses public class ShopifySalesDatespan { public ShopifySalesDatespan(int year, int month, int day=0) { Year = year; Month = month; Day = day; } public int Year { get; set; } // required 2010 - present public int Month { get; set; } // 12 - 1, 0, clipped to; zero = annual or weekly public int Day { get; set; } // -1, 0, 1-31/53; -1 count only, zero = annual or monthly, else day of month or week of year. } public class ShopifySalesRequest : ClientRequest { public ShopifySalesRequest( User user, string clientId, ShopifySalesDatespan datespan, string requestId = null, DateTime? timestamp = null) : base(user, clientId, requestId, timestamp) => Datespan = datespan; public ShopifySalesDatespan Datespan { get; set; } // required 2010 - present } public class ShopifySalesResponse { public int count { get; set; } // total count of records public string next_page_info { get; set; } // pagination header public List orders { get; set; } // list of orders } // required requests and responses public class ShopifyGetSalesRequest : ShopifySalesRequest { public ShopifyGetSalesRequest( User user, string clientId, ShopifySalesDatespan datespan, string requestId = null, DateTime? timestamp = null) : base(user, clientId, datespan, requestId, timestamp) { } } public class ShopifyGetSalesResponse : RequestResponse { public ShopifyGetSalesResponse( ShopifyGetSalesRequest request, int recordCount, IList salesTransactions, Exception exception = null, DateTime? timestamp = null) : base(request, exception, timestamp) { RecordCount = recordCount; SalesTransactions = salesTransactions; } public int RecordCount { get; set; } public IList SalesTransactions { get; set; } } public class ShopifyFetchSalesRequest : ShopifySalesRequest { public ShopifyFetchSalesRequest( User user, string clientId, ShopifySalesDatespan datespan, string requestId = null, DateTime? timestamp = null) : base(user, clientId, datespan, requestId, timestamp) { } } public class ShopifyFetchSalesResponse : RequestResponse { public ShopifyFetchSalesResponse( ShopifyFetchSalesRequest request, ShopifySalesResponse shopifySalesResponse, Exception exception = null, DateTime? timestamp = null) : base(request, exception, timestamp) => this.ShopifySalesResponse = shopifySalesResponse; public ShopifySalesResponse ShopifySalesResponse { get; set; } } // common data-sets public class ShopifyMoney { public string amount { get; set; } public string currency_code { get; set; } } public class ShopifyPriceSet { public Money shop_money { get; set; } public Money presentment_money { get; set; } public class Money { public string amount { get; set; } public string currency_code { get; set; } } } public class ShopifyTaxLine { public string title { get; set; } public string price { get; set; } public PriceSet price_set { get; set; } public double rate { get; set; } public class PriceSet { public Money shop_money { get; set; } public Money presentment_money { get; set; } public class Money { public string amount { get; set; } public string currency_code { get; set; } } } } }