Entitlement Pool - Support Type Field 07/103807/6
authorBen David, Elad (eb7504) <eb7504@intl.att.com>
Tue, 17 Mar 2020 16:12:17 +0000 (18:12 +0200)
committerOfir Sonsino <ofir.sonsino@intl.att.com>
Mon, 23 Mar 2020 08:06:19 +0000 (08:06 +0000)
Change-Id: Ibd9996cce04849332bd23dd62e6143386cdd9a70
Issue-ID: SDC-2820
Signed-off-by: Ben David, Elad (eb7504) <eb7504@intl.att.com>
27 files changed:
common/onap-generic-artifact-browser/onap-generic-artifact-browser-component-tests/pom.xml
common/onap-generic-artifact-browser/onap-generic-artifact-browser-service/pom.xml
common/pom.xml
cucumber-js-test-apis-ci/features/UserFeedback/TestMRN.feature
openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolEntityToEntitlementPoolEntityDto.java
openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolRequestDtoToEntitlementPoolEntity.java
openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/test/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolEntityToEntitlementPoolEntityDtoTest.java
openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/test/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolRequestDtoToEntitlementPoolEntityTest.java
openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolRequestDto.java
openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/EntitlementPoolTest.java
openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java
openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolType.java [new file with mode: 0644]
openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/EntitlementPoolZusammenDaoImpl.java
openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/convertor/ElementToEntitlementPoolConvertor.java
openecomp-be/pom.xml
openecomp-ui/resources/scss/modules/_entitlementPools.scss
openecomp-ui/resources/scss/modules/_licenseModelOverview.scss
openecomp-ui/src/sdc-app/onboarding/licenseModel/LicenseModelActionHelper.js
openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsActionHelper.js
openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsConstants.js
openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsEditorReducer.js
openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsListEditorView.jsx
openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/components/FormContent.jsx
openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseKeyGroups/components/FormContent.jsx
openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/listItems/EntitlementPool.jsx
openecomp-ui/test-utils/factories/licenseModel/EntitlementPoolFactories.js
pom.xml

index e03aee5..b5aec18 100644 (file)
 
     <artifactId>onap-generic-artifact-browser-component-tests</artifactId>
 
-    <properties>
-        <maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    </properties>
-
     <dependencies>
         <!--tested packages-->
         <dependency>
         </dependency>
 
     </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>${maven-compiler-plugin.version}</version>
-                <configuration>
-                    <encoding>${project.build.sourceEncoding}</encoding>
-                    <source>8</source>
-                    <target>8</target>
-                    <compilerArgument>-Werror</compilerArgument>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
 </project>
index 93a571a..81555a0 100644 (file)
 
   <build>
     <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>8</source>
-          <target>8</target>
-        </configuration>
-      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
index 4a405fc..44bd6a4 100644 (file)
 
     <build>
         <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>${mvn.compiler.version}</version>
-            </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-jar-plugin</artifactId>
index 161ea57..e63d3df 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-Feature: User Feedback - Enhance EP & LKG to include MRN
+Feature: User Feedback - Enhance EP to include MRN and Type
 
   Scenario: Test Feature Group and Entitlement Pool
 
@@ -24,27 +24,46 @@ Feature: User Feedback - Enhance EP & LKG to include MRN
 
     Then I want to create input data
     Then I want to update the input property "name" with value "FG_01"
-    Then I want to update the input property "description" with value "FG without MRN"
+    Then I want to update the input property "description" with value "FG"
     Then I want to update the input property "partNumber" with value "999"
     Then I want to create for path "/vendor-license-models/{item.id}/versions/{item.versionId}/feature-groups" with the input data from the context
 
     When I want to create input data
     Then I want to update the input property "name" with value "EP_01"
+    Then I want to update the input property "type" with value "Universal"
     Then I want to update the input property "description" with value "EP without MRN"
     Then I want the following to fail
     Then I want to create for path "/vendor-license-models/{item.id}/versions/{item.versionId}/entitlement-pools" with the input data from the context
 
-
     When I want to create input data
     Then I want to update the input property "name" with value "EP_02"
-    Then I want to update the input property "description" with value "EP with MRN"
     Then I want to update the input property "manufacturerReferenceNumber" with value "12345"
+    Then I want to update the input property "description" with value "EP without Type"
+    Then I want the following to fail
     Then I want to create for path "/vendor-license-models/{item.id}/versions/{item.versionId}/entitlement-pools" with the input data from the context
-    Then I want to get path "/vendor-license-models/{item.id}/versions/{item.versionId}/entitlement-pools/{responseData.value}"
-    Then I want to check property "manufacturerReferenceNumber" for value "12345"
-
-
-
 
