Skip to content

Conversation

leopoldo94
Copy link
Contributor

@leopoldo94 leopoldo94 commented Aug 27, 2025

List of Changes

openapi spec for activations api
fix open api to integrate headers from apim and and fix the activatio…
add json for upsert and get activation api
rename variables to distinguish between two storage account
add implementation for upsert and get activation api
add events for tracking
add utils for managing special servicesrename variable to distinguish between storage accounts
add unit test for the new api
fix unit test after refactoring

Motivation and Context

The necessity to move the Upsert and Get activation API from common to IO Enti&Servizi domain

How Has This Been Tested?

Screenshots (if appropriate):

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@leopoldo94 leopoldo94 requested a review from a team as a code owner August 27, 2025 09:36
Copy link

changeset-bot bot commented Aug 27, 2025

🦋 Changeset detected

Latest commit: 51287eb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
io-services-cms-webapp Minor
@io-services-cms/models Patch
io-services-app-backend Patch
io-services-cms-backoffice Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@leopoldo94 leopoldo94 marked this pull request as draft August 27, 2025 09:36
@leopoldo94 leopoldo94 force-pushed the IOPAE-2127-upser-and-get-activation-implementation branch from 38b4fc1 to 563ca25 Compare September 2, 2025 15:19
Copy link
Contributor

github-actions bot commented Sep 2, 2025

Coverage Report for App Backend (./apps/app-backend)

Status Category Percentage Covered / Total
🔵 Lines 81.59% 687 / 842
🔵 Statements 81.59% 687 / 842
🔵 Functions 75% 33 / 44
🔵 Branches 94.11% 128 / 136
File CoverageNo changed files found.
Generated in workflow #3670

Copy link
Contributor

github-actions bot commented Sep 2, 2025

Coverage Report for Backoffice Frontend (./apps/backoffice)

Status Category Percentage Covered / Total
🔵 Lines 15.01% 1660 / 11059
🔵 Statements 15.01% 1660 / 11059
🔵 Functions 28.32% 83 / 293
🔵 Branches 64.91% 185 / 285
File CoverageNo changed files found.
Generated in workflow #3667

Copy link
Contributor

github-actions bot commented Sep 2, 2025

Coverage Report for Backoffice Backend (./apps/backoffice)

Status Category Percentage Covered / Total
🔵 Lines 66.17% 3511 / 5306
🔵 Statements 66.17% 3511 / 5306
🔵 Functions 64.93% 150 / 231
🔵 Branches 83.9% 641 / 764
File CoverageNo changed files found.
Generated in workflow #3667

Copy link
Contributor

github-actions bot commented Sep 2, 2025

Coverage Report for Webapp (./apps/io-services-cms-webapp)

Status Category Percentage Covered / Total
🔵 Lines 87.58% 6329 / 7226
🔵 Statements 87.58% 6329 / 7226
🔵 Functions 90.28% 288 / 319
🔵 Branches 91.49% 968 / 1058
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
apps/io-services-cms-webapp/src/utils/applicationinsight.ts 77.08% 100% 50% 77.08% 14-15, 17-25
apps/io-services-cms-webapp/src/utils/special-services.ts 100% 100% 100% 100%
apps/io-services-cms-webapp/src/webservice/index.ts 97.37% 100% 100% 97.37% 257-264
apps/io-services-cms-webapp/src/webservice/controllers/get-service-activation.ts 100% 88.23% 100% 100%
apps/io-services-cms-webapp/src/webservice/controllers/upload-service-logo.ts 97.16% 90% 100% 97.16% 100-102, 125
apps/io-services-cms-webapp/src/webservice/controllers/upsert-service-activation.ts 100% 83.33% 100% 100%
Generated in workflow #3670

Copy link
Contributor

github-actions bot commented Sep 2, 2025

Coverage Report for External Clients (./packages/external-clients)

Status Category Percentage Covered / Total
🔵 Lines 84.38% 643 / 762
🔵 Statements 84.38% 643 / 762
🔵 Functions 79.16% 38 / 48
🔵 Branches 95.14% 98 / 103
File CoverageNo changed files found.
Generated in workflow #3670

Copy link
Contributor

github-actions bot commented Sep 2, 2025

Coverage Report for Models (./packages/io-services-cms-models)

Status Category Percentage Covered / Total
🔵 Lines 81.17% 1337 / 1647
🔵 Statements 81.17% 1337 / 1647
🔵 Functions 66.31% 63 / 95
🔵 Branches 97.25% 177 / 182
File CoverageNo changed files found.
Generated in workflow #3670

Copy link

sonarqubecloud bot commented Sep 2, 2025

@leopoldo94 leopoldo94 marked this pull request as ready for review September 2, 2025 15:37
Comment on lines +10 to +24
const SPECIAL_CATEGORY: ServiceLifecycle.definitions.Service["data"]["metadata"]["category"] =
"SPECIAL";

// Authorization check: only services of SPECIAL_CATEGORY can proceed
export const authorizedForSpecialServicesTask = (
category: ServiceLifecycle.definitions.Service["data"]["metadata"]["category"],
): TE.TaskEither<
IResponseErrorForbiddenNotAuthorized,
ServiceLifecycle.definitions.Service["data"]["metadata"]["category"]
> =>
pipe(
O.fromNullable(category),
O.filter((cat) => cat === SPECIAL_CATEGORY),
TE.fromOption(() => ResponseErrorForbiddenNotAuthorized),
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion(non-blocking): we can refactor it into a more understandable form

Suggested change
const SPECIAL_CATEGORY: ServiceLifecycle.definitions.Service["data"]["metadata"]["category"] =
"SPECIAL";
// Authorization check: only services of SPECIAL_CATEGORY can proceed
export const authorizedForSpecialServicesTask = (
category: ServiceLifecycle.definitions.Service["data"]["metadata"]["category"],
): TE.TaskEither<
IResponseErrorForbiddenNotAuthorized,
ServiceLifecycle.definitions.Service["data"]["metadata"]["category"]
> =>
pipe(
O.fromNullable(category),
O.filter((cat) => cat === SPECIAL_CATEGORY),
TE.fromOption(() => ResponseErrorForbiddenNotAuthorized),
);
// Authorization check: only services of SPECIAL_CATEGORY can proceed
export const authorizedForSpecialServicesTask = (
category: ServiceLifecycle.definitions.Service["data"]["metadata"]["category"],
): TE.TaskEither<IResponseErrorForbiddenNotAuthorized, "SPECIAL"> =>
pipe(
O.fromNullable(category),
O.filter((cat) => cat === "SPECIAL"),
TE.fromOption(() => ResponseErrorForbiddenNotAuthorized),
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants