Skip to content

Commit

Permalink
Merge pull request #308 from letehaha/chore/backend-public-repo-changes
Browse files Browse the repository at this point in the history
Backend public repo transition
  • Loading branch information
letehaha committed Sep 16, 2024
2 parents 1b6427c + 9229a37 commit 0ee4a17
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 16 deletions.
36 changes: 24 additions & 12 deletions .github/workflows/check-source-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.REPOSITORIES_ACCESS_TOKEN }}
# Important for forked repositories
# This is dangerous without the "check-permissions" job
ref: ${{ github.event.pull_request.head.sha }}
- id: prepare-env
uses: ./.github/actions/prepare-local-env
- name: Install dependencies
Expand All @@ -28,10 +30,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.REPOSITORIES_ACCESS_TOKEN }}
# Important for forked repositories
# This is dangerous without the "check-permissions" job
ref: ${{ github.event.pull_request.head.sha }}
- uses: ./.github/actions/prepare-local-env
- name: Lint source code
run: npm run lint
Expand All @@ -42,10 +46,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.REPOSITORIES_ACCESS_TOKEN }}
# Important for forked repositories
# This is dangerous without the "check-permissions" job
ref: ${{ github.event.pull_request.head.sha }}
- uses: ./.github/actions/prepare-local-env
- name: Unit testing
run: npm run test:unit
Expand All @@ -56,10 +62,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.REPOSITORIES_ACCESS_TOKEN }}
# Important for forked repositories
# This is dangerous without the "check-permissions" job
ref: ${{ github.event.pull_request.head.sha }}
- uses: ./.github/actions/prepare-local-env
- name: Build source code
run: npm run build
Expand Down Expand Up @@ -89,10 +97,12 @@ jobs:
# options: --user 1001
# steps:
# - name: Checkout repository and submodules
# uses: actions/checkout@v2
# uses: actions/checkout@v4
# with:
# submodules: recursive
# token: ${{ secrets.REPOSITORIES_ACCESS_TOKEN }}
# # Important for forked repositories
# # This is dangerous without the "check-permissions" job
# ref: ${{ github.event.pull_request.head.sha }}
# - uses: ./.github/actions/prepare-local-env
# - name: Run Cypress e2e tests
# uses: cypress-io/github-action@v6
Expand Down Expand Up @@ -122,10 +132,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.REPOSITORIES_ACCESS_TOKEN }}
# Important for forked repositories
# This is dangerous without the "check-permissions" job
ref: ${{ github.event.pull_request.head.sha }}
- id: docker-build
uses: ./.github/actions/docker-build
with:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/image-to-docker-hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ jobs:

steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.REPOSITORIES_ACCESS_TOKEN }}

- id: docker-build
uses: ./.github/actions/docker-build
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ There is also a backend that provides all information and API, but currently, it
4. Build it with `npm run build`

