Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bpdm-gate): Extend error code #1003

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

package org.eclipse.tractusx.bpdm.gate.api.exception

import io.swagger.v3.oas.annotations.media.Schema

/**
* For every combination of possible errors a separate enum class is defined extending this marker interface.
* We need separate enum classes in order to get the correct error codes for each endpoint in the Swagger schema.
Expand All @@ -30,6 +32,23 @@ enum class BusinessPartnerSharingError : ErrorCode {
SharingTimeout,
BpnNotInPool,
MissingTaskID,
@Schema(description = "The provided record contains natural person information. ")
NaturalPersonError,

@Schema(description = "The provided record can not be matched to a legal entity or an address.")
BpnErrorNotFound,

@Schema(description = "The provided record can not link to a clear legal entity.")
BpnErrorTooManyOptions,

@Schema(description = "The provided record does not fulfill mandatory validation rules. ")
MandatoryFieldValidationFailed,

@Schema(description = "The provided record is part of a country that is not allowed to be processed by the GR process (example: Brazil).")
BlacklistCountryPresent,

@Schema(description = "The provided record contains unallowed special characters. ")
UnknownSpecialCharacters
}

enum class ChangeLogOutputError : ErrorCode {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,26 @@

package org.eclipse.tractusx.orchestrator.api.model

import io.swagger.v3.oas.annotations.media.Schema

enum class TaskErrorType {
Timeout,
Unspecified
Unspecified,
@Schema(description = "The provided record contains natural person information. ")
NaturalPersonError,

@Schema(description = "The provided record can not be matched to a legal entity or an address.")
BpnErrorNotFound,

@Schema(description = "The provided record can not link to a clear legal entity.")
BpnErrorTooManyOptions,

@Schema(description = "The provided record does not fulfill mandatory validation rules. ")
MandatoryFieldValidationFailed,

@Schema(description = "The provided record is part of a country that is not allowed to be processed by the GR process (example: Brazil).")
BlacklistCountryPresent,

@Schema(description = "The provided record contains unallowed special characters. ")
UnknownSpecialCharacters
}
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ create table golden_record_tasks (
create table task_errors (
task_id bigint not null,
description varchar(255) not null,
type varchar(255) not null check (type in ('Timeout', 'Unspecified'))
type varchar(255) not null check (type in ('Timeout', 'Unspecified', 'NaturalPersonError', 'BpnErrorNotFound', 'BpnErrorTooManyOptions','MandatoryFieldValidationFailed', 'BlacklistCountryPresent', 'UnknownSpecialCharacters'))
);

create table gate_records (
Expand Down