Skip to content

Commit 127e116

Browse files
authored
Merge pull request #24 from ModusCreateOrg/ADE-91-reports
[ADE-91] Reports endpoints
2 parents 9abc4cd + 2db9451 commit 127e116

27 files changed

+2016
-274
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { Construct } from 'constructs';
2+
import { RemovalPolicy } from 'aws-cdk-lib';
3+
import { AttributeType, BillingMode, Table } from 'aws-cdk-lib/aws-dynamodb';
4+
5+
export function createReportsTable(scope: Construct, id: string): Table {
6+
const table = new Table(scope, id, {
7+
tableName: 'reports',
8+
partitionKey: {
9+
name: 'id',
10+
type: AttributeType.STRING,
11+
},
12+
billingMode: BillingMode.PAY_PER_REQUEST,
13+
removalPolicy: RemovalPolicy.RETAIN,
14+
});
15+
16+
// Add a GSI for querying by userId
17+
table.addGlobalSecondaryIndex({
18+
indexName: 'userIdIndex',
19+
partitionKey: {
20+
name: 'userId',
21+
type: AttributeType.STRING,
22+
},
23+
sortKey: {
24+
name: 'createdAt',
25+
type: AttributeType.STRING,
26+
},
27+
});
28+
29+
return table;
30+
}

backend/package-lock.json

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

backend/package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,14 @@
2828
},
2929
"dependencies": {
3030
"@aws-sdk/client-dynamodb": "^3.758.0",
31+
"@aws-sdk/util-dynamodb": "^3.758.0",
3132
"@aws-sdk/client-secrets-manager": "^3.758.0",
3233
"@nestjs/common": "^10.0.0",
3334
"@nestjs/config": "^3.1.1",
3435
"@nestjs/core": "^10.0.0",
36+
"@nestjs/jwt": "^10.2.0",
3537
"@nestjs/platform-express": "^10.0.0",
38+
"@nestjs/passport": "^10.0.3",
3639
"@types/jest": "^29.5.12",
3740
"axios": "^1.8.1",
3841
"class-transformer": "^0.5.1",
@@ -48,7 +51,11 @@
4851
"rxjs": "^7.8.1",
4952
"source-map-support": "^0.5.21",
5053
"web-vitals": "^2.1.4",
51-
"aws-cdk-lib": "2.139.0"
54+
"aws-cdk-lib": "2.139.0",
55+
"@nestjs/swagger": "^7.1.13",
56+
"swagger-ui-express": "^5.0.0",
57+
"passport": "^0.7.0",
58+
"passport-jwt": "^4.0.1"
5259
},
5360
"devDependencies": {
5461
"@aws-cdk/assert": "^2.68.0",

0 commit comments

Comments
 (0)