@tbox.cn/app-module-member 0.1.0 → 0.2.0

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.
@@ -1,15 +1,14 @@
1
+ import * as _mastra_core_tools from '@mastra/core/tools';
1
2
  import * as _tbox_cn_app_contracts from '@tbox.cn/app-contracts';
2
- import { CardMeta } from '@tbox.cn/app-contracts';
3
3
  import * as zod from 'zod';
4
- import { z } from 'zod';
5
- import { ServerContext } from '@tbox.cn/app-sdk/server';
6
- import { MemberQueryPort, MemberSettlementPort, Points, DiscountRule } from '@tbox.cn/app-contracts-mall';
4
+ import { PreToolDef, ServerContext } from '@tbox.cn/app-sdk/server';
5
+ import { MemberAccountPort, MemberProfilePort, MemberCardPort, MemberBenefitsPort, MemberCouponPort, MemberEnrollmentPort, MemberAccountSnapshot, MemberProfileSnapshot, MemberCardSnapshot, Points, MemberBenefitsSnapshot, PointUsageRecord, DiscountRule, MemberCouponSnapshot } from '@tbox.cn/app-contracts-mall';
7
6
 
8
7
  /**
9
- * MemberService:商圈会员完整实现。
8
+ * MemberService:商圈会员完整实现(011 K2:6 Port 全量)。
10
9
  * extends 契约 Port(保证满足消费方子集约束);完整接口只在本模块包内。
11
10
  */
