eclipse-tractusx / portal-backend

Portal Backend
Apache License 2.0
7 stars 15 forks source link

Certificate Management - enhance db attributes and API details #574

Open jjeroch opened 3 months ago

jjeroch commented 3 months ago

TASK 1

Description: As part of the backend change for the certificate function, the following new attributes need to be added to the companies_certificate table inside the portal database.

Note - all fields which have a ?added are nullable


Acceptance Criteria:

  1. The companies_certificate table should have the new attributes: external_certificate_number, validFrom, validUntil, issuer, trustlevel, and validator.
  2. New table companies_certificate_assigned_sites created and linked to the existing table companies_certificate

TASK 2

Description: enhance GET and POST endpoints with those new attributes

Acceptance Criteria:

  1. The POST endpoint of /certificates should accept the new attributes and store them in the database.
  2. The GET endpoint of /certificates should include the new attributes in the response payload.


Endpoint: POST /api/administration/companydata/companyCertificate

enhance the request body by adding the optional new fields:


Endpoint: GET /api/administration/companydata/companyCertificate

enhance the response body by adding the new fields:

jjeroch commented 1 month ago

Refinement still ongoing, but implementation started in parallel (local - no PR planned for now)

jjeroch commented 1 week ago

@AnuragNagpure can you please adjust the validation for the sites to only allow BPNS numbers.

Test Examples

Success

"BPNS0003726HZL98"

Failing

"BPNL0003726HZL98" "BPNA0003726HZL98" "BPNS0003726HZL9 " "BPNS0003726HZL9" "BPNS0003726HZL999" "BPNS0003 726HZL9" "BPNS0003-726HZL9" "8BPNL0003726HZL9"