Autobilling
Solutech Licensing and Billing Automation System
Solutech SAT Autobilling
Welcome to the Autobilling section of Solutech SAT documentation. This section provides a description of the known issues and limitations related to the Autobilling system.
Known Issues
- Vault Manual Token generation and update The Zoho integration on Autobilling requires a Vault token to read its credentials from Vault and use them in the integration. The problem is that this token expires after 32 days and currently requires a manual update of the token using the following procedure:
- Procedure to Update Token:
- SSH into the Vault server and run the command:
export VAULT_ADDR="[https://vault.solutechlabs.com:8200](https://vault.solutechlabs.com:8200)" && vault token create --ttl=32d -policy=default -policy=admin-policy -policy=app-role-solutech-admin-policy -renewable=true- SSH into the admin server using
admin.solutechlabs.comURL and update theZOHO_VAULT_STATIC_ID=to the new token and run:
php artisan optimize:clear && php artisan config:cache
-
Zoho Payments Admin Reconciliation Pulling Zoho payments happens automatically every 6 hours. However, in some cases, you might be required to pull all Zoho payments for a specific client. This operation will, in turn, update all payments on the portal to match what is recorded on Zoho.
- Procedure to Reconcile:
- To perform this operation, run the following command on the admin server:
php artisan command:pull-zoho-payments {portal client_id} {boolean:- true (will update all payments) - not mandatory}- Note: The optional boolean argument, when set to
true, forces an update of all payments for that client.
- Procedure to Reconcile:
-
Client Invoice Extension Constraints and Process Complexity When adding an extension for a client invoice, the following constraints and technical limitations apply:
- Extension Date Logic: The extension date should never be on the same date as the suspension date. If the suspension date was today, the extension date must be from tomorrow (Suspension Date + 1 day).
- Future Improvement (Codebase): The existing extensions process on the Solutech SAT codebase is not well written and currently lacks a clear log trail. It needs to be updated and simplified in the future to utilize a staging table. This staging table would clearly log which user licenses need to be activated and which have already been activated.
-
License Extension Fails to Activate All Users Occasionally, when extending an older invoice, the extension process may fail to activate all licensed users. To activate and reconcile active/inactive users across the system, a set of commands must be run manually on the server.
- Procedure to Reconcile User Statuses:
php artisan command:activate-licensed-users && \ php artisan command:deactivate-unlicensed-users && \ php artisan command:deactivate-users-with-inactive-license
- Procedure to Reconcile User Statuses:
-
Performance Debt:
billing_user_license_logsTable View The user-facing page for viewing the license change logs (/billing/user-logs), which references the largebilling_user_license_logstable, currently suffers from poor performance.- Current Implementation: The page uses a Blade/Datatables implementation which is not scalable for the volume of data stored, leading to very slow load times.
- Required Improvement: This implementation must be migrated to a performant Vue.js component to handle the data fetching and rendering asynchronously and efficiently.
-
Performance Improvement: Concurrent Autobilling Process 🚀 A staging table was implemented to drastically reduce the time taken for the start-of-the-month autobilling process.
- Implementation: The table, named
autobilling_subscription_logs, facilitates the concurrent processing of invoices. The central command isInvoiceSchedules. - Mechanism: It splits each individual subscription into its own separate job process, allowing them to run concurrently.
- Result: This change reduced the total time required to generate and send all invoices from approximately 3 hours to about 20 minutes. For example, if invoice generation starts at 08:00, all invoices are now typically generated and sent by 08:20.
- Implementation: The table, named