12
- interface MemberService extends MemberQueryPort, MemberSettlementPort {
11
+ interface MemberService extends MemberAccountPort, MemberProfilePort, MemberCardPort, MemberBenefitsPort, MemberCouponPort, MemberEnrollmentPort {
13
12
  /** 积分变动记录(单测/观测用) */
14
13
  audit: {
15
14
  action: string;
@@ -18,11 +17,13 @@ interface MemberService extends MemberQueryPort, MemberSettlementPort {
18
17
  key?: string;
19
18
  }[];
20
19
  }
21
- /** 内存实现(PoC) */
20
+ /** 内存实现(PoC;真实数据源 = joycity-membership provider 接入点,二期) */
22
21
  declare class InMemoryMemberService implements MemberService {
23
22
  private balances;
24
23
  private levels;
25
24
  private idempotentKeys;
25
+ private usages;
26
+ private profiles;
26
27
  audit: {
27
28
  action: string;
28
29
  userId: string;
@@ -30,11 +31,39 @@ declare class InMemoryMemberService implements MemberService {
30
31
  key?: string;
31
32
  }[];
32
33
  constructor(initial?: Record<string, number>);
34
+ getAccount(userId: string): Promise<MemberAccountSnapshot>;
35
+ getProfile(userId: string): Promise<MemberProfileSnapshot>;
36
+ getCard(userId: string): Promise<MemberCardSnapshot | null>;
33
37
  queryPoints(userId: string): Promise<Points>;
38
+ getBenefits(userId: string): Promise<MemberBenefitsSnapshot>;
39
+ listPointUsage(userId: string, page: number, pageSize: number): Promise<{
40
+ items: ReadonlyArray<PointUsageRecord>;
41
+ total: number;
42
+ }>;
34
43
  queryDiscount(userId: string): Promise<DiscountRule | undefined>;
35
44
  deductPoints(userId: string, amount: number, idempotencyKey: string): Promise<boolean>;
36
45
  refundPoints(userId: string, amount: number, idempotencyKey: string): Promise<boolean>;
37
46
  awardPoints(userId: string, amount: number): Promise<boolean>;
47
+ listCoupons(userId: string, page: number, pageSize: number): Promise<{
48
+ items: ReadonlyArray<MemberCouponSnapshot>;
49
+ total: number;
50
+ }>;
51
+ getCoupon(_userId: string, _couponRef: string): Promise<MemberCouponSnapshot | null>;
52
+ enroll(input: {
53
+ userId: string;
54
+ name?: string;
55
+ phone?: string;
56
+ }): Promise<{
57
+ success: boolean;
58
+ memberRef?: string;
59
+ error?: string;
60
+ }>;
61
+ completeAuthorization(input: {
62
+ userId: string;
63
+ scopes: readonly string[];
64
+ }): Promise<{
65
+ success: boolean;
66
+ }>;
38
67
  private levelOf;
39
68
  private maybeUpgrade;
40
69
  private levelChangeListeners;
@@ -44,39 +73,526 @@ declare class InMemoryMemberService implements MemberService {
44
73
  }) => void): void;
45
74
  }
46
75
 
47
- declare const dataSchema: z.ZodObject<{
48
- userId: z.ZodString;
49
- balance: z.ZodNumber;
50
- level: z.ZodEnum<["silver", "gold", "platinum"]>;
51
- }, "strip", z.ZodTypeAny, {
52
- userId: string;
53
- balance: number;
54
- level: "silver" | "gold" | "platinum";
55
- }, {
56
- userId: string;
57
- balance: number;
58
- level: "silver" | "gold" | "platinum";
59
- }>;
60
- declare const meta: CardMeta<typeof dataSchema>;
76
+ /** 7 卡 meta map(key 约定 = cardType) */
77
+ declare const memberCards: {
78
+ readonly 'member-info': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
79
+ userId: zod.ZodString;
80
+ state: zod.ZodEnum<["active", "not_enrolled", "closed"]>;
81
+ displayName: zod.ZodOptional<zod.ZodString>;
82
+ avatarUrl: zod.ZodOptional<zod.ZodString>;
83
+ contactDisplay: zod.ZodOptional<zod.ZodString>;
84
+ memberRef: zod.ZodOptional<zod.ZodString>;
85
+ registeredAt: zod.ZodOptional<zod.ZodString>;
86
+ labels: zod.ZodArray<zod.ZodObject<{
87
+ labelRef: zod.ZodString;
88
+ name: zod.ZodString;
89
+ }, "strip", zod.ZodTypeAny, {
90
+ name: string;
91
+ labelRef: string;
92
+ }, {
93
+ name: string;
94
+ labelRef: string;
95
+ }>, "many">;
96
+ }, "strip", zod.ZodTypeAny, {
97
+ userId: string;
98
+ state: "active" | "not_enrolled" | "closed";
99
+ labels: {
100
+ name: string;
101
+ labelRef: string;
102
+ }[];
103
+ displayName?: string | undefined;
104
+ avatarUrl?: string | undefined;
105
+ contactDisplay?: string | undefined;
106
+ memberRef?: string | undefined;
107
+ registeredAt?: string | undefined;
108
+ }, {
109
+ userId: string;
110
+ state: "active" | "not_enrolled" | "closed";
111
+ labels: {
112
+ name: string;
113
+ labelRef: string;
114
+ }[];
115
+ displayName?: string | undefined;
116
+ avatarUrl?: string | undefined;
117
+ contactDisplay?: string | undefined;
118
+ memberRef?: string | undefined;
119
+ registeredAt?: string | undefined;
120
+ }>>;
121
+ readonly 'member-card-summary': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
122
+ userId: zod.ZodString;
123
+ cardRef: zod.ZodString;
124
+ cardDisplay: zod.ZodString;
125
+ status: zod.ZodEnum<["active", "inactive", "frozen", "expired", "unknown"]>;
126
+ levelName: zod.ZodOptional<zod.ZodString>;
127
+ availablePoints: zod.ZodNumber;
128
+ cardImageUrl: zod.ZodOptional<zod.ZodString>;
129
+ }, "strip", zod.ZodTypeAny, {
130
+ status: "unknown" | "active" | "inactive" | "frozen" | "expired";
131
+ userId: string;
132
+ cardRef: string;
133
+ cardDisplay: string;
134
+ availablePoints: number;
135
+ levelName?: string | undefined;
136
+ cardImageUrl?: string | undefined;
137
+ }, {
138
+ status: "unknown" | "active" | "inactive" | "frozen" | "expired";
139
+ userId: string;
140
+ cardRef: string;
141
+ cardDisplay: string;
142
+ availablePoints: number;
143
+ levelName?: string | undefined;
144
+ cardImageUrl?: string | undefined;
145
+ }>>;
146
+ readonly 'member-coupon-list': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
147
+ userId: zod.ZodString;
148
+ items: zod.ZodArray<zod.ZodObject<{
149
+ couponRef: zod.ZodString;
150
+ title: zod.ZodString;
151
+ type: zod.ZodEnum<["amount", "discount", "gift", "parking", "unknown"]>;
152
+ status: zod.ZodEnum<["effective", "used", "expired", "invalid", "unknown"]>;
153
+ benefitText: zod.ZodOptional<zod.ZodString>;
154
+ thresholdText: zod.ZodOptional<zod.ZodString>;
155
+ }, "strip", zod.ZodTypeAny, {
156
+ type: "unknown" | "amount" | "discount" | "gift" | "parking";
157
+ status: "unknown" | "expired" | "effective" | "used" | "invalid";
158
+ title: string;
159
+ couponRef: string;
160
+ benefitText?: string | undefined;
161
+ thresholdText?: string | undefined;
162
+ }, {
163
+ type: "unknown" | "amount" | "discount" | "gift" | "parking";
164
+ status: "unknown" | "expired" | "effective" | "used" | "invalid";
165
+ title: string;
166
+ couponRef: string;
167
+ benefitText?: string | undefined;
168
+ thresholdText?: string | undefined;
169
+ }>, "many">;
170
+ total: zod.ZodNumber;
171
+ }, "strip", zod.ZodTypeAny, {
172
+ userId: string;
173
+ total: number;
174
+ items: {
175
+ type: "unknown" | "amount" | "discount" | "gift" | "parking";
176
+ status: "unknown" | "expired" | "effective" | "used" | "invalid";
177
+ title: string;
178
+ couponRef: string;
179
+ benefitText?: string | undefined;
180
+ thresholdText?: string | undefined;
181
+ }[];
182
+ }, {
183
+ userId: string;
184
+ total: number;
185
+ items: {
186
+ type: "unknown" | "amount" | "discount" | "gift" | "parking";
187
+ status: "unknown" | "expired" | "effective" | "used" | "invalid";
188
+ title: string;
189
+ couponRef: string;
190
+ benefitText?: string | undefined;
191
+ thresholdText?: string | undefined;
192
+ }[];
193
+ }>>;
194
+ readonly 'member-coupon-detail': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
195
+ couponRef: zod.ZodString;
196
+ title: zod.ZodString;
197
+ type: zod.ZodEnum<["amount", "discount", "gift", "parking", "unknown"]>;
198
+ status: zod.ZodEnum<["effective", "used", "expired", "invalid", "unknown"]>;
199
+ description: zod.ZodOptional<zod.ZodString>;
200
+ benefitText: zod.ZodOptional<zod.ZodString>;
201
+ thresholdText: zod.ZodOptional<zod.ZodString>;
202
+ }, "strip", zod.ZodTypeAny, {
203
+ type: "unknown" | "amount" | "discount" | "gift" | "parking";
204
+ status: "unknown" | "expired" | "effective" | "used" | "invalid";
205
+ title: string;
206
+ couponRef: string;
207
+ description?: string | undefined;
208
+ benefitText?: string | undefined;
209
+ thresholdText?: string | undefined;
210
+ }, {
211
+ type: "unknown" | "amount" | "discount" | "gift" | "parking";
212
+ status: "unknown" | "expired" | "effective" | "used" | "invalid";
213
+ title: string;
214
+ couponRef: string;
215
+ description?: string | undefined;
216
+ benefitText?: string | undefined;
217
+ thresholdText?: string | undefined;
218
+ }>>;
219
+ readonly 'member-point-usage-list': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
220
+ userId: zod.ZodString;
221
+ balance: zod.ZodNumber;
222
+ level: zod.ZodEnum<["silver", "gold", "platinum"]>;
223
+ items: zod.ZodArray<zod.ZodObject<{
224
+ usageRecordRef: zod.ZodString;
225
+ title: zod.ZodString;
226
+ amount: zod.ZodString;
227
+ usedAt: zod.ZodOptional<zod.ZodString>;
228
+ description: zod.ZodOptional<zod.ZodString>;
229
+ }, "strip", zod.ZodTypeAny, {
230
+ amount: string;
231
+ title: string;
232
+ usageRecordRef: string;
233
+ description?: string | undefined;
234
+ usedAt?: string | undefined;
235
+ }, {
236
+ amount: string;
237
+ title: string;
238
+ usageRecordRef: string;
239
+ description?: string | undefined;
240
+ usedAt?: string | undefined;
241
+ }>, "many">;
242
+ total: zod.ZodNumber;
243
+ }, "strip", zod.ZodTypeAny, {
244
+ userId: string;
245
+ total: number;
246
+ items: {
247
+ amount: string;
248
+ title: string;
249
+ usageRecordRef: string;
250
+ description?: string | undefined;
251
+ usedAt?: string | undefined;
252
+ }[];
253
+ balance: number;
254
+ level: "silver" | "gold" | "platinum";
255
+ }, {
256
+ userId: string;
257
+ total: number;
258
+ items: {
259
+ amount: string;
260
+ title: string;
261
+ usageRecordRef: string;
262
+ description?: string | undefined;
263
+ usedAt?: string | undefined;
264
+ }[];
265
+ balance: number;
266
+ level: "silver" | "gold" | "platinum";
267
+ }>>;
268
+ readonly 'member-enrollment-form': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
269
+ userId: zod.ZodString;
270
+ state: zod.ZodEnum<["active", "not_enrolled", "closed"]>;
271
+ fields: zod.ZodArray<zod.ZodObject<{
272
+ fieldId: zod.ZodString;
273
+ label: zod.ZodString;
274
+ required: zod.ZodBoolean;
275
+ }, "strip", zod.ZodTypeAny, {
276
+ required: boolean;
277
+ label: string;
278
+ fieldId: string;
279
+ }, {
280
+ required: boolean;
281
+ label: string;
282
+ fieldId: string;
283
+ }>, "many">;
284
+ actionId: zod.ZodString;
285
+ }, "strip", zod.ZodTypeAny, {
286
+ userId: string;
287
+ actionId: string;
288
+ state: "active" | "not_enrolled" | "closed";
289
+ fields: {
290
+ required: boolean;
291
+ label: string;
292
+ fieldId: string;
293
+ }[];
294
+ }, {
295
+ userId: string;
296
+ actionId: string;
297
+ state: "active" | "not_enrolled" | "closed";
298
+ fields: {
299
+ required: boolean;
300
+ label: string;
301
+ fieldId: string;
302
+ }[];
303
+ }>>;
304
+ readonly 'member-enrollment-status': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
305
+ userId: zod.ZodString;
306
+ success: zod.ZodBoolean;
307
+ memberRef: zod.ZodOptional<zod.ZodString>;
308
+ message: zod.ZodOptional<zod.ZodString>;
309
+ state: zod.ZodEnum<["active", "not_enrolled", "closed"]>;
310
+ }, "strip", zod.ZodTypeAny, {
311
+ success: boolean;
312
+ userId: string;
313
+ state: "active" | "not_enrolled" | "closed";
314
+ message?: string | undefined;
315
+ memberRef?: string | undefined;
316
+ }, {
317
+ success: boolean;
318
+ userId: string;
319
+ state: "active" | "not_enrolled" | "closed";
320
+ message?: string | undefined;
321
+ memberRef?: string | undefined;
322
+ }>>;
323
+ };
61
324
 
