import 'package:dio/dio.dart';

import '../../../../../core/locator/locator.dart';
import '../../../../../core/network/api_provider_imp.dart';

class ShopApiProvider {
  ApiProviderImp get _api => locator<ApiProviderImp>();

  Future<Response> getShop() => _api.get('/shop');

  Future<Response> buyCard(String cardId) =>
      _api.post('/shop/buy-card', body: {'card_id': cardId});

  Future<Response> selectCard(String cardId) =>
      _api.post('/shop/select-card', body: {'card_id': cardId});

  Future<Response> purchase({
    required String store,
    required String kind,
    required String productId,
    required String token,
    String purchaseData = '',
    String signature = '',
  }) =>
      _api.post('/shop/purchase', body: {
        'store': store,
        'kind': kind,
        'product_id': productId,
        'token': token,
        'purchase_data': purchaseData,
        'signature': signature,
      });

  Future<Response> adReward(String token) =>
      _api.post('/rewards/ad', body: {'token': token});
}
