@tbox.cn/app-module-parking 0.10.2 → 0.10.3

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.
@@ -6,7 +6,7 @@ import {
6
6
  resolveParkingQueryPort,
7
7
  resolveParkingVehiclePort,
8
8
  serverModule
9
- } from "../chunk-AC5FKXIW.js";
9
+ } from "../chunk-VH3J7FEI.js";
10
10
  export {
11
11
  InMemoryParkingService,
12
12
  inMemoryParking,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tbox.cn/app-module-parking",
3
- "version": "0.10.2",
3
+ "version": "0.10.3",
4
4
  "type": "module",
5
5
  "description": "商圈停车模块:计费支付、车辆寻车、缴费记录与开票(codegen 源)。",
6
6
  "exports": {
@@ -18,10 +18,10 @@
18
18
  }
19
19
  },
20
20
  "dependencies": {
21
- "@tbox.cn/app-contracts": "0.12.1",
22
- "@tbox.cn/app-contracts-mall": "0.12.2",
23
- "@tbox.cn/app-agent-sdk-client": "0.1.2",
24
- "@tbox.cn/app-agent-sdk-server": "0.1.2"
21
+ "@tbox.cn/app-contracts": "0.12.3",
22
+ "@tbox.cn/app-contracts-mall": "0.12.3",
23
+ "@tbox.cn/app-agent-sdk-client": "0.1.3",
24
+ "@tbox.cn/app-agent-sdk-server": "0.1.4"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "zod": "3.25.76",
@@ -1,14 +1,14 @@
1
- /** parking 卡 meta 聚合(015 S5:5 卡;key 约定 = meta.cardType) */
1
+ /** parking 卡 meta 聚合(015 S5:5 卡;key 约定 = meta.cardType;书序与 CardMeta.order 预览序位一致) */
2
+ import parkingVehicleManagement from './parking-vehicle-management/meta';
3
+ import parkingInfo from './parking-info/meta';
2
4
  import parkingPayment from './parking-payment/meta';
3
5
  import parkingPaymentResult from './parking-payment-result/meta';
4
6
  import parkingPaymentRecords from './parking-payment-records/meta';
5
- import parkingVehicleManagement from './parking-vehicle-management/meta';
6
- import parkingInfo from './parking-info/meta';
7
7
 
8
8
  export const parkingCards = {
9
+ 'parking-vehicle-management': parkingVehicleManagement,
10
+ 'parking-info': parkingInfo,
9
11
  'parking-payment': parkingPayment,
10
12
  'parking-payment-result': parkingPaymentResult,
11
13
  'parking-payment-records': parkingPaymentRecords,
12
- 'parking-vehicle-management': parkingVehicleManagement,
13
- 'parking-info': parkingInfo,
14
14
  } as const;
@@ -14,6 +14,7 @@ const meta: CardMeta<typeof parkingInfoCardDataSchema> = {
14
14
  },
15
15
  samples,
16
16
  schemaVersion: 1,
17
+ order: 2,
17
18
  };
18
19
 
19
20
  export default meta;
@@ -24,6 +24,7 @@ const meta: CardMeta<typeof parkingPaymentCardDataSchema> = {
24
24
  },
25
25
  samples,
26
26
  schemaVersion: 1,
27
+ order: 3,
27
28
  };
28
29
 
29
30
  export default meta;
@@ -6,6 +6,9 @@
6
6
  * - 视觉等价的输入合并一格、note 列全(沉默会员态三格合一就是这个原因);
7
7
  * - 覆盖基准是组件真正读的 data 分支(settlement 终态/优惠矩阵/互斥/零费用/令牌缺席),
8
8
  * 不是 sampleData 的形状;
9
+ * - 预览只保留五格附加样本(加服务端合成的「初始态」共六格):零费用/长时长/支付完成/
10
+ * 三类优惠混合/未入会有券;其余 hidden: true,真源保留且 shape/schema 质量检查仍全量巡走;
11
+ * 恢复展示 = 移除标记;
9
12
  * - 样本即契约:data 必须 dataSchema 校验通过且无 shape 外键(tests/samples.test.ts 双断言)。
10
13
  */
11
14
  import type { CardSample } from '@tbox.cn/app-contracts';
