@merkl/api 0.20.4 → 0.20.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/database/api/.generated/drizzle/schema.d.ts +0 -102
- package/dist/database/api/.generated/drizzle/schema.js +5 -11
- package/dist/database/api/.generated/drizzle/schema.ts +5 -11
- package/dist/database/api/.generated/edge.js +8 -15
- package/dist/database/api/.generated/index-browser.js +5 -12
- package/dist/database/api/.generated/index.d.ts +149 -464
- package/dist/database/api/.generated/index.js +8 -15
- package/dist/database/api/.generated/package.json +1 -1
- package/dist/database/api/.generated/schema.prisma +5 -11
- package/dist/database/api/.generated/wasm.js +5 -12
- package/dist/src/eden/index.d.ts +65 -90
- package/dist/src/index.d.ts +13 -18
- package/dist/src/jobs/update-dynamic-data.js +2 -0
- package/dist/src/modules/v4/apr/apr.model.d.ts +3 -3
- package/dist/src/modules/v4/apr/apr.model.js +1 -1
- package/dist/src/modules/v4/computedValue/computedValue.controller.d.ts +1 -3
- package/dist/src/modules/v4/computedValue/computedValue.repository.d.ts +1 -3
- package/dist/src/modules/v4/computedValue/computedValue.repository.js +0 -2
- package/dist/src/modules/v4/computedValue/computedValue.service.d.ts +1 -3
- package/dist/src/modules/v4/dynamicData/dynamicData.service.js +2 -5
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +12 -15
- package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +6 -6
- package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +19 -36
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +17 -26
- package/dist/src/modules/v4/opportunity/opportunity.service.js +1 -1
- package/dist/src/modules/v4/reward/reward.model.d.ts +4 -4
- package/dist/src/modules/v4/reward/reward.model.js +1 -1
- package/dist/src/modules/v4/reward/reward.repository.d.ts +2 -4
- package/dist/src/modules/v4/reward/reward.service.d.ts +5 -10
- package/dist/src/modules/v4/reward/reward.service.js +1 -1
- package/dist/src/modules/v4/router.d.ts +13 -18
- package/dist/src/modules/v4/tvl/tvl.model.d.ts +3 -3
- package/dist/src/modules/v4/tvl/tvl.model.js +1 -1
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/src/index.d.ts
CHANGED
@@ -285,9 +285,8 @@ declare const app: Elysia<"", false, {
|
|
285
285
|
cumulated: number;
|
286
286
|
timestamp: bigint;
|
287
287
|
breakdowns: {
|
288
|
-
id:
|
288
|
+
id: string;
|
289
289
|
type: import("@db/api").$Enums.AprType;
|
290
|
-
uuid: string;
|
291
290
|
identifier: string;
|
292
291
|
value: number;
|
293
292
|
aprRecordId: string;
|
@@ -298,9 +297,8 @@ declare const app: Elysia<"", false, {
|
|
298
297
|
total: number;
|
299
298
|
timestamp: bigint;
|
300
299
|
breakdowns: {
|
301
|
-
id:
|
300
|
+
id: string;
|
302
301
|
type: import("@db/api").$Enums.TvlType;
|
303
|
-
uuid: string;
|
304
302
|
identifier: string;
|
305
303
|
value: number;
|
306
304
|
tvlRecordId: string;
|
@@ -311,8 +309,7 @@ declare const app: Elysia<"", false, {
|
|
311
309
|
total: number;
|
312
310
|
timestamp: bigint;
|
313
311
|
breakdowns: {
|
314
|
-
id:
|
315
|
-
uuid: string;
|
312
|
+
id: string;
|
316
313
|
value: number;
|
317
314
|
campaignId: string;
|
318
315
|
dailyRewardsRecordId: string;
|
@@ -513,7 +510,7 @@ declare const app: Elysia<"", false, {
|
|
513
510
|
timestamp: string | bigint;
|
514
511
|
cumulated: number;
|
515
512
|
breakdowns: {
|
516
|
-
id:
|
513
|
+
id: string;
|
517
514
|
type: "CAMPAIGN" | "TOKEN" | "PROTOCOL";
|
518
515
|
identifier: string;
|
519
516
|
value: number;
|
@@ -524,7 +521,7 @@ declare const app: Elysia<"", false, {
|
|
524
521
|
total: number;
|
525
522
|
timestamp: string | bigint;
|
526
523
|
breakdowns: {
|
527
|
-
id:
|
524
|
+
id: string;
|
528
525
|
type: "TOKEN" | "PROTOCOL";
|
529
526
|
identifier: string;
|
530
527
|
value: number;
|
@@ -536,7 +533,7 @@ declare const app: Elysia<"", false, {
|
|
536
533
|
total: number;
|
537
534
|
timestamp: string | bigint;
|
538
535
|
breakdowns: {
|
539
|
-
id:
|
536
|
+
id: string;
|
540
537
|
token: {
|
541
538
|
price?: number | null | undefined;
|
542
539
|
symbol: string;
|
@@ -644,7 +641,7 @@ declare const app: Elysia<"", false, {
|
|
644
641
|
timestamp: string | bigint;
|
645
642
|
cumulated: number;
|
646
643
|
breakdowns: {
|
647
|
-
id:
|
644
|
+
id: string;
|
648
645
|
type: "CAMPAIGN" | "TOKEN" | "PROTOCOL";
|
649
646
|
identifier: string;
|
650
647
|
value: number;
|
@@ -655,7 +652,7 @@ declare const app: Elysia<"", false, {
|
|
655
652
|
total: number;
|
656
653
|
timestamp: string | bigint;
|
657
654
|
breakdowns: {
|
658
|
-
id:
|
655
|
+
id: string;
|
659
656
|
type: "TOKEN" | "PROTOCOL";
|
660
657
|
identifier: string;
|
661
658
|
value: number;
|
@@ -667,7 +664,7 @@ declare const app: Elysia<"", false, {
|
|
667
664
|
total: number;
|
668
665
|
timestamp: string | bigint;
|
669
666
|
breakdowns: {
|
670
|
-
id:
|
667
|
+
id: string;
|
671
668
|
token: {
|
672
669
|
price?: number | null | undefined;
|
673
670
|
symbol: string;
|
@@ -809,7 +806,7 @@ declare const app: Elysia<"", false, {
|
|
809
806
|
timestamp: string | bigint;
|
810
807
|
cumulated: number;
|
811
808
|
breakdowns: {
|
812
|
-
id:
|
809
|
+
id: string;
|
813
810
|
type: "CAMPAIGN" | "TOKEN" | "PROTOCOL";
|
814
811
|
identifier: string;
|
815
812
|
value: number;
|
@@ -820,7 +817,7 @@ declare const app: Elysia<"", false, {
|
|
820
817
|
total: number;
|
821
818
|
timestamp: string | bigint;
|
822
819
|
breakdowns: {
|
823
|
-
id:
|
820
|
+
id: string;
|
824
821
|
type: "TOKEN" | "PROTOCOL";
|
825
822
|
identifier: string;
|
826
823
|
value: number;
|
@@ -832,7 +829,7 @@ declare const app: Elysia<"", false, {
|
|
832
829
|
total: number;
|
833
830
|
timestamp: string | bigint;
|
834
831
|
breakdowns: {
|
835
|
-
id:
|
832
|
+
id: string;
|
836
833
|
token: {
|
837
834
|
price?: number | null | undefined;
|
838
835
|
symbol: string;
|
@@ -4588,11 +4585,9 @@ declare const app: Elysia<"", false, {
|
|
4588
4585
|
headers: unknown;
|
4589
4586
|
response: {
|
4590
4587
|
200: {
|
4591
|
-
id:
|
4588
|
+
id: string;
|
4592
4589
|
reason: string;
|
4593
|
-
uuid: string;
|
4594
4590
|
campaignId: string;
|
4595
|
-
stringId: string;
|
4596
4591
|
boost: number | null;
|
4597
4592
|
}[];
|
4598
4593
|
};
|
@@ -46,6 +46,8 @@ const main = async () => {
|
|
46
46
|
else if (status !== "LIVE" && campaign.startTimestamp > now)
|
47
47
|
status = "SOON";
|
48
48
|
}
|
49
|
+
if (status === "PAST" && opportunity.apr !== 0)
|
50
|
+
await OpportunityService.update(opportunity.id, { status, apr: 0 });
|
49
51
|
if (opportunity.status !== status)
|
50
52
|
await OpportunityService.updateStatus(opportunity.id, status);
|
51
53
|
}
|
@@ -12,9 +12,9 @@ export type AprRecord = Resource<"AprRecord", "id" | "opportunityId", {
|
|
12
12
|
* @description Describes one apr fraction of record
|
13
13
|
* @see {@link Resource}
|
14
14
|
*/
|
15
|
-
export type AprBreakdown = Resource<"AprBreakdown", "id" | "aprRecordId"
|
15
|
+
export type AprBreakdown = Resource<"AprBreakdown", "id" | "aprRecordId">;
|
16
16
|
export declare const AprBreakdownResourceDto: import("@sinclair/typebox").TObject<{
|
17
|
-
id: import("@sinclair/typebox").
|
17
|
+
id: import("@sinclair/typebox").TString;
|
18
18
|
type: import("@sinclair/typebox").TEnum<{
|
19
19
|
CAMPAIGN: "CAMPAIGN";
|
20
20
|
TOKEN: "TOKEN";
|
@@ -28,7 +28,7 @@ export declare const AprRecordResourceDto: import("@sinclair/typebox").TObject<{
|
|
28
28
|
cumulated: import("@sinclair/typebox").TNumber;
|
29
29
|
timestamp: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBigInt, import("@sinclair/typebox").TString]>;
|
30
30
|
breakdowns: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
31
|
-
id: import("@sinclair/typebox").
|
31
|
+
id: import("@sinclair/typebox").TString;
|
32
32
|
type: import("@sinclair/typebox").TEnum<{
|
33
33
|
CAMPAIGN: "CAMPAIGN";
|
34
34
|
TOKEN: "TOKEN";
|
@@ -2,7 +2,7 @@ import { AprType } from "@db/api";
|
|
2
2
|
import { t } from "elysia";
|
3
3
|
// ─── Dtos ────────────────────────────────────────────────────────────────────
|
4
4
|
export const AprBreakdownResourceDto = t.Object({
|
5
|
-
id: t.
|
5
|
+
id: t.String(),
|
6
6
|
type: t.Enum(AprType),
|
7
7
|
identifier: t.String(),
|
8
8
|
value: t.Number(),
|
@@ -51,11 +51,9 @@ export declare const ComputedValueController: Elysia<"/value", false, {
|
|
51
51
|
headers: unknown;
|
52
52
|
response: {
|
53
53
|
200: {
|
54
|
-
id:
|
54
|
+
id: string;
|
55
55
|
reason: string;
|
56
|
-
uuid: string;
|
57
56
|
campaignId: string;
|
58
|
-
stringId: string;
|
59
57
|
boost: number | null;
|
60
58
|
}[];
|
61
59
|
};
|
@@ -7,11 +7,9 @@ export declare abstract class ComputedValueRepository {
|
|
7
7
|
} | null>;
|
8
8
|
static upsertCampaignComputedValue(data: UpsertCampaignComputedValueModel): Promise<void>;
|
9
9
|
static findUserValues(data: GetUserComputedValuesModel): Promise<{
|
10
|
-
id:
|
10
|
+
id: string;
|
11
11
|
reason: string;
|
12
|
-
uuid: string;
|
13
12
|
campaignId: string;
|
14
|
-
stringId: string;
|
15
13
|
boost: number | null;
|
16
14
|
}[]>;
|
17
15
|
static upsertUserComputedValues(data: UpsertUserComputedValuesModel): Promise<void>;
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import { apiDbClient } from "@db";
|
2
2
|
import { UserRepository } from "../user/user.repository";
|
3
|
-
import { ComputedValueService } from "./computedValue.service";
|
4
3
|
export class ComputedValueRepository {
|
5
4
|
static async findCampaignValue(params) {
|
6
5
|
return await apiDbClient.campaignComputedValue.findUnique({
|
@@ -38,7 +37,6 @@ export class ComputedValueRepository {
|
|
38
37
|
},
|
39
38
|
update: { [item.field]: item.value },
|
40
39
|
create: {
|
41
|
-
stringId: ComputedValueService.hashUserComputedValueId(item.campaignId, item.address, item.reason),
|
42
40
|
campaignId: item.campaignId,
|
43
41
|
address: item.address,
|
44
42
|
reason: item.reason,
|
@@ -8,11 +8,9 @@ export declare abstract class ComputedValueService {
|
|
8
8
|
} | null>;
|
9
9
|
static upsertCampaignComputedValue(data: UpsertCampaignComputedValueModel): Promise<void>;
|
10
10
|
static findUserValues(params: GetUserComputedValuesModel): Promise<{
|
11
|
-
id:
|
11
|
+
id: string;
|
12
12
|
reason: string;
|
13
|
-
uuid: string;
|
14
13
|
campaignId: string;
|
15
|
-
stringId: string;
|
16
14
|
boost: number | null;
|
17
15
|
}[]>;
|
18
16
|
static upsertUserComputedValues(data: UpsertUserComputedValuesModel): Promise<void>;
|
@@ -102,11 +102,8 @@ export class DynamicDataService {
|
|
102
102
|
const campaignTypeToCampaigns = new Map();
|
103
103
|
for (const campaign of campaigns) {
|
104
104
|
const type = campaign.campaignType;
|
105
|
-
|
106
|
-
|
107
|
-
campaigns = [campaign];
|
108
|
-
else
|
109
|
-
campaigns.push(campaign);
|
105
|
+
const campaigns = campaignTypeToCampaigns.get(campaign.campaignType) ?? [];
|
106
|
+
campaigns.push(campaign);
|
110
107
|
campaignTypeToCampaigns.set(type, campaigns);
|
111
108
|
}
|
112
109
|
const dynamicDataArray = [];
|
@@ -140,9 +140,8 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
140
140
|
cumulated: number;
|
141
141
|
timestamp: bigint;
|
142
142
|
breakdowns: {
|
143
|
-
id:
|
143
|
+
id: string;
|
144
144
|
type: import("@db/api").$Enums.AprType;
|
145
|
-
uuid: string;
|
146
145
|
identifier: string;
|
147
146
|
value: number;
|
148
147
|
aprRecordId: string;
|
@@ -153,9 +152,8 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
153
152
|
total: number;
|
154
153
|
timestamp: bigint;
|
155
154
|
breakdowns: {
|
156
|
-
id:
|
155
|
+
id: string;
|
157
156
|
type: import("@db/api").$Enums.TvlType;
|
158
|
-
uuid: string;
|
159
157
|
identifier: string;
|
160
158
|
value: number;
|
161
159
|
tvlRecordId: string;
|
@@ -166,8 +164,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
166
164
|
total: number;
|
167
165
|
timestamp: bigint;
|
168
166
|
breakdowns: {
|
169
|
-
id:
|
170
|
-
uuid: string;
|
167
|
+
id: string;
|
171
168
|
value: number;
|
172
169
|
campaignId: string;
|
173
170
|
dailyRewardsRecordId: string;
|
@@ -368,7 +365,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
368
365
|
timestamp: string | bigint;
|
369
366
|
cumulated: number;
|
370
367
|
breakdowns: {
|
371
|
-
id:
|
368
|
+
id: string;
|
372
369
|
type: "CAMPAIGN" | "TOKEN" | "PROTOCOL";
|
373
370
|
identifier: string;
|
374
371
|
value: number;
|
@@ -379,7 +376,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
379
376
|
total: number;
|
380
377
|
timestamp: string | bigint;
|
381
378
|
breakdowns: {
|
382
|
-
id:
|
379
|
+
id: string;
|
383
380
|
type: "TOKEN" | "PROTOCOL";
|
384
381
|
identifier: string;
|
385
382
|
value: number;
|
@@ -391,7 +388,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
391
388
|
total: number;
|
392
389
|
timestamp: string | bigint;
|
393
390
|
breakdowns: {
|
394
|
-
id:
|
391
|
+
id: string;
|
395
392
|
token: {
|
396
393
|
price?: number | null | undefined;
|
397
394
|
symbol: string;
|
@@ -499,7 +496,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
499
496
|
timestamp: string | bigint;
|
500
497
|
cumulated: number;
|
501
498
|
breakdowns: {
|
502
|
-
id:
|
499
|
+
id: string;
|
503
500
|
type: "CAMPAIGN" | "TOKEN" | "PROTOCOL";
|
504
501
|
identifier: string;
|
505
502
|
value: number;
|
@@ -510,7 +507,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
510
507
|
total: number;
|
511
508
|
timestamp: string | bigint;
|
512
509
|
breakdowns: {
|
513
|
-
id:
|
510
|
+
id: string;
|
514
511
|
type: "TOKEN" | "PROTOCOL";
|
515
512
|
identifier: string;
|
516
513
|
value: number;
|
@@ -522,7 +519,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
522
519
|
total: number;
|
523
520
|
timestamp: string | bigint;
|
524
521
|
breakdowns: {
|
525
|
-
id:
|
522
|
+
id: string;
|
526
523
|
token: {
|
527
524
|
price?: number | null | undefined;
|
528
525
|
symbol: string;
|
@@ -664,7 +661,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
664
661
|
timestamp: string | bigint;
|
665
662
|
cumulated: number;
|
666
663
|
breakdowns: {
|
667
|
-
id:
|
664
|
+
id: string;
|
668
665
|
type: "CAMPAIGN" | "TOKEN" | "PROTOCOL";
|
669
666
|
identifier: string;
|
670
667
|
value: number;
|
@@ -675,7 +672,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
675
672
|
total: number;
|
676
673
|
timestamp: string | bigint;
|
677
674
|
breakdowns: {
|
678
|
-
id:
|
675
|
+
id: string;
|
679
676
|
type: "TOKEN" | "PROTOCOL";
|
680
677
|
identifier: string;
|
681
678
|
value: number;
|
@@ -687,7 +684,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
687
684
|
total: number;
|
688
685
|
timestamp: string | bigint;
|
689
686
|
breakdowns: {
|
690
|
-
id:
|
687
|
+
id: string;
|
691
688
|
token: {
|
692
689
|
price?: number | null | undefined;
|
693
690
|
symbol: string;
|
@@ -65,7 +65,7 @@ export declare const OpportunityResourceDto: import("@sinclair/typebox").TObject
|
|
65
65
|
cumulated: import("@sinclair/typebox").TNumber;
|
66
66
|
timestamp: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBigInt, import("@sinclair/typebox").TString]>;
|
67
67
|
breakdowns: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
68
|
-
id: import("@sinclair/typebox").
|
68
|
+
id: import("@sinclair/typebox").TString;
|
69
69
|
type: import("@sinclair/typebox").TEnum<{
|
70
70
|
CAMPAIGN: "CAMPAIGN";
|
71
71
|
TOKEN: "TOKEN";
|
@@ -80,7 +80,7 @@ export declare const OpportunityResourceDto: import("@sinclair/typebox").TObject
|
|
80
80
|
total: import("@sinclair/typebox").TNumber;
|
81
81
|
timestamp: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBigInt, import("@sinclair/typebox").TString]>;
|
82
82
|
breakdowns: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
83
|
-
id: import("@sinclair/typebox").
|
83
|
+
id: import("@sinclair/typebox").TString;
|
84
84
|
type: import("@sinclair/typebox").TEnum<{
|
85
85
|
TOKEN: "TOKEN";
|
86
86
|
PROTOCOL: "PROTOCOL";
|
@@ -95,7 +95,7 @@ export declare const OpportunityResourceDto: import("@sinclair/typebox").TObject
|
|
95
95
|
total: import("@sinclair/typebox").TNumber;
|
96
96
|
timestamp: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBigInt, import("@sinclair/typebox").TString]>;
|
97
97
|
breakdowns: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
98
|
-
id: import("@sinclair/typebox").
|
98
|
+
id: import("@sinclair/typebox").TString;
|
99
99
|
campaignId: import("@sinclair/typebox").TString;
|
100
100
|
value: import("@sinclair/typebox").TNumber;
|
101
101
|
dailyRewardsRecordId: import("@sinclair/typebox").TString;
|
@@ -166,7 +166,7 @@ export declare const OpportunityWithCampaignsResourceDto: import("@sinclair/type
|
|
166
166
|
cumulated: import("@sinclair/typebox").TNumber;
|
167
167
|
timestamp: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBigInt, import("@sinclair/typebox").TString]>;
|
168
168
|
breakdowns: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
169
|
-
id: import("@sinclair/typebox").
|
169
|
+
id: import("@sinclair/typebox").TString;
|
170
170
|
type: import("@sinclair/typebox").TEnum<{
|
171
171
|
CAMPAIGN: "CAMPAIGN";
|
172
172
|
TOKEN: "TOKEN";
|
@@ -181,7 +181,7 @@ export declare const OpportunityWithCampaignsResourceDto: import("@sinclair/type
|
|
181
181
|
total: import("@sinclair/typebox").TNumber;
|
182
182
|
timestamp: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBigInt, import("@sinclair/typebox").TString]>;
|
183
183
|
breakdowns: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
184
|
-
id: import("@sinclair/typebox").
|
184
|
+
id: import("@sinclair/typebox").TString;
|
185
185
|
type: import("@sinclair/typebox").TEnum<{
|
186
186
|
TOKEN: "TOKEN";
|
187
187
|
PROTOCOL: "PROTOCOL";
|
@@ -196,7 +196,7 @@ export declare const OpportunityWithCampaignsResourceDto: import("@sinclair/type
|
|
196
196
|
total: import("@sinclair/typebox").TNumber;
|
197
197
|
timestamp: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBigInt, import("@sinclair/typebox").TString]>;
|
198
198
|
breakdowns: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
199
|
-
id: import("@sinclair/typebox").
|
199
|
+
id: import("@sinclair/typebox").TString;
|
200
200
|
campaignId: import("@sinclair/typebox").TString;
|
201
201
|
value: import("@sinclair/typebox").TNumber;
|
202
202
|
dailyRewardsRecordId: import("@sinclair/typebox").TString;
|
@@ -4,7 +4,7 @@ import { type AprRecord } from "../apr";
|
|
4
4
|
import type { Campaign } from "../campaign";
|
5
5
|
import { type DailyRewardsRecord } from "../reward";
|
6
6
|
import { type TvlRecord } from "../tvl";
|
7
|
-
import type { CreateOpportunityModel, GetOpportunitiesQueryModel, UpdateOpportunityModel } from "./opportunity.model";
|
7
|
+
import type { CreateOpportunityModel, GetOpportunitiesQueryModel, Opportunity, UpdateOpportunityModel } from "./opportunity.model";
|
8
8
|
export declare abstract class OpportunityRepository {
|
9
9
|
#private;
|
10
10
|
static create(newOpp: CreateOpportunityModel, upsert?: boolean): Promise<{
|
@@ -95,9 +95,8 @@ export declare abstract class OpportunityRepository {
|
|
95
95
|
} | null;
|
96
96
|
TvlRecords: ({
|
97
97
|
TvlBreakdown: {
|
98
|
-
id:
|
98
|
+
id: string;
|
99
99
|
type: import("@db/api").$Enums.TvlType;
|
100
|
-
uuid: string;
|
101
100
|
identifier: string;
|
102
101
|
value: number;
|
103
102
|
tvlRecordId: string;
|
@@ -110,9 +109,8 @@ export declare abstract class OpportunityRepository {
|
|
110
109
|
})[];
|
111
110
|
AprRecords: ({
|
112
111
|
AprBreakdown: {
|
113
|
-
id:
|
112
|
+
id: string;
|
114
113
|
type: import("@db/api").$Enums.AprType;
|
115
|
-
uuid: string;
|
116
114
|
identifier: string;
|
117
115
|
value: number;
|
118
116
|
aprRecordId: string;
|
@@ -154,8 +152,7 @@ export declare abstract class OpportunityRepository {
|
|
154
152
|
}[];
|
155
153
|
};
|
156
154
|
} & {
|
157
|
-
id:
|
158
|
-
uuid: string;
|
155
|
+
id: string;
|
159
156
|
value: number;
|
160
157
|
campaignId: string;
|
161
158
|
dailyRewardsRecordId: string;
|
@@ -238,9 +235,8 @@ export declare abstract class OpportunityRepository {
|
|
238
235
|
} | null;
|
239
236
|
TvlRecords: ({
|
240
237
|
TvlBreakdown: {
|
241
|
-
id:
|
238
|
+
id: string;
|
242
239
|
type: import("@db/api").$Enums.TvlType;
|
243
|
-
uuid: string;
|
244
240
|
identifier: string;
|
245
241
|
value: number;
|
246
242
|
tvlRecordId: string;
|
@@ -253,9 +249,8 @@ export declare abstract class OpportunityRepository {
|
|
253
249
|
})[];
|
254
250
|
AprRecords: ({
|
255
251
|
AprBreakdown: {
|
256
|
-
id:
|
252
|
+
id: string;
|
257
253
|
type: import("@db/api").$Enums.AprType;
|
258
|
-
uuid: string;
|
259
254
|
identifier: string;
|
260
255
|
value: number;
|
261
256
|
aprRecordId: string;
|
@@ -297,8 +292,7 @@ export declare abstract class OpportunityRepository {
|
|
297
292
|
}[];
|
298
293
|
};
|
299
294
|
} & {
|
300
|
-
id:
|
301
|
-
uuid: string;
|
295
|
+
id: string;
|
302
296
|
value: number;
|
303
297
|
campaignId: string;
|
304
298
|
dailyRewardsRecordId: string;
|
@@ -439,9 +433,8 @@ export declare abstract class OpportunityRepository {
|
|
439
433
|
} | null;
|
440
434
|
TvlRecords: ({
|
441
435
|
TvlBreakdown: {
|
442
|
-
id:
|
436
|
+
id: string;
|
443
437
|
type: import("@db/api").$Enums.TvlType;
|
444
|
-
uuid: string;
|
445
438
|
identifier: string;
|
446
439
|
value: number;
|
447
440
|
tvlRecordId: string;
|
@@ -454,9 +447,8 @@ export declare abstract class OpportunityRepository {
|
|
454
447
|
})[];
|
455
448
|
AprRecords: ({
|
456
449
|
AprBreakdown: {
|
457
|
-
id:
|
450
|
+
id: string;
|
458
451
|
type: import("@db/api").$Enums.AprType;
|
459
|
-
uuid: string;
|
460
452
|
identifier: string;
|
461
453
|
value: number;
|
462
454
|
aprRecordId: string;
|
@@ -498,8 +490,7 @@ export declare abstract class OpportunityRepository {
|
|
498
490
|
}[];
|
499
491
|
};
|
500
492
|
} & {
|
501
|
-
id:
|
502
|
-
uuid: string;
|
493
|
+
id: string;
|
503
494
|
value: number;
|
504
495
|
campaignId: string;
|
505
496
|
dailyRewardsRecordId: string;
|
@@ -589,9 +580,8 @@ export declare abstract class OpportunityRepository {
|
|
589
580
|
} | null;
|
590
581
|
TvlRecords: ({
|
591
582
|
TvlBreakdown: {
|
592
|
-
id:
|
583
|
+
id: string;
|
593
584
|
type: import("@db/api").$Enums.TvlType;
|
594
|
-
uuid: string;
|
595
585
|
identifier: string;
|
596
586
|
value: number;
|
597
587
|
tvlRecordId: string;
|
@@ -604,9 +594,8 @@ export declare abstract class OpportunityRepository {
|
|
604
594
|
})[];
|
605
595
|
AprRecords: ({
|
606
596
|
AprBreakdown: {
|
607
|
-
id:
|
597
|
+
id: string;
|
608
598
|
type: import("@db/api").$Enums.AprType;
|
609
|
-
uuid: string;
|
610
599
|
identifier: string;
|
611
600
|
value: number;
|
612
601
|
aprRecordId: string;
|
@@ -648,8 +637,7 @@ export declare abstract class OpportunityRepository {
|
|
648
637
|
}[];
|
649
638
|
};
|
650
639
|
} & {
|
651
|
-
id:
|
652
|
-
uuid: string;
|
640
|
+
id: string;
|
653
641
|
value: number;
|
654
642
|
campaignId: string;
|
655
643
|
dailyRewardsRecordId: string;
|
@@ -790,9 +778,8 @@ export declare abstract class OpportunityRepository {
|
|
790
778
|
} | null;
|
791
779
|
TvlRecords: ({
|
792
780
|
TvlBreakdown: {
|
793
|
-
id:
|
781
|
+
id: string;
|
794
782
|
type: import("@db/api").$Enums.TvlType;
|
795
|
-
uuid: string;
|
796
783
|
identifier: string;
|
797
784
|
value: number;
|
798
785
|
tvlRecordId: string;
|
@@ -805,9 +792,8 @@ export declare abstract class OpportunityRepository {
|
|
805
792
|
})[];
|
806
793
|
AprRecords: ({
|
807
794
|
AprBreakdown: {
|
808
|
-
id:
|
795
|
+
id: string;
|
809
796
|
type: import("@db/api").$Enums.AprType;
|
810
|
-
uuid: string;
|
811
797
|
identifier: string;
|
812
798
|
value: number;
|
813
799
|
aprRecordId: string;
|
@@ -849,8 +835,7 @@ export declare abstract class OpportunityRepository {
|
|
849
835
|
}[];
|
850
836
|
};
|
851
837
|
} & {
|
852
|
-
id:
|
853
|
-
uuid: string;
|
838
|
+
id: string;
|
854
839
|
value: number;
|
855
840
|
campaignId: string;
|
856
841
|
dailyRewardsRecordId: string;
|
@@ -897,9 +882,8 @@ export declare abstract class OpportunityRepository {
|
|
897
882
|
};
|
898
883
|
tvlRecord: {
|
899
884
|
TvlBreakdown: {
|
900
|
-
id:
|
885
|
+
id: string;
|
901
886
|
type: import("@db/api").$Enums.TvlType;
|
902
|
-
uuid: string;
|
903
887
|
identifier: string;
|
904
888
|
value: number;
|
905
889
|
tvlRecordId: string;
|
@@ -912,8 +896,7 @@ export declare abstract class OpportunityRepository {
|
|
912
896
|
};
|
913
897
|
dailyRewardsRecord: {
|
914
898
|
DailyRewardsBreakdown: {
|
915
|
-
id:
|
916
|
-
uuid: string;
|
899
|
+
id: string;
|
917
900
|
value: number;
|
918
901
|
campaignId: string;
|
919
902
|
dailyRewardsRecordId: string;
|
@@ -998,7 +981,7 @@ export declare abstract class OpportunityRepository {
|
|
998
981
|
static aggregateMax(field: keyof Prisma.OpportunityMaxAggregateInputType, query: GetOpportunitiesQueryModel): Promise<{
|
999
982
|
max: string;
|
1000
983
|
}>;
|
1001
|
-
static update(id: string, data:
|
984
|
+
static update(id: string, data: Partial<Opportunity["raw"]>): Promise<{
|
1002
985
|
id: string;
|
1003
986
|
name: string;
|
1004
987
|
type: string;
|