Skip to content

Commit 2d8fdbf

Browse files
committed
Remove payInvoiceList endpoint sync
1 parent 7a09e93 commit 2d8fdbf

12 files changed

Lines changed: 89 additions & 155 deletions

File tree

workers/loc.api/bfx.api.router/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class BfxApiRouter extends BaseBfxApiRouter {
4141
['positionsAudit', 90],
4242
['wallets', 90],
4343
['ledgers', 90],
44-
['payInvoiceList', 90],
4544
['accountTrades', 90],
4645
['fundingTrades', 90],
4746
['trades', 10],

workers/loc.api/service.report.framework.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -718,28 +718,6 @@ class FrameworkReportService extends ReportService {
718718
}, 'getLedgers', args, cb)
719719
}
720720

721-
/**
722-
* @override
723-
*/
724-
getPayInvoiceList (space, args, cb) {
725-
return this._privResponder(async () => {
726-
if (!await this.isSyncModeWithDbData(space, args)) {
727-
return this._subAccountApiData
728-
.getDataForSubAccount(
729-
(args) => super.getPayInvoiceList(space, args),
730-
args,
731-
{ datePropName: 't' }
732-
)
733-
}
734-
735-
return this._dao.findInCollBy(
736-
this._SYNC_API_METHODS.PAY_INVOICE_LIST,
737-
args,
738-
{ isPrepareResponse: true, shouldParamsBeVerified: true }
739-
)
740-
}, 'getPayInvoiceList', args, cb)
741-
}
742-
743721
/**
744722
* @override
745723
*/

workers/loc.api/service.report.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ class ReportService extends BaseReportService {
1919
return super.getLedgers(null, args)
2020
}
2121

22-
[SYNC_API_METHODS.PAY_INVOICE_LIST] (args) {
23-
return super.getPayInvoiceList(null, args)
24-
}
25-
2622
[SYNC_API_METHODS.TRADES] (args) {
2723
return super.getTrades(null, args)
2824
}

workers/loc.api/sync/dao/db-migrations/sqlite-migrations/migration.v33.js

Lines changed: 0 additions & 68 deletions
This file was deleted.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
'use strict'
2+
3+
/*
4+
* CREATED_AT: 2025-09-19T07:32:50.867Z
5+
* VERSION: v43
6+
*/
7+
8+
const AbstractMigration = require('./abstract.migration')
9+
10+
class MigrationV43 extends AbstractMigration {
11+
/**
12+
* @override
13+
*/
14+
up () {
15+
const sqlArr = [
16+
'DROP TABLE payInvoiceList'
17+
]
18+
19+
this.addSql(sqlArr)
20+
}
21+
22+
/**
23+
* @override
24+
*/
25+
down () {
26+
const sqlArr = [
27+
`CREATE TABLE payInvoiceList (
28+
_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
29+
id VARCHAR(255),
30+
t BIGINT,
31+
duration INT,
32+
amount DECIMAL(22,12),
33+
currency VARCHAR(255),
34+
orderId VARCHAR(255),
35+
payCurrencies TEXT,
36+
webhook VARCHAR(255),
37+
redirectUrl VARCHAR(255),
38+
status VARCHAR(255),
39+
customerInfo TEXT,
40+
invoices TEXT,
41+
payment TEXT,
42+
merchantName VARCHAR(255),
43+
subUserId INT,
44+
user_id INT NOT NULL,
45+
CONSTRAINT payInvoiceList_fk_user_id
46+
FOREIGN KEY (user_id)
47+
REFERENCES users(_id)
48+
ON UPDATE CASCADE
49+
ON DELETE CASCADE,
50+
CONSTRAINT payInvoiceList_fk_subUserId
51+
FOREIGN KEY (subUserId)
52+
REFERENCES users(_id)
53+
ON UPDATE CASCADE
54+
ON DELETE CASCADE
55+
)`,
56+
57+
`CREATE UNIQUE INDEX payInvoiceList_id_user_id
58+
ON payInvoiceList(id, user_id)`,
59+
`CREATE INDEX payInvoiceList_user_id_currency_t
60+
ON payInvoiceList(user_id, currency, t)`,
61+
`CREATE INDEX payInvoiceList_user_id_id_t
62+
ON payInvoiceList(user_id, id, t)`,
63+
`CREATE INDEX payInvoiceList_user_id_t
64+
ON payInvoiceList(user_id, t)`,
65+
`CREATE INDEX payInvoiceList_user_id_subUserId_t
66+
ON payInvoiceList(user_id, subUserId, t)
67+
WHERE subUserId IS NOT NULL`,
68+
`CREATE INDEX payInvoiceList_subUserId_id
69+
ON payInvoiceList(subUserId, id)
70+
WHERE subUserId IS NOT NULL`
71+
]
72+
73+
this.addSql(sqlArr)
74+
}
75+
76+
/**
77+
* @override
78+
*/
79+
before () { return this.dao.disableForeignKeys() }
80+
81+
/**
82+
* @override
83+
*/
84+
after () { return this.dao.enableForeignKeys() }
85+
}
86+
87+
module.exports = MigrationV43

