BACKOFFICE-GARAJIMCLIENT

mail@pastecode.io avatar
unknown
java
2 years ago
23 kB
1
Indexable
Never
package com.oto11.feign_client;

import com.fasterxml.jackson.databind.JsonNode;
import com.oto11.dto.PageData;
import com.oto11.dto.backoffice.BOPendingApprovalDTO;
import com.oto11.dto.backoffice.BOPendingApprovalDetailDTO;
import com.oto11.dto.backoffice.ListingCountDTO;
import com.oto11.dto.catalog.CategoryDTO;
import com.oto11.dto.catalog.ResultDTO;
import com.oto11.dto.garage.CampaignAndAdditionalServiceDTO;
import com.oto11.dto.garage.GarageAdditionalServicesDTO;
import com.oto11.dto.orders.OrdersActivityDTO;
import com.oto11.dto.orders.OrdersDTO;
import com.oto11.dto.sales.SalesDTO;
import com.oto11.dto.settlement.SettlementPaymentDTO;
import com.oto11.dto.settlement.SettlementSalesDTO;
import com.oto11.dto.sso.UserDto;
import com.oto11.dto.vava.bo.VavaApprovalItem;
import com.oto11.dto.vava.bo.VavaApprovalItemDetail;
import com.oto11.dto.vava.bo.VavaApprovalItemDetailWithVehicleInfo;
import com.oto11.dto.vava.bo.VavaApprovementRequest;
import com.oto11.exception.*;
import com.oto11.response.BaseReturn;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;
import java.util.Map;
import java.util.Optional;

@FeignClient(url = "${backoffice.garajimapi.url}", name = "garajim-api")
public interface GarajimClient {

    @GetMapping(value = "/api/v1/garage11/find-pending-approval-vehicles")
    ResponseEntity<PageData<List<BOPendingApprovalDTO>>> findPendingApprovalVehicles(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret,
                                                                                     @RequestParam(value = "status", required = false) String status, @RequestParam(value = "plate", required = false) String plate, @RequestParam(value = "chassisNumber", required = false) String chassisNumber, @RequestParam(required = false) String carId, @RequestParam(required = false) String garageId,
                                                                                     @RequestParam(required = false) String sellerId, @RequestParam(required = false) Boolean popular, @RequestParam(required = false) Boolean isManuallyPrice, @RequestParam(value = "beginDate") String beginDate, @RequestParam(value = "endDate") String endDate,
                                                                                     @RequestParam(value = "pageNo") Integer pageNo, @RequestParam(value = "pageSize") Integer pageSize, @RequestParam(value = "sortBy") String sortBy, @RequestParam(value = "sortType") String sortType);

    @GetMapping(value = "/api/v1/garage11/find-pending-approval-vehicle")
    ResponseEntity<BOPendingApprovalDetailDTO> getPendingApprovalVehicle(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret, @RequestParam(value = "id", required = false) String carId);

    @PostMapping(value = "/api/v1/garage11/update-pending-approval-vehicle")
    ResponseEntity<BOPendingApprovalDetailDTO> updatePendingApprovalVehicle(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret, @RequestBody BOPendingApprovalDetailDTO carDetail) throws DetailedInvalidRequestException;

    @GetMapping(value = "/api/v1/garage11/get-all-pending-approval-vehicles")
    ResponseEntity<List<BOPendingApprovalDetailDTO>> getAllPendingApprovalVehicles(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret,
                                                                                   @RequestParam(value = "status", required = false) String status, @RequestParam(value = "plate", required = false) String plate, @RequestParam(value = "chassisNumber", required = false) String chassisNumber, @RequestParam(required = false) String carId, @RequestParam(required = false) String sellerId,
                                                                                   @RequestParam(value = "beginDate") String beginDate, @RequestParam(value = "endDate") String endDate);

    @GetMapping(value = "/api/v1/garage11/update-status")
    ResponseEntity<BaseReturn> updateStatus(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret,
                                            @RequestParam String carId, @RequestParam String status) throws UnAuthorizedException;


    @GetMapping(value = "/api/v1/definition/colors")
    ResponseEntity<List<ResultDTO>> getColors(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret);

    @GetMapping(value = "/api/v1/definition/cities")
    ResponseEntity<List<ResultDTO>> getCities(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret);

