Closes #20 Implement Comprehensive Transaction History and Ledger System #30
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Brief Description of Actions Taken and Issues Faced
Actions Taken
configuration.ts,data-source.ts,transaction.entity.ts,ledger-entry.entity.ts,audit-log.entity.ts,account.entity.ts,transaction.service.ts,transaction.controller.ts, and themigrations/directory) and updatedtreasury.module.tsto define entities, services, controllers, and TypeORM configuration for the Treasury module. These files implement a double-entry bookkeeping system with transaction management, audit logging, reconciliation, and reporting.postgresuser with a password (password), and created abudgetchaindatabase to matchsrc/config/configuration.ts. This enabled TypeORM to connect to a local database.typeorm,pg,@nestjs/typeorm,@nestjs/config,ts-node,typeorm-ts-node-commonjs) and PostgreSQL packages (postgresql,postgresql-contrib) to support the application and database.typeorm,typeorm:migration:generate,typeorm:migration:run) topackage.jsonto enable migration generation and execution.src/config/configuration.tsto define explicit database credentials (host: 'localhost',port: 5432,user: 'postgres',password: 'password',name: 'budgetchain') and ensuredsrc/config/data-source.tscorrectly accessed these for TypeORM migrations.POST /transactions,GET /transactions,POST /transactions/reconcile,GET /transactions/report) withcurl.Issues Faced with the Database
ECONNREFUSEDonlocalhost:5432) occurred because no PostgreSQL server was running locally, preventing TypeORM from connecting. This was evident from repeated connection failures in the logs.data-source.tshad incorrectConfigServiceusage (e.g.,configService.get('database.host')instead ofconfigService.get('database').host), causing TypeScript errors due to mismatched types and unrecognized nested keys.postgresuser needed a password to match the application’s configuration, and a specific database (budgetchain) had to be created to align withconfiguration.ts.closes #20