@r2wa-org/eden 0.0.101 → 0.0.102
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/admin/index.d.ts +39 -21
- package/dist/asset-convert-product/admin/dto.schemas.d.ts +12 -0
- package/dist/asset-convert-product/admin/router.d.ts +12 -12
- package/dist/asset-convert-product/admin/service.d.ts +12 -12
- package/dist/check-in/admin/reward.dto.schemas.d.ts +156 -14
- package/dist/check-in/admin/reward.router.d.ts +23 -5
- package/dist/check-in/admin/reward.service.d.ts +4 -1
- package/dist/check-in/admin/router.d.ts +23 -5
- package/dist/check-in/constants.d.ts +2 -0
- package/dist/check-in/index.d.ts +2 -0
- package/dist/check-in/internal/reward.service.d.ts +31 -0
- package/dist/check-in/user/dto.schemas.d.ts +3 -22
- package/dist/check-in/user/router.d.ts +3 -10
- package/dist/check-in/user/service.d.ts +3 -4
- package/dist/file-storage/user/router.d.ts +13 -1
- package/dist/index.d.ts +44 -33
- package/dist/ledger/admin/dto.schemas.d.ts +12 -0
- package/dist/ledger/admin/router.d.ts +4 -4
- package/dist/ledger/db.schemas.d.ts +8 -8
- package/dist/ledger/schema.d.ts +6 -6
- package/dist/ledger/user/dto.schemas.d.ts +8 -8
- package/dist/ledger/user/router.d.ts +2 -2
- package/dist/ledger/user/service.d.ts +2 -2
- package/dist/lock-activity/admin/router.d.ts +1 -13
- package/dist/lock-activity/user/router.d.ts +1 -13
- package/dist/news/admin/router.d.ts +1 -13
- package/dist/team/user/router.d.ts +13 -1
- package/dist/welfare-cycle/admin/router.d.ts +13 -1
- package/package.json +1 -1
|
@@ -111,6 +111,83 @@ export declare const checkInRewardPlanResponseSchema: import("@sinclair/typebox"
|
|
|
111
111
|
email: import("@sinclair/typebox").TString;
|
|
112
112
|
}>, import("@sinclair/typebox").TNull]>;
|
|
113
113
|
}>;
|
|
114
|
+
/** 尚未配置签到奖励时 GET 返回 null,避免首次进入管理页报错 */
|
|
115
|
+
export declare const checkInRewardPlanNullableResponseSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
116
|
+
checkInType: import("@sinclair/typebox").TEnum<{
|
|
117
|
+
app: "app";
|
|
118
|
+
meeting: "meeting";
|
|
119
|
+
}>;
|
|
120
|
+
createdAt: import("@sinclair/typebox").TDate;
|
|
121
|
+
createdBy: import("@sinclair/typebox").TString;
|
|
122
|
+
creator: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
123
|
+
id: import("@sinclair/typebox").TString;
|
|
124
|
+
name: import("@sinclair/typebox").TString;
|
|
125
|
+
email: import("@sinclair/typebox").TString;
|
|
126
|
+
}>, import("@sinclair/typebox").TNull]>;
|
|
127
|
+
dailyPayoutAccountType: import("@sinclair/typebox").TObject<{
|
|
128
|
+
id: import("@sinclair/typebox").TString;
|
|
129
|
+
key: import("@sinclair/typebox").TString;
|
|
130
|
+
name: import("@sinclair/typebox").TString;
|
|
131
|
+
isActive: import("@sinclair/typebox").TBoolean;
|
|
132
|
+
}>;
|
|
133
|
+
dailyPayoutAccountTypeId: import("@sinclair/typebox").TString;
|
|
134
|
+
dailyRewardAmount: import("@sinclair/typebox").TString;
|
|
135
|
+
dailyRewardCategory: import("@sinclair/typebox").TString;
|
|
136
|
+
id: import("@sinclair/typebox").TString;
|
|
137
|
+
isEnabled: import("@sinclair/typebox").TBoolean;
|
|
138
|
+
name: import("@sinclair/typebox").TString;
|
|
139
|
+
rewardAsset: import("@sinclair/typebox").TObject<{
|
|
140
|
+
id: import("@sinclair/typebox").TString;
|
|
141
|
+
code: import("@sinclair/typebox").TString;
|
|
142
|
+
name: import("@sinclair/typebox").TString;
|
|
143
|
+
symbol: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
144
|
+
precision: import("@sinclair/typebox").TInteger;
|
|
145
|
+
isActive: import("@sinclair/typebox").TBoolean;
|
|
146
|
+
}>;
|
|
147
|
+
rewardAssetId: import("@sinclair/typebox").TString;
|
|
148
|
+
rules: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
149
|
+
createdAt: import("@sinclair/typebox").TDate;
|
|
150
|
+
createdBy: import("@sinclair/typebox").TString;
|
|
151
|
+
creator: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
152
|
+
id: import("@sinclair/typebox").TString;
|
|
153
|
+
name: import("@sinclair/typebox").TString;
|
|
154
|
+
email: import("@sinclair/typebox").TString;
|
|
155
|
+
}>, import("@sinclair/typebox").TNull]>;
|
|
156
|
+
id: import("@sinclair/typebox").TString;
|
|
157
|
+
isEnabled: import("@sinclair/typebox").TBoolean;
|
|
158
|
+
payoutAccountType: import("@sinclair/typebox").TObject<{
|
|
159
|
+
id: import("@sinclair/typebox").TString;
|
|
160
|
+
key: import("@sinclair/typebox").TString;
|
|
161
|
+
name: import("@sinclair/typebox").TString;
|
|
162
|
+
isActive: import("@sinclair/typebox").TBoolean;
|
|
163
|
+
}>;
|
|
164
|
+
payoutAccountTypeId: import("@sinclair/typebox").TString;
|
|
165
|
+
planId: import("@sinclair/typebox").TString;
|
|
166
|
+
rewardAmount: import("@sinclair/typebox").TString;
|
|
167
|
+
rewardCategory: import("@sinclair/typebox").TString;
|
|
168
|
+
ruleType: import("@sinclair/typebox").TEnum<{
|
|
169
|
+
consecutive: "consecutive";
|
|
170
|
+
cumulative: "cumulative";
|
|
171
|
+
}>;
|
|
172
|
+
sortOrder: import("@sinclair/typebox").TInteger;
|
|
173
|
+
thresholdDays: import("@sinclair/typebox").TInteger;
|
|
174
|
+
updatedAt: import("@sinclair/typebox").TDate;
|
|
175
|
+
updatedBy: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
176
|
+
updater: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
177
|
+
id: import("@sinclair/typebox").TString;
|
|
178
|
+
name: import("@sinclair/typebox").TString;
|
|
179
|
+
email: import("@sinclair/typebox").TString;
|
|
180
|
+
}>, import("@sinclair/typebox").TNull]>;
|
|
181
|
+
}>>;
|
|
182
|
+
sortOrder: import("@sinclair/typebox").TInteger;
|
|
183
|
+
updatedAt: import("@sinclair/typebox").TDate;
|
|
184
|
+
updatedBy: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
185
|
+
updater: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
186
|
+
id: import("@sinclair/typebox").TString;
|
|
187
|
+
name: import("@sinclair/typebox").TString;
|
|
188
|
+
email: import("@sinclair/typebox").TString;
|
|
189
|
+
}>, import("@sinclair/typebox").TNull]>;
|
|
190
|
+
}>, import("@sinclair/typebox").TNull]>;
|
|
114
191
|
export declare const checkInRewardPlanCreateSchema: import("@sinclair/typebox").TObject<{
|
|
115
192
|
checkInType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<{
|
|
116
193
|
app: "app";
|
|
@@ -137,20 +214,6 @@ export declare const checkInRewardPlanCreateSchema: import("@sinclair/typebox").
|
|
|
137
214
|
sortOrder: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
138
215
|
}>;
|
|
139
216
|
export type CheckInRewardPlanCreateInputType = typeof checkInRewardPlanCreateSchema.static;
|
|
140
|
-
export declare const checkInRewardPlanUpdateSchema: import("@sinclair/typebox").TObject<{
|
|
141
|
-
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
142
|
-
rewardAssetId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
143
|
-
dailyRewardAmount: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
144
|
-
dailyRewardCategory: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
145
|
-
dailyPayoutAccountTypeId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
146
|
-
checkInType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<{
|
|
147
|
-
app: "app";
|
|
148
|
-
meeting: "meeting";
|
|
149
|
-
}>>;
|
|
150
|
-
isEnabled: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
151
|
-
sortOrder: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
152
|
-
}>;
|
|
153
|
-
export type CheckInRewardPlanUpdateInputType = typeof checkInRewardPlanUpdateSchema.static;
|
|
154
217
|
export declare const checkInRewardRuleCreateSchema: import("@sinclair/typebox").TObject<{
|
|
155
218
|
isEnabled: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
156
219
|
payoutAccountTypeId: import("@sinclair/typebox").TString;
|
|
@@ -177,3 +240,82 @@ export declare const checkInRewardRuleUpdateSchema: import("@sinclair/typebox").
|
|
|
177
240
|
thresholdDays: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
178
241
|
}>;
|
|
179
242
|
export type CheckInRewardRuleUpdateInputType = typeof checkInRewardRuleUpdateSchema.static;
|
|
243
|
+
/** 更新既有里程碑规则(须带 id) */
|
|
244
|
+
export declare const checkInRewardRuleUpdateItemSchema: import("@sinclair/typebox").TObject<{
|
|
245
|
+
id: import("@sinclair/typebox").TString;
|
|
246
|
+
isEnabled: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
247
|
+
payoutAccountTypeId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
248
|
+
rewardAmount: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
249
|
+
rewardCategory: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
250
|
+
ruleType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<{
|
|
251
|
+
consecutive: "consecutive";
|
|
252
|
+
cumulative: "cumulative";
|
|
253
|
+
}>>;
|
|
254
|
+
sortOrder: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
255
|
+
thresholdDays: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
256
|
+
}>;
|
|
257
|
+
export type CheckInRewardRuleUpdateItemType = typeof checkInRewardRuleUpdateItemSchema.static;
|
|
258
|
+
/** 有 id 更新、无 id 新增 */
|
|
259
|
+
export declare const checkInRewardRuleUpsertItemSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
260
|
+
id: import("@sinclair/typebox").TString;
|
|
261
|
+
isEnabled: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
262
|
+
payoutAccountTypeId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
263
|
+
rewardAmount: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
264
|
+
rewardCategory: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
265
|
+
ruleType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<{
|
|
266
|
+
consecutive: "consecutive";
|
|
267
|
+
cumulative: "cumulative";
|
|
268
|
+
}>>;
|
|
269
|
+
sortOrder: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
270
|
+
thresholdDays: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
271
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
272
|
+
isEnabled: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
273
|
+
payoutAccountTypeId: import("@sinclair/typebox").TString;
|
|
274
|
+
rewardAmount: import("@sinclair/typebox").TString;
|
|
275
|
+
rewardCategory: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
276
|
+
ruleType: import("@sinclair/typebox").TEnum<{
|
|
277
|
+
consecutive: "consecutive";
|
|
278
|
+
cumulative: "cumulative";
|
|
279
|
+
}>;
|
|
280
|
+
sortOrder: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
281
|
+
thresholdDays: import("@sinclair/typebox").TInteger;
|
|
282
|
+
}>]>;
|
|
283
|
+
export type CheckInRewardRuleUpsertItemType = typeof checkInRewardRuleUpsertItemSchema.static;
|
|
284
|
+
export declare const checkInRewardPlanUpdateSchema: import("@sinclair/typebox").TObject<{
|
|
285
|
+
checkInType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<{
|
|
286
|
+
app: "app";
|
|
287
|
+
meeting: "meeting";
|
|
288
|
+
}>>;
|
|
289
|
+
dailyPayoutAccountTypeId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
290
|
+
dailyRewardAmount: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
291
|
+
dailyRewardCategory: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
292
|
+
isEnabled: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
293
|
+
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
294
|
+
rewardAssetId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
295
|
+
rules: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
296
|
+
id: import("@sinclair/typebox").TString;
|
|
297
|
+
isEnabled: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
298
|
+
payoutAccountTypeId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
299
|
+
rewardAmount: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
300
|
+
rewardCategory: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
301
|
+
ruleType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<{
|
|
302
|
+
consecutive: "consecutive";
|
|
303
|
+
cumulative: "cumulative";
|
|
304
|
+
}>>;
|
|
305
|
+
sortOrder: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
306
|
+
thresholdDays: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
307
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
308
|
+
isEnabled: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
309
|
+
payoutAccountTypeId: import("@sinclair/typebox").TString;
|
|
310
|
+
rewardAmount: import("@sinclair/typebox").TString;
|
|
311
|
+
rewardCategory: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
312
|
+
ruleType: import("@sinclair/typebox").TEnum<{
|
|
313
|
+
consecutive: "consecutive";
|
|
314
|
+
cumulative: "cumulative";
|
|
315
|
+
}>;
|
|
316
|
+
sortOrder: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
317
|
+
thresholdDays: import("@sinclair/typebox").TInteger;
|
|
318
|
+
}>]>>>;
|
|
319
|
+
sortOrder: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
320
|
+
}>;
|
|
321
|
+
export type CheckInRewardPlanUpdateInputType = typeof checkInRewardPlanUpdateSchema.static;
|
|
@@ -456,7 +456,7 @@ export declare const checkInRewardPlanAdminRouter: Elysia<"/reward-plans", {
|
|
|
456
456
|
name: string;
|
|
457
457
|
email: string;
|
|
458
458
|
} | null;
|
|
459
|
-
};
|
|
459
|
+
} | null;
|
|
460
460
|
401: "Unauthorized";
|
|
461
461
|
403: "Forbidden: Admins only";
|
|
462
462
|
422: {
|
|
@@ -585,13 +585,31 @@ export declare const checkInRewardPlanAdminRouter: Elysia<"/reward-plans", {
|
|
|
585
585
|
"reward-plans": {
|
|
586
586
|
patch: {
|
|
587
587
|
body: {
|
|
588
|
-
|
|
589
|
-
|
|
588
|
+
checkInType?: "app" | "meeting" | undefined;
|
|
589
|
+
dailyPayoutAccountTypeId?: string | undefined;
|
|
590
590
|
dailyRewardAmount?: string | undefined;
|
|
591
591
|
dailyRewardCategory?: string | undefined;
|
|
592
|
-
dailyPayoutAccountTypeId?: string | undefined;
|
|
593
|
-
checkInType?: "app" | "meeting" | undefined;
|
|
594
592
|
isEnabled?: boolean | undefined;
|
|
593
|
+
name?: string | undefined;
|
|
594
|
+
rewardAssetId?: string | undefined;
|
|
595
|
+
rules?: ({
|
|
596
|
+
id: string;
|
|
597
|
+
isEnabled?: boolean | undefined;
|
|
598
|
+
payoutAccountTypeId?: string | undefined;
|
|
599
|
+
rewardAmount?: string | undefined;
|
|
600
|
+
rewardCategory?: string | undefined;
|
|
601
|
+
ruleType?: "consecutive" | "cumulative" | undefined;
|
|
602
|
+
sortOrder?: number | undefined;
|
|
603
|
+
thresholdDays?: number | undefined;
|
|
604
|
+
} | {
|
|
605
|
+
isEnabled?: boolean | undefined;
|
|
606
|
+
payoutAccountTypeId: string;
|
|
607
|
+
rewardAmount: string;
|
|
608
|
+
rewardCategory?: string | undefined;
|
|
609
|
+
ruleType: "consecutive" | "cumulative";
|
|
610
|
+
sortOrder?: number | undefined;
|
|
611
|
+
thresholdDays: number;
|
|
612
|
+
})[] | undefined;
|
|
595
613
|
sortOrder?: number | undefined;
|
|
596
614
|
};
|
|
597
615
|
params: {};
|
|
@@ -4,6 +4,9 @@ export declare abstract class AdminCheckInRewardConfigService {
|
|
|
4
4
|
private static loadPlanDetail;
|
|
5
5
|
private static touchPlanUpdatedBy;
|
|
6
6
|
private static createRuleInTx;
|
|
7
|
+
private static isRuleUpdateItem;
|
|
8
|
+
private static updateRuleInTx;
|
|
9
|
+
private static syncRulesInTx;
|
|
7
10
|
static getDefaultPlan(): Promise<{
|
|
8
11
|
rules: {
|
|
9
12
|
createdAt: Date;
|
|
@@ -73,7 +76,7 @@ export declare abstract class AdminCheckInRewardConfigService {
|
|
|
73
76
|
id: string;
|
|
74
77
|
name: string;
|
|
75
78
|
} | null;
|
|
76
|
-
}>;
|
|
79
|
+
} | null>;
|
|
77
80
|
static createPlan(operatorId: string, input: CheckInRewardPlanCreateInputType): Promise<{
|
|
78
81
|
rules: {
|
|
79
82
|
createdAt: Date;
|
|
@@ -459,7 +459,7 @@ export declare const checkInAdminRouter: Elysia<"/checkIns", {
|
|
|
459
459
|
name: string;
|
|
460
460
|
email: string;
|
|
461
461
|
} | null;
|
|
462
|
-
};
|
|
462
|
+
} | null;
|
|
463
463
|
401: "Unauthorized";
|
|
464
464
|
403: "Forbidden: Admins only";
|
|
465
465
|
422: {
|
|
@@ -588,13 +588,31 @@ export declare const checkInAdminRouter: Elysia<"/checkIns", {
|
|
|
588
588
|
"reward-plans": {
|
|
589
589
|
patch: {
|
|
590
590
|
body: {
|
|
591
|
-
|
|
592
|
-
|
|
591
|
+
checkInType?: "app" | "meeting" | undefined;
|
|
592
|
+
dailyPayoutAccountTypeId?: string | undefined;
|
|
593
593
|
dailyRewardAmount?: string | undefined;
|
|
594
594
|
dailyRewardCategory?: string | undefined;
|
|
595
|
-
dailyPayoutAccountTypeId?: string | undefined;
|
|
596
|
-
checkInType?: "app" | "meeting" | undefined;
|
|
597
595
|
isEnabled?: boolean | undefined;
|
|
596
|
+
name?: string | undefined;
|
|
597
|
+
rewardAssetId?: string | undefined;
|
|
598
|
+
rules?: ({
|
|
599
|
+
id: string;
|
|
600
|
+
isEnabled?: boolean | undefined;
|
|
601
|
+
payoutAccountTypeId?: string | undefined;
|
|
602
|
+
rewardAmount?: string | undefined;
|
|
603
|
+
rewardCategory?: string | undefined;
|
|
604
|
+
ruleType?: "consecutive" | "cumulative" | undefined;
|
|
605
|
+
sortOrder?: number | undefined;
|
|
606
|
+
thresholdDays?: number | undefined;
|
|
607
|
+
} | {
|
|
608
|
+
isEnabled?: boolean | undefined;
|
|
609
|
+
payoutAccountTypeId: string;
|
|
610
|
+
rewardAmount: string;
|
|
611
|
+
rewardCategory?: string | undefined;
|
|
612
|
+
ruleType: "consecutive" | "cumulative";
|
|
613
|
+
sortOrder?: number | undefined;
|
|
614
|
+
thresholdDays: number;
|
|
615
|
+
})[] | undefined;
|
|
598
616
|
sortOrder?: number | undefined;
|
|
599
617
|
};
|
|
600
618
|
params: {};
|
package/dist/check-in/index.d.ts
CHANGED
|
@@ -5,7 +5,9 @@ export { checkInRewardPlanAdminRouter } from './admin/reward.router';
|
|
|
5
5
|
export * from './db.schemas';
|
|
6
6
|
export * from './reward.db.schemas';
|
|
7
7
|
export * from './reward.schema';
|
|
8
|
+
export * from './constants';
|
|
8
9
|
export * from './internal/service';
|
|
10
|
+
export * from './internal/reward.service';
|
|
9
11
|
export * from './permissions';
|
|
10
12
|
export * from './schema';
|
|
11
13
|
export { checkInRouter } from './user/router';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { TransactionTx } from '../../db/transaction';
|
|
2
|
+
import { checkInRewardRule } from '../reward.schema';
|
|
3
|
+
type CheckInRewardPayoutItem = {
|
|
4
|
+
kind: 'daily' | 'milestone';
|
|
5
|
+
ruleId?: string;
|
|
6
|
+
ruleType?: (typeof checkInRewardRule.$inferSelect)['ruleType'];
|
|
7
|
+
thresholdDays?: number;
|
|
8
|
+
amount: string;
|
|
9
|
+
ledgerEntryId: string;
|
|
10
|
+
isIdempotent: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type CheckInRewardPayoutResult = {
|
|
13
|
+
payouts: CheckInRewardPayoutItem[];
|
|
14
|
+
};
|
|
15
|
+
export declare abstract class InternalCheckInRewardService {
|
|
16
|
+
private static addDays;
|
|
17
|
+
private static resolveActivePlan;
|
|
18
|
+
private static countCumulativeDays;
|
|
19
|
+
private static countConsecutiveStreakDays;
|
|
20
|
+
private static buildDailyIdempotencyKey;
|
|
21
|
+
private static buildMilestoneIdempotencyKey;
|
|
22
|
+
private static payoutAmount;
|
|
23
|
+
private static processDailyReward;
|
|
24
|
+
private static processMilestoneRewards;
|
|
25
|
+
static processCheckInRewards(tx: TransactionTx, params: {
|
|
26
|
+
userId: string;
|
|
27
|
+
checkInId: string;
|
|
28
|
+
localDate: string;
|
|
29
|
+
}): Promise<CheckInRewardPayoutResult>;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -154,12 +154,7 @@ export declare const checkInResponseSchema: import("drizzle-typebox").BuildSchem
|
|
|
154
154
|
}, {}, {}>;
|
|
155
155
|
}, undefined>;
|
|
156
156
|
export type CheckInResponseType = typeof checkInResponseSchema.static;
|
|
157
|
-
export declare const checkInCreateSchema: import("@sinclair/typebox").TObject<{
|
|
158
|
-
checkInType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<{
|
|
159
|
-
app: "app";
|
|
160
|
-
meeting: "meeting";
|
|
161
|
-
}>>;
|
|
162
|
-
}>;
|
|
157
|
+
export declare const checkInCreateSchema: import("@sinclair/typebox").TObject<{}>;
|
|
163
158
|
export type CheckInCreateInputType = typeof checkInCreateSchema.static;
|
|
164
159
|
export declare const checkInListResponseSchema: import("@sinclair/typebox").TObject<{
|
|
165
160
|
data: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
@@ -477,25 +472,11 @@ export declare const checkInSummaryResponseSchema: import("@sinclair/typebox").T
|
|
|
477
472
|
checkedInToday: import("@sinclair/typebox").TBoolean;
|
|
478
473
|
}>;
|
|
479
474
|
export type CheckInSummaryResponseType = typeof checkInSummaryResponseSchema.static;
|
|
480
|
-
export declare const checkInStatsQuerySchema: import("@sinclair/typebox").TObject<{
|
|
481
|
-
checkInType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<{
|
|
482
|
-
app: "app";
|
|
483
|
-
meeting: "meeting";
|
|
484
|
-
}>>;
|
|
485
|
-
}>;
|
|
475
|
+
export declare const checkInStatsQuerySchema: import("@sinclair/typebox").TObject<{}>;
|
|
486
476
|
export type CheckInStatsQueryType = typeof checkInStatsQuerySchema.static;
|
|
487
|
-
export declare const checkInTodayQuerySchema: import("@sinclair/typebox").TObject<{
|
|
488
|
-
checkInType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<{
|
|
489
|
-
app: "app";
|
|
490
|
-
meeting: "meeting";
|
|
491
|
-
}>>;
|
|
492
|
-
}>;
|
|
477
|
+
export declare const checkInTodayQuerySchema: import("@sinclair/typebox").TObject<{}>;
|
|
493
478
|
export type CheckInTodayQueryType = typeof checkInTodayQuerySchema.static;
|
|
494
479
|
export declare const checkInListQuerySchema: import("@sinclair/typebox").TObject<{
|
|
495
|
-
checkInType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<{
|
|
496
|
-
app: "app";
|
|
497
|
-
meeting: "meeting";
|
|
498
|
-
}>>;
|
|
499
480
|
endDate: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TDate>;
|
|
500
481
|
limit: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
501
482
|
offset: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
@@ -382,9 +382,7 @@ export declare const checkInRouter: Elysia<"/checkIns", {
|
|
|
382
382
|
} & {
|
|
383
383
|
checkIns: {
|
|
384
384
|
post: {
|
|
385
|
-
body: {
|
|
386
|
-
checkInType?: "app" | "meeting" | undefined;
|
|
387
|
-
};
|
|
385
|
+
body: {};
|
|
388
386
|
params: {};
|
|
389
387
|
query: {};
|
|
390
388
|
headers: {};
|
|
@@ -419,7 +417,6 @@ export declare const checkInRouter: Elysia<"/checkIns", {
|
|
|
419
417
|
body: {};
|
|
420
418
|
params: {};
|
|
421
419
|
query: {
|
|
422
|
-
checkInType?: "app" | "meeting" | undefined;
|
|
423
420
|
endDate?: Date | undefined;
|
|
424
421
|
limit?: number | undefined;
|
|
425
422
|
offset?: number | undefined;
|
|
@@ -486,9 +483,7 @@ export declare const checkInRouter: Elysia<"/checkIns", {
|
|
|
486
483
|
get: {
|
|
487
484
|
body: {};
|
|
488
485
|
params: {};
|
|
489
|
-
query: {
|
|
490
|
-
checkInType?: "app" | "meeting" | undefined;
|
|
491
|
-
};
|
|
486
|
+
query: {};
|
|
492
487
|
headers: {};
|
|
493
488
|
response: {
|
|
494
489
|
200: {
|
|
@@ -550,9 +545,7 @@ export declare const checkInRouter: Elysia<"/checkIns", {
|
|
|
550
545
|
get: {
|
|
551
546
|
body: {};
|
|
552
547
|
params: {};
|
|
553
|
-
query: {
|
|
554
|
-
checkInType?: "app" | "meeting" | undefined;
|
|
555
|
-
};
|
|
548
|
+
query: {};
|
|
556
549
|
headers: {};
|
|
557
550
|
response: {
|
|
558
551
|
200: {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { CheckInCreateInputType, CheckInListQueryType, CheckInStatsQueryType, CheckInTodayQueryType, CheckInTimezoneUpdateInputType } from './dto.schemas';
|
|
2
2
|
export declare abstract class UserCheckInService {
|
|
3
3
|
private static validateUserId;
|
|
4
|
-
private static getCheckInTypeOrDefault;
|
|
5
4
|
private static addDays;
|
|
6
5
|
private static validateTimezone;
|
|
7
6
|
private static getNextDayStartUtc;
|
|
@@ -20,7 +19,7 @@ export declare abstract class UserCheckInService {
|
|
|
20
19
|
pendingEffectiveAt: Date | null;
|
|
21
20
|
timezoneChangedAt: Date | null;
|
|
22
21
|
}>;
|
|
23
|
-
static checkIn(userId: string,
|
|
22
|
+
static checkIn(userId: string, _payload?: CheckInCreateInputType): Promise<{
|
|
24
23
|
checkInAt: Date;
|
|
25
24
|
checkInLocalDate: string;
|
|
26
25
|
checkInOffsetMinutes: number | null;
|
|
@@ -65,12 +64,12 @@ export declare abstract class UserCheckInService {
|
|
|
65
64
|
limit: number;
|
|
66
65
|
offset: number;
|
|
67
66
|
}>;
|
|
68
|
-
static getMySummary(userId: string,
|
|
67
|
+
static getMySummary(userId: string, _query?: CheckInStatsQueryType): Promise<{
|
|
69
68
|
totalDays: number;
|
|
70
69
|
checkedInToday: boolean;
|
|
71
70
|
currentStreakDays: number;
|
|
72
71
|
}>;
|
|
73
|
-
static getMyTodayStatus(userId: string,
|
|
72
|
+
static getMyTodayStatus(userId: string, _query: CheckInTodayQueryType): Promise<{
|
|
74
73
|
checkedInToday: boolean;
|
|
75
74
|
}>;
|
|
76
75
|
}
|
|
@@ -35,7 +35,19 @@ export declare const fileStorageRouter: Elysia<"/file_storage", {
|
|
|
35
35
|
headers: import("elysia").HTTPHeaders;
|
|
36
36
|
status?: number | keyof import("elysia").StatusMap;
|
|
37
37
|
redirect?: string;
|
|
38
|
-
cookie?: Record<string,
|
|
38
|
+
cookie?: Record<string, {
|
|
39
|
+
domain?: string | undefined;
|
|
40
|
+
expires?: Date | undefined;
|
|
41
|
+
httpOnly?: boolean | undefined;
|
|
42
|
+
maxAge?: number | undefined;
|
|
43
|
+
path?: string | undefined;
|
|
44
|
+
priority?: 'low' | 'medium' | 'high' | undefined;
|
|
45
|
+
partitioned?: boolean | undefined;
|
|
46
|
+
sameSite?: true | false | 'lax' | 'strict' | 'none' | undefined;
|
|
47
|
+
secure?: boolean | undefined;
|
|
48
|
+
secrets?: string | null | (string | null)[];
|
|
49
|
+
value?: unknown;
|
|
50
|
+
}>;
|
|
39
51
|
};
|
|
40
52
|
path: string;
|
|
41
53
|
route: string;
|