Skip to content

Commit

Permalink
MODCON-88 add COMPLETED_WITH_ERRORS status to distinguish failures on…
Browse files Browse the repository at this point in the history
… creating primary affiliations for users (#95)
  • Loading branch information
tatsiana-tarhonskaya authored Aug 18, 2023
1 parent da159ff commit 6216970
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ private void createPrimaryUserAffiliations(UUID consortiumId, String centralTena
" and error message: {}", user.getId(), tenantId, e.getMessage(), e);
}
}
tenantService.updateTenantSetupStatus(tenantId, centralTenantId, hasFailedAffiliations ? SetupStatusEnum.FAILED
: SetupStatusEnum.COMPLETED);
tenantService.updateTenantSetupStatus(tenantId, centralTenantId, hasFailedAffiliations ?
SetupStatusEnum.COMPLETED_WITH_ERRORS : SetupStatusEnum.COMPLETED);
log.info("createPrimaryUserAffiliations:: Successfully created {} of {} primary affiliations for tenant {}",
affiliatedUsersCount, userList.size(), tenantId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

<changeSet id="MODCON-88@add-tenant-setup-status" author="tatsiana_tarhonskaya@epam.com">
<sql dbms="postgresql">
CREATE TYPE setup_status as ENUM ('IN_PROGRESS', 'COMPLETED', 'FAILED');
CREATE TYPE setup_status as ENUM ('IN_PROGRESS', 'COMPLETED', 'COMPLETED_WITH_ERRORS', 'FAILED');
CREATE CAST (character varying as setup_status) WITH INOUT AS IMPLICIT;
</sql>
<addColumn tableName="tenant">
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/swagger.api/schemas/tenant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ TenantDetails:
properties:
setupStatus:
type: string
enum: [ "IN_PROGRESS", "COMPLETED", "FAILED" ]
enum: [ "IN_PROGRESS", "COMPLETED", "COMPLETED_WITH_ERRORS", "FAILED" ]

TenantCollection:
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,6 @@ void createPrimaryAffiliationsPartialFailure() throws JsonProcessingException {

syncPrimaryAffiliationService.createPrimaryUserAffiliations(consortiumId, centralTenantId, spab);
verifyNoInteractions(kafkaService);
verify(tenantService).updateTenantSetupStatus(tenantId, centralTenantId, SetupStatusEnum.FAILED);
verify(tenantService).updateTenantSetupStatus(tenantId, centralTenantId, SetupStatusEnum.COMPLETED_WITH_ERRORS);
}
}

0 comments on commit 6216970

Please sign in to comment.