    @GetMapping(value = "/api/v1/definition/vehicle-types")
    ResponseEntity<List<CategoryDTO>> getVehicleTypes(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret);

    @GetMapping(value = "/api/v1/garage11/find-approval-in-sales-process")
    ResponseEntity<PageData<List<VavaApprovalItem>>> findAllApprovalByStatusIsInSalesProcess(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret,
                                                                                             @RequestParam(value = "pageNo", required = false) Integer pageNo, @RequestParam(value = "pageSize", required = false) Integer pageSize, @RequestParam(value = "sortBy", required = false) String sortBy, @RequestParam(value = "sortType", required = false) String sortType,
                                                                                             @RequestParam(value = "firstName", required = false) String firstName, @RequestParam(value = "lastName", required = false) String lastName, @RequestParam(value = "phone", required = false) String phone, @RequestParam(value = "plateNumber", required = false) String plateNumber, @RequestParam(value = "carId", required = false) String carId,
                                                                                             @RequestParam(value = "email", required = false) String email, @RequestParam(value = "status", required = false) String status, @RequestParam(value = "centreId", required = false) String centreId, @RequestParam(value = "beginDate", required = false) Timestamp beginDate, @RequestParam(value = "endDate", required = false) Timestamp endDate);

    @CrossOrigin
    @GetMapping(value = "/api/v1/garage11/find-vava-centre-list")
    ResponseEntity<List<Map<String, Object>>> findVavaCentreList(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret);

    @GetMapping(value = "/api/v1/garage11/find-vava-approval-item-detail/{carId}")
    ResponseEntity<Optional<VavaApprovalItemDetail>> findVavaApprovalItemByCarId(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret, @PathVariable("carId") String carId);

    @GetMapping(value = "/api/v1/garage11/find-all-vava-approval-item")
    ResponseEntity<List<VavaApprovalItemDetailWithVehicleInfo>> findAllVavaApprovementItem(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret,
                                                                                           @RequestParam(value = "firstName", required = false) String firstName, @RequestParam(value = "lastName", required = false) String lastName, @RequestParam(value = "phone", required = false) String phone, @RequestParam(value = "plateNumber", required = false) String plateNumber, @RequestParam(value = "carId", required = false) String carId,
                                                                                           @RequestParam(value = "email", required = false) String email, @RequestParam(value = "status", required = false) String status, @RequestParam(value = "beginDate", required = false) Timestamp beginDate, @RequestParam(value = "endDate", required = false) Timestamp endDate);

    @PostMapping(value = "/api/v1/garage11/vava-approvement")
    ResponseEntity<BaseReturn> vavaApprovement(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret, @RequestBody VavaApprovementRequest vavaApprovementRequest);

    @GetMapping(value = "/api/v1/garage11/sales/find-sales-list")
    ResponseEntity<PageData<List<SalesDTO>>> findSalesList(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret,
                                                           @RequestParam(value = "orderId", required = false) Long orderId,
                                                           @RequestParam(value = "buyerId", required = false) String buyerId,
                                                           @RequestParam(value = "buyerName", required = false) String buyerName,
                                                           @RequestParam(value = "buyerSurname", required = false) String buyerSurname,
                                                           @RequestParam(value = "sellerId", required = false) String sellerId,
                                                           @RequestParam(value = "sellerName", required = false) String sellerName,
                                                           @RequestParam(value = "plate", required = false) String plate,
                                                           @RequestParam(required = false) String garageId,
                                                           @RequestParam(value = "title", required = false) String vehicleTitle,
                                                           @RequestParam(value = "beginDate") String beginDate,
                                                           @RequestParam(value = "endDate") String endDate,
                                                           @RequestParam(value = "salesType", required = false) String salesType,
                                                           @RequestParam(value = "campaign",required = false) String campaign,
                                                           @RequestParam(value = "pageNo") Integer pageNo,
                                                           @RequestParam(value = "pageSize") Integer pageSize,
                                                           @RequestParam(value = "sortBy") String sortBy,
                                                           @RequestParam(value = "sortType") String sortType);

