feat: BILLmanager API на уровне хостера, миграция со старых аккаунтов
Docker / build (push) Failing after 18s

Made-with: Cursor
This commit is contained in:
Denozordec
2026-03-21 00:52:49 +07:00
parent 2da1f6a6f0
commit 28d723983e
19 changed files with 445 additions and 97 deletions
+6 -1
View File
@@ -2,6 +2,7 @@ import { Router } from 'express'
import express from 'express'
import { readFileSync, existsSync } from 'node:fs'
import { getDb, saveDb, DB_PATH, reloadDatabaseFromBuffer } from '../db.js'
import { consolidateProviderApiFromAccounts } from '../db/migrations.js'
import { rowToVps } from './vps.js'
import { rowToActiveTariff, rowToTariffSyncOptions } from '../utils/row-mappers.js'
@@ -111,7 +112,7 @@ function importJsonSnapshot(data) {
const providers = Array.isArray(data.providers) ? data.providers : []
for (const p of providers) {
run(
`INSERT OR REPLACE INTO providers (id, name, website, contact, baseCurrency, usdRate, eurRate, notes) VALUES (?, ?, ?, ?, ?, ?, ?, ?)`,
`INSERT OR REPLACE INTO providers (id, name, website, contact, baseCurrency, usdRate, eurRate, notes, apiType, apiBaseUrl) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
p.id ?? '',
p.name ?? '',
p.website ?? '',
@@ -120,6 +121,8 @@ function importJsonSnapshot(data) {
p.usdRate ?? '',
p.eurRate ?? '',
p.notes ?? '',
p.apiType ?? '',
p.apiBaseUrl ?? '',
)
}
@@ -159,6 +162,8 @@ function importJsonSnapshot(data) {
)
}
consolidateProviderApiFromAccounts(db)
const settingsList = Array.isArray(data.settings) ? data.settings : data.settings ? [data.settings] : []
for (const s of settingsList) {
let customFields = s.customFields