From 16f76f3bacba2b036c3c74168964e38292e57dc7 Mon Sep 17 00:00:00 2001 From: "anatoly.shipitz" Date: Thu, 10 Jul 2025 17:24:33 +0200 Subject: [PATCH 1/3] feat(config): Add QBO configuration and schema validation - Introduced a new `qbo.ts` file containing the QBO API configuration and schema validation using Zod. - Updated the main configuration file to include the QBO schema in the validation process. These changes enhance the application's configuration management by integrating QBO API settings, ensuring proper validation of required environment variables. --- workers/main/src/configs/index.ts | 2 ++ workers/main/src/configs/qbo.ts | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 workers/main/src/configs/qbo.ts diff --git a/workers/main/src/configs/index.ts b/workers/main/src/configs/index.ts index 4ffe476..8ec60c4 100644 --- a/workers/main/src/configs/index.ts +++ b/workers/main/src/configs/index.ts @@ -3,10 +3,12 @@ import { redmineDatabaseSchema } from './redmineDatabase'; import { slackSchema } from './slack'; import { temporalSchema } from './temporal'; import { workerSchema } from './worker'; +import { qboSchema } from './qbo'; export const validationResult = temporalSchema .merge(workerSchema) .merge(slackSchema) .merge(redmineDatabaseSchema) .merge(mongoDatabaseSchema) + .merge(qboSchema) .safeParse(process.env); diff --git a/workers/main/src/configs/qbo.ts b/workers/main/src/configs/qbo.ts new file mode 100644 index 0000000..d80bc50 --- /dev/null +++ b/workers/main/src/configs/qbo.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +export const qboConfig = { + apiUrl: process.env.QBO_API_URL, + bearerToken: process.env.QBO_BEARER_TOKEN, +}; + +export const qboSchema = z.object({ + QBO_API_URL: z.string().url(), + QBO_BEARER_TOKEN: z.string(), +}); \ No newline at end of file From aa639ec9b6741c6189157c02eb495e6ef33ec77c Mon Sep 17 00:00:00 2001 From: "anatoly.shipitz" Date: Thu, 10 Jul 2025 17:26:31 +0200 Subject: [PATCH 2/3] fix(config): Correct QBO schema import in main configuration - Removed duplicate import of `qboSchema` in `index.ts` and ensured proper inclusion of the QBO schema in the validation process. - Added a newline at the end of the `qbo.ts` file for consistency. These changes improve the clarity and maintainability of the configuration files by eliminating redundancy and adhering to coding standards. --- workers/main/src/configs/index.ts | 2 +- workers/main/src/configs/qbo.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/workers/main/src/configs/index.ts b/workers/main/src/configs/index.ts index 8ec60c4..4b3bd31 100644 --- a/workers/main/src/configs/index.ts +++ b/workers/main/src/configs/index.ts @@ -1,9 +1,9 @@ import { mongoDatabaseSchema } from './mongoDatabase'; +import { qboSchema } from './qbo'; import { redmineDatabaseSchema } from './redmineDatabase'; import { slackSchema } from './slack'; import { temporalSchema } from './temporal'; import { workerSchema } from './worker'; -import { qboSchema } from './qbo'; export const validationResult = temporalSchema .merge(workerSchema) diff --git a/workers/main/src/configs/qbo.ts b/workers/main/src/configs/qbo.ts index d80bc50..0481ddc 100644 --- a/workers/main/src/configs/qbo.ts +++ b/workers/main/src/configs/qbo.ts @@ -8,4 +8,4 @@ export const qboConfig = { export const qboSchema = z.object({ QBO_API_URL: z.string().url(), QBO_BEARER_TOKEN: z.string(), -}); \ No newline at end of file +}); From 881d891f52f04768b41e849c36e289182053fc69 Mon Sep 17 00:00:00 2001 From: "anatoly.shipitz" Date: Fri, 11 Jul 2025 15:25:28 +0200 Subject: [PATCH 3/3] feat(config): Update environment configuration for QBO integration - Added QBO API URL and bearer token to the `.env.test` file for QuickBooks Online integration. - Ensured existing Slack channel ID remains intact. These changes enhance the application's configuration by integrating necessary environment variables for QuickBooks API access. --- workers/main/.env.test | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/workers/main/.env.test b/workers/main/.env.test index 5ae1edf..bba98b2 100644 --- a/workers/main/.env.test +++ b/workers/main/.env.test @@ -9,4 +9,7 @@ MONGO_DB_PASSWORD=testpassword MONGO_DB_NAME=testdb SLACK_TOKEN=test-token -SLACK_FIN_REPORT_CHANNEL_ID=C02URP5L3U5 \ No newline at end of file +SLACK_FIN_REPORT_CHANNEL_ID=C02URP5L3U5 + +QBO_API_URL=https://quickbooks.api.intuit.com/v3/company/111111111 +QBO_BEARER_TOKEN=test-token