62
325
  /** 模块注册入口:自注册闭环(与客户端 clientModule 对称) */
63
326
  declare const serverModule: {
327
+ declaration: {
328
+ componentId: string;
329
+ features: string[];
330
+ };
64
331
  cards: {
65
- readonly points: _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
332
+ readonly 'member-info': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
333
+ userId: zod.ZodString;
334
+ state: zod.ZodEnum<["active", "not_enrolled", "closed"]>;
335
+ displayName: zod.ZodOptional<zod.ZodString>;
336
+ avatarUrl: zod.ZodOptional<zod.ZodString>;
337
+ contactDisplay: zod.ZodOptional<zod.ZodString>;
338
+ memberRef: zod.ZodOptional<zod.ZodString>;
339
+ registeredAt: zod.ZodOptional<zod.ZodString>;
340
+ labels: zod.ZodArray<zod.ZodObject<{
341
+ labelRef: zod.ZodString;
342
+ name: zod.ZodString;
343
+ }, "strip", zod.ZodTypeAny, {
344
+ name: string;
345
+ labelRef: string;
346
+ }, {
347
+ name: string;
348
+ labelRef: string;
349
+ }>, "many">;
350
+ }, "strip", zod.ZodTypeAny, {
351
+ userId: string;
352
+ state: "active" | "not_enrolled" | "closed";
353
+ labels: {
354
+ name: string;
355
+ labelRef: string;
356
+ }[];
357
+ displayName?: string | undefined;
358
+ avatarUrl?: string | undefined;
359
+ contactDisplay?: string | undefined;
360
+ memberRef?: string | undefined;
361
+ registeredAt?: string | undefined;
362
+ }, {
363
+ userId: string;
364
+ state: "active" | "not_enrolled" | "closed";
365
+ labels: {
366
+ name: string;
367
+ labelRef: string;
368
+ }[];
369
+ displayName?: string | undefined;
370
+ avatarUrl?: string | undefined;
371
+ contactDisplay?: string | undefined;
372
+ memberRef?: string | undefined;
373
+ registeredAt?: string | undefined;
374
+ }>>;
375
+ readonly 'member-card-summary': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
376
+ userId: zod.ZodString;
377
+ cardRef: zod.ZodString;
378
+ cardDisplay: zod.ZodString;
379
+ status: zod.ZodEnum<["active", "inactive", "frozen", "expired", "unknown"]>;
380
+ levelName: zod.ZodOptional<zod.ZodString>;
381
+ availablePoints: zod.ZodNumber;
382
+ cardImageUrl: zod.ZodOptional<zod.ZodString>;
383
+ }, "strip", zod.ZodTypeAny, {
384
+ status: "unknown" | "active" | "inactive" | "frozen" | "expired";
385
+ userId: string;
386
+ cardRef: string;
387
+ cardDisplay: string;
388
+ availablePoints: number;
389
+ levelName?: string | undefined;
390
+ cardImageUrl?: string | undefined;
391
+ }, {
392
+ status: "unknown" | "active" | "inactive" | "frozen" | "expired";
393
+ userId: string;
394
+ cardRef: string;
395
+ cardDisplay: string;
396
+ availablePoints: number;
397
+ levelName?: string | undefined;
398
+ cardImageUrl?: string | undefined;
399
+ }>>;
400
+ readonly 'member-coupon-list': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
401
+ userId: zod.ZodString;
402
+ items: zod.ZodArray<zod.ZodObject<{
403
+ couponRef: zod.ZodString;
404
+ title: zod.ZodString;
405
+ type: zod.ZodEnum<["amount", "discount", "gift", "parking", "unknown"]>;
406
+ status: zod.ZodEnum<["effective", "used", "expired", "invalid", "unknown"]>;
407
+ benefitText: zod.ZodOptional<zod.ZodString>;
408
+ thresholdText: zod.ZodOptional<zod.ZodString>;
409
+ }, "strip", zod.ZodTypeAny, {
410
+ type: "unknown" | "amount" | "discount" | "gift" | "parking";
411
+ status: "unknown" | "expired" | "effective" | "used" | "invalid";
412
+ title: string;
413
+ couponRef: string;
414
+ benefitText?: string | undefined;
415
+ thresholdText?: string | undefined;
416
+ }, {
417
+ type: "unknown" | "amount" | "discount" | "gift" | "parking";
418
+ status: "unknown" | "expired" | "effective" | "used" | "invalid";
419
+ title: string;
420
+ couponRef: string;
421
+ benefitText?: string | undefined;
422
+ thresholdText?: string | undefined;
423
+ }>, "many">;
424
+ total: zod.ZodNumber;
425
+ }, "strip", zod.ZodTypeAny, {
426
+ userId: string;
427
+ total: number;
428
+ items: {
429
+ type: "unknown" | "amount" | "discount" | "gift" | "parking";
430
+ status: "unknown" | "expired" | "effective" | "used" | "invalid";
431
+ title: string;
432
+ couponRef: string;
433
+ benefitText?: string | undefined;
434
+ thresholdText?: string | undefined;
435
+ }[];
436
+ }, {
437
+ userId: string;
438
+ total: number;
439
+ items: {
440
+ type: "unknown" | "amount" | "discount" | "gift" | "parking";
441
+ status: "unknown" | "expired" | "effective" | "used" | "invalid";
442
+ title: string;
443
+ couponRef: string;
444
+ benefitText?: string | undefined;
445
+ thresholdText?: string | undefined;
446
+ }[];
447
+ }>>;
448
+ readonly 'member-coupon-detail': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
449
+ couponRef: zod.ZodString;
450
+ title: zod.ZodString;
451
+ type: zod.ZodEnum<["amount", "discount", "gift", "parking", "unknown"]>;
452
+ status: zod.ZodEnum<["effective", "used", "expired", "invalid", "unknown"]>;
453
+ description: zod.ZodOptional<zod.ZodString>;
454
+ benefitText: zod.ZodOptional<zod.ZodString>;
455
+ thresholdText: zod.ZodOptional<zod.ZodString>;
456
+ }, "strip", zod.ZodTypeAny, {
457
+ type: "unknown" | "amount" | "discount" | "gift" | "parking";
458
+ status: "unknown" | "expired" | "effective" | "used" | "invalid";
459
+ title: string;
460
+ couponRef: string;
461
+ description?: string | undefined;
462
+ benefitText?: string | undefined;
463
+ thresholdText?: string | undefined;
464
+ }, {
465
+ type: "unknown" | "amount" | "discount" | "gift" | "parking";
466
+ status: "unknown" | "expired" | "effective" | "used" | "invalid";
467
+ title: string;
468
+ couponRef: string;
469
+ description?: string | undefined;
470
+ benefitText?: string | undefined;
471
+ thresholdText?: string | undefined;
472
+ }>>;
473
+ readonly 'member-point-usage-list': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
66
474
  userId: zod.ZodString;
