cabloy 5.1.227 → 5.1.228
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/.cabloy-version +1 -1
- package/CHANGELOG.md +16 -0
- package/CONTRIBUTING.md +1 -1
- package/package.json +2 -2
- package/repo-agent-governance/managed-assets.json +30 -30
- package/repo-agent-governance/policies/repository.md +1 -1
- package/repo-agent-governance/skills/cabloy-backend-scaffold/SKILL.md +3 -3
- package/repo-agent-governance/skills/cabloy-backend-scaffold/references/follow-up-checklist.md +2 -2
- package/repo-agent-governance/skills/cabloy-frontend-scaffold/SKILL.md +1 -0
- package/repo-agent-governance/skills/cabloy-master-detail/SKILL.md +2 -1
- package/repo-agent-governance/skills/cabloy-resource-field-update/SKILL.md +2 -0
- package/repo-agent-governance/skills/cabloy-resource-field-update/references/follow-up-checklist.md +11 -5
- package/repo-agent-governance/skills/cabloy-resource-field-update/references/verification-checklist.md +10 -14
- package/repo-agent-governance/skills/cabloy-spec-execution/evals/evals.json +4 -2
- package/repo-agent-governance/skills/cabloy-spec-execution/references/execution-protocol.md +1 -1
- package/repo-agent-governance/tests/evidence-paths.test.mjs +84 -13
- package/repo-agent-governance/tools/evidence-paths/sanitize.mjs +38 -8
- package/repo-docs/backend/migration-and-changes.md +21 -14
- package/repo-docs/backend/quickstart.md +1 -1
- package/repo-docs/backend/resource-field-update.md +3 -2
- package/repo-docs/backend/unit-testing.md +9 -3
- package/repo-docs/frontend/table-cell-cookbook.md +32 -0
- package/repo-docs/fullstack/quickstart.md +1 -1
- package/repo-docs/reference/repo-scripts.md +2 -2
- package/repo-e2e/specs/a-commerce.spec.ts +83 -9
- package/scripts/init.ts +14 -0
- package/vona/pnpm-lock.yaml +25 -82
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/config/locale/en-us.ts +2 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/config/locale/zh-cn.ts +2 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/dto/orderShip.tsx +4 -2
- package/zova/package.original.json +1 -1
- package/zova/packages-cli/cli/package.json +5 -2
- package/zova/packages-cli/cli-set-front/package.json +5 -2
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.bin.buildRest.ts +5 -1
- package/zova/pnpm-lock.yaml +434 -276
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/.metadata/index.ts +23 -23
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/api/openapi/schemas.ts +28 -12
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/api/openapi/types.ts +245 -85
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/component/tableCellActionAdjustStock/controller.tsx +3 -2
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/component/tableCellActionShip/controller.tsx +82 -34
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/config/locale/en-us.ts +1 -0
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/config/locale/zh-cn.ts +1 -0
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
import type { SchemaObject } from 'openapi3-ts/oas31';
|
|
1
2
|
import type { TableIdentity } from 'table-identity';
|
|
3
|
+
import type { TypeFormOnSubmitData } from 'zova-module-a-form';
|
|
2
4
|
import type { IJsxRenderContextTableCell } from 'zova-module-a-table';
|
|
3
5
|
|
|
4
6
|
import { BeanControllerBase, Use } from 'zova';
|
|
5
7
|
import { Controller } from 'zova-module-a-bean';
|
|
8
|
+
import { ZForm } from 'zova-module-a-form';
|
|
9
|
+
import { $QueryEnsureLoaded } from 'zova-module-a-model';
|
|
6
10
|
import { ZButton } from 'zova-module-basic-button';
|
|
7
11
|
|
|
12
|
+
import type { ApiApiCommerceTradeOrdershipRequestBody } from '../../api/commerceTradeOrder.js';
|
|
8
13
|
import type { ITableCellOptionsActionShip } from '../../bean/tableCell.actionShip.js';
|
|
9
14
|
import type { ModelOrder } from '../../model/order.js';
|
|
10
15
|
|
|
@@ -20,48 +25,91 @@ export class ControllerTableCellActionShip extends BeanControllerBase {
|
|
|
20
25
|
@Use({ beanFullName: 'commerce-trade.model.order' })
|
|
21
26
|
$$modelOrder: ModelOrder;
|
|
22
27
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
confirmed = false;
|
|
28
|
+
draft: ApiApiCommerceTradeOrdershipRequestBody = { carrier: '', trackingNumber: '' };
|
|
29
|
+
schema?: SchemaObject;
|
|
26
30
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (!carrier || !trackingNumber || !this.confirmed) return;
|
|
31
|
+
get apiSchemasShip() {
|
|
32
|
+
return this.scope.apiSchema.commerceTradeOrder.ship();
|
|
33
|
+
}
|
|
31
34
|
|
|
35
|
+
private get _mutation() {
|
|
32
36
|
const orderId = this.$$renderContext.cellContext.row.id as TableIdentity;
|
|
33
|
-
|
|
37
|
+
return this.$$modelOrder.ship(orderId);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
private async _submit(
|
|
41
|
+
data: TypeFormOnSubmitData<ApiApiCommerceTradeOrdershipRequestBody>,
|
|
42
|
+
close: () => void,
|
|
43
|
+
) {
|
|
44
|
+
const mutation = this._mutation;
|
|
45
|
+
if (mutation.isPending) return;
|
|
46
|
+
const confirmed = await this.$performCommand('basic-commands:confirm', {
|
|
47
|
+
text: this.scope.locale.ShipOrderConfirm(),
|
|
48
|
+
});
|
|
49
|
+
if (!confirmed) return;
|
|
50
|
+
await mutation.mutateAsync(data.value);
|
|
51
|
+
close();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
private async _ensureSchema() {
|
|
55
|
+
await $QueryEnsureLoaded(() => this.apiSchemasShip.sdk);
|
|
56
|
+
if (!this.schema) {
|
|
57
|
+
this.schema = this.$computed(() => this.apiSchemasShip.requestBody);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
private async _openDialog() {
|
|
62
|
+
await this._ensureSchema();
|
|
63
|
+
this.draft = { carrier: '', trackingNumber: '' };
|
|
64
|
+
this.$appModal.dialog(
|
|
65
|
+
{
|
|
66
|
+
title: this.scope.locale.ShipOrder(),
|
|
67
|
+
slotDefault: dialog => (
|
|
68
|
+
<ZForm
|
|
69
|
+
data={this.draft}
|
|
70
|
+
schema={this.schema}
|
|
71
|
+
onSubmitData={data => this._submit(data, dialog.close)}
|
|
72
|
+
onShowError={async ({ error }) => {
|
|
73
|
+
await this.$performCommand('basic-commands:alert', {
|
|
74
|
+
type: 'error',
|
|
75
|
+
text: error.message,
|
|
76
|
+
});
|
|
77
|
+
}}
|
|
78
|
+
slotFooter={$$form => (
|
|
79
|
+
<div class="flex justify-end gap-2">
|
|
80
|
+
{$$form.formState.isSubmitting && (
|
|
81
|
+
<span class="loading loading-spinner text-primary"></span>
|
|
82
|
+
)}
|
|
83
|
+
<button class="btn btn-ghost" type="button" onClick={dialog.close}>
|
|
84
|
+
{this.scope.locale.Cancel()}
|
|
85
|
+
</button>
|
|
86
|
+
<button
|
|
87
|
+
class="btn btn-primary"
|
|
88
|
+
disabled={$$form.formState.isSubmitting || this._mutation.isPending}
|
|
89
|
+
type="submit"
|
|
90
|
+
>
|
|
91
|
+
{this.scope.locale.ShipOrder()}
|
|
92
|
+
</button>
|
|
93
|
+
</div>
|
|
94
|
+
)}
|
|
95
|
+
></ZForm>
|
|
96
|
+
),
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
closeOnBackdrop: false,
|
|
100
|
+
closeOnEscape: false,
|
|
101
|
+
maxWidth: 480,
|
|
102
|
+
showCloseButton: true,
|
|
103
|
+
},
|
|
104
|
+
);
|
|
34
105
|
}
|
|
35
106
|
|
|
36
107
|
protected render() {
|
|
37
108
|
const props = this.$props as ControllerTableCellActionShipProps;
|
|
38
109
|
return (
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
name="carrier"
|
|
43
|
-
placeholder="Carrier"
|
|
44
|
-
v-model={this.carrier}
|
|
45
|
-
/>
|
|
46
|
-
<input
|
|
47
|
-
class="input input-bordered input-sm join-item w-36"
|
|
48
|
-
name="trackingNumber"
|
|
49
|
-
placeholder="Tracking number"
|
|
50
|
-
v-model={this.trackingNumber}
|
|
51
|
-
/>
|
|
52
|
-
<label class="label cursor-pointer join-item gap-1 px-2">
|
|
53
|
-
<input
|
|
54
|
-
class="checkbox checkbox-sm"
|
|
55
|
-
name="confirmed"
|
|
56
|
-
type="checkbox"
|
|
57
|
-
v-model={this.confirmed}
|
|
58
|
-
/>
|
|
59
|
-
<span class="label-text text-xs">{this.scope.locale.Confirm()}</span>
|
|
60
|
-
</label>
|
|
61
|
-
<ZButton class={props.class} onPerform={() => this._ship()}>
|
|
62
|
-
{this.scope.locale.ShipOrder()}
|
|
63
|
-
</ZButton>
|
|
64
|
-
</div>
|
|
110
|
+
<ZButton class={props.class} onPerform={() => this._openDialog()}>
|
|
111
|
+
{this.scope.locale.ShipOrder()}
|
|
112
|
+
</ZButton>
|
|
65
113
|
);
|
|
66
114
|
}
|
|
67
115
|
}
|
|
@@ -68,6 +68,7 @@ export default {
|
|
|
68
68
|
Confirm: 'Confirm',
|
|
69
69
|
Cancel: 'Cancel',
|
|
70
70
|
ShipOrder: 'Ship order',
|
|
71
|
+
ShipOrderConfirm: 'Ship this order with the entered shipment details?',
|
|
71
72
|
RequestRefund: 'Request refund',
|
|
72
73
|
RefundRequestHelp: 'Refunds are for the whole unshipped order only.',
|
|
73
74
|
RefundReason: 'Reason for refund',
|