workers/loc.api/sync/schema/allowed.colls.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,5 @@ module.exports = {
2828
CANDLES: TABLES_NAMES.CANDLES,
2929
STATUS_MESSAGES: TABLES_NAMES.STATUS_MESSAGES,
3030
LOGINS: TABLES_NAMES.LOGINS,
31-
CHANGE_LOGS: TABLES_NAMES.CHANGE_LOGS,
32-
PAY_INVOICE_LIST: TABLES_NAMES.PAY_INVOICE_LIST
31+
CHANGE_LOGS: TABLES_NAMES.CHANGE_LOGS
3332
}

workers/loc.api/sync/schema/models/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* in the `workers/loc.api/sync/dao/db-migrations/sqlite-migrations` folder,
88
* e.g. `migration.v1.js`, where `v1` is `SUPPORTED_DB_VERSION`
99
*/
10-
const SUPPORTED_DB_VERSION = 42
10+
const SUPPORTED_DB_VERSION = 43
1111

1212
const TABLES_NAMES = require('../tables-names')
1313

@@ -26,7 +26,6 @@ const positionsHistory = require('./positions-history')
2626
const positionsSnapshot = require('./positions-snapshot')
2727
const logins = require('./logins')
2828
const changeLogs = require('./change-logs')
29-
const payInvoiceList = require('./pay-invoice-list')
3029
const tickersHistory = require('./tickers-history')
3130
const statusMessages = require('./status-messages')
3231
const publicCollsConf = require('./public-colls-conf')
@@ -60,7 +59,6 @@ const models = new Map([
6059
[TABLES_NAMES.POSITIONS_SNAPSHOT, positionsSnapshot],
6160
[TABLES_NAMES.LOGINS, logins],
6261
[TABLES_NAMES.CHANGE_LOGS, changeLogs],
63-
[TABLES_NAMES.PAY_INVOICE_LIST, payInvoiceList],
6462
[TABLES_NAMES.TICKERS_HISTORY, tickersHistory],
6563
[TABLES_NAMES.STATUS_MESSAGES, statusMessages],
6664
[TABLES_NAMES.PUBLIC_COLLS_CONF, publicCollsConf],

workers/loc.api/sync/schema/models/pay-invoice-list.js

Lines changed: 0 additions & 37 deletions
This file was deleted.

workers/loc.api/sync/schema/sync-schema/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ const positionsHistory = require('./positions-history')
1616
const positionsSnapshot = require('./positions-snapshot')
1717
const logins = require('./logins')
1818
const changeLogs = require('./change-logs')
19-
const payInvoiceList = require('./pay-invoice-list')
2019
const tickersHistory = require('./tickers-history')
2120
const wallets = require('./wallets')
2221
const symbols = require('./symbols')
@@ -43,7 +42,6 @@ const _methodCollMap = new Map([
4342
[SYNC_API_METHODS.POSITIONS_SNAPSHOT, positionsSnapshot],
4443
[SYNC_API_METHODS.LOGINS, logins],
4544
[SYNC_API_METHODS.CHANGE_LOGS, changeLogs],
46-
[SYNC_API_METHODS.PAY_INVOICE_LIST, payInvoiceList],
4745
[SYNC_API_METHODS.TICKERS_HISTORY, tickersHistory],
4846
[SYNC_API_METHODS.WALLETS, wallets],
4947
[SYNC_API_METHODS.SYMBOLS, symbols],

workers/loc.api/sync/schema/sync-schema/pay-invoice-list.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)