Skip to content

Commit

Permalink
feat!: embed ledger (#1146)
Browse files Browse the repository at this point in the history
* feat: initial core deposit and credit facility work (#1144)

* chore(core-deposit): DepositAccount boilerplate

* chore(deposit): deposit entity

* test: dummy perms wip

* test: use DummyPerms in deposit test

* test: account -> balance integration

* chore(deposit): add DepositLedger

* chore: record_deposit template

* chore: execute record_deposit template

* chore: impl balance usecase

* chore: templates for withdraw use case

* chore: include deposit in sqlx-prepare

* chore: run sqlx prepare

* refactor: rename AccountHolderId -> DepositAccountHolderId

* chore: withdrawal entity in core

* chore: impl withdrawal usecases

* chore: sqlx-prepare

* fix: add instrumentation to credit_facility.list

* chore: clippy

* chore: CreditLedger boilerplate

* chore: create credit facility accounts

* chore: run sqlx-prepare

* chore: move get_credit_facility_balance

* chore: add / remove collateral templates

* chore: fix name

---------

Co-authored-by: bodymindarts <justin@galoy.io>
Co-authored-by: Vaibhav <thevaibhavdixit@gmail.com>

* ci: update workflows to run on feature branch PRs as well

* feat: withdrawal jobs (#1147)

* wip: withdrawal jobs

* chore: genericize deposit approval job

* fix: clippy warnings

* test: dumnmy objects, actions and events for test

* chore: cancel withdrawals

* chore: address pr reviews

* chore: process error

* chore: wire up core deposit in app (#1169)

* chore: wire up core deposit in app

* refactor: do not expose ledger_account_id from DepositAccount

* chore: bump cala

* refactor: create_journal in app

* refactor: accountHolderId -> customerId

* chore: bump cala

* test: use deposit_account_id

* chore: proper audit entries

* fix: execute returns WithdrawalError

---------

Co-authored-by: bodymindarts <justin@galoy.io>

---------

Co-authored-by: bodymindarts <justin@galoy.io>

* feat: add chart of accounts (#1142)

* feat: add chart_of_accounts package

* feat: add chart of accounts code type

* feat: add chart of accounts entity boilerplate

* feat: add chart of accounts repo

* chore: run sqlx-prepare

* feat: add authz chart of account primitives

* chore: init chart of accounts package

* feat: add chart of account 'find_or_create'

* feat: add chart of account create account functions

* feat: add 'create account' use cases

* feat: add name field to accounts created

* feat: add 'find_transaction_account' use-case

* fix: AccountIdx Display trait

This is to allow formatting properly when converting code to string
format.

* fix: handle NotFound error and return other errors

* refactor: consolidate ChartOfAccountCode enum

* test: add account creation integration test

* test: add ChartOfAccountCode unit tests

* test: and chart of accounts entity unit tests

* refactor: move 'code' to crate top level

* refactor: move 'ChartOfAccountAccountDetails' to primitives

* refactor: change 'create_transaction_account' return type

* feat: add chart of accounts ledger

* chore: add ledger call from create-account use-case

* chore: add 'description' field to accounts

* refactor: remove singleton, pass chart id around

* chore: add list_charts function

* fix: missing CoreDepositObject fns

* refactor: rename CoreChartOfAccounts

* refactor: move chart-of-accounts

* chore: remove depoit / withdrawal

* chore: initialize ChartOfAccounts in app

* chore: pass CoreChartOfAccounts into Deposit

* chore: add comments for deposit / chart integration

* chore: remove checking struct from deposit account balance

* chore: conditional compilation of async_graphql

* chore: complete collateral-update (#1148)

* chore: complete collateral-update

* chore: move repay to credit-facility ledger

* chore: payment template

* fix: rebase issues

* chore: execute repayment in embedded ledger

* chore: embed  complete credit facility

* chore: credit facility activation template

* chore: interest accural and incurrence templates

---------

Co-authored-by: Vaibhav <thevaibhavdixit@gmail.com>

* chore: address pr reviews

* chore: bump cala

* chore: integrate chart of accounts into deposits (#1173)

* chore: add account_id param to 'create_transaction_account'

* refactor: change charts use-case functions to domain service functions

* chore: use chart of accounts to create deposit account

* chore: add chart of accounts default id

* fix: move normal_balance_type to value object

* refactor: change AccountDetails 'code' to 'path' and add 'code' as string

* fix: use globally unique ledger codes from chart of accounts

This is to fix the issue that there can be multiple charts with same
codes and codes are unique in ledger.

* chore: pass deposit audit info to chart_of_account operation

* chore: transaction_account_factory boilerplate

* feat: add reference to chart of account entity

* chore: run sqlx-prepare

* feat: add find_by_reference for charts

* chore: replace ledger with TransactionAccountFactory

* chore: add ledger seed & remove charts config

* feat: add reference to chart create accounts for idempotency

* chore: find or create account paths in seed

* refactor: change param from &str to String

* chore: move seed to new accounting module

---------

Co-authored-by: bodymindarts <justin@galoy.io>

* chore; handle db ops for credit facility jobs

* refactor: restructure accounting init seed (#1176)

* refactor: rename accounting to accounting_init

* refactor: move create_journal to accounting init

* refactor: move seed steps into separate functions

* fix: seed arguments (#1182)

* chore: correct lints

* chore: embed disbursal (#1185)

* chore: embed disbursal

* chore: handle sub op

* chore: remove commented code

* feat: expose deposit account on withdrawals and deposits (#1202)

* chore: admin panel changes for embed-ledger (#1219)

* chore: admin panel changes for embed-ledger

* fix: make deposits DataLoader use private

---------

Co-authored-by: vindard <17693119+vindard@users.noreply.github.com>

* fix: template param in deposit & disbursal templates (#1220)

* fix: param name in deposit & disbursal templates

* refactor: rename template param to 'credit_omnibus_account'

* feat: swap in embedded ledger in Customer module (#1221)

* feat: add embedded customer ledger implementation

* refactor: swap in new embedded ledger in customer module

* refactor: use new customer account ids in other modules

* fix: error naming

* fix: pass correct journal id

* fix: credit facility debit accounts

* fix: receivable currency

* fix: params.credit_facility_account

* test: comment assert_accounts_balanced in credit-facility.bats

* chore: skip chart of accounts e2e

Chart of accounts query needs to be reimplemented as a projection from
entity instead of traversing account sets directly from ledger.

* fix: governance e2e test

* chore: integrate chart of accounts into credit facility (#1187)

* refactor: add 'ChartOfAccountCreationDetails' type

* refactor: abstract create_control_sub_account function

* chore: add credit facility seed steps

* refactor: move app types to app-primitives modules

* chore: use chart of accounts create in initiate

* fix: fetch chart from in-progress db op

* fix: use deposits account for Customer account (#1231)

* refactor: move accounting_init primitives to module

* fix: use deposit account as customer checking account

* chore: remove unused 'ledger' from Customer module

* chore: fix error message

* refactor: rename charts entity name, rename code to path (#1242)

---------

Co-authored-by: bodymindarts <justin@galoy.io>
Co-authored-by: Vaibhav <thevaibhavdixit@gmail.com>
Co-authored-by: Siddharth <siddharthtiwarikreplind@gmail.com>
  • Loading branch information
4 people authored Jan 13, 2025
1 parent c6bbfc4 commit 87a17b9
Show file tree
Hide file tree
Showing 468 changed files with 17,126 additions and 3,490 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ name: Audit

on:
pull_request:
branches: [ main ]
branches:
- main
- 'feature/**'

jobs:
security_audit:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/bats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: "E2E Tests"

on:
pull_request:
branches: [main]
branches:
- main
- 'feature/**'

jobs:
integration:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/check-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ name: Check Code

on:
pull_request:
branches: [main]
branches:
- main
- 'feature/**'

jobs:
check-code-backend:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/spelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ name: Spelling

on:
pull_request:
branches: [ main ]
branches:
- main
- 'feature/**'

jobs:
spelling:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: Storybook

on:
pull_request:
branches: [main]
branches:
- main
- 'feature/**'
paths:
- "apps/admin-panel/**"
push:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: "Integration Tests"

on:
pull_request:
branches: [main]
branches:
- main
- 'feature/**'

jobs:
integration:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/vendor/rust-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ name: Audit

on:
pull_request:
branches: [ main ]
branches:
- main
- 'feature/**'

jobs:
security_audit:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/vendor/spelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ name: Spelling

on:
pull_request:
branches: [ main ]
branches:
- main
- 'feature/**'

jobs:
spelling:
Expand Down
Loading

0 comments on commit 87a17b9

Please sign in to comment.