Skip to content

Commit

Permalink
release: merge migrations (#186)
Browse files Browse the repository at this point in the history
* chore(migrations): align migrations
* feat(ssi): add SUSTAINABILITY_CREDENTIAL type
* release: bump version for v1.6.0-RC5

-----------

Reviewed-By: Norbert Truchsess <norbert.truchsess@t-online.de>
  • Loading branch information
Phil91 authored Aug 7, 2023
1 parent d73c9f2 commit a45ed48
Show file tree
Hide file tree
Showing 12 changed files with 102 additions and 7 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@

New features, fixed bugs, known defects and other noteworthy changes to each release of the Catena-X Portal Backend.

## 1.6.0-RC5

### Change
* Administration Service
* add validation to endpoint /api/administration/serviceaccount/owncompany/serviceaccounts/{serviceAccountId} to check if requesting user is either owner or provider
* enable search of clientId for GET /api/administration/serviceaccount/owncompany/serviceaccounts
* Daps
* Remove Daps calls from all business logic

### Technical Support
* update of the portal_welcome_email template
* add check whether an endpoint should only be callable for a service account user
* add check whether an endpoint should only be callable for a company user

### Bugfix
* Logging
* configure serilog for backend services

### Known Knowns
* Registration process additional invited user receives 'Welcome Email' without personal salutation due to missing first and last name
* New service account is created with identity "Company User" inside identity table - however the user mapping to company_service_accounts is assigned correctly
* Managed technical users (for offer customers) are not fetched in the GET /serviceAccounts call
* Changing an app instance type (/api/apps/AppReleaseProcess/instance-type/{appId}) is not blocked as soon as the app is submitted for release

## 1.6.0-RC4

### Change
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<Project>
<PropertyGroup>
<VersionPrefix>1.6.0</VersionPrefix>
<VersionSuffix>RC4</VersionSuffix>
<VersionSuffix>RC5</VersionSuffix>
</PropertyGroup>
</Project>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

namespace Org.Eclipse.TractusX.Portal.Backend.PortalBackend.Migrations.Migrations
{
public partial class CPLP3105RemoveDaps : Migration
public partial class _160rc5 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
Expand Down Expand Up @@ -71,6 +71,18 @@ protected override void Up(MigrationBuilder migrationBuilder)
table.PrimaryKey("pk_audit_connector20230803", x => x.audit_v1id);
});

migrationBuilder.InsertData(
schema: "portal",
table: "verified_credential_external_types",
columns: new[] { "id", "label" },
values: new object[] { 5, "SUSTAINABILITY_CREDENTIAL" });

migrationBuilder.InsertData(
schema: "portal",
table: "verified_credential_types",
columns: new[] { "id", "label" },
values: new object[] { 5, "SUSTAINABILITY_FRAMEWORK" });

migrationBuilder.Sql("CREATE FUNCTION portal.LC_TRIGGER_AFTER_DELETE_CONNECTOR() RETURNS trigger as $LC_TRIGGER_AFTER_DELETE_CONNECTOR$\r\nBEGIN\r\n INSERT INTO portal.audit_connector20230803 (\"id\", \"name\", \"connector_url\", \"type_id\", \"status_id\", \"provider_id\", \"host_id\", \"self_description_document_id\", \"location_id\", \"self_description_message\", \"date_last_changed\", \"company_service_account_id\", \"last_editor_id\", \"audit_v1id\", \"audit_v1operation_id\", \"audit_v1date_last_changed\", \"audit_v1last_editor_id\") SELECT OLD.id, \r\n OLD.name, \r\n OLD.connector_url, \r\n OLD.type_id, \r\n OLD.status_id, \r\n OLD.provider_id, \r\n OLD.host_id, \r\n OLD.self_description_document_id, \r\n OLD.location_id, \r\n OLD.self_description_message, \r\n OLD.date_last_changed, \r\n OLD.company_service_account_id, \r\n OLD.last_editor_id, \r\n gen_random_uuid(), \r\n 3, \r\n CURRENT_DATE, \r\n OLD.last_editor_id;\r\nRETURN NEW;\r\nEND;\r\n$LC_TRIGGER_AFTER_DELETE_CONNECTOR$ LANGUAGE plpgsql;\r\nCREATE TRIGGER LC_TRIGGER_AFTER_DELETE_CONNECTOR AFTER DELETE\r\nON portal.connectors\r\nFOR EACH ROW EXECUTE PROCEDURE portal.LC_TRIGGER_AFTER_DELETE_CONNECTOR();");

