forked from unimatrix/web
Correct virtual payroll funding and finish clan and account controls
This commit is contained in:
parent
c7eda356c7
commit
e772698229
1 changed files with 100 additions and 22 deletions
2
website/scripts/correct-payroll-funding.mjs
Normal file
2
website/scripts/correct-payroll-funding.mjs
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
import {fileURLToPath} from 'node:url';import {resolve} from 'node:path';import {openDatabase} from '../node/mysql.mjs';import {openPostbankDatabase} from '../node/postbank-db.mjs';import {canRunScheduler} from '../node/scheduler-authority.mjs';import {correctPayrollTreasuryFunding} from '../node/postbank-payroll-issuer.mjs';
|
||||
if(process.argv[1]&&fileURLToPath(import.meta.url)===resolve(process.argv[1])){const central=await openDatabase(process.env),bank=await openPostbankDatabase(process.env);try{const actorId=process.argv.find(a=>a.startsWith('--actor='))?.slice(8),period=process.argv.find(a=>a.startsWith('--period='))?.slice(9);if(!bank||!await canRunScheduler(central,{id:actorId}))throw Error('Current central control is required.');console.log(JSON.stringify(await correctPayrollTreasuryFunding(bank,{period,actorId,apply:process.argv.includes('--apply')})));}finally{await bank?.close();await central.close();}}
|
||||
Loading…
Reference in a new issue

Staff