Added event composer

This commit is contained in:
CHIEFSOFT\ameye
2025-10-06 06:49:17 -04:00
parent be53d8a4c5
commit fbf30471f0
8 changed files with 396 additions and 4 deletions
+26
View File
@@ -0,0 +1,26 @@
# Use an official Python runtime as a parent image
FROM python:3.9-slim
# Set the working directory in the container
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Expose port 5000 for the Flask app
EXPOSE 5000
# Set environment variables
ENV FLASK_APP=app.py
ENV FLASK_RUN_HOST=0.0.0.0
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:5000", "--timeout", "120", "wsgi:wsgi_app"]
#RUN exec gunicorn -w 4 -b 0.0.0.0:5000 wsgi:wsgi_app
#RUN chmod +x entrypoint.sh
#
#ENTRYPOINT ["entrypoint.sh"]
+4 -3
View File
@@ -1,8 +1,8 @@
services:
digifi-core:
image: "registry.simbrellang.net/digifi/banktoproductcore:latest"
build:
dockerfile: Dockerfile
# build:
# dockerfile: Dockerfile
env_file:
- .env.core
ports:
@@ -10,9 +10,10 @@ services:
environment:
- FLASK_APP=wsgi.py
- FLASK_ENV=production
#- DATABASE_URL=postgresql+psycopg2://${DATABASE_USER}:${DATABASE_PASSWORD}@${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE_NAME}
- SQLALCHEMY_DATABASE_URI_FULL="oracle+oracledb://FIRSTADVSTG:Pchanged_56789@10.2.110.30:1521/?service_name=firstadv"
volumes:
- .:/app
#network_mode: "host" # Uses the host's network
restart: always
+8
View File
@@ -0,0 +1,8 @@
#!/bin/sh
# echo "Running DB migrations..."
# flask db migrate -m "Migration on $(date)"
# flask db upgrade
echo "Starting Gunicorn server..."
exec gunicorn -w 4 -b 0.0.0.0:5000 wsgi:wsgi_app
+45
View File
@@ -0,0 +1,45 @@
# Flask and Extensions
Flask==2.3.3
# Database
flask-sqlalchemy
flask-migrate
psycopg2-binary
alembic
oracledb
# Schema for validations
Flask-Marshmallow==0.15.0
marshmallow==3.19.0
# CORS
Flask-Cors==3.0.10
# Deployment
gunicorn
# Swagger
flask-swagger-ui
# Env
python-dotenv
# Requests
httpx
# JWT
flask-jwt-extended
# Kafka
confluent-kafka==1.9.2
python-dateutil
Flask-Mail==0.10.0
pandas==2.1.3
openpyxl==3.1.5
+28
View File
@@ -0,0 +1,28 @@
APP_PORT=5000
API_URL="/swagger.json"
KAFKA_TIMEOUT=1000.0
KAFKA_TOPICS="PROCESS_PAYMENT,LOAN_REPAYMENT"
DATABASE_USER=FIRSTADVSTG
DATABASE_PASSWORD=Pchanged_56789
DATABASE_HOST=ig-x6-uat-scan
DATABASE_PORT=1521
DATABASE_NAME=FIRSTADVSTG
DATABASE_SID=firstadv
SQLALCHEMY_DATABASE_URI_FULL="oracle+oracledb://FIRSTADVSTG:Pchanged_56789@10.2.110.30:1521/?service_name=firstadv"
KAFKA_BROKER="10.2.110.20:9092"
BANK_CALL_APP_ID="app1"
BANK_CALL_API_KEY="testtest-api-key-12345"
BANK_CALL_BASE_URL="https://first-advance-middleware-develop.fbn-devops-dev-asenv.appserviceenvironment.net"
BANK_CALL_DISBURSE_LOAN_ENDPOINT="/api/DisburseLoan"
BANK_CALL_COLLECT_LOAN_ENDPOINT="/api/CollectLoan"
BANK_CALL_TRANSACTION_VERIFY="/api/TransactionVerify"
FLASK_APP=wsgi.py
FLASK_ENV=development
+33
View File
@@ -0,0 +1,33 @@
version: "3.8"
services:
digifi-event:
image: "registry.simbrellang.net/digifi/eventmanager:latest"
build: .
env_file:
- .env.event
ports:
- "5000:5000"
environment:
- FLASK_APP=app.py
- FLASK_RUN_HOST=0.0.0.0
volumes:
- .:/app
restart: always
networks:
- digital
swagger:
image: swaggerapi/swagger-ui:v5.1.0
ports:
- "9000:8080"
volumes:
- ./openapi.yml:/usr/local/openapi.yml
environment:
- SWAGGER_JSON=/usr/local/openapi.yml
restart: always
networks:
- digital
networks:
digital:
driver: bridge
+251
View File
@@ -0,0 +1,251 @@
openapi: 3.0.3
info:
title: Event Manager API
description: The documentation for Event Manager API
version: 1.0.0
contact:
name: API Support
email: support@example.com
license:
name: MIT
url: https://opensource.org/licenses/MIT
servers:
- url: http://localhost:5000
description: Local development server
- url: http://www.simbrellang.net:5000
description: Remote Temporary development server
- url: https://event-core.simbrellang.net
description: Remote development server
paths:
/health:
get:
summary: Returns a health message
responses:
200:
description: A successful response
/status-call:
post:
summary: Perform a status call
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
requestId:
type: string
example: "R02802"
countryCode:
type: string
example: "NGR"
transactionId:
type: string
example: "Tr201712RK9232P115"
debtId:
type: string
example: "173021"
transactionType:
type: string
example: "Disbursement"
customerId:
type: string
example: "CN621868"
responses:
200:
description: A successful response
/sms:
post:
summary: Send a SMS
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
text:
type: string
example: "This is a test message for SMS request method."
dest:
type: string
example: "+2348039409144"
unicode:
type: boolean
example: false
responses:
200:
description: A successful response
/bulk-sms:
post:
summary: Send a bulk SMS
requestBody:
required: true
content:
application/json:
schema:
type: array
items:
type: object
properties:
text:
type: string
example: "This is a test message for SMS request method."
dest:
type: string
example: "+2348039409144"
unicode:
type: boolean
example: true
responses:
200:
description: A successful response
/autocall/refresh-verify-disbursement:
get:
summary: Refresh the disbursement to verify
responses:
200:
description: A successful response
/autocall/refresh-disbursement:
get:
summary: Refresh the disbursement
responses:
200:
description: A successful response
/autocall/refresh-verify-collection:
get:
summary: Refresh the disbursement to verify
responses:
200:
description: A successful response
/autocall/refresh-collection:
get:
summary: Refresh the disbursement
responses:
200:
description: A successful response
/autocall/payment-callback:
get:
summary: The Payment callback
responses:
200:
description: A successful response
/autocall/penal-charge:
post:
summary: Penal Charge Request
requestBody:
required: true
content:
application/json:
schema:
type: array
items:
type: object
properties:
transactionId:
type: string
example: "T004"
fbnTransactionId:
type: string
example: "Tr201712RK9232P115"
debtId:
type: string
example: "273194670"
customerId:
type: string
example: "CN621868"
accountId:
type: string
example: "2017821799"
penalCharge:
type: number
example: "1.2"
lienAmount:
type: number
example: "101.2"
countryId:
type: string
example: "01"
comment:
type: string
example: "Testing PenalCharge"
responses:
200:
description: A successful response
/autocall/analytic-salary-detect:
post:
summary: Salary Detect Endpoint
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
customerId:
type: string
example: "CN621868"
accountId:
type: string
example: "OP621868"
status:
type: string
salaryAmount:
type: number
example: 200000
salaryDate:
type: string
example: "2025-01-01"
responses:
200:
description: A successful response
/autocall/report:
get:
summary: Generate and send a report
responses:
200:
description: A successful response
/autocall/overdue-loans:
get:
summary: Get all overdue loans
responses:
200:
description: A successful response
/autocall/direct/loan:
post:
summary: Direct call for loan disbursement
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
transactionId:
type: string
example: "TXN123456"
responses:
200:
description: A successful response
/autocall/direct/repayment:
post:
summary: Direct call for loan repayment
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
transactionId:
type: string
example: "TXN123456"
responses:
200:
description: A successful response
+1 -1
View File
@@ -23,7 +23,7 @@ SQLALCHEMY_DATABASE_URI_FULL="oracle+oracledb://FIRSTADVSTG:Pchanged_56789@10.2.
KAFKA_BROKER="10.2.110.20:9082"
#Bank Calls =====================================================================
SIMBRELLA_BASE_URL="https://bank-emulator.dev.simbrellang.net"
SIMBRELLA_BASE_URL="https://first-advance-middleware-develop.fbn-devops-dev-asenv.appserviceenvironment.net"
SIMBRELLA_APP_ID="app1"
SIMBRELLA_API_KEY="testtest-api-key-12345"