+    When I want to create input data
+    Then I want to update the input property "name" with value "EP_03"
+    Then I want to update the input property "type" with value "_Universal"
+    Then I want to update the input property "manufacturerReferenceNumber" with value "12345"
+    Then I want to update the input property "description" with value "EP with wrong type"
+    Then I want the following to fail
+    Then I want to create for path "/vendor-license-models/{item.id}/versions/{item.versionId}/entitlement-pools" with the input data from the context
 
+    When I want to create input data
+    Then I want to update the input property "name" with value "EP_04"
+    Then I want to update the input property "type" with value ""
+    Then I want to update the input property "manufacturerReferenceNumber" with value "12345"
+    Then I want to update the input property "description" with value "EP with empty Type"
+    Then I want the following to fail
+    Then I want to create for path "/vendor-license-models/{item.id}/versions/{item.versionId}/entitlement-pools" with the input data from the context
 
+    When I want to create input data
+    Then I want to update the input property "name" with value "EP_05"
+    Then I want to update the input property "description" with value "EP with valid type and MRN"
+    Then I want to update the input property "type" with value "Universal"
+    Then I want to update the input property "manufacturerReferenceNumber" with value "12345"
+    Then I want to create for path "/vendor-license-models/{item.id}/versions/{item.versionId}/entitlement-pools" with the input data from the context
+    Then I want to get path "/vendor-license-models/{item.id}/versions/{item.versionId}/entitlement-pools/{responseData.value}"
+    Then I want to check property "manufacturerReferenceNumber" for value "12345"
+    Then I want to check property "type" for value "Universal"
\ No newline at end of file
index f2010e6..999b430 100644 (file)
@@ -23,6 +23,7 @@ import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
 import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolType;
 import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther;
 import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope;
 import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolEntityDto;
@@ -154,4 +155,16 @@ public class MapEntitlementPoolEntityToEntitlementPoolEntityDtoTest {
         mapper.doMapping(source, target);
         assertEquals(target.getManufacturerReferenceNumber(), param);
     }
+
+    @Test
+    public void testType() {
+        EntitlementPoolEntity source = new EntitlementPoolEntity();
+        EntitlementPoolEntityDto target = new EntitlementPoolEntityDto();
+        MapEntitlementPoolEntityToEntitlementPoolEntityDto mapper =
+                new MapEntitlementPoolEntityToEntitlementPoolEntityDto();
+        EntitlementPoolType entitlementPoolType = EntitlementPoolType.One_Time;
+        source.setType(entitlementPoolType);
+        mapper.doMapping(source, target);
+        assertEquals(target.getType(), entitlementPoolType);
+    }
 }
index 7ff6fb7..0c28cee 100644 (file)
@@ -21,6 +21,7 @@ import static org.testng.Assert.assertEquals;
 import java.util.Collections;
 import java.util.HashSet;
 import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolType;
 import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope;
 import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolRequestDto;
 import org.openecomp.sdcrests.vendorlicense.types.MultiChoiceOrOtherDto;
@@ -126,6 +127,19 @@ public class MapEntitlementPoolRequestDtoToEntitlementPoolEntityTest {
         assertEquals(target.getManufacturerReferenceNumber(), param);
     }
 
+    @Test
+    public void testType() {
+        EntitlementPoolRequestDto source = new EntitlementPoolRequestDto();
+        EntitlementPoolEntity target = new EntitlementPoolEntity();
+        MapEntitlementPoolRequestDtoToEntitlementPoolEntity mapper = new
+                MapEntitlementPoolRequestDtoToEntitlementPoolEntity();
+        EntitlementPoolType entitlementPoolType = EntitlementPoolType.Universal;
+        source.setType(entitlementPoolType);
+        mapper.doMapping(source, target);
+        assertEquals(target.getType(), entitlementPoolType);
+    }
+
+
     enum TestEnum {
         Yes
     }
index dbd6ddc..f9a0456 100644 (file)
@@ -24,6 +24,7 @@ package org.openecomp.sdcrests.vendorlicense.types;
 import io.swagger.v3.oas.annotations.media.Schema;
 import org.codehaus.jackson.annotate.JsonIgnoreProperties;
 import org.hibernate.validator.constraints.NotBlank;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolType;
 import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope;
 import org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit;
 
