Skip to content

Commit

Permalink
test(backend): register endpoint + coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
0xLucqs committed Apr 11, 2024
1 parent 538a21f commit 0d22cf1
Show file tree
Hide file tree
Showing 17 changed files with 589 additions and 87 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,8 @@ jobs:
with:
name: coverage
path: ./backend/coverage
- name: "Upload vitest config"
uses: actions/upload-artifact@v4
with:
name: vitest.config.ts
path: ./backend/vitest.config.ts
6 changes: 2 additions & 4 deletions backend/biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
"rules": {
"recommended": true
},
"ignore": [
"./coverage"
]
"ignore": ["coverage"]
},
"formatter": {
"enabled": true,
Expand All @@ -23,4 +21,4 @@
"quoteStyle": "single"
}
}
}
}
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
"fastify-plugin": "^4.5.1",
"postgres": "^3.4.4"
}
}
}
23 changes: 11 additions & 12 deletions backend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions backend/src/db/migrations/0002_misty_puma.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CREATE TABLE IF NOT EXISTS "registration" (
"address" text,
"phone_number" text,
"first_name" text,
"last_name" text,
"created_at" timestamp,
"_cursor" bigint
);
3 changes: 3 additions & 0 deletions backend/src/db/migrations/0003_fuzzy_forgotten_one.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE "registration" ADD PRIMARY KEY ("phone_number");--> statement-breakpoint
ALTER TABLE "registration" ALTER COLUMN "phone_number" SET NOT NULL;--> statement-breakpoint
ALTER TABLE "registration" ADD COLUMN "is_confirmed" boolean;
183 changes: 183 additions & 0 deletions backend/src/db/migrations/meta/0002_snapshot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
{
"id": "2b2c4f57-8c0d-4595-acfb-6cfcdfa0bb71",
"prevId": "2e782cb5-83f3-45c4-94d7-72bd2cdabf88",
"version": "5",
"dialect": "pg",
"tables": {
"registration": {
"name": "registration",
"schema": "",
"columns": {
"address": {
"name": "address",
"type": "text",
"primaryKey": false,
"notNull": false
},
"phone_number": {
"name": "phone_number",
"type": "text",
"primaryKey": false,
"notNull": false
},
"first_name": {
"name": "first_name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"last_name": {
"name": "last_name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"_cursor": {
"name": "_cursor",
"type": "bigint",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"balance_usdc": {
"name": "balance_usdc",
"schema": "",
"columns": {
"network": {
"name": "network",
"type": "text",
"primaryKey": false,
"notNull": false
},
"block_number": {
"name": "block_number",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"block_timestamp": {
"name": "block_timestamp",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"address": {
"name": "address",
"type": "text",
"primaryKey": false,
"notNull": false
},
"balance": {
"name": "balance",
"type": "text",
"primaryKey": false,
"notNull": false
},
"_cursor": {
"name": "_cursor",
"type": "bigint",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"transfer_usdc": {
"name": "transfer_usdc",
"schema": "",
"columns": {
"transfer_id": {
"name": "transfer_id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"network": {
"name": "network",
"type": "text",
"primaryKey": false,
"notNull": false
},
"block_hash": {
"name": "block_hash",
"type": "text",
"primaryKey": false,
"notNull": false
},
"block_number": {
"name": "block_number",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"block_timestamp": {
"name": "block_timestamp",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"transaction_hash": {
"name": "transaction_hash",
"type": "text",
"primaryKey": false,
"notNull": false
},
"from_address": {
"name": "from_address",
"type": "text",
"primaryKey": false,
"notNull": false
},
"to_address": {
"name": "to_address",
"type": "text",
"primaryKey": false,
"notNull": false
},
"amount": {
"name": "amount",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"_cursor": {
"name": "_cursor",
"type": "bigint",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
}
},
"enums": {},
"schemas": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}
Loading

0 comments on commit 0d22cf1

Please sign in to comment.