Area
Notification Service / Reliability (Correctness)
Complexity
Hard
File(s)
notification-service/src/db.ts (recordInvestment, line 155); notification-service/src/listener.ts; notification-service/src/index.ts; notification-service/src/config.ts (vault_contract_id, line 30)
Problem
docs/NOTIFICATIONS.md states the investor_projects index is "built by monitoring Deposit events from the InvestmentVault" and ProjectFunded events. Store.recordInvestment exists to populate that table, but it is called only from pipeline.test.ts — nowhere in listener.ts or index.ts is there any code that polls the vault contract or decodes Deposit/ProjectFunded events. VAULT_CONTRACT_ID is accepted in config and documented in .env.example, but nothing in src/ actually reads config.vault_contract_id. In a real deployment this means getInvestorsForProject always returns [], so notifyInvestors is never invoked with any recipients — the notification system is a no-op end-to-end until investors are seeded some other way.
Scope
In:
- A second poller (mirroring pollScoreChanges) against vault_contract_id that decodes Deposit/ProjectFunded events and calls recordInvestment.
Out:
- Full investment-vault economics/share-accounting logic — only the identity linkage (investor <-> project) is needed here.
Acceptance Criteria
Area
Notification Service / Reliability (Correctness)
Complexity
Hard
File(s)
notification-service/src/db.ts (recordInvestment, line 155); notification-service/src/listener.ts; notification-service/src/index.ts; notification-service/src/config.ts (vault_contract_id, line 30)
Problem
docs/NOTIFICATIONS.md states the investor_projects index is "built by monitoring Deposit events from the InvestmentVault" and ProjectFunded events. Store.recordInvestment exists to populate that table, but it is called only from pipeline.test.ts — nowhere in listener.ts or index.ts is there any code that polls the vault contract or decodes Deposit/ProjectFunded events. VAULT_CONTRACT_ID is accepted in config and documented in .env.example, but nothing in src/ actually reads config.vault_contract_id. In a real deployment this means getInvestorsForProject always returns [], so notifyInvestors is never invoked with any recipients — the notification system is a no-op end-to-end until investors are seeded some other way.
Scope
In:
Out:
Acceptance Criteria