@@ -46,6 +47,9 @@ public class EntitlementPoolRequestDto {
   @Size(max = 1000)
   private String description;
 
+  @NotNull
+  private EntitlementPoolType type;
+
   private Integer thresholdValue;
 
   private ThresholdUnit thresholdUnits;
@@ -82,6 +86,14 @@ public class EntitlementPoolRequestDto {
     this.description = description;
   }
 
+  public EntitlementPoolType getType() {
+    return type;
+  }
+
+  public void setType(EntitlementPoolType type) {
+    this.type = type;
+  }
+
   public Integer getThresholdValue() {
     return thresholdValue;
   }
index 5db85fe..d7edce3 100644 (file)
@@ -31,6 +31,7 @@ import org.openecomp.sdc.vendorlicense.dao.LimitDao;
 import org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction;
 import org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric;
 import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolType;
 import org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime;
 import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther;
 import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope;
@@ -78,6 +79,7 @@ public class EntitlementPoolTest {
   public EntitlementPoolEntity createEntitlementPool(String vlmId, Version version, String id,
                                                      String name, String desc, int threshold,
                                                      ThresholdUnit thresholdUnit,
+                                                     EntitlementPoolType type,
                                                      EntitlementMetric entitlementMetricChoice,
                                                      String entitlementMetricOther,
                                                      String increments,
@@ -93,6 +95,7 @@ public class EntitlementPoolTest {
     entitlementPool.setVersion(version);
     entitlementPool.setName(name);
     entitlementPool.setDescription(desc);
+    entitlementPool.setType(type);
     entitlementPool.setThresholdValue(threshold);
     entitlementPool.setThresholdUnit(thresholdUnit);
     entitlementPool.setIncrements(increments);
@@ -102,7 +105,7 @@ public class EntitlementPoolTest {
   }
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     MockitoAnnotations.initMocks(this);
   }
 
@@ -121,7 +124,7 @@ public class EntitlementPoolTest {
     opScopeChoices.add(OperationalScope.Network_Wide);
     EntitlementPoolEntity ep2 =
         createEntitlementPool("vlm1Id", null, ep1_id, EP1_NAME, "EP2 dec", 70, ThresholdUnit
-                .Absolute,
+                .Absolute, EntitlementPoolType.Unique,
             EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
             opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
     DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
@@ -144,8 +147,8 @@ public class EntitlementPoolTest {
     opScopeChoices.add(OperationalScope.Network_Wide);
     EntitlementPoolEntity ep2 =
         createEntitlementPool("vlm2Id", null, ep1_id, EP1_NAME, "EP2 dec", 70,
-            ThresholdUnit.Absolute,
-            EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
+            ThresholdUnit.Absolute, EntitlementPoolType.Unique,
+                EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
             opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
     DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
     ep2.setStartDate(LocalDate.now().format(formatter));
@@ -166,8 +169,8 @@ public class EntitlementPoolTest {
     opScopeChoices.add(OperationalScope.Network_Wide);
     EntitlementPoolEntity ep2 =
         createEntitlementPool("vlm3Id", null, ep1_id, EP1_NAME, "EP2 dec", 70,
-            ThresholdUnit.Absolute,
-            EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
+            ThresholdUnit.Absolute, EntitlementPoolType.Unique,
+                EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
             opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
     DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
     ep2.setExpiryDate(LocalDate.now().plusDays(2L).format(formatter));
@@ -187,8 +190,8 @@ public class EntitlementPoolTest {
     opScopeChoices.add(OperationalScope.Network_Wide);
     EntitlementPoolEntity ep2 =
         createEntitlementPool("vlm4Id", null, ep1_id, EP1_NAME, "EP2 dec", 70,
-            ThresholdUnit.Absolute,
-            EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
+            ThresholdUnit.Absolute, EntitlementPoolType.Unique,
+                EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
             opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
     DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
     ep2.setStartDate(LocalDate.now().format(formatter));
@@ -208,7 +211,7 @@ public class EntitlementPoolTest {
     opScopeChoices.add(OperationalScope.Network_Wide);
     EntitlementPoolEntity ep2 =
             createEntitlementPool("vlm2Id", null, ep1_id, EP1_NAME, "EP2 dec", 70,
-                    ThresholdUnit.Absolute,
+                    ThresholdUnit.Absolute, EntitlementPoolType.Unique,
                     EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
                     opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
     DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
@@ -230,7 +233,7 @@ public class EntitlementPoolTest {
     opScopeChoices.add(OperationalScope.Network_Wide);
     EntitlementPoolEntity ep2 =
             createEntitlementPool("vlm2Id", null, ep1_id, EP1_NAME, "EP2 dec", 70,
-                    ThresholdUnit.Absolute,
+                    ThresholdUnit.Absolute, EntitlementPoolType.Unique,
                     EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
                     opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
     ep2.setStartDate(null);
@@ -250,9 +253,8 @@ public class EntitlementPoolTest {
     opScopeChoices.add(OperationalScope.Network_Wide);
     EntitlementPoolEntity ep2 =
         createEntitlementPool(vlm1_id, VERSION01, ep1_id, EP1_NAME, "EP2 dec", 70,
-            ThresholdUnit
-                .Absolute,
-            EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
+            ThresholdUnit.Absolute, EntitlementPoolType.Unique,
+                EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
             opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
     DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
     ep2.setStartDate(LocalDate.now().minusDays(3L).format(formatter));
@@ -271,8 +273,8 @@ public class EntitlementPoolTest {
     opScopeChoices.add(OperationalScope.Network_Wide);
     EntitlementPoolEntity ep2 =
         createEntitlementPool("vlm2Id", null, ep1_id, EP1_NAME, "EP2 dec", 70,
-            ThresholdUnit.Absolute,
-            EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
+            ThresholdUnit.Absolute, EntitlementPoolType.Unique,
+                EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average, null,
             opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
     DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
     ep2.setStartDate(LocalDate.now().format(formatter));
@@ -294,8 +296,8 @@ public class EntitlementPoolTest {
       opScopeChoices.add(OperationalScope.Network_Wide);
       EntitlementPoolEntity ep2 =
           createEntitlementPool("vlm3Id", null, ep1_id, EP1_NAME, "EP2 dec", 70,
-              ThresholdUnit.Absolute,
-              EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average,
+              ThresholdUnit.Absolute, EntitlementPoolType.Unique,
+                  EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average,
               null,
               opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
       DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
@@ -318,8 +320,8 @@ public class EntitlementPoolTest {
       opScopeChoices.add(OperationalScope.Network_Wide);
       EntitlementPoolEntity ep2 =
           createEntitlementPool("vlm4Id", null, ep1_id, EP1_NAME, "EP2 dec", 70,
-              ThresholdUnit.Absolute,
-              EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average,
+              ThresholdUnit.Absolute, EntitlementPoolType.Unique,
+                  EntitlementMetric.Other, "exception metric2", "inc2", AggregationFunction.Average,
               null,
               opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
       DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
@@ -342,7 +344,7 @@ public class EntitlementPoolTest {
 
     EntitlementPoolEntity entitlementPool =
         createEntitlementPool(vlm1_id, VERSION01, ep1_id, EP1_NAME, "EP2 dec", 70,
-            ThresholdUnit.Absolute, EntitlementMetric.Other, "exception metric2", "inc2",
+            ThresholdUnit.Absolute, EntitlementPoolType.Unique, EntitlementMetric.Other, "exception metric2", "inc2",
             AggregationFunction.Average, null,
             opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
     DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy");
@@ -371,7 +373,7 @@ public class EntitlementPoolTest {
 
     EntitlementPoolEntity entitlementPool =
         createEntitlementPool(vlm1_id, VERSION01, ep1_id, EP1_NAME, "EP2 dec", 70,
-            ThresholdUnit.Absolute, EntitlementMetric.Other, "exception metric2", "inc2",
+            ThresholdUnit.Absolute, EntitlementPoolType.Unique, EntitlementMetric.Other, "exception metric2", "inc2",
             AggregationFunction.Average, null,
             opScopeChoices, null, EntitlementTime.Other, "time2", "sku2");
     DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy'T'HH:mm:ss'Z'");
@@ -400,11 +402,11 @@ public class EntitlementPoolTest {
 
     doReturn(Arrays.asList(
         createEntitlementPool(vlm1_id, VERSION01, ep1_id, EP1_NAME, "EP1 dec", 70,
-            ThresholdUnit.Absolute, EntitlementMetric.Other, "exception metric1",
+            ThresholdUnit.Absolute, EntitlementPoolType.Unique, EntitlementMetric.Other, "exception metric1",
             "inc1", AggregationFunction.Average, null,
             opScopeChoices, null, EntitlementTime.Other, "time1", "sku1"),
         createEntitlementPool(vlm1_id, VERSION01, ep2_id, EP2_NAME, "EP2 dec", 70,
-            ThresholdUnit.Absolute, EntitlementMetric.Other, "exception metric2",
+            ThresholdUnit.Absolute, EntitlementPoolType.Unique, EntitlementMetric.Other, "exception metric2",
             "inc2", AggregationFunction.Average, null,
             opScopeChoices, null, EntitlementTime.Other, "time2", "sku2")))
         .when(vendorLicenseFacade).listEntitlementPools(vlm1_id, VERSION01);
index 4c2435a..4d3c1d6 100644 (file)
@@ -57,6 +57,7 @@ public class EntitlementPoolEntity implements VersionableEntity {
   private String id;
   private String name;
   private String description;
+  private EntitlementPoolType type;
 
   @Column(name = "threshold")
   private Integer thresholdValue;
@@ -179,6 +180,14 @@ public class EntitlementPoolEntity implements VersionableEntity {
     this.description = description;
   }
 
+  public EntitlementPoolType getType() {
+    return type;
+  }
+
+  public void setType(EntitlementPoolType type) {
+    this.type = type;
+  }
+
   public Integer getThresholdValue() {
     return thresholdValue;
   }
@@ -311,7 +320,7 @@ public class EntitlementPoolEntity implements VersionableEntity {
   @Override
   public int hashCode() {
     return Objects
-        .hash(vendorLicenseModelId, version, id, name, description, thresholdValue, thresholdUnit,
+        .hash(vendorLicenseModelId, version, id, name, description, type, thresholdValue, thresholdUnit,
             increments, operationalScope, referencingFeatureGroups, startDate, expiryDate);
   }
 
@@ -329,6 +338,7 @@ public class EntitlementPoolEntity implements VersionableEntity {
         && Objects.equals(id, that.id)
         && Objects.equals(name, that.name)
         && Objects.equals(description, that.description)
+        && type == that.type
         && Objects.equals(thresholdUnit, that.thresholdUnit)
         && Objects.equals(increments, that.increments)
         && Objects.equals(that.operationalScope, operationalScope)
@@ -346,6 +356,7 @@ public class EntitlementPoolEntity implements VersionableEntity {
         + ", id='" + id + '\''
         + ", name='" + name + '\''
         + ", description='" + description + '\''
+        + ", type=" + type
         + ", thresholdValue=" + thresholdValue
         + ", thresholdUnit='" + thresholdUnit + '\''
         + ", increments='" + increments + '\''
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolType.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolType.java
new file mode 100644 (file)
index 0000000..3b66fab
--- /dev/null
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorlicense.dao.types;
+
+public enum EntitlementPoolType {
+    Universal,
+    Unique,
+    One_Time;
+
+    public static EntitlementPoolType permissiveValueOf(String name) {
+        if (name == null){
+            return null;
+        } else {
+            return EntitlementPoolType.valueOf(name);
+        }
+    }
+}
index aa9c249..e084cf1 100644 (file)
@@ -238,6 +238,7 @@ public class EntitlementPoolZusammenDaoImpl implements EntitlementPoolDao {
     info.setDescription(entitlementPool.getDescription());
     info.addProperty(ElementPropertyName.elementType.name(), ElementType.EntitlementPool);
     info.addProperty("version_uuid", entitlementPool.getVersionUuId());
+    info.addProperty("EntitlementPoolType", entitlementPool.getType());
     info.addProperty("thresholdValue", entitlementPool.getThresholdValue());
     info.addProperty("threshold_unit", entitlementPool.getThresholdUnit());
     info.addProperty("increments", entitlementPool.getIncrements());
index 258886c..2f06b9b 100644 (file)
@@ -25,6 +25,7 @@ import com.amdocs.zusammen.datatypes.item.Info;
 import com.amdocs.zusammen.datatypes.item.Relation;
 import org.openecomp.convertor.ElementConvertor;
 import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
+import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolType;
 import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther;
 import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope;
 import org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit;
@@ -78,6 +79,7 @@ public class ElementToEntitlementPoolConvertor extends ElementConvertor {
     entitlementPool.setName(info.getName());
     entitlementPool.setDescription(info.getDescription());
     entitlementPool.setVersionUuId(info.getProperty("version_uuid"));
+    entitlementPool.setType(EntitlementPoolType.permissiveValueOf(info.getProperty("EntitlementPoolType")));
     entitlementPool.setThresholdValue(toInteger(info.getProperty("thresholdValue")));
     String thresholdUnit = info.getProperty("threshold_unit");
     entitlementPool
index 09f6daf..7c99ba5 100644 (file)
 
     <build>
         <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>${mvn.compiler.version}</version>
-            </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-jar-plugin</artifactId>
index 736927f..8e8b820 100644 (file)
@@ -4,6 +4,9 @@
             @extend .heading-1;
             color: $purple;
         }
+        .type {
+            color: $orange;
+        }
     }
 }
 
index eca87b6..02a8922 100644 (file)
@@ -346,9 +346,6 @@ $lkg-ep-color: $light-blue;
                             display: flex;
                             flex-direction: column;
                             justify-content: space-between;
-                            *:last-child {
-                                margin-top: 20px;
-                            }
                             *:only-child {
                                 margin-top: 0;
                             }
index be33af7..d6a3c8b 100644 (file)
@@ -4,9 +4,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
index dec7d9c..f1e2f2d 100644 (file)
@@ -41,6 +41,7 @@ function postEntitlementPool(licenseModelId, entitlementPool, version) {
     return RestAPIUtil.post(baseUrl(licenseModelId, version), {
         name: entitlementPool.name,
         description: entitlementPool.description,
+        type: entitlementPool.type,
         thresholdValue: entitlementPool.thresholdValue,
         thresholdUnits: getValue(entitlementPool.thresholdUnits),
         increments: entitlementPool.increments,
@@ -62,6 +63,7 @@ function putEntitlementPool(
         {
             name: entitlementPool.name,
             description: entitlementPool.description,
+            type: entitlementPool.type,
             thresholdValue: entitlementPool.thresholdValue,
             thresholdUnits: getValue(entitlementPool.thresholdUnits),
             increments: entitlementPool.increments,
index d4a2f09..571b512 100644 (file)
@@ -58,6 +58,12 @@ export const thresholdUnitType = {
 };
 
 export const optionsInputValues = {
+    TYPE: [
+        { enum: '', title: i18n('please select…') },
+        { enum: 'Universal', title: 'Universal' },
+        { enum: 'Unique', title: 'Unique' },
+        { enum: 'One_Time', title: 'One Time' }
+    ],
     TIME: [
         { enum: '', title: i18n('please select…') },
         { enum: 'Hour', title: 'Hour' },
@@ -91,9 +97,9 @@ export const extractValue = item => {
         return '';
     } //TODO fix it later
     return item
-        ? item.choice === optionInputOther.OTHER
-          ? item.other
-          : InputOptions.getTitleByName(optionsInputValues, item.choice)
+        ? item === optionInputOther.OTHER
+          ? item
+          : InputOptions.getTitleByName(optionsInputValues, item)
         : '';
 };
 
index eb9cd51..674a8eb 100644 (file)
@@ -56,6 +56,11 @@ export default (state = {}, action) => {
                         errorText: '',
                         validations: [{ type: 'maxLength', data: 1000 }]
                     },
+                    type: {
+                        isValid: true,
+                        errorText: '',
+                        validations: [{ type: 'required', data: true }]
+                    },
                     increments: {
                         isValid: true,
                         errorText: '',
index 2592687..7e980f1 100644 (file)
@@ -20,7 +20,8 @@ import i18n from 'nfvo-utils/i18n/i18n.js';
 import ListEditorView from 'nfvo-components/listEditor/ListEditorView.jsx';
 import ListEditorItemView from 'nfvo-components/listEditor/ListEditorItemView.jsx';
 
-import { extractUnits } from './EntitlementPoolsConstants';
+import { optionsInputValues, extractUnits } from './EntitlementPoolsConstants';
+import InputOptions from 'nfvo-components/input/validation/InputOptions.jsx';
 
 class EntitlementPoolsListEditorView extends React.Component {
     static propTypes = {
@@ -89,6 +90,7 @@ class EntitlementPoolsListEditorView extends React.Component {
         let {
             id,
             name,
+            type,
             description,
             thresholdValue,
             thresholdUnits,
@@ -111,7 +113,12 @@ class EntitlementPoolsListEditorView extends React.Component {
                         <div className="textEllipses text name">{name}</div>
                     </div>
                 </div>
-
+                <div className="list-editor-item-view-field">
+                    <div className="title">{i18n('Type')}</div>
+                    <div className="text type">
+                        {InputOptions.getTitleByName(optionsInputValues, type)}
+                    </div>
+                </div>
                 <div className="list-editor-item-view-field">
                     <div className="title">{i18n('Entitlement')}</div>
                     <div className="entitlement-pools-count">
index b734a88..9eb38de 100644 (file)
@@ -19,7 +19,10 @@ import i18n from 'nfvo-utils/i18n/i18n.js';
 import GridSection from 'nfvo-components/grid/GridSection.jsx';
 import GridItem from 'nfvo-components/grid/GridItem.jsx';
 import Input from 'nfvo-components/input/validation/Input.jsx';
-import { SP_ENTITLEMENT_POOL_FORM } from '../EntitlementPoolsConstants.js';
+import {
+    optionsInputValues,
+    SP_ENTITLEMENT_POOL_FORM
+} from 'sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsConstants.js';
 import { DATE_FORMAT } from 'sdc-app/onboarding/OnboardingConstants.js';
 import { optionsInputValues as LicenseModelOptionsInputValues } from '../../LicenseModelConstants.js';
 import UuId from 'sdc-app/onboarding/licenseModel/components/UuId.jsx';
@@ -34,6 +37,7 @@ export const EntitlementPoolsFormContent = ({
 }) => {
     let {
         name,
+        type,
         description,
         thresholdUnits,
         thresholdValue,
@@ -45,7 +49,7 @@ export const EntitlementPoolsFormContent = ({
         versionUUID
     } = data;
     return (
-        <GridSection hasLastColSet>
+        <GridSection hasLostColSet>
             <GridItem colSpan={2}>
                 <Input
                     onChange={name =>
@@ -62,7 +66,44 @@ export const EntitlementPoolsFormContent = ({
                     type="text"
                 />
             </GridItem>
-            <GridItem colSpan={2} lastColInRow>
+            <GridItem colSpan={2}>
+                <Input
+                    isRequired={true}
+                    onChange={e => {
+                        const selectedIndex = e.target.selectedIndex;
+                        const val = e.target.options[selectedIndex].value;
+                        onDataChanged({ type: val }, SP_ENTITLEMENT_POOL_FORM);
+                    }}
+                    value={type}
+                    label={i18n('Type')}
+                    data-test-id="create-ep-type"
+                    isValid={genericFieldInfo.type.isValid}
+                    errorText={genericFieldInfo.type.errorText}
+                    groupClassName="bootstrap-input-options"
+                    className="input-options-select"
+                    overlayPos="bottom"
+                    type="select">
+                    {optionsInputValues.TYPE.map(type => (
+                        <option key={type.enum} value={type.enum}>
+                            {type.title}
+                        </option>
+                    ))}
+                </Input>
+            </GridItem>
+            <GridItem colSpan={2} stretch>
+                <Input
+                    onChange={description =>
+                        onDataChanged({ description }, SP_ENTITLEMENT_POOL_FORM)
+                    }
+                    isValid={genericFieldInfo.description.isValid}
+                    errorText={genericFieldInfo.description.errorText}
+                    label={i18n('Description')}
+                    value={description}
+                    data-test-id="create-ep-description"
+                    type="textarea"
+                />
+            </GridItem>
+            <GridItem>
                 <Input
                     onChange={e => {
                         // setting the unit to the correct value
@@ -97,21 +138,30 @@ export const EntitlementPoolsFormContent = ({
                         )
                     )}
                 </Input>
-            </GridItem>
-            <GridItem colSpan={2} stretch>
                 <Input
-                    onChange={description =>
-                        onDataChanged({ description }, SP_ENTITLEMENT_POOL_FORM)
+                    type="date"
+                    label={i18n('Start Date')}
+                    value={startDate}
+                    dateFormat={DATE_FORMAT}
+                    startDate={startDate}
+                    endDate={expiryDate}
+                    onChange={startDate =>
+                        onDataChanged(
+                            {
+                                startDate: startDate
+                                    ? startDate.format(DATE_FORMAT)
+                                    : ''
+                            },
+                            SP_ENTITLEMENT_POOL_FORM,
+                            { startDate: validateStartDate }
+                        )
                     }
-                    isValid={genericFieldInfo.description.isValid}
-                    errorText={genericFieldInfo.description.errorText}
-                    label={i18n('Description')}
-                    value={description}
-                    data-test-id="create-ep-description"
-                    type="textarea"
+                    isValid={genericFieldInfo.startDate.isValid}
+                    errorText={genericFieldInfo.startDate.errorText}
+                    selectsStart
                 />
             </GridItem>
-            <GridItem colSpan={2} lastColInRow>
+            <GridItem>
                 <Input
                     className="entitlement-pools-form-row-threshold-value"
                     onChange={thresholdValue =>
@@ -131,16 +181,30 @@ export const EntitlementPoolsFormContent = ({
                     type="text"
                 />
                 <Input
-                    onChange={increments =>
-                        onDataChanged({ increments }, SP_ENTITLEMENT_POOL_FORM)
-                    }
-                    label={i18n('Increments')}
-                    value={increments}
-                    data-test-id="create-ep-increments"
-                    type="text"
+                    type="date"
+                    label={i18n('Expiry Date')}
+                    value={expiryDate}
+                    dateFormat={DATE_FORMAT}
+                    startDate={startDate}
+                    endDate={expiryDate}
+                    onChange={expiryDate => {
+                        onDataChanged(
+                            {
+                                expiryDate: expiryDate
+                                    ? expiryDate.format(DATE_FORMAT)
+                                    : ''
+                            },
+                            SP_ENTITLEMENT_POOL_FORM
+                        );
+                        onDataChanged({ startDate }, SP_ENTITLEMENT_POOL_FORM, {
+                            startDate: validateStartDate
+                        });
+                    }}
+                    isValid={genericFieldInfo.expiryDate.isValid}
+                    errorText={genericFieldInfo.expiryDate.errorText}
+                    selectsEnd
                 />
             </GridItem>
-
             <GridItem colSpan={2}>
                 <Input
                     className="entitlement-pools-form-row-threshold-value"
@@ -161,64 +225,19 @@ export const EntitlementPoolsFormContent = ({
                     data-test-id="create-ep-manufacturerReferenceNumber-value"
                     value={manufacturerReferenceNumber}
                     type="text"
-                    groupClassName="no-bottom-margin"
                 />
             </GridItem>
-            <GridItem colSpan={2} lastColInRow>
-                <div className="date-section">
-                    <Input
-                        groupClassName="no-bottom-margin"
-                        type="date"
-                        label={i18n('Start Date')}
-                        value={startDate}
-                        dateFormat={DATE_FORMAT}
-                        startDate={startDate}
-                        endDate={expiryDate}
-                        onChange={startDate =>
-                            onDataChanged(
-                                {
-                                    startDate: startDate
-                                        ? startDate.format(DATE_FORMAT)
-                                        : ''
-                                },
-                                SP_ENTITLEMENT_POOL_FORM,
-                                { startDate: validateStartDate }
-                            )
-                        }
-                        isValid={genericFieldInfo.startDate.isValid}
-                        errorText={genericFieldInfo.startDate.errorText}
-                        selectsStart
-                    />
-                    <Input
-                        groupClassName="no-bottom-margin"
-                        type="date"
-                        label={i18n('Expiry Date')}
-                        value={expiryDate}
-                        dateFormat={DATE_FORMAT}
-                        startDate={startDate}
-                        endDate={expiryDate}
-                        onChange={expiryDate => {
-                            onDataChanged(
-                                {
-                                    expiryDate: expiryDate
-                                        ? expiryDate.format(DATE_FORMAT)
-                                        : ''
-                                },
-                                SP_ENTITLEMENT_POOL_FORM
-                            );
-                            onDataChanged(
-                                { startDate },
-                                SP_ENTITLEMENT_POOL_FORM,
-                                {
-                                    startDate: validateStartDate
-                                }
-                            );
-                        }}
-                        isValid={genericFieldInfo.expiryDate.isValid}
-                        errorText={genericFieldInfo.expiryDate.errorText}
-                        selectsEnd
-                    />
-                </div>
+            <GridItem colSpan={2}>
+                <Input
+                    onChange={increments =>
+                        onDataChanged({ increments }, SP_ENTITLEMENT_POOL_FORM)
+                    }
+                    label={i18n('Increments')}
+                    value={increments}
+                    data-test-id="create-ep-increments"
+                    groupClassName="no-bottom-margin"
+                    type="text"
+                />
             </GridItem>
             {id && versionUUID && <UuId id={id} versionUUID={versionUUID} />}
         </GridSection>
index c2c62b1..2486428 100644 (file)
@@ -214,7 +214,6 @@ const LicenseKeyGroupFormContent = ({
                     groupClassName="no-bottom-margin"
                 />
             </GridItem>
-
             <GridItem colSpan={2}>
                 <Input
                     onChange={increments =>
index ec5c76b..cceca25 100644 (file)
  */
 import React, { Component } from 'react';
 import i18n from 'nfvo-utils/i18n/i18n.js';
-import { extractUnits } from '../../entitlementPools/EntitlementPoolsConstants.js';
+import {
+    extractValue,
+    extractUnits
+} from 'sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsConstants.js';
 import ArrowCol from './listItemsComponents/ArrowCol.jsx';
 import ItemInfo from './listItemsComponents/ItemInfo.jsx';
 import IconCol from './listItemsComponents/IconCol.jsx';
@@ -30,6 +33,7 @@ class EntitlementPool extends Component {
             epData: {
                 name,
                 description,
+                type,
                 thresholdValue,
                 thresholdUnits,
                 manufacturerReferenceNumber
@@ -46,6 +50,13 @@ class EntitlementPool extends Component {
                 <IconCol className="ep-icon" text="EP" />
                 <ItemInfo name={name} description={description} />
                 <AdditionalDataCol>
+                    {type && (
+                        <AdditionalDataElement
+                            className="vlm-list-item-entitlement-metric"
+                            name={i18n('Type')}
+                            value={extractValue(type)}
+                        />
+                    )}
                     {thresholdValue && (
                         <AdditionalDataElement
                             className="vlm-list-item-entitlement-metric"
index 11422b4..d558b9a 100644 (file)
@@ -28,6 +28,7 @@ Factory.define('EntitlementPoolExtendedBaseFactory')
         thresholdValue: 76,
         thresholdUnits: '%',
         increments: 'string',
+        type: 'Universal',
         startDate: new Date().getTime(),
         expiryDate: new Date().getTime()
     });
diff --git a/pom.xml b/pom.xml
index 601b2cb..81e917b 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -386,7 +386,7 @@ Modifications copyright (c) 2018-2019 Nokia
         <plugin>
           <groupId>pl.project13.maven</groupId>
           <artifactId>git-commit-id-plugin</artifactId>
-          <version>2.2.6</version>
+          <version>4.0.0</version>
         </plugin>
       </plugins>
     </pluginManagement>