67
475
  balance: zod.ZodNumber;
68
476
  level: zod.ZodEnum<["silver", "gold", "platinum"]>;
477
+ items: zod.ZodArray<zod.ZodObject<{
478
+ usageRecordRef: zod.ZodString;
479
+ title: zod.ZodString;
480
+ amount: zod.ZodString;
481
+ usedAt: zod.ZodOptional<zod.ZodString>;
482
+ description: zod.ZodOptional<zod.ZodString>;
483
+ }, "strip", zod.ZodTypeAny, {
484
+ amount: string;
485
+ title: string;
486
+ usageRecordRef: string;
487
+ description?: string | undefined;
488
+ usedAt?: string | undefined;
489
+ }, {
490
+ amount: string;
491
+ title: string;
492
+ usageRecordRef: string;
493
+ description?: string | undefined;
494
+ usedAt?: string | undefined;
495
+ }>, "many">;
496
+ total: zod.ZodNumber;
69
497
  }, "strip", zod.ZodTypeAny, {
70
498
  userId: string;
499
+ total: number;
500
+ items: {
501
+ amount: string;
502
+ title: string;
503
+ usageRecordRef: string;
504
+ description?: string | undefined;
505
+ usedAt?: string | undefined;
506
+ }[];
71
507
  balance: number;
72
508
  level: "silver" | "gold" | "platinum";
73
509
  }, {
74
510
  userId: string;
511
+ total: number;
512
+ items: {
513
+ amount: string;
514
+ title: string;
515
+ usageRecordRef: string;
516
+ description?: string | undefined;
517
+ usedAt?: string | undefined;
518
+ }[];
75
519
  balance: number;
76
520
  level: "silver" | "gold" | "platinum";
77
521
  }>>;
