first commit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import os
|
||||
|
||||
class Config:
|
||||
|
||||
BANK_CODE_MAPPING = {
|
||||
"9": "0015", "12": "0014", "13": "0016", "14": "0009",
|
||||
"15": "0005", "16": "0001", "7": "0013", "6": "0002",
|
||||
"5": "0007", "17": "0020", "1": "0012", "10": "0017",
|
||||
"11": "0018", "2": "0003", "4": "0004",
|
||||
"8": "0006", "3": "0021"
|
||||
}
|
||||
|
||||
FETCH_QUEUE_URL = "https://43.225.3.224:443/IPKS_Queue_Generation/fetchAllQueue"
|
||||
|
||||
def __init__(self):
|
||||
self.db_user = os.getenv("DB_USER", "")
|
||||
self.db_password = os.getenv("DB_PASSWORD", "")
|
||||
self.db_dsn = os.getenv("DB_DSN", "")
|
||||
|
||||
self.poll_interval_minutes = int(os.getenv("POLL_INTERVAL_MINUTES", "60"))
|
||||
self.bank_codes = self._parse_bank_codes()
|
||||
|
||||
def _parse_bank_codes(self):
|
||||
codes_str = os.getenv(
|
||||
"BANK_CODES",
|
||||
"0001,0002,0003,0004,0005,0006,0007,0009,0012,0013,0014,0015,0016,0017,0018,0020,0021"
|
||||
)
|
||||
return [c.strip() for c in codes_str.split(",") if c.strip()]
|
||||
|
||||
def validate(self):
|
||||
if not self.db_user or not self.db_password or not self.db_dsn:
|
||||
raise RuntimeError("Database configuration missing")
|
||||
Reference in New Issue
Block a user