Add serviceOrder rest services
[externalapi/nbi.git] / src / main / java / org / onap / nbi / apis / serviceorder / workflow / CreateAAICustomerManager.java
1 package org.onap.nbi.apis.serviceorder.workflow;
2
3 import org.onap.nbi.apis.serviceorder.MultiClient;
4 import org.onap.nbi.apis.serviceorder.model.orchestrator.ServiceOrderInfo;
5 import org.springframework.beans.factory.annotation.Autowired;
6 import org.springframework.stereotype.Service;
7
8 @Service
9 public class CreateAAICustomerManager {
10
11
12     @Autowired
13     private MultiClient serviceOrderConsumerService;
14
15
16     public void createAAICustomer(ServiceOrderInfo serviceOrderInfo) {
17
18
19         if (serviceOrderInfo.isUseServiceOrderCustomer() && serviceOrderInfo.isAllItemsInAdd()
20                 && !serviceOrderConsumerService
21                         .isCustomerPresentInAAI(serviceOrderInfo.getSubscriberInfo().getGlobalSubscriberId())) {
22             serviceOrderConsumerService.putCustomer(serviceOrderInfo.getSubscriberInfo());
23         }
24     }
25
26
27 }
28
29