    @GetMapping(value = "/api/v1/garage11/sales/get-sales")
    ResponseEntity<SalesDTO> getSales(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret, @RequestParam(value = "id") String carId, @RequestParam(value = "orderId", required = false) Long orderId);

    @PostMapping(value = "/api/v1/garage11/sales/update-sales")
    ResponseEntity<SalesDTO> updateSales(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret, @RequestBody SalesDTO sales);

    @GetMapping(value = "/api/v1/garage11/sales/set-settlement-status")
    ResponseEntity<Boolean> setSettlementStatus(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret, @RequestParam Long orderId, @RequestParam Integer settlementStatus);

    @GetMapping(value = "/api/v1/garage11/sales/find-sales")
    ResponseEntity<SettlementSalesDTO> findSales(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret, @RequestParam Long salesId);

    @GetMapping(value = "/api/v1/garage11/sales/find-all-sales-list")
    ResponseEntity<List<SalesDTO>> findAllSalesList(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret,
                                                    @RequestParam(value = "orderId", required = false) Long orderId,
                                                    @RequestParam(value = "buyerId", required = false) String buyerId,
                                                    @RequestParam(value = "buyerName", required = false) String buyerName,
                                                    @RequestParam(value = "buyerSurname", required = false) String buyerSurname,
                                                    @RequestParam(value = "sellerId", required = false) String sellerId,
                                                    @RequestParam(value = "sellerName", required = false) String sellerName,
                                                    @RequestParam(value = "plate", required = false) String plate,
                                                    @RequestParam(required = false) String garageId,
                                                    @RequestParam(value = "title", required = false) String vehicleTitle,
                                                    @RequestParam(value = "beginDate") Timestamp beginDate,
                                                    @RequestParam(value = "endDate") Timestamp endDate,
                                                    @RequestParam(value = "salesType", required = false) String salesType);

    @GetMapping(value = "/api/v1/orders/find-orders-list")
    ResponseEntity<PageData<List<OrdersDTO>>> findOrdersList(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret,
                                                             @RequestParam(value = "orderId", required = false) Long orderId,
                                                             @RequestParam(value = "userId", required = false) String userId,
                                                             @RequestParam(value = "userType", required = false) String userType,
                                                             @RequestParam(value = "sellerId", required = false) String sellerId,
                                                             @RequestParam(required = false) String plate,
                                                             @RequestParam(value = "sellerType", required = false) String sellerType,
                                                             @RequestParam(value = "listingId", required = false) String listingId,
                                                             @RequestParam(value = "orderStatus", required = false) String orderStatus,
                                                             @RequestParam(value = "isActive", required = false) Integer isActive,
                                                             @RequestParam(value = "orderType", required = false) String orderType,
                                                             @RequestParam(value = "gaId", required = false) Long gaId,
                                                             @RequestParam(value = "shareCode", required = false) String shareCode,
                                                             @RequestParam(value = "salesPrice", required = false) BigDecimal salesPrice,
                                                             @RequestParam(value = "beginDate") String beginDate,
                                                             @RequestParam(value = "endDate") String endDate,
                                                             @RequestParam(value = "pageNo") Integer pageNo, @RequestParam(value = "pageSize") Integer pageSize, @RequestParam(value = "sortBy") String sortBy, @RequestParam(value = "sortType") String sortType);

    @GetMapping(value = "/api/v1/orders/get-order-detail-by-id")
    ResponseEntity<List<OrdersDTO>> getOrdersDetail(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret, @RequestParam(value = "orderId", required = false) Long orderId);

    @GetMapping(value = "/api/v1/payments/find-payment-by-order-id")
    ResponseEntity<SettlementPaymentDTO> findPaymentByOrderId(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret, @RequestParam Long orderId);

    @GetMapping(value = "/api/v1/payments/find-payments-by-order-id")
    ResponseEntity<List<SettlementPaymentDTO>> findPaymentsByOrderId(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret, @RequestParam Long orderId);

