Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PRDP-289] feat: add failed cart recovery #49

Merged
merged 33 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
09b80ad
[PRDP-289] feat: introducing service to recover failed carts
alexyey Dec 15, 2023
daa94d6
[PRDP-289] feat: Updated RecoverFailedCart
alexyey Dec 18, 2023
9458509
[PRDP-289] feat: introducing service to recover failed carts
alexyey Dec 15, 2023
dc7bde2
[PRDP-289] feat: Updated RecoverFailedCart
alexyey Dec 18, 2023
2b8d964
Merge remote-tracking branch 'origin/PRDP-289-feat-add-failed-cart-re…
alessio-cialini Jan 3, 2024
1a08568
[PRDP-289] feat: introducing service to recover failed carts
alexyey Dec 15, 2023
aa510c7
[PRDP-289] feat: Updated RecoverFailedCart
alexyey Dec 18, 2023
085c93d
[PRDP-289] feat: updated test classes after main rebase
alessio-cialini Jan 3, 2024
dba84b9
Merge remote-tracking branch 'origin/PRDP-289-feat-add-failed-cart-re…
alessio-cialini Jan 3, 2024
20e8a5a
[PRDP-289] feat: introducing massive cart recovery
alessio-cialini Jan 3, 2024
d16d89b
[PRDP-289] feat: introducing RecoverFailedCartMassive, RecoverFailedC…
alessio-cialini Jan 3, 2024
c131f6b
[PRDP-289] feat: introducing RecoverFailedCart, RecoverFailedCartTest
alessio-cialini Jan 3, 2024
5a8c612
[PRDP-289] feat: Updated helm chart, introducing RecoverFailed massiv…
alessio-cialini Jan 4, 2024
902d8cd
[PRDP-289] feat: introducing service to recover failed carts
alexyey Dec 15, 2023
c8e1deb
[PRDP-289] feat: Updated RecoverFailedCart
alexyey Dec 18, 2023
768fc2d
[PRDP-289] feat: updated test classes after main rebase
alessio-cialini Jan 3, 2024
e54b457
[PRDP-289] feat: introducing service to recover failed carts
alexyey Dec 15, 2023
91d14f9
[PRDP-289] feat: introducing service to recover failed carts
alexyey Dec 15, 2023
b01d8ba
[PRDP-289] feat: introducing massive cart recovery
alessio-cialini Jan 3, 2024
dadcc50
[PRDP-289] feat: introducing RecoverFailedCartMassive, RecoverFailedC…
alessio-cialini Jan 3, 2024
5e68277
[PRDP-289] feat: introducing RecoverFailedCart, RecoverFailedCartTest
alessio-cialini Jan 3, 2024
eb29652
[PRDP-289] feat: Updated helm chart, introducing RecoverFailed massiv…
alessio-cialini Jan 4, 2024
650d8a6
[PRDP-289] feat: Updated tests for scheduled recovery of failed carts
alessio-cialini Jan 4, 2024
b5aab3d
Merge remote-tracking branch 'origin/PRDP-289-feat-add-failed-cart-re…
alessio-cialini Jan 4, 2024
1efaa35
[PRDP-289] feat: Updated BizEventCosmosClient
alessio-cialini Jan 4, 2024
3cae14e
[PRDP-289] feat: Updated RecoverFailedCart
alessio-cialini Jan 4, 2024
dc389d8
[PRDP-289] feat: Updated existing services to handle cart
alessio-cialini Jan 4, 2024
edfe4c2
[PRDP-289] feat: Updated existing apis and tests for cart management
alessio-cialini Jan 5, 2024
3153483
[PRDP-289] feat: Updated existing apis and tests for cart management
alessio-cialini Jan 5, 2024
20fa16f
[PRDP-289] feat: Updated openapi.json
alessio-cialini Jan 5, 2024
f7f1b9d
[PRDP-289] feat: Updated openapi.json and existing apis for managemen…
alessio-cialini Jan 5, 2024
d7063bf
[PRDP-289] feat: Updated openapi.json and existing apis for managemen…
alessio-cialini Jan 5, 2024
d0f80f2
[PRDP-289] feat: Updated openapi.json
alessio-cialini Jan 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,14 @@ microservice-chart:
OTEL_TRACES_SAMPLER: "always_on"
MAX_DATE_DIFF_MILLIS: "1800000" # 30min
MAX_DATE_DIFF_NOTIFY_MILLIS: "1800000" # 30nin
MAX_DATE_DIFF_CART_MILLIS: "1800000" # 30nin
TRIGGER_NOTIFY_REC_SCHEDULE: "0 0 */2 * * *"
RECOVER_FAILED_CRON: "0 0 */2 * * *"
RECOVER_FAILED_CART_CRON: "0 0 */2 * * *"
AZURE_FUNCTIONS_MESH_JAVA_OPTS: "-javaagent:/home/site/wwwroot/jmx_prometheus_javaagent-0.19.0.jar=12345:/home/site/wwwroot/config.yaml -javaagent:/home/site/wwwroot/opentelemetry-javaagent.jar -Xmx768m -XX:+UseG1GC"
FAILED_AUTORECOVER_ENABLED: "true"
NOT_NOTIFIED_AUTORECOVER_ENABLED: "true"
FAILED_CART_AUTORECOVER_ENABLED: "true"
RECOVER_FAILED_MASSIVE_MAX_DAYS: "0"
RECOVER_NOT_NOTIFIED_MASSIVE_MAX_DAYS: "0"
RECOVER_NOT_NOTIFIED_MASSIVE_MAX_RECORDS: "200"
Expand Down
3 changes: 3 additions & 0 deletions helm/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,14 @@ microservice-chart:
OTEL_TRACES_SAMPLER: "always_on"
MAX_DATE_DIFF_MILLIS: "1800000" # 30min
MAX_DATE_DIFF_NOTIFY_MILLIS: "1800000" # 30nin
MAX_DATE_DIFF_CART_MILLIS: "1800000" # 30nin
TRIGGER_NOTIFY_REC_SCHEDULE: "0 0 */1 * * *"
RECOVER_FAILED_CRON: "0 0 */1 * * *"
RECOVER_FAILED_CART_CRON: "0 0 */1 * * *"
AZURE_FUNCTIONS_MESH_JAVA_OPTS: "-javaagent:/home/site/wwwroot/jmx_prometheus_javaagent-0.19.0.jar=12345:/home/site/wwwroot/config.yaml -javaagent:/home/site/wwwroot/opentelemetry-javaagent.jar -Xmx768m -XX:+UseG1GC"
FAILED_AUTORECOVER_ENABLED: "true"
NOT_NOTIFIED_AUTORECOVER_ENABLED: "true"
FAILED_CART_AUTORECOVER_ENABLED: "false"
RECOVER_FAILED_MASSIVE_MAX_DAYS: "0"
RECOVER_NOT_NOTIFIED_MASSIVE_MAX_DAYS: "0"
RECOVER_NOT_NOTIFIED_MASSIVE_MAX_RECORDS: "200"
Expand Down
3 changes: 3 additions & 0 deletions helm/values-uat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,14 @@ microservice-chart:
OTEL_TRACES_SAMPLER: "always_on"
MAX_DATE_DIFF_MILLIS: "1800000" # 30min
MAX_DATE_DIFF_NOTIFY_MILLIS: "1800000" # 30nin
MAX_DATE_DIFF_CART_MILLIS: "1800000" # 30nin
TRIGGER_NOTIFY_REC_SCHEDULE: "0 0 */1 * * *"
RECOVER_FAILED_CRON: "0 0 */1 * * *"
RECOVER_FAILED_CART_CRON: "0 0 */1 * * *"
AZURE_FUNCTIONS_MESH_JAVA_OPTS: "-javaagent:/home/site/wwwroot/jmx_prometheus_javaagent-0.19.0.jar=12345:/home/site/wwwroot/config.yaml -javaagent:/home/site/wwwroot/opentelemetry-javaagent.jar -Xmx768m -XX:+UseG1GC"
FAILED_AUTORECOVER_ENABLED: "true"
NOT_NOTIFIED_AUTORECOVER_ENABLED: "true"
FAILED_CART_AUTORECOVER_ENABLED: "false"
RECOVER_FAILED_MASSIVE_MAX_DAYS: "0"
RECOVER_NOT_NOTIFIED_MASSIVE_MAX_DAYS: "0"
RECOVER_NOT_NOTIFIED_MASSIVE_MAX_RECORDS: "200"
Expand Down
271 changes: 271 additions & 0 deletions openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,15 @@
"type": "string"
},
"required": true
},
{
"in": "query",
"name": "isCart",
"description": "Boolean to determine if the id refers to a cart",
"schema": {
"type": "string"
},
"required": false
}
],
"responses": {
Expand Down Expand Up @@ -886,6 +895,241 @@
}
]
},
"/carts/{cart-id}/recover-failed": {
"post": {
"tags": [
"API-recoverFailedCart"
],
"summary": "Recover a cart in FAILED or INSERTED status",
"operationId": "RecoverFailedCart",
"parameters": [
{
"in": "path",
"name": "cart-id",
"description": "Cart id.",
"schema": {
"type": "string"
},
"required": true
}
],
"requestBody": {
"content": {
"application/json": {}
},
"required": false
},
"responses": {
"200": {
"description": "Successful Calls.",
"headers": {
"X-Request-Id": {
"description": "This header identifies the call",
"schema": {
"type": "string"
}
}
},
"content": {
"text/plain": {
"schema": {
"type": "string",
"example": "Receipt with eventId 76abb1f1-c9f9-4ead-9e66-12fec4d51042 recovered"
}
}
}
},
"400": {
"description": "Bad request.",
"headers": {
"X-Request-Id": {
"description": "This header identifies the call",
"schema": {
"type": "string"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemJson"
}
}
}
},
"404": {
"description": "Receipt or BizEvent not found",
"headers": {
"X-Request-Id": {
"description": "This header identifies the call",
"schema": {
"type": "string"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemJson"
}
}
}
},
"500": {
"description": "Error processing the request",
"headers": {
"X-Request-Id": {
"description": "This header identifies the call",
"schema": {
"type": "string"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemJson"
}
}
}
},
"default": {
"description": "Unexpected error.",
"headers": {
"X-Request-Id": {
"description": "This header identifies the call",
"schema": {
"type": "string"
}
}
}
}
},
"security": [
{
"ApiKey": []
}
]
},
"parameters": [
{
"name": "X-Request-Id",
"in": "header",
"description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.",
"schema": {
"type": "string"
}
}
]
},
"/carts/recover-failed": {
"post": {
"tags": [
"API-recoverCartFailed"
],
"summary": "Recover a group of cart in FAILED, or INSERTED status",
"operationId": "RecoverFailedCartMassive",
"parameters": [
{
"in": "query",
"name": "status",
"schema": {
"type": "string"
},
"required": true
}
],
"requestBody": {
"content": {
"application/json": {}
},
"required": false
},
"responses": {
"200": {
"description": "Successful Calls.",
"headers": {
"X-Request-Id": {
"description": "This header identifies the call",
"schema": {
"type": "string"
}
}
},
"content": {
"text/plain": {
"schema": {
"type": "string",
"example": "Recovered 10 carts"
}
}
}
},
"400": {
"description": "Bad request",
"headers": {
"X-Request-Id": {
"description": "This header identifies the call",
"schema": {
"type": "string"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemJson"
}
}
}
},
"500": {
"description": "Error processing the request",
"headers": {
"X-Request-Id": {
"description": "This header identifies the call",
"schema": {
"type": "string"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemJson"
}
}
}
},
"default": {
"description": "Unexpected error.",
"headers": {
"X-Request-Id": {
"description": "This header identifies the call",
"schema": {
"type": "string"
}
}
}
}
},
"security": [
{
"ApiKey": []
}
]
},
"parameters": [
{
"name": "X-Request-Id",
"in": "header",
"description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.",
"schema": {
"type": "string"
}
}
]
},
"/receipts/{event-id}/recover-failed": {
"post": {
"tags": [
Expand All @@ -902,6 +1146,15 @@
"type": "string"
},
"required": true
},
{
"in": "query",
"name": "isCart",
"description": "Boolean to determine if the id refers to a cart",
"schema": {
"type": "string"
},
"required": false
}
],
"requestBody": {
Expand Down Expand Up @@ -1137,6 +1390,15 @@
"type": "string"
},
"required": true
},
{
"in": "query",
"name": "isCart",
"description": "Boolean to determine if the id refers to a cart",
"schema": {
"type": "string"
},
"required": false
}
],
"requestBody": {
Expand Down Expand Up @@ -1372,6 +1634,15 @@
"type": "string"
},
"required": true
},
{
"in": "query",
"name": "isCart",
"description": "Boolean to determine if the id refers to a cart",
"schema": {
"type": "string"
},
"required": false
}
],
"requestBody": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import it.gov.pagopa.receipt.pdf.helpdesk.client.impl.ReceiptCosmosClientImpl;
import it.gov.pagopa.receipt.pdf.helpdesk.entity.receipt.ReceiptError;
import it.gov.pagopa.receipt.pdf.helpdesk.entity.receipt.enumeration.ReceiptErrorStatusType;
import it.gov.pagopa.receipt.pdf.helpdesk.exception.CartNotFoundException;
import it.gov.pagopa.receipt.pdf.helpdesk.exception.ReceiptNotFoundException;
import it.gov.pagopa.receipt.pdf.helpdesk.model.ProblemJson;
import org.slf4j.Logger;
Expand Down
Loading
Loading