package io.delphi.qa.auto.awsmfrw.tests.api;

import io.delphi.qa.auto.awsmfrw.common_baby.EnDelphiFsResourceList;
import io.delphi.qa.auto.awsmfrw.common_baby.delphi.api.QueryParamsContainer;
import io.delphi.qa.auto.awsmfrw.models.ICanFetch;
import io.delphi.qa.auto.awsmfrw.models.api.rest.v3.methods.params.*;
import io.delphi.qa.auto.awsmfrw.models.db.sql.pg.EnDelphiDbResourceList;

@QueryParamsContainer
public abstract class BsApiRestMagicTest extends BsApiTest
    implements ICanFetchStartDate,
        ICanFetchEndDate,
        ICanFetchDsps,
        ICanFetchIsrcs,
        ICanFetchProductFamilyNos,
        ICanFetchMediaTypes,
        ICanFetchProductIds,
        ICanFetchArtistIds,
        ICanFetchTrackIds,
        ICanFetchChartIds,
        ICanFetchProjectIds,
        ICanFetchProductVersionNos,
        ICanFetchPlaylistIds,
        ICanFetchParentRepOwnerKeys,
        ICanFetchRepOwnerKeys,
        ICanFetchDecibelLabelIds,
        ICanFetchVideoIds,
        ICanFetchCountryCodes,
        ICanFetchContentTypes,
        ICanFetchConfigCatKeys,
        ICanFetchConfigKeys {

  // search params
  // --date range
//  protected String START_DATE = fetchStartDate();
  protected String START_DATE = ICanFetch.fetchItem(EnDelphiFsResourceList.START_DATE);
  protected final String END_DATE = fetchEndDate();
  // --general
  protected final String ARTIST_ID = fetchArtistId();
  private final String ARTIST_IDS = String.join(",", fetchArtistIds());
  private final String DSP = fetchDsp();
  private final String DSPS = String.join(",", fetchDsps());
  private final String ISRC = fetchIsrc();
  private final String ISRCS = String.join(",", fetchIsrcs());
  private final String COUNTRY_CODE = fetchCountryCode(false);
  private final String COUNTRY_CODES = String.join(",", fetchCountryCodes(false));
  private final String LABEL_ID = fetchDecibelLabelId();
  private final String PROJECT_ID = fetchProjectId();
  protected final String PRODUCT_FAMILY_NO = fetchProductFamilyNo();
  private final String PRODUCT_FAMILY_NOS = String.join(",", fetchProductFamilyNos());
  protected final String PRODUCT_ID = fetchProductId();
  private final String PRODUCT_IDS = String.join(",", fetchProductIds());
  private final String PRODUCT_VERSION_NO = fetchProductVersionNo();
  protected final String CONFIG_CAT_KEY = fetchConfigCatKey();
  private final String CONFIG_CAT_KEYS = String.join(",", fetchConfigCatKeys());
  protected final String REP_OWNER_KEY = fetchParentRepOwnerKey();
  private final String REP_OWNER_KEYS = String.join(",", fetchParentRepOwnerKeys());
  protected final String VIDEO_ID = fetchVideoId();
  private final String VIDEO_IDS = String.join(",", fetchVideoIds());
  protected final String TRACK_ID = fetchTrackId();
  private final String TRACK_IDS = String.join(",", fetchTrackIds());
  private final String PLAYLIST_ID = fetchPlaylistId();
  private final String PLAYLIST_IDS = String.join(",", fetchPlaylistIds());
  private final String CHART_GROUP = fetchChartGroup(true, fetchStreamDsp());
  private final String CHART_GROUPS = String.join(",", fetchChartGroups(true, fetchStreamDsp()));
  protected final String CONFIG_KEY = ICanFetch.fetchItem(EnDelphiDbResourceList.CONFIG_KEY);
  //
  private final String AGG_BY_ISRC = "isrc";
  private final String AGG_BY_ARTIST = "artist";
}
