Class CdekServiceImpl
- java.lang.Object
-
- co.mastermindcms.modules.services.cdek.CdekServiceImpl
-
- All Implemented Interfaces:
CdekService
@Service public class CdekServiceImpl extends java.lang.Object implements CdekService
-
-
Field Summary
Fields Modifier and Type Field Description private com.cdek.java.model.auth.request.AuthRequest
authRequest
private com.cdek.java.model.auth.request.AuthRequest
authRequestTest
private com.cdek.java.client.CdekClientImpl
cdekClient
private com.cdek.java.client.CdekClientImpl
cdekClientTest
private CommerceProperties
commerceProperties
private com.fasterxml.jackson.databind.ObjectMapper
mapper
private OrderRepository
orderRepository
private ProfileRepository
profileRepository
private SellerRepository
sellerRepository
-
Constructor Summary
Constructors Constructor Description CdekServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.cdek.java.model.auth.response.AuthResponse
authenticate()
com.cdek.java.model.auth.response.AuthResponse
authenticateTest()
com.cdek.java.model.calculator.response.Calculator
calculate(com.cdek.java.model.calculator.request.CalculatorRequest request)
java.math.BigDecimal
calculateDeliveryPrice(Order order)
com.cdek.java.model.courier.response.CourierResponse
createCourierRequest(com.cdek.java.model.courier.request.CourierRequest request)
java.util.List<com.cdek.java.model.deliverypoint.response.DeliveryPointResponse>
getDeliveryPoints(com.cdek.java.model.deliverypoint.request.DeliveryPointRequest request)
com.cdek.java.model.calculator.response.TariffCode
getTariffCode(Order order)
com.cdek.java.model.calculator.response.Tariffs
getTariffs(com.cdek.java.model.calculator.request.CalculatorRequest calcReq)
void
init()
boolean
isCdekKeysDefined()
Checks if the CDEK keys are defined.boolean
isTestCdekKeysDefined()
Checks if the CDEK test keys are defined.com.cdek.java.model.order.response.OrderResponse
orderRegistration(com.cdek.java.model.order.request.OrderRequest request)
boolean
ship(Order order)
-
-
-
Field Detail
-
sellerRepository
@Autowired private SellerRepository sellerRepository
-
profileRepository
@Autowired private ProfileRepository profileRepository
-
orderRepository
@Autowired private OrderRepository orderRepository
-
commerceProperties
@Autowired private CommerceProperties commerceProperties
-
authRequest
private com.cdek.java.model.auth.request.AuthRequest authRequest
-
authRequestTest
private com.cdek.java.model.auth.request.AuthRequest authRequestTest
-
cdekClient
private com.cdek.java.client.CdekClientImpl cdekClient
-
cdekClientTest
private com.cdek.java.client.CdekClientImpl cdekClientTest
-
mapper
private final com.fasterxml.jackson.databind.ObjectMapper mapper
-
-
Method Detail
-
init
@PostConstruct public void init()
-
isCdekKeysDefined
public boolean isCdekKeysDefined()
Description copied from interface:CdekService
Checks if the CDEK keys are defined.- Specified by:
isCdekKeysDefined
in interfaceCdekService
- Returns:
- true if the CDEK keys are defined, false otherwise.
-
isTestCdekKeysDefined
public boolean isTestCdekKeysDefined()
Description copied from interface:CdekService
Checks if the CDEK test keys are defined.- Specified by:
isTestCdekKeysDefined
in interfaceCdekService
- Returns:
- true if the CDEK test keys are defined, false otherwise.
-
authenticate
public com.cdek.java.model.auth.response.AuthResponse authenticate()
- Specified by:
authenticate
in interfaceCdekService
-
authenticateTest
public com.cdek.java.model.auth.response.AuthResponse authenticateTest()
- Specified by:
authenticateTest
in interfaceCdekService
-
calculate
public com.cdek.java.model.calculator.response.Calculator calculate(com.cdek.java.model.calculator.request.CalculatorRequest request)
- Specified by:
calculate
in interfaceCdekService
-
orderRegistration
public com.cdek.java.model.order.response.OrderResponse orderRegistration(com.cdek.java.model.order.request.OrderRequest request)
- Specified by:
orderRegistration
in interfaceCdekService
-
createCourierRequest
public com.cdek.java.model.courier.response.CourierResponse createCourierRequest(com.cdek.java.model.courier.request.CourierRequest request)
- Specified by:
createCourierRequest
in interfaceCdekService
-
getDeliveryPoints
public java.util.List<com.cdek.java.model.deliverypoint.response.DeliveryPointResponse> getDeliveryPoints(com.cdek.java.model.deliverypoint.request.DeliveryPointRequest request)
- Specified by:
getDeliveryPoints
in interfaceCdekService
-
getTariffs
public com.cdek.java.model.calculator.response.Tariffs getTariffs(com.cdek.java.model.calculator.request.CalculatorRequest calcReq)
- Specified by:
getTariffs
in interfaceCdekService
-
getTariffCode
public com.cdek.java.model.calculator.response.TariffCode getTariffCode(Order order)
- Specified by:
getTariffCode
in interfaceCdekService
-
calculateDeliveryPrice
public java.math.BigDecimal calculateDeliveryPrice(Order order)
- Specified by:
calculateDeliveryPrice
in interfaceCdekService
-
ship
public boolean ship(Order order)
- Specified by:
ship
in interfaceCdekService
-
-