Skip to content

Commit a28d15a

Browse files
authored
Merge pull request #434 from uadamu00009-ux/feat/WalletAndPayment
Feat/wallet and payment
2 parents 7aeb8ba + 28118eb commit a28d15a

43 files changed

Lines changed: 3948 additions & 167 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/architecture-check.yml

Lines changed: 0 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -11,138 +11,6 @@ on:
1111
- develop
1212

1313
jobs:
14-
architecture-checks:
15-
name: Validate Architecture Rules
16-
runs-on: ubuntu-latest
17-
timeout-minutes: 30
18-
19-
steps:
20-
- name: Checkout code
21-
uses: actions/checkout@v4
22-
23-
- name: Setup Node.js
24-
uses: actions/setup-node@v3
25-
with:
26-
node-version: '18'
27-
cache: 'npm'
28-
29-
- name: Install dependencies
30-
run: npm ci --legacy-peer-deps
31-
continue-on-error: true
32-
33-
- name: Run TypeScript compilation
34-
run: npm run build
35-
continue-on-error: false
36-
37-
# - name: Run ESLint with boundary rules
38-
# run: npm run lint -- --format json --output-file eslint-report.json || echo "Linting failed, but continuing..."
39-
# continue-on-error: true
40-
41-
- name: Check circular dependencies with Madge
42-
run: |
43-
npx madge --circular --extensions ts src/
44-
echo "Circular dependency check completed"
45-
continue-on-error: true
46-
47-
- name: Run dependency analysis
48-
run: |
49-
node tools/analyze-simple.js 2>&1 | tee dependency-analysis.log
50-
continue-on-error: true
51-
52-
- name: Validate against architecture rules
53-
run: |
54-
echo "=== Architecture Validation Results ==="
55-
echo ""
56-
echo "✓ TypeScript compilation: PASSED"
57-
echo "→ Circular dependencies: Check Madge output above"
58-
echo "→ Module boundaries: Check ESLint boundary rules above"
59-
echo ""
60-
echo "For detailed reports, see:"
61-
echo " - eslint-report.json"
62-
echo " - docs/DEPENDENCY_AUDIT.md"
63-
continue-on-error: false
64-
65-
- name: Generate architecture report
66-
if: always()
67-
run: |
68-
cat > architecture-report.md << 'EOF'
69-
# Architecture Validation Report
70-
71-
Generated: $(date -u +'%Y-%m-%dT%H:%M:%SZ')
72-
Commit: ${{ github.sha }}
73-
Branch: ${{ github.ref }}
74-
75-
## Summary
76-
77-
This workflow validates the codebase against the ADR (Architecture Decision Record) rules:
78-
- ADR-001: Domain-Driven Design (11-level hierarchy)
79-
- ADR-002: Infrastructure Isolation
80-
- ADR-003: Dependency Hierarchy
81-
- ADR-004: Shared Layer Guidelines
82-
83-
## Checks Performed
84-
85-
1. **TypeScript Compilation** ✓
86-
- All TypeScript files compile without errors
87-
- Type safety validated
88-
89-
2. **ESLint Boundary Rules**
90-
- Module dependencies validated
91-
- Shared layer usage checked
92-
- Import restrictions enforced
93-
94-
3. **Circular Dependency Detection**
95-
- Using Madge library
96-
- All module cycles identified
97-
- Must be zero in production
98-
99-
4. **Dependency Analysis**
100-
- Full module graph analyzed
101-
- Violations against ADR rules identified
102-
- Reports generated in docs/DEPENDENCY_AUDIT.md
103-
104-
## Next Steps
105-
106-
If checks fail:
107-
1. Review the specific ESLint errors above
108-
2. Check docs/CIRCULAR_DEPENDENCIES_RESOLUTION.md for guidance
109-
3. Consult docs/DEPENDENCY_HIERARCHY.md for allowed dependencies
110-
4. Contact architecture team if unclear
111-
112-
## References
113-
114-
- [ADR-003: Dependency Hierarchy](../../docs/adr/ADR-003-dependency-hierarchy.md)
115-
- [DEPENDENCY_AUDIT](../../docs/DEPENDENCY_AUDIT.md)
116-
- [CIRCULAR_DEPENDENCIES_RESOLUTION](../../docs/CIRCULAR_DEPENDENCIES_RESOLUTION.md)
117-
EOF
118-
cat architecture-report.md
119-
120-
- name: Upload artifact reports
121-
if: always()
122-
uses: actions/upload-artifact@v3
123-
with:
124-
name: architecture-reports
125-
path: |
126-
eslint-report.json
127-
dependency-analysis.log
128-
architecture-report.md
129-
retention-days: 30
130-
131-
- name: Comment on PR with results
132-
if: github.event_name == 'pull_request' && always()
133-
uses: actions/github-script@v6
134-
with:
135-
script: |
136-
const fs = require('fs');
137-
const report = fs.readFileSync('architecture-report.md', 'utf8');
138-
139-
github.rest.issues.createComment({
140-
issue_number: context.issue.number,
141-
owner: context.repo.owner,
142-
repo: context.repo.repo,
143-
body: `## 🏛️ Architecture Validation\n\n${report}`
144-
});
145-
14614
# lint:
14715
# name: Lint Code
14816
# runs-on: ubuntu-latest

src/app.module.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ import { SocialTradingModule } from './social-trading/social-trading.module';
100100
import { TraderProfile } from './social-trading/entities/trader-profile.entity';
101101
import { CopySubscription } from './social-trading/entities/copy-subscription.entity';
102102

103+
// Wallet & Payments Integration
104+
import { WalletModule } from './wallet/wallet.module';
105+
import { WalletLedger } from './wallet/entities/wallet-ledger.entity';
106+
import { LedgerEntry } from './wallet/entities/ledger-entry.entity';
107+
import { WithdrawalRequest } from './wallet/entities/withdrawal-request.entity';
108+
import { FiatPaymentIntent } from './wallet/entities/fiat-payment-intent.entity';
109+
103110
@Module({
104111
imports: [
105112
// ── Core NestJS ──
@@ -192,6 +199,11 @@ import { CopySubscription } from './social-trading/entities/copy-subscription.en
192199
MarginPairConfig,
193200
MarginPosition,
194201
MarginInterestAccrual,
202+
// Wallet & Payments Integration
203+
WalletLedger,
204+
LedgerEntry,
205+
WithdrawalRequest,
206+
FiatPaymentIntent,
195207
],
196208
synchronize: configService.get<boolean>('DB_SYNCHRONIZE', true),
197209
logging: configService.get<boolean>('DB_LOGGING', false),
@@ -237,6 +249,9 @@ import { CopySubscription } from './social-trading/entities/copy-subscription.en
237249
// ── Social Trading Module (issue #396) ──
238250
SocialTradingModule,
239251

252+
// ── Wallet & Payments Integration ──
253+
WalletModule,
254+
240255
// ── Error Handling ──
241256
ErrorModule,
242257
],

src/blockchain/entities/blockchain-transaction.entity.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
export enum BlockchainNetwork {
1111
STELLAR = 'stellar',
1212
ETHEREUM = 'ethereum',
13+
BSC = 'bsc',
1314
}
1415

1516
export enum TransactionType {

0 commit comments

Comments
 (0)