Skip to content

Commit d2f429d

Browse files
authored
Merge branch 'main' into feat/587-offline-error-handling
2 parents dafbeb3 + ef653cf commit d2f429d

Some content is hidden

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

48 files changed

+5950
-375
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
5252
- name: Install Rust
5353
uses: dtolnay/rust-toolchain@stable
5454
with:
55+
toolchain: stable
5556
components: rustfmt, clippy
5657
- name: Cache dependencies
5758
uses: Swatinem/rust-cache@v2

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
backend/node_modules/
22
node_modules
33
target
4+
contracts/target/
5+
contracts/**/test_snapshots/
6+
contracts/cobertura.xml
47
dist
58
.env
69
.next

backend/.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ POOL_TOKEN_ADDRESS=
1515
# Secret key for the on-chain LoanManager admin account (G... / S...)
1616
LOAN_MANAGER_ADMIN_SECRET=
1717

18+
# Loan configuration (required)
19+
LOAN_MIN_SCORE=500
20+
LOAN_MAX_AMOUNT=50000
21+
LOAN_INTEREST_RATE_PERCENT=12
22+
CREDIT_SCORE_THRESHOLD=600
23+
1824
# Indexer Configuration
1925
INDEXER_POLL_INTERVAL_MS=30000
2026
INDEXER_BATCH_SIZE=100

backend/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.env
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* @type {import('node-pg-migrate').ColumnDefinitions | undefined}
3+
*/
4+
export const shorthands = undefined;
5+
6+
/**
7+
* @param pgm {import('node-pg-migrate').MigrationBuilder}
8+
* @returns {Promise<void> | void}
9+
*/
10+
export const up = (pgm) => {
11+
// Add payload column to webhook_deliveries table
12+
pgm.addColumn("webhook_deliveries", {
13+
payload: {
14+
type: "jsonb",
15+
notNull: false,
16+
},
17+
});
18+
19+
// Add next_retry_at column to track when to retry
20+
pgm.addColumn("webhook_deliveries", {
21+
next_retry_at: {
22+
type: "timestamp",
23+
notNull: false,
24+
},
25+
});
26+
27+
// Add index for efficient retry polling
28+
pgm.createIndex("webhook_deliveries", ["next_retry_at"], {
29+
where: "next_retry_at IS NOT NULL AND delivered_at IS NULL",
30+
});
31+
32+
// Add index for subscription + event tracking
33+
pgm.createIndex("webhook_deliveries", ["subscription_id", "event_id"]);
34+
};
35+
36+
/**
37+
* @param pgm {import('node-pg-migrate').MigrationBuilder}
38+
* @returns {Promise<void> | void}
39+
*/
40+
export const down = (pgm) => {
41+
pgm.dropIndex("webhook_deliveries", ["subscription_id", "event_id"]);
42+
pgm.dropIndex("webhook_deliveries", ["next_retry_at"]);
43+
pgm.dropColumn("webhook_deliveries", "next_retry_at");
44+
pgm.dropColumn("webhook_deliveries", "payload");
45+
};

backend/package-lock.json

Lines changed: 0 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)