Skip to content

Commit bd4d6fc

Browse files
feat: add dispute statuses, npm audit, license compliance, and fix integration test CI (#371)
Co-authored-by: Levi-Ojukwu <ojukwulevichinedu@gmail.com>
1 parent 6270086 commit bd4d6fc

6 files changed

Lines changed: 58 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,41 @@ jobs:
2020
- name: Install dependencies
2121
run: npm ci
2222

23+
- name: Run npm audit
24+
run: npm audit --audit-level=moderate
25+
continue-on-error: false
26+
27+
- name: Generate audit report
28+
if: always()
29+
run: npm audit --json > audit-report.json || true
30+
31+
- name: Upload audit report
32+
if: always()
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: npm-audit-report
36+
path: audit-report.json
37+
38+
- name: Install license-checker
39+
run: npm install -g license-checker
40+
41+
- name: Check license compliance
42+
run: |
43+
npx license-checker --production --failOn "GPL-2.0;GPL-3.0;AGPL-3.0;SSPL-1.0;EUPL-1.1;OSL-3.0;CPAL-1.0;CPL-1.0;EPL-1.0;EPL-2.0;CDDL-1.0;CDDL-1.1;MPL-2.0" --summary
44+
echo "License compliance check passed"
45+
46+
- name: Generate license report
47+
if: always()
48+
run: |
49+
npx license-checker --production --json --out license-report.json || true
50+
51+
- name: Upload license report
52+
if: always()
53+
uses: actions/upload-artifact@v4
54+
with:
55+
name: license-report
56+
path: license-report.json
57+
2358
- name: Cache TypeScript build output
2459
uses: actions/cache@v4
2560
with:

.github/workflows/integration-test.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
jobs:
99
integration-test:
1010
runs-on: ubuntu-latest
11+
timeout-minutes: 20
1112

1213
services:
1314
postgres:
@@ -46,8 +47,21 @@ jobs:
4647
- name: Install dependencies
4748
run: npm ci
4849

50+
- name: Generate Prisma client
51+
run: npx prisma generate
52+
4953
- name: Run database migrations
5054
run: npx prisma migrate deploy
5155

5256
- name: Run integration tests
53-
run: npm run test:integration
57+
run: npm run test:integration -- --forceExit
58+
59+
- name: Upload test artifacts on failure
60+
if: failure()
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: integration-test-results
64+
path: |
65+
test-results/
66+
coverage/
67+
retention-days: 7
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-- AlterEnum
2+
ALTER TYPE "DisputeStatus" ADD VALUE 'CANCELLED';
3+
ALTER TYPE "DisputeStatus" ADD VALUE 'ABANDONED';

prisma/schema.prisma

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ enum DisputeStatus {
2222
OPEN
2323
UNDER_REVIEW
2424
RESOLVED
25+
CANCELLED
26+
ABANDONED
2527
}
2628

2729
model Escrow {

src/common/enums/escrow-state.enum.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ export enum DisputeStatusEnum {
2626
OPEN = 'OPEN',
2727
UNDER_REVIEW = 'UNDER_REVIEW',
2828
RESOLVED = 'RESOLVED',
29+
CANCELLED = 'CANCELLED',
30+
ABANDONED = 'ABANDONED',
2931
}

src/prisma/prisma.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export type NotificationType =
3737
| 'DISPUTED'
3838
| 'COMPLETED'
3939
| 'REFUNDED';
40-
export type DisputeState = 'OPEN' | 'UNDER_REVIEW' | 'RESOLVED';
40+
export type DisputeState = 'OPEN' | 'UNDER_REVIEW' | 'RESOLVED' | 'CANCELLED' | 'ABANDONED';
4141

4242
export interface EscrowRecord {
4343
id: string;

0 commit comments

Comments
 (0)