PAY-JOBS - PAD invoice creation failing on TEST - Due to float/double math instead of using decimal
I think this might have something to do with Site Registry:
2022-10-31 21:18:10,006 - invoke_jobs - DEBUG in oauth_service:oauth_service.py:59 - post: data : {"batch_source": "BC REG MANUAL_OTHER", "cust_trx_type": "BC_REGISTRIES", "transaction_date": "2022-10-31T14:18:09Z", "transaction_number": "REGT00021558", "gl_date": "2022-10-31T14:18:09Z", "term_name": "IMMEDIATE", "comments": "", "lines": [{"line_number": 1, "line_type": "LINE", "description": "Site Search", "unit_price": 4074.0, "quantity": 1, "distribution": [{"dist_line_number": 1, "amount": 4074.0, "account": "112.32041.35301.1278.3200000.000000.0000"}]}, {"line_number": 2, "line_type": "LINE", "description": "Service Fee", "unit_price": 111.2999999999998, "quantity": 1, "distribution": [{"dist_line_number": 2, "amount": 111.2999999999998, "account": "112.32041.35301.1278.3200000.000000.0000"}]}]}
2022-10-31 21:18:11,539 - invoke_jobs - ERROR in oauth_service:oauth_service.py:75 - post: HTTPError on POST with status code
2022-10-31 21:18:11,539 - invoke_jobs - INFO in oauth_service:oauth_service.py:89 - __log_response: Response Headers {'Date': 'Mon, 31 Oct 2022 21:18:10 GMT', 'Transfer-Encoding': 'chunked', 'Content-Length': '11388', 'Content-Type': 'text/html', 'CAS-Returned-Messages': '[Trx Errors = [9999] Transaction not created, API message (line id: 2): REV:111.2999999999998 : The sum of the distribution amounts must equal to the line amount.]'}
2022-10-31 21:18:11,539 - invoke_jobs - INFO in cfs_create_invoice_task:cfs_create_invoice_task.py:265 - _create_pad_invoices: 400 Client Error: Bad Request for url: https://xxxx/xxx/cas/cfs/parties/103640/accs/74220/sites/120143/invs/
"unit_price": 111.2999999999998
"amount": 111.2999999999998,
Looks similar to the problem where I had to make a workaround because we're using floats instead of decimal data type on the column in the database.
Illustrating the problem:


Columns affected -^
These should be migrated to a numeric instead. Similar to what I originally suggested:
https://docs.sqlalchemy.org/en/14/core/type_basics.html#sqlalchemy.types.Numeric
Looks like there are two issues at hand here. Storing the value as a Float or Double.. also with calculation
Example from code:

Ashna and I agreed that this is ready for PROD. Was deployed on prod on Wednesday.