## Additional information
1. Backend repository shares some TypeScript types using **git submodules** functionality, that can be accessible by importing them from `shared-types`. Since the backend application is private, these types are available only to contributors. For convenience, there's a `git-pull` npm script that pulls all the submodules. To init git submodules run `git submodule update --init --recursive` command.
1. Backend repository shares some TypeScript types using **git submodules** functionality, that can be accessible by importing them from `shared-types`. For convenience, there's a `git-pull` npm script that pulls all the submodules. To init git submodules run `git submodule update --init --recursive` command.
2 changes: 1 addition & 1 deletion backend
Submodule backend updated 93 files
+2 −0 .dockerignore
+12 −0 .env.template
+4 −4 .github/actions/docker-build/action.yml
+8 −25 .github/workflows/check-source-code.yml
+3 −2 .github/workflows/image-to-docker-hub.yml
+0 −6 Dockerfile
+70 −33 README.md
+17 −0 docker/dev/Dockerfile
+40 −0 docker/dev/docker-compose.yml
+6 −0 docker/dev/docker-destroy.sh
+17 −0 docker/dev/docker-entrypoint.sh
+13 −0 docker/prod/Dockerfile
+8 −0 docker/prod/docker-compose.yml
+19 −0 docker/test/Dockerfile
+31 −0 docker/test/docker-compose.yml
+1 −0 jest.config.e2e.ts
+273 −135 package-lock.json
+18 −14 package.json
+12 −1 post-install.sh
+3 −19 src/app.ts
+25 −0 src/common/helpers.ts
+1 −0 src/common/lib/redis/index.ts
+8 −0 src/common/lib/redis/key-formatter.ts
+0 −6 src/common/types.ts
+109 −132 src/controllers/banks/monobank.controller.ts
+0 −82 src/controllers/categories.controller.ts
+57 −0 src/controllers/categories.controller/create-category.ts
+35 −0 src/controllers/categories.controller/delete-category.ts
+19 −0 src/controllers/categories.controller/get-categories.ts
+55 −0 src/controllers/categories.controller/update-category.ts
+1 −5 src/migrations/1664386509637-exchange-rates.js
+46 −64 src/models/Accounts.model.ts
+61 −85 src/models/Balances.model.ts
+23 −40 src/models/Categories.model.ts
+28 −53 src/models/Currencies.model.ts
+1 −4 src/models/ExchangeRates.model.ts
+13 −21 src/models/MerchantCategoryCodes.model.ts
+17 −18 src/models/RefundTransactions.model.ts
+152 −201 src/models/Transactions.model.ts
+53 −74 src/models/UserExchangeRates.model.ts
+15 −27 src/models/UserMerchantCategoryCodes.model.ts
+59 −84 src/models/Users.model.ts
+68 −92 src/models/UsersCurrencies.model.ts
+15 −35 src/models/banks/monobank/Users.model.ts
+8 −0 src/models/index.ts
+30 −0 src/redis.ts
+18 −5 src/routes/categories.route.ts
+172 −261 src/services/accounts.service.ts
+108 −125 src/services/auth.service.ts
+20 −21 src/services/banks/monobank/users.ts
+32 −58 src/services/calculate-ref-amount.service.ts
+19 −141 src/services/categories.service.ts
+72 −0 src/services/categories/create-category.e2e.ts
+8 −0 src/services/categories/create-category.ts
+90 −0 src/services/categories/delete-category.e2e.ts
+46 −0 src/services/categories/delete-category.ts
+139 −0 src/services/categories/edit-category.e2e.ts
+8 −0 src/services/categories/edit-category.ts
+1 −0 src/services/categories/index.ts
+1 −0 src/services/common/index.ts
+22 −0 src/services/common/with-transaction.ts
+14 −33 src/services/stats/get-balance-history-for-account.ts
+90 −106 src/services/stats/get-balance-history.ts
+5 −22 src/services/stats/get-expenses-amount-for-period.ts
+6 −25 src/services/stats/get-expenses-history.ts
+1 −1 src/services/stats/get-spendings-by-categories/get-spendings-by-categories.e2e.ts
+12 −41 src/services/stats/get-spendings-by-categories/index.ts
+6 −30 src/services/stats/get-total-balance.ts
+3 −2 src/services/system-currencies/get-all-currencies.service.ts
+0 −1 src/services/tests.todos.e2e.ts
+149 −190 src/services/transactions/create-transaction.ts
+48 −64 src/services/transactions/delete-transaction.ts
+15 −23 src/services/transactions/get-by-id.ts
+15 −24 src/services/transactions/get-by-transfer-id.ts
+5 −5 src/services/transactions/get-transaction-by-some-id.ts
+5 −15 src/services/transactions/get-transactions.ts
+44 −64 src/services/transactions/transactions-linking/link-transactions.ts
+27 −47 src/services/transactions/transactions-linking/unlink-transfer-transactions.ts
+109 −157 src/services/transactions/update-transaction.ts
+100 −111 src/services/tx-refunds/create-single-refund.service.ts
+29 −41 src/services/tx-refunds/get-refund-for-transaction-by-id.service.ts
+46 −54 src/services/tx-refunds/get-refund.service.ts
+10 −26 src/services/tx-refunds/get-refunds.service.ts
+36 −49 src/services/tx-refunds/remove-refund-link.service.ts
+38 −39 src/services/user-exchange-rate/get-exchange-rate.service.ts
+17 −41 src/services/user-exchange-rate/get-user-exchange-rates.service.ts
+7 −18 src/services/user-exchange-rate/remove-exchange-rates.service.ts
+8 −13 src/services/user-exchange-rate/update-exchange-rates.service.ts
+133 −281 src/services/user.service.ts
+37 −0 src/tests/README.md
+85 −13 src/tests/helpers/categories.ts
+52 −0 src/tests/setup-e2e-tests.sh
+13 −4 src/tests/setupIntegrationTests.ts

0 comments on commit 0ee4a17

Please sign in to comment.