Skip to content

Commit

Permalink
Merge pull request #155 from pagopa/PAGOPA-2348
Browse files Browse the repository at this point in the history
feat: returning cheapest bundle for each psp PAGOPA-2348
  • Loading branch information
FedericoRuzzier authored Nov 12, 2024
2 parents ec78b2e + 795f097 commit 1cc3175
Show file tree
Hide file tree
Showing 21 changed files with 660 additions and 316 deletions.
4 changes: 2 additions & 2 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: pagopa-afm-calculator
description: Microservice that handles calculation for pagoPA Advanced Fees Management
type: application
version: 2.45.0
appVersion: 2.10.32
version: 2.46.0
appVersion: 2.10.32-1-PAGOPA-2348
dependencies:
- name: microservice-chart
version: 2.4.0
Expand Down
2 changes: 1 addition & 1 deletion helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-afm-calculator
tag: "2.10.32"
tag: "2.10.32-1-PAGOPA-2348"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion helm/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-afm-calculator
tag: "2.10.32"
tag: "2.10.32-1-PAGOPA-2348"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion helm/values-uat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-afm-calculator
tag: "2.10.32"
tag: "2.10.32-1-PAGOPA-2348"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
108 changes: 89 additions & 19 deletions integration-test/src/config/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"touchpoint": "ANY",
"paymentType": null,
"abi": 14156,
"pspBusinessName": "psp business name int-test-1"
"pspBusinessName": "psp business name int-test-1",
"cart" : true
},
{
"id": "int-test-2",
Expand All @@ -38,7 +39,8 @@
"validityDateTo": null,
"touchpoint": "ANY",
"abi": 14156,
"pspBusinessName": "psp business name int-test-2"
"pspBusinessName": "psp business name int-test-2",
"cart" : true
},
{
"id": "int-test-3",
Expand All @@ -59,7 +61,8 @@
"validityDateTo": null,
"touchpoint": "ANY",
"abi": 14156,
"pspBusinessName": "psp business name int-test-3"
"pspBusinessName": "psp business name int-test-3",
"cart" : true
},
{
"id": "int-test-4",
Expand All @@ -82,7 +85,8 @@
"validityDateFrom": null,
"validityDateTo": null,
"touchpoint": "ANY",
"paymentType": null
"paymentType": null,
"cart" : true
},
{
"id": "int-test-5",
Expand All @@ -107,7 +111,8 @@
"validityDateFrom": null,
"validityDateTo": null,
"abi": 14156,
"pspBusinessName": "psp business name int-test-5"
"pspBusinessName": "psp business name int-test-5",
"cart" : true
},
{
"id": "int-test-6",
Expand All @@ -127,7 +132,8 @@
"validityDateTo": null,
"paymentType": null,
"abi": 14156,
"pspBusinessName": "psp business name int-test-6"
"pspBusinessName": "psp business name int-test-6",
"cart" : true
},
{
"id": "int-test-7",
Expand All @@ -147,7 +153,8 @@
"validityDateTo": null,
"paymentType": null,
"abi": 14156,
"pspBusinessName": "psp business name int-test-7"
"pspBusinessName": "psp business name int-test-7",
"cart" : true
},
{
"id": "int-test-8",
Expand All @@ -167,7 +174,8 @@
"validityDateTo": null,
"paymentType": null,
"abi": 14156,
"pspBusinessName": "psp business name int-test-8"
"pspBusinessName": "psp business name int-test-8",
"cart" : true
},
{
"id": "int-test-9",
Expand All @@ -187,7 +195,8 @@
"validityDateTo": null,
"paymentType": null,
"abi": 14156,
"pspBusinessName": "psp business name int-test-9"
"pspBusinessName": "psp business name int-test-9",
"cart" : true
},
{
"id": "int-test-10",
Expand All @@ -207,7 +216,8 @@
"touchpoint": "ANY",
"paymentType": "CP",
"abi": "AMREX",
"pspBusinessName": "psp business name int-test-10"
"pspBusinessName": "psp business name int-test-10",
"cart" : true
},
{
"id": "int-test-cart-cart-1",
Expand All @@ -227,7 +237,8 @@
"touchpoint": "ANY",
"paymentType": "CP",
"abi": 14156,
"pspBusinessName": "psp business name int-test-cart-1"
"pspBusinessName": "psp business name int-test-cart-1",
"cart" : true
},
{
"id": "int-test-cart-cart-2",
Expand All @@ -247,7 +258,8 @@
"touchpoint": "ANY",
"paymentType": "CP",
"abi": 14156,
"pspBusinessName": "psp business name int-test-cart-2"
"pspBusinessName": "psp business name int-test-cart-2",
"cart" : true
},
{
"id": "int-test-cart-cart-3",
Expand All @@ -267,7 +279,8 @@
"touchpoint": "ANY",
"paymentType": "CP",
"abi": 14156,
"pspBusinessName": "psp business name int-test-cart-3"
"pspBusinessName": "psp business name int-test-cart-3",
"cart" : true
},
{
"id": "int-test-cart-cart-4",
Expand All @@ -287,7 +300,8 @@
"touchpoint": "ANY",
"paymentType": "CP",
"abi": 14156,
"pspBusinessName": "psp business name int-test-cart-4"
"pspBusinessName": "psp business name int-test-cart-4",
"cart" : true
},
{
"id": "int-test-cart-cart-5",
Expand All @@ -307,7 +321,8 @@
"touchpoint": "ANY",
"paymentType": "CP",
"abi": 14156,
"pspBusinessName": "psp business name int-test-cart-5"
"pspBusinessName": "psp business name int-test-cart-5",
"cart" : true
},
{
"id": "int-test-cart-cart-6",
Expand All @@ -327,7 +342,8 @@
"touchpoint": "ANY",
"paymentType": "CP",
"abi": 14156,
"pspBusinessName": "psp business name int-test-cart-6"
"pspBusinessName": "psp business name int-test-cart-6",
"cart" : true
},
{
"id": "int-test-cart-cart-7",
Expand All @@ -347,7 +363,50 @@
"touchpoint": "ANY",
"paymentType": null,
"abi": 10101,
"pspBusinessName": "psp business name int-test-cart-7"
"pspBusinessName": "psp business name int-test-cart-7",
"cart" : true
},
{
"id": "int-test-cart-cart-8",
"idPsp": "PPAYITR1XXX",
"idBrokerPsp": "88888888899",
"idChannel": "88888888899_01_ONUS",
"digitalStamp": false,
"digitalStampRestriction": false,
"name": "pacchetto 8",
"description": "pacchetto 8",
"paymentAmount": 100,
"minPaymentAmount": 899999999999986,
"maxPaymentAmount": 899999999999988,
"type": "GLOBAL",
"validityDateFrom": null,
"validityDateTo": null,
"touchpoint": "ANY",
"paymentType": "CP",
"abi": 14156,
"pspBusinessName": "psp business name int-test-cart-8",
"cart" : true
},
{
"id": "int-test-cart-cart-9",
"idPsp": "PPAYITR1XXX",
"idBrokerPsp": "88888888899",
"idChannel": "88888888899_01_ONUS",
"digitalStamp": false,
"digitalStampRestriction": false,
"name": "pacchetto 9",
"description": "pacchetto 9",
"paymentAmount": 150,
"minPaymentAmount": 899999999999986,
"maxPaymentAmount": 899999999999988,
"type": "PRIVATE",
"validityDateFrom": null,
"validityDateTo": null,
"touchpoint": "ANY",
"paymentType": "CP",
"abi": 14156,
"pspBusinessName": "psp business name int-test-cart-9",
"cart" : true
}
],
"ciBundles": [
Expand Down Expand Up @@ -479,7 +538,7 @@
"maxPaymentAmount": 20
},
{
"id": "int-test-cart-cart-10",
"id": "int-test-cart-10",
"maxPaymentAmount": 40
}
]
Expand All @@ -490,10 +549,21 @@
"idBundle": "int-test-cart-cart-7",
"attributes": [
{
"id": "int-test-cart-9",
"id": "int-test-cart-11",
"maxPaymentAmount": 20
}
]
},
{
"id": "int-test-cart-10",
"ciFiscalCode": "77777777777",
"idBundle": "int-test-cart-cart-9",
"attributes": [
{
"id": "int-test-cart-12",
"maxPaymentAmount": 60
}
]
}
],
"touchpoints": [
Expand Down
21 changes: 5 additions & 16 deletions integration-test/src/features/getFees.feature
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Feature: GetFees - Get List of fees by CI, amount, method, touchpoint
"bin": "309500",
"paymentMethod": "CP",
"touchpoint": null,
"idPspList": [{"idPsp":"88888888889"}],
"idPspList": [{"idPsp":"PPAYITR1XXX"}],
"transferList": [
{
"creditorInstitution": "77777777777",
Expand All @@ -96,12 +96,8 @@ Feature: GetFees - Get List of fees by CI, amount, method, touchpoint
Then check statusCode is 200
And the body response ordering for the bundleOptions.onUs field is:
| onUs |
| true |
| false |
| false |
| false |
| false |
| true |



Scenario: Get List of fees by CI, amount, touchpoint and single PSP
Expand All @@ -113,7 +109,7 @@ Feature: GetFees - Get List of fees by CI, amount, method, touchpoint
"bin": "309500",
"paymentMethod": null,
"touchpoint": "IO",
"idPspList": [{"idPsp":"88888888888"}],
"idPspList": [{"idPsp":"PPAYITR1XXX"}],
"transferList": [
{
"creditorInstitution": "77777777777",
Expand All @@ -130,8 +126,8 @@ Feature: GetFees - Get List of fees by CI, amount, method, touchpoint
Then check statusCode is 200
And the body response ordering for the bundleOptions.onUs field is:
| onUs |
| true |
| false |
| true |
| false |


Expand Down Expand Up @@ -195,7 +191,7 @@ Feature: GetFees - Get List of fees by CI, amount, method, touchpoint
"bin": "309500",
"paymentMethod": null,
"touchpoint": "IO",
"idPspList": [{"idPsp":"88888888889"}],
"idPspList": [{"idPsp":"BPPIITRRXXX"}],
"transferList": [
{
"creditorInstitution": "77777777777",
Expand Down Expand Up @@ -280,13 +276,6 @@ Feature: GetFees - Get List of fees by CI, amount, method, touchpoint
Then check statusCode is 200
And the body response ordering for the bundleOptions.onUs field is:
| onUs |
| false |
| false |
| false |
| false |
| false |
| false |
| false |

Scenario: Execute a GetFees request with allCcp flag set to false
Given initial json
Expand Down
Loading

0 comments on commit 1cc3175

Please sign in to comment.