Skip to content

Commit

Permalink
feat(bpdm-gate): Extend error code
Browse files Browse the repository at this point in the history
  • Loading branch information
kunyao-cofinity-x committed Jul 18, 2024
1 parent bedcf07 commit 35ae848
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
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

0 comments on commit 35ae848

Please sign in to comment.