Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: embed ledger #1146

Merged
merged 37 commits into from
Jan 13, 2025
Merged

feat!: embed ledger #1146

merged 37 commits into from
Jan 13, 2025

Conversation

@vindard vindard force-pushed the feature/embed-ledger branch from af8f79b to 5c2e92f Compare December 13, 2024 14:20
This was referenced Dec 13, 2024
@vindard vindard changed the title feat: embed ledger feat!: embed ledger Dec 13, 2024
@vindard vindard force-pushed the feature/embed-ledger branch 2 times, most recently from 52f70fb to a08cc69 Compare December 18, 2024 19:58
core/deposit/Cargo.toml Outdated Show resolved Hide resolved
lana/app/Cargo.toml Outdated Show resolved Hide resolved
@vindard vindard force-pushed the feature/embed-ledger branch 3 times, most recently from bdd18fd to 43094a4 Compare December 23, 2024 12:58
Copy link

github-actions bot commented Dec 23, 2024

Storybook preview: Link to Storybook

@vindard vindard force-pushed the feature/embed-ledger branch 2 times, most recently from d43a4c4 to 0b6fefb Compare December 26, 2024 14:28
@thevaibhav-dixit thevaibhav-dixit marked this pull request as ready for review January 7, 2025 18:55
@vindard vindard force-pushed the feature/embed-ledger branch 2 times, most recently from cd9beba to 6968df1 Compare January 9, 2025 13:11
vindard and others added 11 commits January 13, 2025 10:31
* 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>
* 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 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
thevaibhav-dixit and others added 26 commits January 13, 2025 10:31
* 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: 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>
* refactor: rename accounting to accounting_init

* refactor: move create_journal to accounting init

* refactor: move seed steps into separate functions
* chore: embed disbursal

* chore: handle sub op

* chore: remove commented code
* chore: admin panel changes for embed-ledger

* fix: make deposits DataLoader use private

---------

Co-authored-by: vindard <17693119+vindard@users.noreply.github.com>
* fix: param name in deposit & disbursal templates

* refactor: rename template param to 'credit_omnibus_account'
* feat: add embedded customer ledger implementation

* refactor: swap in new embedded ledger in customer module

* refactor: use new customer account ids in other modules
Chart of accounts query needs to be reimplemented as a projection from
entity instead of traversing account sets directly from ledger.
* 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
* 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
@vindard vindard force-pushed the feature/embed-ledger branch from c92e19f to a6b6b76 Compare January 13, 2025 14:44
@vindard vindard merged commit 87a17b9 into main Jan 13, 2025
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants