Skip to content

Commit

Permalink
Merge pull request #347 from ZIMkaRU/feature/add-support-for-pdf-reports
Browse files Browse the repository at this point in the history
Add support for PDF reports
  • Loading branch information
ezewer authored Feb 20, 2024
2 parents 16e21f3 + 1da7550 commit cb91dfc
Show file tree
Hide file tree
Showing 59 changed files with 2,724 additions and 1,310 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ logs/*
db/*
!db/.gitkeep
csv/
report-files/
logs
package-lock.json
workers/loc.api/queue/temp/*.csv
workers/loc.api/queue/temp/*.pdf
workers/loc.api/queue/temp/*.zip
2 changes: 1 addition & 1 deletion config/service.report.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"signedUrlExpireTime": 28800
},
"isSpamRestrictionMode": true,
"isAddedUniqueEndingToCsvName": false,
"isAddedUniqueEndingToReportFileName": false,
"isСompress": true,
"isLoggerDisabled": false
}
26 changes: 13 additions & 13 deletions test/2-api-filter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const {
createMockRESTv2SrvWithDate
} = require('./helpers/helpers.mock-rest-v2')
const {
testMethodOfGettingCsv
testMethodOfGettingReportFile
} = require('./helpers/helpers.tests')

process.env.NODE_CONFIG_DIR = path.join(__dirname, 'config')
Expand Down Expand Up @@ -578,7 +578,7 @@ describe('API filter', () => {
{
args: {
...baseArgs,
method: 'getLedgersCsv',
method: 'getLedgersFile',
params: {
...baseParams,
symbol: ['BTC'],
Expand All @@ -591,7 +591,7 @@ describe('API filter', () => {
{
args: {
...baseArgs,
method: 'getLedgersCsv',
method: 'getLedgersFile',
params: {
...baseParams,
symbol: ['BTC'],
Expand All @@ -604,7 +604,7 @@ describe('API filter', () => {
{
args: {
...baseArgs,
method: 'getLedgersCsv',
method: 'getLedgersFile',
params: {
...baseParams,
symbol: ['BTC'],
Expand All @@ -617,7 +617,7 @@ describe('API filter', () => {
{
args: {
...baseArgs,
method: 'getTradesCsv',
method: 'getTradesFile',
params: {
...baseParams,
symbol: ['tBTCUSD', 'tETHUSD'],
Expand Down Expand Up @@ -645,7 +645,7 @@ describe('API filter', () => {
}
})

it('it should be successfully performed by the getLedgersCsv method', async function () {
it('it should be successfully performed by the getLedgersFile method', async function () {
this.timeout(20000)

const procPromise = queueToPromise(processorQueue)
Expand All @@ -656,7 +656,7 @@ describe('API filter', () => {
.type('json')
.send({
auth,
method: 'getLedgersCsv',
method: 'getLedgersFile',
params: {
symbol: ['BTC'],
end,
Expand All @@ -673,10 +673,10 @@ describe('API filter', () => {
.expect('Content-Type', /json/)
.expect(200)

await testMethodOfGettingCsv(procPromise, aggrPromise, res)
await testMethodOfGettingReportFile(procPromise, aggrPromise, res)
})

it('it should be successfully performed by the getMultipleCsv method', async function () {
it('it should be successfully performed by the getMultipleFile method', async function () {
this.timeout(20000)

const procPromise = queueToPromise(processorQueue)
Expand All @@ -687,13 +687,13 @@ describe('API filter', () => {
.type('json')
.send({
auth,
method: 'getMultipleCsv',
method: 'getMultipleFile',
params: {
email,
language: 'ru',
multiExport: [
{
method: 'getTradesCsv',
method: 'getTradesFile',
symbol: ['tBTCUSD', 'tETHUSD'],
end,
start,
Expand All @@ -707,7 +707,7 @@ describe('API filter', () => {
}
},
{
method: 'getTickersHistoryCsv',
method: 'getTickersHistoryFile',
symbol: 'BTC',
end,
start,
Expand All @@ -723,6 +723,6 @@ describe('API filter', () => {
.expect('Content-Type', /json/)
.expect(200)

await testMethodOfGettingCsv(procPromise, aggrPromise, res)
await testMethodOfGettingReportFile(procPromise, aggrPromise, res)
})
})
18 changes: 9 additions & 9 deletions test/3-report-signature.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const {
createMockRESTv2SrvWithDate
} = require('./helpers/helpers.mock-rest-v2')
const {
testMethodOfGettingCsv
testMethodOfGettingReportFile
} = require('./helpers/helpers.tests')

const signature = `-----BEGIN PGP SIGNATURE-----
Expand Down Expand Up @@ -79,7 +79,7 @@ describe('Signature', () => {
} catch (err) { }
})

it('it should be successfully performed by the getMultipleCsv method', async function () {
it('it should be successfully performed by the getMultipleFile method', async function () {
this.timeout(60000)

const procPromise = queueToPromise(processorQueue)
Expand All @@ -90,21 +90,21 @@ describe('Signature', () => {
.type('json')
.send({
auth,
method: 'getMultipleCsv',
method: 'getMultipleFile',
params: {
email,
isSignatureRequired: true,
multiExport: [
{
method: 'getTradesCsv',
method: 'getTradesFile',
symbol: ['tBTCUSD', 'tETHUSD'],
end,
start,
limit: 1000,
timezone: 'America/Los_Angeles'
},
{
method: 'getTickersHistoryCsv',
method: 'getTickersHistoryFile',
symbol: 'BTC',
end,
start,
Expand All @@ -117,10 +117,10 @@ describe('Signature', () => {
.expect('Content-Type', /json/)
.expect(200)

await testMethodOfGettingCsv(procPromise, aggrPromise, res)
await testMethodOfGettingReportFile(procPromise, aggrPromise, res)
})

it('it should be successfully performed by the getLedgersCsv method', async function () {
it('it should be successfully performed by the getLedgersFile method', async function () {
this.timeout(60000)

const procPromise = queueToPromise(processorQueue)
Expand All @@ -131,7 +131,7 @@ describe('Signature', () => {
.type('json')
.send({
auth,
method: 'getLedgersCsv',
method: 'getLedgersFile',
params: {
symbol: ['BTC'],
end,
Expand All @@ -146,7 +146,7 @@ describe('Signature', () => {
.expect('Content-Type', /json/)
.expect(200)

await testMethodOfGettingCsv(procPromise, aggrPromise, res)
await testMethodOfGettingReportFile(procPromise, aggrPromise, res)
})

it('it should be successfully performed by the verifyDigitalSignature method', async function () {
Expand Down
Loading

0 comments on commit cb91dfc

Please sign in to comment.