Skip to content

Commit

Permalink
Merge branch 'main' into 122-feature-allow-control-plane-user-to-push…
Browse files Browse the repository at this point in the history
…-api-activity-log-to-external-system
  • Loading branch information
KsiBart authored Nov 21, 2024
2 parents 8f9a913 + 01c049e commit e42a936
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,18 @@ spec:
- rejected
valueMapping:
CREATING: acknowledged,
ACTIVATING: inProgress,
ACCEPTED: inProgress,
MANUAL: inProgress,
DELETING: inProgress,
DISABLING: inProgress,
DENIED: rejected,
ERROR: failed,
ACTIVE: completed,
DISABLED: disabled,
CANCELLED: disabled,
PENDING: pending,
PENDING_ACCEPTANCE: pending,
ACTIVATING: inProgress
ACCEPTED: inProgress
MANUAL: inProgress
DELETING: inProgress
DISABLING: inProgress
DENIED: rejected
ERROR: failed
ACTIVE: completed
DISABLED: disabled
CANCELLED: disabled
PENDING: pending
PENDING_ACCEPTANCE: pending
DELETED: completed
source: "@{{responseBody.status}}"
sourceLocation: BODY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ spec:
- name: mapper.order.uni.add.bandwidth
title: "Bandwidth of the UNI"
source: "@{{productOrderItem[0].product.productConfiguration.bandwidth}}"
sourceType: customized_enum
sourceValues:
- 1000
- 10000
target: "@{{speed}}"
sourceLocation: BODY
targetLocation: BODY
Expand Down Expand Up @@ -143,21 +147,21 @@ spec:
- partial
- rejected
valueMapping:
progressing: inProgress,
created: acknowledged,
CREATING: acknowledged,
ACTIVATING: inProgress,
ACCEPTED: inProgress,
MANUAL: inProgress,
DELETING: inProgress,
DISABLING: inProgress,
DENIED: rejected,
ERROR: failed,
ACTIVE: completed,
DISABLED: disabled,
CANCELLED: disabled,
PENDING: pending,
PENDING_ACCEPTANCE: pending,
progressing: inProgress
created: acknowledged
CREATING: acknowledged
ACTIVATING: inProgress
ACCEPTED: inProgress
MANUAL: inProgress
DELETING: inProgress
DISABLING: inProgress
DENIED: rejected
ERROR: failed
ACTIVE: completed
DISABLED: disabled
CANCELLED: disabled
PENDING: pending
PENDING_ACCEPTANCE: pending
DELETED: completed
source: "@{{responseBody.status}}"
sourceLocation: BODY
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.consoleconnect.kraken.operator.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum MappingTypeEnum {
ENUM("enum"),
CUSTOMIZED_ENUM("customized_enum");
private final String kind;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.consoleconnect.kraken.operator.core.dto.UnifiedAssetDto;
import com.consoleconnect.kraken.operator.core.enums.ActionTypeEnum;
import com.consoleconnect.kraken.operator.core.enums.ExpectTypeEnum;
import com.consoleconnect.kraken.operator.core.enums.MappingTypeEnum;
import com.consoleconnect.kraken.operator.core.enums.ParamLocationEnum;
import com.consoleconnect.kraken.operator.core.exception.KrakenException;
import com.consoleconnect.kraken.operator.core.model.AppProperty;
Expand Down Expand Up @@ -41,7 +42,6 @@ public class MappingMatrixCheckerActionRunner extends AbstractActionRunner {
public static final String MESSAGE_ALERT = "api use case is not supported %s";
public static final String CHECK_NAME_ENABLED = "enabled";
public static final String PARAM_NAME = "param";
public static final String ENUM = "enum";
public static final String NOT_FOUND = "notFound";
public static final String COLON = ":";
private final UnifiedAssetService unifiedAssetService;
Expand Down Expand Up @@ -217,7 +217,8 @@ public void checkRequestConstraints(String targetKey, Map<String, Object> inputs
|| ParamLocationEnum.HYBRID.name().equals(mapper.getTargetLocation())) {
continue;
}
if (Objects.equals(mapper.getSourceType(), ENUM)) {
if (MappingTypeEnum.ENUM.getKind().equals(mapper.getSourceType())
|| MappingTypeEnum.CUSTOMIZED_ENUM.getKind().equals(mapper.getSourceType())) {
checkEnumValue(mapper.getSource(), mapper.getTarget(), inputs, mapper.getSourceValues());
} else if (mapper.getTarget() != null && !mapper.getTarget().contains("@{{")) {
checkConstantValue(mapper.getSource(), mapper.getTarget(), inputs);
Expand Down

0 comments on commit e42a936

Please sign in to comment.