    @GetMapping(value = "/api/v1/orders/find-all-orders-list")
    ResponseEntity<List<OrdersDTO>> findAllOrdersList(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret,
                                                      @RequestParam(value = "orderId", required = false) Long orderId,
                                                      @RequestParam(value = "userId", required = false) String userId,
                                                      @RequestParam(value = "userType", required = false) String userType,
                                                      @RequestParam(value = "sellerId", required = false) String sellerId,
                                                      @RequestParam(required = false) String plate,
                                                      @RequestParam(value = "sellerType", required = false) String sellerType,
                                                      @RequestParam(value = "listingId", required = false) String listingId,
                                                      @RequestParam(value = "orderStatus", required = false) String orderStatus,
                                                      @RequestParam(value = "isActive", required = false) String isActive,
                                                      @RequestParam(value = "orderType", required = false) String orderType,
                                                      @RequestParam(value = "gaId", required = false) Long gaId,
                                                      @RequestParam(value = "shareCode", required = false) String shareCode,
                                                      @RequestParam(value = "salesPrice", required = false) BigDecimal salesPrice,
                                                      @RequestParam(value = "beginDate") Timestamp beginDate,
                                                      @RequestParam(value = "endDate") Timestamp endDate);

    @GetMapping(value = "/api/v1/user/get-profile-detail-by-id-and-type")
    ResponseEntity<UserDto> getProfileDetail(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret, @RequestParam(value = "id", required = false) String userId, @RequestParam(value = "type", required = false) String userType);

    @GetMapping(value = "/api/v1/garage11/update-ad-life-days-with-day-extension")
    ResponseEntity<Boolean> updateAdLifeDaysWithDayExtension(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret, @RequestParam(value = "dayExtension") Integer dayExtension);

    @GetMapping(value = "/api/v1/garage11/get-delivered-date")
    ResponseEntity<Timestamp> getDeliveredDate(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret, @RequestParam String carId);

    @GetMapping(value = "/api/v1/garage11/set-delivered-date")
    ResponseEntity<Boolean> setDeliveredDate(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret, @RequestParam String carId, @RequestParam Timestamp deliveredDate);

    @GetMapping(value = "/api/v1/garage11/add-purchased-car-to-garage")
    ResponseEntity<Boolean> addPurchasedCarToGarage(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret, @RequestParam String carId);

    @GetMapping(value = "/api/v1/orders/get-order-activity-by-id")
    ResponseEntity<OrdersActivityDTO> getActivityOrdersDetail(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret, @RequestParam(value = "orderId", required = false) Long orderId);

    @GetMapping(value = "/api/v1/options/cancel-option")
    JsonNode cancelOption(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret, @RequestParam String carId);

    @GetMapping(value = "/api/v1/options/cancel-credit-option")
    JsonNode cancelCreditOption(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret, @RequestHeader(value = "x-n11-user-id") String userId, @RequestHeader(value = "x-n11-user-type") String userType, @RequestParam Long orderId);

    @PostMapping(value = "/api/v1/garage11/favorite-car-by-car-ids")
    ResponseEntity<List<ListingCountDTO>> favoriteCarByCarIds(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret, @RequestBody List<String> carIds);

    @GetMapping(value = "/api/v1/options/extend-option-time")
    ResponseEntity<BaseReturn> extendOptionTime(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret, @RequestParam(value = "carId") String carId, @RequestParam(value = "day") int day) throws DetailedInvalidRequestException, NotFoundException, NotModifyWhilePurchasingException, UnAuthorizedException, NotModifiedException;

    @GetMapping(value = "/api/v1/options/extend-credit-option-time")
    ResponseEntity<BaseReturn> extendCreditOptionTime(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret, @RequestParam(value = "carId") String carId, @RequestParam(value = "day") int day) throws DetailedInvalidRequestException, NotFoundException, NotModifyWhilePurchasingException, UnAuthorizedException, NotModifiedException;

    @GetMapping(value = "/api/v1/garage11/campaign-and-addtional-services")
    ResponseEntity<CampaignAndAdditionalServiceDTO> findCampaignAndAdditionalServices(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret, @RequestParam String carId) throws UnAuthorizedException, NotFoundException;

    @GetMapping(value = "/api/v1/garage11/get-garage-additional-services")
    ResponseEntity<List<GarageAdditionalServicesDTO>> getGarageAdditionalServices(@RequestHeader(value = "x-api-key") String apiKey, @RequestHeader(value = "x-api-secret") String apiSecret, @RequestParam Long gaId) throws UnAuthorizedException, NotFoundException;



}