522
+ readonly 'member-enrollment-form': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
523
+ userId: zod.ZodString;
524
+ state: zod.ZodEnum<["active", "not_enrolled", "closed"]>;
525
+ fields: zod.ZodArray<zod.ZodObject<{
526
+ fieldId: zod.ZodString;
527
+ label: zod.ZodString;
528
+ required: zod.ZodBoolean;
529
+ }, "strip", zod.ZodTypeAny, {
530
+ required: boolean;
531
+ label: string;
532
+ fieldId: string;
533
+ }, {
534
+ required: boolean;
535
+ label: string;
536
+ fieldId: string;
537
+ }>, "many">;
538
+ actionId: zod.ZodString;
539
+ }, "strip", zod.ZodTypeAny, {
540
+ userId: string;
541
+ actionId: string;
542
+ state: "active" | "not_enrolled" | "closed";
543
+ fields: {
544
+ required: boolean;
545
+ label: string;
546
+ fieldId: string;
547
+ }[];
548
+ }, {
549
+ userId: string;
550
+ actionId: string;
551
+ state: "active" | "not_enrolled" | "closed";
552
+ fields: {
553
+ required: boolean;
554
+ label: string;
555
+ fieldId: string;
556
+ }[];
557
+ }>>;
558
+ readonly 'member-enrollment-status': _tbox_cn_app_contracts.CardMeta<zod.ZodObject<{
559
+ userId: zod.ZodString;
560
+ success: zod.ZodBoolean;
561
+ memberRef: zod.ZodOptional<zod.ZodString>;
562
+ message: zod.ZodOptional<zod.ZodString>;
563
+ state: zod.ZodEnum<["active", "not_enrolled", "closed"]>;
564
+ }, "strip", zod.ZodTypeAny, {
565
+ success: boolean;
566
+ userId: string;
567
+ state: "active" | "not_enrolled" | "closed";
568
+ message?: string | undefined;
569
+ memberRef?: string | undefined;
570
+ }, {
571
+ success: boolean;
572
+ userId: string;
573
+ state: "active" | "not_enrolled" | "closed";
574
+ message?: string | undefined;
575
+ memberRef?: string | undefined;
576
+ }>>;
577
+ };
578
+ preTools: {
579
+ queryPoints: PreToolDef<_mastra_core_tools.Tool<{
580
+ userId: string;
581
+ }, {
582
+ userId: string;
583
+ total: number;
584
+ items: {
585
+ amount: string;
586
+ title: string;
587
+ usageRecordRef: string;
588
+ description?: string | undefined;
589
+ usedAt?: string | undefined;
590
+ }[];
591
+ balance: number;
592
+ level: "silver" | "gold" | "platinum";
593
+ }, unknown, unknown, _mastra_core_tools.ToolExecutionContext<unknown, unknown, unknown>, "queryPoints", unknown>>;
78
594
  };
