Skip to content

Commit cd6c642

Browse files
Merge pull request #151 from ahmadogo/search
Search & Indexing (Full-text + Structured)
2 parents 36cd50d + ef459b0 commit cd6c642

93 files changed

Lines changed: 2711 additions & 1383 deletions

File tree

Some content is hidden

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

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
parser: '@typescript-eslint/parser',
33
parserOptions: {
4-
project: 'tsconfig.json',
4+
project: ['tsconfig.json', 'tsconfig.test.json'],
55
sourceType: 'module',
66
},
77
plugins: ['@typescript-eslint/eslint-plugin', 'import'],
@@ -32,6 +32,7 @@ module.exports = {
3232
'@typescript-eslint/explicit-module-boundary-types': 'off',
3333
'@typescript-eslint/no-explicit-any': 'off',
3434
"@typescript-eslint/no-namespace": "off",
35+
"@typescript-eslint/no-unused-vars": "off",
3536
"import/no-relative-parent-imports": "error",
3637
},
3738
};

package-lock.json

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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"@nestjs/config": "^3.1.1",
5656
"@nestjs/core": "^10.3.0",
5757
"@nestjs/cqrs": "^11.0.3",
58+
"@nestjs/elasticsearch": "^11.1.0",
5859
"@nestjs/event-emitter": "^3.0.1",
5960
"@nestjs/mapped-types": "*",
6061
"@nestjs/passport": "^10.0.3",

src/app.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ import { KycGuard } from "./common/guard/kyc.guard";
128128
import { StrategyAuthGuard } from "./core/auth/guards/strategy-auth.guard";
129129
import { GlobalExceptionFilter } from "./common/filters/global-exception.filter";
130130
import { SubmissionVerifierService } from "./blockchain/oracle/submission-verifier.service";
131+
import { SearchModule } from "./search/search.module";
131132
import { LoggingMiddleware } from "./common/middleware/logging.middleware";
132133
import { ProfilingMiddleware } from "./profiling/profiling.middleware";
133134
import { GraphqlGatewayModule } from "./graphql/graphql.module";
@@ -251,6 +252,7 @@ import { TenantModuleState } from "./modules/registry/entities/tenant-module-sta
251252
ProfilingModule,
252253
EmailModule,
253254
AgentReviewsModule,
255+
SearchModule,
254256
GraphqlGatewayModule,
255257
WebhookModule,
256258
FileUploadModule,

src/blockchain/oracle/dto/payload-response.dto.ts

