Skip to content

Commit

Permalink
[PPABV-31] feat: add new PM mongo db services and configuration for d…
Browse files Browse the repository at this point in the history
…ocker (#138)

* feat: add new PM mongo db services and configuration for docker

* fix: revert application.properties to avoid possible integration test failures; revert .env.example; revert docker-compose version tag removal

* fix: revert application.properties to avoid possible integration test failures; revert .env.example; revert docker-compose version tag removal

* fix: remove empty line to clean up files changed list

* fix: rename pm db references to history db

* fix: rename pm db references to history db

* fix: rename pm db references to history db
  • Loading branch information
dylantangredi-bvt authored Oct 28, 2024
1 parent 890ec25 commit 045242a
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,31 @@ services:
depends_on:
- mongo

mongo-history:
container_name: pagopa-history-helpdesk-mongo
image: mongo
env_file: docker/mongoDB/conf/mongodb-history.env
ports:
- "27018:27017"
networks:
- pagopa-ecommerce-net
healthcheck:
test: echo "db.stats().ok" | mongo --quiet
interval: 10s
volumes:
- ./docker/mongoDB/mongo-history-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro

mongo-express-history:
container_name: pagopa-history-helpdesk-express
image: mongo-express
env_file: docker/mongoDB/conf/mongo-express-history.env
ports:
- "8082:8081"
networks:
- pagopa-ecommerce-net
depends_on:
- mongo-history

pagopa-pdv-mock:
container_name: pagopa-pdv-mock-helpdesk
build:
Expand Down
3 changes: 3 additions & 0 deletions docker/mongoDB/conf/mongo-express-history.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MONGO_INITDB_ROOT_USERNAME=admin
MONGO_INITDB_ROOT_PASSWORD=password
ME_CONFIG_MONGODB_URL=mongodb://$MONGO_INITDB_ROOT_USERNAME:$MONGO_INITDB_ROOT_PASSWORD@pagopa-history-helpdesk-mongo:27017/
3 changes: 3 additions & 0 deletions docker/mongoDB/conf/mongodb-history.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MONGO_INITDB_ROOT_USERNAME=admin
MONGO_INITDB_ROOT_PASSWORD=password
MONGO_INITDB_DATABASE=history
75 changes: 75 additions & 0 deletions docker/mongoDB/mongo-history-init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
conn = new Mongo();
db = conn.getDB("history");

db.getCollection('pm-transactions-history').insertMany([{
"userInfo": {
"userFiscalCode": "RSSMRA80A01H501U",
"notificationEmail": "[email protected]",
"authenticationType": 1
},
"transactionInfo": {
"creationDate": "2024-05-10T11:14:32.556+02:00",
"status": 1,
"statusDetails": 1,
"amount": 30000,
"fee": 100,
"grandTotal": 30100,
"rrn": "241310000102",
"authorizationCode": "00",
"paymentMethodName": "Pagamento con carte"
},
"paymentInfo": {
"origin": "CITTADINANZA_DIGITALE",
"details": [
{
"subject": "TARI 2021",
"iuv": "02055446688775544",
"idTransaction": "feae3da1480841a6ba11520cbd36090b",
"creditorInstitution": "EC_TE",
"paFiscalCode": "77777777777"
}
]
},
"pspInfo": {
"pspId": "UNCRITMM",
"businessName": "UniCredit S.p.A",
"idChannel": "00348170101_01_ONUS"
},
"product": "PM"
},
{
"userInfo": {
"userFiscalCode": "NVEGVN80A01H501U",
"notificationEmail": "[email protected]",
"authenticationType": 1
},
"transactionInfo": {
"creationDate": "2024-06-10T11:14:32.556+02:00",
"status": 1,
"statusDetails": 1,
"amount": 45000,
"fee": 150,
"grandTotal": 45150,
"rrn": "241310000103",
"authorizationCode": "01",
"paymentMethodName": "Pagamento con carte"
},
"paymentInfo": {
"origin": "CITTADINANZA_DIGITALE",
"details": [
{
"subject": "TARI 2022",
"iuv": "02055446688775545",
"idTransaction": "feae3da1480841a6ba11520cbd36091c",
"creditorInstitution": "EC_TE",
"paFiscalCode": "77777777777"
}
]
},
"pspInfo": {
"pspId": "UNCRITMM",
"businessName": "UniCredit S.p.A",
"idChannel": "00348170101_01_ONUS"
},
"product": "PM"
}]);

0 comments on commit 045242a

Please sign in to comment.