79
595
  register(ctx: ServerContext): void;
80
596
  };
81
597
 
82
- export { InMemoryMemberService, type MemberService, meta as pointsMeta, serverModule };
598
+ export { InMemoryMemberService, type MemberService, memberCards, serverModule };
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  InMemoryMemberService,
3
- meta_default,
3
+ memberCards,
4
4
  serverModule
5
- } from "../chunk-F6FHBH3N.js";
5
+ } from "../chunk-ZV6B36AO.js";
6
6
  export {
7
7
  InMemoryMemberService,
8
- meta_default as pointsMeta,
8
+ memberCards,
9
9
  serverModule
10
10
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tbox.cn/app-module-member",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "description": "商圈会员模块:积分查询/扣减/发放/退款、等级(codegen 源)。",
6
6
  "exports": {
@@ -18,9 +18,9 @@
18
18
  }
19
19
  },
20
20
  "dependencies": {
21
- "@tbox.cn/app-sdk": "^0.1.0",
21
+ "@tbox.cn/app-sdk": "^0.2.0",
22
22
  "@tbox.cn/app-contracts": "^0.1.0",
23
- "@tbox.cn/app-contracts-mall": "^0.1.0"
23
+ "@tbox.cn/app-contracts-mall": "^0.2.0"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "zod": "^3.24.0",