Lines changed: 67 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,49 +5,95 @@ import { PayloadStatus, PayloadType } from "../entities/signed-payload.entity";
55
* Response DTO for payload operations
66
*/
77
export class PayloadResponseDto {
8-
@ApiProperty({ description: "Unique payload UUID", example: "a1b2c3d4-1234-5678-90ef-ghijklmnopqr" })
8+
@ApiProperty({
9+
description: "Unique payload UUID",
10+
example: "a1b2c3d4-1234-5678-90ef-ghijklmnopqr",
11+
})
912
id: string;
1013

11-
@ApiProperty({ description: "Type of payload", enum: PayloadType, example: PayloadType.PRICE_FEED })
14+
@ApiProperty({
15+
description: "Type of payload",
16+
enum: PayloadType,
17+
example: PayloadType.PRICE_FEED,
18+
})
1219
payloadType: PayloadType;
1320

14-
@ApiProperty({ description: "Ethereum address that signed this payload", example: "0xAbCd1234567890abcdef1234567890abcdef1234" })
21+
@ApiProperty({
22+
description: "Ethereum address that signed this payload",
23+
example: "0xAbCd1234567890abcdef1234567890abcdef1234",
24+
})
1525
signerAddress: string;
1626

1727
@ApiProperty({ description: "Submission nonce", example: "42" })
1828
nonce: string;
1929

20-
@ApiProperty({ description: "Raw payload data", type: "object", example: { token: "ETH", price: 3200.5 } })
30+
@ApiProperty({
31+
description: "Raw payload data",
32+
type: "object",
33+
example: { token: "ETH", price: 3200.5 },
34+
})
2135
payload: Record<string, any>;
2236

23-
@ApiProperty({ description: "Keccak256 hash of the payload", example: "0xabc123..." })
37+
@ApiProperty({
38+
description: "Keccak256 hash of the payload",
39+
example: "0xabc123...",
40+
})
2441
payloadHash: string;
2542

26-
@ApiProperty({ description: "EIP-712 structured data hash", example: "0xdef456..." })
43+
@ApiProperty({
44+
description: "EIP-712 structured data hash",
45+
example: "0xdef456...",
46+
})
2747
structuredDataHash: string;
2848

29-
@ApiPropertyOptional({ description: "ECDSA signature (0x-prefixed, 132 chars)", nullable: true, example: "0x..." })
49+
@ApiPropertyOptional({
50+
description: "ECDSA signature (0x-prefixed, 132 chars)",
51+
nullable: true,
52+
example: "0x...",
53+
})
3054
signature: string | null;
3155

3256
@ApiProperty({ description: "Payload expiry timestamp" })
3357
expiresAt: Date;
3458

35-
@ApiProperty({ description: "Current submission status", enum: PayloadStatus, example: PayloadStatus.PENDING })
59+
@ApiProperty({
60+
description: "Current submission status",
61+
enum: PayloadStatus,
62+
example: PayloadStatus.PENDING,
63+
})
3664
status: PayloadStatus;
3765

38-
@ApiPropertyOptional({ description: "On-chain transaction hash after submission", nullable: true, example: "0x..." })
66+
@ApiPropertyOptional({
67+
description: "On-chain transaction hash after submission",
68+
nullable: true,
69+
example: "0x...",
70+
})
3971
transactionHash: string | null;
4072

41-
@ApiPropertyOptional({ description: "Block number when confirmed on-chain", nullable: true, example: "18500000" })
73+
@ApiPropertyOptional({
74+
description: "Block number when confirmed on-chain",
75+
nullable: true,
76+
example: "18500000",
77+
})
4278
blockNumber: string | null;
4379

44-
@ApiProperty({ description: "Total number of submission attempts", example: 1 })
80+
@ApiProperty({
81+
description: "Total number of submission attempts",
82+
example: 1,
83+
})
4584
submissionAttempts: number;
4685

47-
@ApiPropertyOptional({ description: "Error message if submission failed", nullable: true })
86+
@ApiPropertyOptional({
87+
description: "Error message if submission failed",
88+
nullable: true,
89+
})
4890
errorMessage: string | null;
4991

50-
@ApiPropertyOptional({ description: "Optional metadata", nullable: true, type: "object" })
92+
@ApiPropertyOptional({
93+
description: "Optional metadata",
94+
nullable: true,
95+
type: "object",
96+
})
5197
metadata: Record<string, any> | null;
5298

5399
@ApiProperty({ description: "Record creation timestamp" })
@@ -56,9 +102,15 @@ export class PayloadResponseDto {
56102
@ApiProperty({ description: "Record last-updated timestamp" })
57103
updatedAt: Date;
58104

59-
@ApiPropertyOptional({ description: "When submitted to blockchain", nullable: true })
105+
@ApiPropertyOptional({
106+
description: "When submitted to blockchain",
107+
nullable: true,
108+
})
60109
submittedAt: Date | null;
61110

62-
@ApiPropertyOptional({ description: "When confirmed on-chain", nullable: true })
111+
@ApiPropertyOptional({
112+
description: "When confirmed on-chain",
113+
nullable: true,
114+
})
63115
confirmedAt: Date | null;
64116
}

src/blockchain/oracle/dto/sign-payload.dto.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ export class SignPayloadDto {
1414
payloadId: string;
1515

1616
@ApiProperty({
17-
description: "Ethereum private key (0x-prefixed, 64 hex chars). NOTE: use client-side signing in production.",
18-
example: "0x4c0883a69102937d6231471b5dbb6e538eba2ef68e5fd63f36fe1ef7e9bb4d7f",
17+
description:
18+
"Ethereum private key (0x-prefixed, 64 hex chars). NOTE: use client-side signing in production.",
19+
example:
20+
"0x4c0883a69102937d6231471b5dbb6e538eba2ef68e5fd63f36fe1ef7e9bb4d7f",
1921
pattern: "^0x[a-fA-F0-9]{64}$",
2022
})
2123
@IsString()

0 commit comments

Comments
 (0)