@@ -144,8 +144,11 @@ def get_balance(self) -> List[List[str]]:
144144 data = []
145145 if 'data' in response and 'postBalanceDetails' in response ['data' ]:
146146 balance_details = response ['data' ]['postBalanceDetails' ]
147+ # Filter to show only specific fields for balance
148+ allowed_fields = ['accountId' , 'accountType' , 'balanceRemaining' , 'connectionStatus' ]
147149 for key , value in balance_details .items ():
148- data .append ([key , str (value ) if value is not None else '' ])
150+ if key in allowed_fields :
151+ data .append ([key , str (value ) if value is not None else '' ])
149152
150153 return data
151154
@@ -159,4 +162,33 @@ def get_customer_info(self) -> List[List[str]]:
159162 Returns:
160163 List[List[str]]: A list of [key, value] pairs containing customer information
161164 """
162- return self .get_balance ()
165+ query = f"""query{{
166+ postBalanceDetails(input: {{
167+ customerNumber: "{ self .customer_number } ",
168+ tenantCode: "{ self .TENANT_CODE } "
169+ }}) {{
170+ accountId
171+ customerName
172+ customerClass
173+ mobileNumber
174+ emailId
175+ accountType
176+ balanceRemaining
177+ connectionStatus
178+ customerType
179+ minRecharge
180+ }}
181+ }}"""
182+
183+ response = self ._make_graphql_request (query )
184+
185+ data = []
186+ if 'data' in response and 'postBalanceDetails' in response ['data' ]:
187+ balance_details = response ['data' ]['postBalanceDetails' ]
188+ # Filter to show only specific fields for customer info
189+ allowed_fields = ['accountId' , 'customerName' , 'customerClass' , 'mobileNumber' ]
190+ for key , value in balance_details .items ():
191+ if key in allowed_fields :
192+ data .append ([key , str (value ) if value is not None else '' ])
193+
194+ return data
0 commit comments