@@ -68,6 +71,7 @@ export const samples: CardSample<ParkingPaymentCardData>[] = [
68
71
  label: '标准形态',
69
72
  note: 'hero meta「入场 · 已停」+ summary 已停时长 + 页脚 caveats 齐全,其余格子的基线',
70
73
  group: BASIC,
74
+ hidden: true,
71
75
  data: {
72
76
  ...BASE, quoteRef: 'b_std', membership: MEMBER_ACTIVE,
73
77
  payableText: '15.00 元', appliedBenefits: [], selectableBenefits: [],
@@ -108,6 +112,7 @@ export const samples: CardSample<ParkingPaymentCardData>[] = [
108
112
  label: '历史卡',
109
113
  note: 'isHistory——hero 右上出「历史报价」(当前卡不出这个角标),全部动作禁用',
110
114
  group: BASIC,
115
+ hidden: true,
111
116
  data: {
112
117
  ...BASE, quoteRef: 'b_hist', entryAtText: '08-13 09:10',
113
118
  membership: MEMBER_ACTIVE,
@@ -120,6 +125,7 @@ export const samples: CardSample<ParkingPaymentCardData>[] = [
120
125
  label: '授权已过期',
121
126
  note: 'confirmToken 缺席(单次令牌已消费/超时)→ 按钮置灰 + 红字说明。此前画廊恒喂令牌,这一态从没渲染过',
122
127
  group: BASIC,
128
+ hidden: true,
123
129
  data: {
124
130
  ...BASE, quoteRef: 'b_notoken', membership: MEMBER_ACTIVE,
125
131
  payableText: '15.00 元', appliedBenefits: [], selectableBenefits: [POINTS_BENEFIT],
@@ -130,6 +136,7 @@ export const samples: CardSample<ParkingPaymentCardData>[] = [
130
136
  label: '终态·支付处理中',
131
137
  note: 'settlement.paying——confirm-payment 原地写入,按钮恒置灰、优惠区不再可改',
132
138
  group: BASIC,
139
+ hidden: true,
133
140
  data: {
134
141
  ...BASE, quoteRef: 'b_paying', membership: MEMBER_ACTIVE,
135
142
  discountText: '5.75 元', payableText: '9.25 元',
@@ -152,6 +159,7 @@ export const samples: CardSample<ParkingPaymentCardData>[] = [
152
159
  label: '终态·支付未完成',
153
160
  note: 'settlement.failed——需重新查询报价',
154
161
  group: BASIC,
162
+ hidden: true,
155
163
  data: {
156
164
  ...BASE, quoteRef: 'b_failed', membership: MEMBER_ACTIVE,
157
165
  payableText: '15.00 元',
@@ -168,6 +176,7 @@ export const samples: CardSample<ParkingPaymentCardData>[] = [
168
176
  label: '已入会·无任何优惠',
169
177
  note: 'selectableBenefits 空 → 优惠区整块不渲染',
170
178
  group: MATRIX,
179
+ hidden: true,
171
180
  data: {
172
181
  ...BASE, quoteRef: 'm_none', membership: MEMBER_ACTIVE,
173
182
  payableText: '15.00 元', appliedBenefits: [], selectableBenefits: [],
@@ -177,6 +186,7 @@ export const samples: CardSample<ParkingPaymentCardData>[] = [
177
186
  label: '已入会·只有券',
178
187
  note: '券已 autoSelected 生效 → 按钮报 9.00 元(与「当前应付」同源)',
179
188
  group: MATRIX,
189
+ hidden: true,
180
190
  data: {
181
191
  ...BASE, quoteRef: 'm_coupon', membership: MEMBER_ACTIVE,
182
192
  discountText: '6.00 元', payableText: '9.00 元',
@@ -188,6 +198,7 @@ export const samples: CardSample<ParkingPaymentCardData>[] = [
188
198
  label: '已入会·只有等级权益',
189
199
  note: '唯一优惠是自动生效的等级权益 → 优惠区无可勾项、整块不渲染,减免只在费用明细现身',
190
200
  group: MATRIX,
201
+ hidden: true,
191
202
  data: {
192
203
  ...BASE, quoteRef: 'm_level', membership: MEMBER_ACTIVE,
193
204
  discountText: '0.75 元', payableText: '14.25 元',
@@ -198,6 +209,7 @@ export const samples: CardSample<ParkingPaymentCardData>[] = [
198
209
  label: '已入会·只有积分',
199
210
  note: '积分未勾 → 按钮仍报 15.00 元,勾上才 reprice。paymentOptions 的 exact 与 requires_reprice 两态卡上无差别(客户端已不读该字段),故不再各占一格',
200
211
  group: MATRIX,
212
+ hidden: true,
201
213
  data: {
202
214
  ...BASE, quoteRef: 'm_points', membership: MEMBER_ACTIVE,
203
215
  payableText: '15.00 元', appliedBenefits: [], selectableBenefits: [POINTS_BENEFIT],
@@ -211,6 +223,7 @@ export const samples: CardSample<ParkingPaymentCardData>[] = [
211
223
  label: '已入会·券 + 积分可叠加',
212
224
  note: '两类都无 exclusiveWithKinds → 默认可叠加,勾选互不影响',
213
225
  group: MATRIX,
226
+ hidden: true,
214
227
  data: {
215
228
  ...BASE, quoteRef: 'm_stack', membership: MEMBER_ACTIVE,
216
229
  discountText: '6.00 元', payableText: '9.00 元',
@@ -222,6 +235,7 @@ export const samples: CardSample<ParkingPaymentCardData>[] = [
222
235
  label: '已入会·券与积分互斥',
223
236
  note: '券标 exclusiveWithKinds:[points]——勾任一方都会撤下另一方(判定双向)。互斥在勾选前完全不可见:两项外观与可叠加的一模一样,description 也没被渲染',
224
237
  group: MATRIX,
238
+ hidden: true,
225
239
  data: {
226
240
  ...BASE, quoteRef: 'm_conflict', membership: MEMBER_ACTIVE,
227
241
  payableText: '15.00 元', appliedBenefits: [],
@@ -246,6 +260,7 @@ export const samples: CardSample<ParkingPaymentCardData>[] = [
246
260
  label: '等级权益·需用户选择',
247
261
  note: 'discount + autoSelected=false——厂商要求用户主动选,故仍留在勾选区,不走自动生效那条路',
248
262
  group: MATRIX,
263
+ hidden: true,
249
264
  data: {
250
265
  ...BASE, quoteRef: 'm_level_opt', membership: MEMBER_ACTIVE,
251
266
  payableText: '15.00 元', appliedBenefits: [],
@@ -259,6 +274,7 @@ export const samples: CardSample<ParkingPaymentCardData>[] = [
259
274
  label: '⚠ 已入会·积分不足',
260
275
  note: 'availablePoints < requiredPoints → 服务端撤掉 points 入口,但积分项仍在优惠区可勾。勾了会重算失败,卡上没有一处说明「积分不够」',
261
276
  group: MATRIX,
277
+ hidden: true,
262
278
  data: {
263
279
  ...BASE, quoteRef: 'm_insufficient',
264
280
  membership: { state: 'active', availablePoints: 120 },
@@ -282,6 +298,7 @@ export const samples: CardSample<ParkingPaymentCardData>[] = [
282
298
  label: '未入会·无优惠',
283
299
  note: '最朴素的未入会态:只有引导条',
284
300
  group: MATRIX,
301
+ hidden: true,
285
302
  data: {
286
303
  ...BASE, quoteRef: 'm_ne',
287
304
  membership: { state: 'not_enrolled' },
@@ -292,6 +309,7 @@ export const samples: CardSample<ParkingPaymentCardData>[] = [
292
309
  label: '未登录',
293
310
  note: 'unauthenticated——同一条引导换成「去登录」',
294
311
  group: MATRIX,
312
+ hidden: true,
295
313
  data: {
296
314
  ...BASE, quoteRef: 'm_anon', durationText: '3 小时 05 分', entryAtText: undefined,
297
315
  membership: { state: 'unauthenticated' },
@@ -302,6 +320,7 @@ export const samples: CardSample<ParkingPaymentCardData>[] = [
302
320
  label: '⚠ 会员态沉默',
303
321
  note: 'unknown / closed / unavailable 三态渲染完全相同——组件只认 not_enrolled 与 unauthenticated,这三个既无积分入口也无任何说明,与「已入会但商场无积分权益」无法区分。三格合一,差异只在 data',
304
322
  group: MATRIX,
323
+ hidden: true,
305
324
  data: {
306
325
  ...BASE, quoteRef: 'm_silent',
307
326
  membership: { state: 'closed' },
@@ -27,6 +27,7 @@ const meta: CardMeta<typeof parkingPaymentRecordsCardDataSchema> = {
27
27
  samples,
28
28
  schemaVersion: 2,
29
29
  migrate: (oldData) => oldData as Record<string, unknown>,
30
+ order: 5,
30
31
  };
31
32
 
32
33
  export default meta;
@@ -70,6 +70,7 @@ export const samples: CardSample<ParkingPaymentRecordsCardData>[] = [
70
70
  message: RECORD_DETAIL_MESSAGE,
71
71
  },
72
72
  isHistory: true,
73
+ hidden: true,
73
74
  },
74
75
  {
75
76
  label: '授权已过期',
@@ -82,5 +83,6 @@ export const samples: CardSample<ParkingPaymentRecordsCardData>[] = [
82
83
  total: 1, hasMore: false, caveats: ['仅展示近 6 个月缴费记录'],
83
84
  },
84
85
  noTokens: true,
86
+ hidden: true,
85
87
  },
86
88
  ];
@@ -16,6 +16,7 @@ const meta: CardMeta<typeof parkingPaymentResultCardDataSchema> = {
16
16
  },
17
17
  samples,
18
18
  schemaVersion: 1,
19
+ order: 4,
19
20
  };
20
21
 
21
22
  export default meta;
@@ -36,6 +36,7 @@ export const samples: CardSample<ParkingPaymentResultCardData>[] = [
36
36
  { label: '缴费时间', value: '今天 18:02' },
37
37
  ],
38
38
  },
39
+ hidden: true,
39
40
  },
40
41
  {
41
42
  label: '厂商确认中',
@@ -50,6 +51,7 @@ export const samples: CardSample<ParkingPaymentResultCardData>[] = [
50
51
  { label: '缴费时间', value: '今天 10:31' },
51
52
  ],
52
53
  },
54
+ hidden: true,
53
55
  },
54
56
  {
55
57
  label: '极简·无金额无明细',
@@ -59,6 +61,7 @@ export const samples: CardSample<ParkingPaymentResultCardData>[] = [
59
61
  paymentRef: 'PO55667788', plateNo: '浙A12345', status: 'UNKNOWN',
60
62
  message: '支付结果确认中,稍后可在缴费记录中核对', retryable: true,
61
63
  },
64
+ hidden: true,
62
65
  },
63
66
  {
64
67
  label: '授权已过期',
@@ -70,6 +73,7 @@ export const samples: CardSample<ParkingPaymentResultCardData>[] = [
70
73
  details: [{ label: '车牌', value: '浙A12345' }],
71
74
  },
72
75
  noTokens: true,
76
+ hidden: true,
73
77
  },
74
78
  {
75
79
  label: '历史卡',
@@ -80,5 +84,6 @@ export const samples: CardSample<ParkingPaymentResultCardData>[] = [
80
84
  amountText: '9.25 元', message: '支付结果确认中', retryable: true,
81
85
  },
82
86
  isHistory: true,
87
+ hidden: true,
83
88
  },
84
89
  ];
@@ -15,6 +15,7 @@ const meta: CardMeta<typeof parkingVehicleManagementCardDataSchema> = {
15
15
  },
16
16
  samples,
17
17
  schemaVersion: 1,
18
+ order: 1,
18
19
  };
19
20
 
20
21
  export default meta;
@@ -60,6 +60,7 @@ export const samples: CardSample<ParkingVehicleManagementCardData>[] = [
60
60
  membership: { state: 'not_enrolled' },
61
61
  },
62
62
  isHistory: true,
63
+ hidden: true,
63
64
  },
64
65
  {
65
66
  label: '授权已过期',
@@ -69,5 +70,6 @@ export const samples: CardSample<ParkingVehicleManagementCardData>[] = [
69
70
  bound: [{ vehicleRef: 'v_1', plateNo: '浙A12345', parked: true }],
70
71
  },
71
72
  noTokens: true,
73
+ hidden: true,
72
74
  },
73
75
  ];
@@ -36,9 +36,39 @@ describe('parking samples 双断言(样本即契约)', () => {
36
36
  expect(resultMeta.samples).toHaveLength(6);
37
37
  });
38
38
 
39
- it('变体标志在场:isHistory 与 noTokens 样本均存在(预览页考察载体)', () => {
39
+ it('历史与授权失效样本保留质量检查但不进入 Preview', () => {
40
40
  const all: CardSample[] = metas.flatMap((m) => (m.samples ?? []) as CardSample[]);
41
- expect(all.some((s) => s.isHistory)).toBe(true);
42
- expect(all.some((s) => s.noTokens)).toBe(true);
41
+ const histories = all.filter((sample) => sample.isHistory === true);
42
+ const noTokens = all.filter((sample) => sample.noTokens === true);
43
+ expect(histories.length).toBeGreaterThan(0);
44
+ expect(noTokens.length).toBeGreaterThan(0);
45
+ expect(histories.every((sample) => sample.hidden === true)).toBe(true);
46
+ expect(noTokens.every((sample) => sample.hidden === true)).toBe(true);
47
+ });
48
+
49
+ it('支付回执负向、过程与降级样本不进入 Preview', () => {
50
+ const hiddenLabels = new Set(
51
+ (resultMeta.samples ?? []).filter((sample) => sample.hidden === true).map((sample) => sample.label),
52
+ );
53
+ expect(hiddenLabels).toEqual(new Set([
54
+ '支付取消',
55
+ '厂商确认中',
56
+ '极简·无金额无明细',
57
+ '授权已过期',
58
+ '历史卡',
59
+ ]));
60
+ });
61
+
62
+ it('停车缴费 Preview 只保留五个互补的附加样本', () => {
63
+ const visibleLabels = (paymentMeta.samples ?? [])
64
+ .filter((sample) => sample.hidden !== true)
65
+ .map((sample) => sample.label);
66
+ expect(visibleLabels).toEqual([
67
+ '零费用',
68
+ '多费项·跨日长时长',
69
+ '终态·已完成支付',
70
+ '已入会·三类混合',
71
+ '未入会·有券',
72
+ ]);
43
73
  });
44
74
  });