migrationBuilder.Sql("CREATE FUNCTION portal.LC_TRIGGER_AFTER_INSERT_CONNECTOR() RETURNS trigger as $LC_TRIGGER_AFTER_INSERT_CONNECTOR$\r\nBEGIN\r\n INSERT INTO portal.audit_connector20230803 (\"id\", \"name\", \"connector_url\", \"type_id\", \"status_id\", \"provider_id\", \"host_id\", \"self_description_document_id\", \"location_id\", \"self_description_message\", \"date_last_changed\", \"company_service_account_id\", \"last_editor_id\", \"audit_v1id\", \"audit_v1operation_id\", \"audit_v1date_last_changed\", \"audit_v1last_editor_id\") SELECT NEW.id, \r\n NEW.name, \r\n NEW.connector_url, \r\n NEW.type_id, \r\n NEW.status_id, \r\n NEW.provider_id, \r\n NEW.host_id, \r\n NEW.self_description_document_id, \r\n NEW.location_id, \r\n NEW.self_description_message, \r\n NEW.date_last_changed, \r\n NEW.company_service_account_id, \r\n NEW.last_editor_id, \r\n gen_random_uuid(), \r\n 1, \r\n CURRENT_DATE, \r\n NEW.last_editor_id;\r\nRETURN NEW;\r\nEND;\r\n$LC_TRIGGER_AFTER_INSERT_CONNECTOR$ LANGUAGE plpgsql;\r\nCREATE TRIGGER LC_TRIGGER_AFTER_INSERT_CONNECTOR AFTER INSERT\r\nON portal.connectors\r\nFOR EACH ROW EXECUTE PROCEDURE portal.LC_TRIGGER_AFTER_INSERT_CONNECTOR();");
Expand All @@ -86,6 +98,18 @@ protected override void Down(MigrationBuilder migrationBuilder)

migrationBuilder.Sql("DROP FUNCTION portal.LC_TRIGGER_AFTER_UPDATE_CONNECTOR() CASCADE;");

migrationBuilder.DeleteData(
schema: "portal",
table: "verified_credential_external_types",
keyColumn: "id",
keyValue: 5);

migrationBuilder.DeleteData(
schema: "portal",
table: "verified_credential_types",
keyColumn: "id",
keyValue: 5);

migrationBuilder.DropTable(
name: "audit_connector20230803",
schema: "portal");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5102,6 +5102,11 @@ protected override void BuildModel(ModelBuilder modelBuilder)
{
Id = 4,
Label = "VEHICLE_DISMANTLE"
},
new
{
Id = 5,
Label = "SUSTAINABILITY_CREDENTIAL"
});
});

Expand Down Expand Up @@ -5181,6 +5186,11 @@ protected override void BuildModel(ModelBuilder modelBuilder)
{
Id = 4,
Label = "DISMANTLER_CERTIFICATE"
},
new
{
Id = 5,
Label = "SUSTAINABILITY_FRAMEWORK"
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,13 @@
"template": "https://catena-x.net/fileadmin/user_upload/04_Einfuehren_und_umsetzen/Framework_Use_Case_Traceability/Catena_X_Use_Case_Rahmenbedingungen_Trace_3.0_DE.pdf",
"valid_from": "2024-01-01 00:00:00.000000 +00:00",
"expiry": "2024-12-31 00:00:00.000000 +00:00"
},
{
"id": "1268a76a-ca19-4dd8-b932-01f24071d565",
"verified_credential_external_type_id": 5,
"version": "1.0.0",
"template": "https://catena-x.net/fileadmin/user_upload/04_Einfuehren_und_umsetzen/Framework_Use_Case_Traceability/Catena_X_Use_Case_Rahmenbedingungen_Trace_3.0_DE.pdf",
"valid_from": "2024-01-01 00:00:00.000000 +00:00",
"expiry": "2024-12-31 00:00:00.000000 +00:00"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@
{
"verified_credential_external_type_id": 4,
"verified_credential_type_id": 4
},
{
"verified_credential_external_type_id": 5,
"verified_credential_type_id": 5
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@
{
"verified_credential_type_id": 4,
"verified_credential_type_kind_id": 2
},
{
"verified_credential_type_id": 5,
"verified_credential_type_kind_id": 1
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@
{
"verified_credential_type_id": 3,
"use_case_id": "c065a349-f649-47f8-94d5-1a504a855419"
},
{
"verified_credential_type_id": 5,
"use_case_id": "1aacde78-35ec-4df3-ba1e-f988cddcbbd8"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ public enum VerifiedCredentialExternalTypeId

[EnumMember(Value = "vehicleDismantle")]
VEHICLE_DISMANTLE = 4,

[EnumMember(Value = "Sustainability_Credential")]
SUSTAINABILITY_CREDENTIAL = 5,
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,7 @@ public enum VerifiedCredentialTypeId

[EnumMember(Value = "Dismantler Certificate")]
DISMANTLER_CERTIFICATE = 4,

[EnumMember(Value = "Sustainability Framework")]
SUSTAINABILITY_FRAMEWORK = 5,
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@ public async Task GetDetailsForCompany_WithValidData_ReturnsExpected()
var result = await sut.GetUseCaseParticipationForCompany(_validCompanyId, "en").ToListAsync().ConfigureAwait(false);

// Assert
result.Should().HaveCount(3);
result.Where(x => x.Description != null).Should().HaveCount(3).And.Satisfy(
result.Should().HaveCount(4);
result.Where(x => x.Description != null).Should().HaveCount(4).And.Satisfy(
x => x.Description == "Traceability",
x => x.Description == "Sustainability & CO2-Footprint",
x => x.Description == "Quality Management");
x => x.Description == "Quality Management",
x => x.Description == "Circular Economy");
var traceability = result.Single(x => x.CredentialType == VerifiedCredentialTypeId.TRACEABILITY_FRAMEWORK);
traceability.VerifiedCredentials.Should().HaveCount(3).And.Satisfy(
x => x.ExternalDetailData.Version == "1.0.0" && x.SsiDetailData.Single().ParticipationStatus == CompanySsiDetailStatusId.PENDING,
Expand Down

0 comments on commit a45ed48

Please sign in to comment.