Tests for Time Format (#87)

This commit is contained in:
Kirill
2024-04-30 16:15:03 +05:00
committed by GitHub
parent e5867813ab
commit 99b0a24d48
4 changed files with 125 additions and 18 deletions

View File

@@ -13,10 +13,10 @@ type Analytics struct {
type GetAnalyticsDataParams struct {
// Date from which the data will be in the report
DateFrom *core.RequestDate `json:"date_from"`
DateFrom *core.TimeFormat `json:"date_from"`
// Date up to which the data will be in the report
DateTo *core.RequestDate `json:"date_to"`
DateTo *core.TimeFormat `json:"date_to"`
// Items Enum: "unknownDimension" "sku" "spu" "day" "week" "month" "year" "category1" "category2" "category3" "category4" "brand" "modelID"
// Data grouping available to all sellers:

View File

@@ -23,8 +23,8 @@ func TestGetAnalyticsData(t *testing.T) {
http.StatusOK,
map[string]string{"Client-Id": "my-client-id", "Api-Key": "my-api-key"},
&GetAnalyticsDataParams{
DateFrom: core.NewRequestDate(time.Now().Add(time.Duration(30)*24*time.Hour), core.LayoutRequestDateDefault),
DateTo: core.NewRequestDate(time.Now(), core.LayoutRequestDateDefault),
DateFrom: core.NewTimeFormat(time.Now().Add(time.Duration(30)*24*time.Hour), core.ShortDateLayout),
DateTo: core.NewTimeFormat(time.Now(), core.ShortDateLayout),
Dimension: []GetAnalyticsDataDimension{SKUDimension, DayDimension},
Metrics: []GetAnalyticsDataFilterMetric{HistViewPDP},
Sort: []GetAnalyticsDataSort{