cabloy 5.1.117 → 5.1.119
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/.github/workflows/vona-test-pg.yml +2 -2
- package/.github/workflows/vona-test-sqlite3.yml +2 -2
- package/CHANGELOG.md +19 -0
- package/cabloy-docs/backend/metrics-guide.md +75 -0
- package/e2e/specs/a-commerce/commerce.spec.ts +111 -0
- package/observability/README.md +18 -0
- package/observability/collector/otel-collector.yaml +34 -0
- package/observability/docker-compose.metrics.yml +25 -0
- package/observability/grafana/provisioning/datasources/prometheus.yaml +8 -0
- package/observability/prometheus/prometheus.yaml +7 -0
- package/package.json +1 -1
- package/scripts/upgrade.ts +1 -0
- package/vona/env/.env +6 -0
- package/vona/packages-cli/cli/package.json +1 -1
- package/vona/packages-cli/cli-set-api/package.json +1 -1
- package/vona/packages-vona/vona/package.json +1 -1
- package/vona/packages-vona/vona-core/package.json +1 -1
- package/vona/packages-vona/vona-core/src/lib/framework/processWorker.ts +1 -1
- package/vona/packages-vona/vona-mock/package.json +1 -1
- package/vona/packages-vona/vona-mock/src/index.ts +2 -0
- package/vona/packages-vona/vona-mock/src/lib/testLock.ts +21 -0
- package/vona/pnpm-lock.yaml +167 -64
- package/vona/src/suite/a-commerce/modules/commerce-catalog/test/catalog.test.ts +13 -3
- package/vona/src/suite/a-commerce/modules/commerce-catalog/test/product.test.ts +124 -70
- package/vona/src/suite/a-commerce/modules/commerce-payment/src/.metadata/index.ts +221 -0
- package/vona/src/suite/a-commerce/modules/commerce-payment/src/bean/meta.index.ts +12 -0
- package/vona/src/suite/a-commerce/modules/commerce-payment/src/bean/meta.version.ts +91 -0
- package/vona/src/suite/a-commerce/modules/commerce-payment/src/entity/refundAttempt.tsx +37 -0
- package/vona/src/suite/a-commerce/modules/commerce-payment/src/entity/refundAudit.tsx +47 -0
- package/vona/src/suite/a-commerce/modules/commerce-payment/src/entity/refundRequest.tsx +43 -0
- package/vona/src/suite/a-commerce/modules/commerce-payment/src/model/refundAttempt.ts +10 -0
- package/vona/src/suite/a-commerce/modules/commerce-payment/src/model/refundAudit.ts +10 -0
- package/vona/src/suite/a-commerce/modules/commerce-payment/src/model/refundRequest.ts +10 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/.metadata/index.ts +36 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/controller/order.ts +43 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/dto/orderDetail.tsx +23 -2
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/dto/orderSelectResItem.tsx +3 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/dto/orderSummary.tsx +23 -2
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/dto/refundOutcomeCreate.tsx +16 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/dto/refundRequestCreate.tsx +15 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/dto/refundResult.tsx +35 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/dto/refundReview.tsx +15 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/entity/orderAudit.tsx +55 -13
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/service/order.ts +459 -10
- package/vona/src/suite/a-commerce/modules/commerce-trade/test/cartOwnership.test.ts +2 -4
- package/vona/src/suite/a-commerce/modules/commerce-trade/test/checkoutReservation.test.ts +2 -4
- package/vona/src/suite/a-commerce/modules/commerce-trade/test/checkoutTransaction.test.ts +2 -4
- package/vona/src/suite/a-commerce/modules/commerce-trade/test/orderSnapshot.test.ts +2 -4
- package/vona/src/suite/a-commerce/modules/commerce-trade/test/paymentOutcome.test.ts +2 -4
- package/vona/src/suite/a-commerce/modules/commerce-trade/test/refundLifecycle.test.ts +337 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/test/reservationExpiry.test.ts +2 -3
- package/vona/src/suite/a-commerce/modules/commerce-trade/test/shipment.test.ts +2 -4
- package/vona/src/suite/a-commerce/modules/commerce-trade/test/shipmentRefundRace.test.ts +143 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/test/stockBalance.test.ts +2 -4
- package/vona/src/suite/a-commerce/modules/commerce-trade/test/stockReservation.test.ts +2 -4
- package/vona/src/suite/cabloy-basic/modules/basic-metrics/package.json +54 -0
- package/vona/src/suite/cabloy-basic/modules/basic-metrics/src/.metadata/index.ts +189 -0
- package/vona/src/suite/cabloy-basic/modules/basic-metrics/src/.metadata/this.ts +1 -0
- package/vona/src/suite/cabloy-basic/modules/basic-metrics/src/bean/ssrMenu.metrics.ts +23 -0
- package/vona/src/suite/cabloy-basic/modules/basic-metrics/src/controller/metrics.ts +21 -0
- package/vona/src/suite/cabloy-basic/modules/basic-metrics/src/dto/metricsQueue.ts +25 -0
- package/vona/src/suite/cabloy-basic/modules/basic-metrics/src/dto/metricsRuntime.ts +36 -0
- package/vona/src/suite/cabloy-basic/modules/basic-metrics/src/dto/metricsSnapshot.ts +21 -0
- package/vona/src/suite/cabloy-basic/modules/basic-metrics/src/index.ts +1 -0
- package/vona/src/suite/cabloy-basic/modules/basic-metrics/src/service/metrics.ts +11 -0
- package/vona/src/suite/cabloy-basic/modules/basic-metrics/tsconfig.build.json +11 -0
- package/vona/src/suite/cabloy-basic/modules/basic-metrics/tsconfig.json +5 -0
- package/vona/src/suite/cabloy-basic/package.json +1 -0
- package/vona/src/suite-vendor/a-vona/modules/a-core/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-instance/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-instance/src/bean/middlewareSystem.app.ts +2 -0
- package/vona/src/suite-vendor/a-vona/modules/a-instance/src/bean/middlewareSystem.instance.ts +2 -0
- package/vona/src/suite-vendor/a-vona/modules/a-metrics/package.json +62 -0
- package/vona/src/suite-vendor/a-vona/modules/a-metrics/src/.metadata/index.ts +178 -0
- package/vona/src/suite-vendor/a-vona/modules/a-metrics/src/.metadata/this.ts +1 -0
- package/vona/src/suite-vendor/a-vona/modules/a-metrics/src/bean/bean.metrics.ts +15 -0
- package/vona/src/suite-vendor/a-vona/modules/a-metrics/src/bean/middlewareSystem.health.ts +24 -0
- package/vona/src/suite-vendor/a-vona/modules/a-metrics/src/bean/middlewareSystem.metrics.ts +51 -0
- package/vona/src/suite-vendor/a-vona/modules/a-metrics/src/config/config.ts +75 -0
- package/vona/src/suite-vendor/a-vona/modules/a-metrics/src/index.ts +2 -0
- package/vona/src/suite-vendor/a-vona/modules/a-metrics/src/monkey.ts +27 -0
- package/vona/src/suite-vendor/a-vona/modules/a-metrics/src/service/health.ts +53 -0
- package/vona/src/suite-vendor/a-vona/modules/a-metrics/src/service/metrics.ts +222 -0
- package/vona/src/suite-vendor/a-vona/modules/a-metrics/src/service/metricsRuntime.ts +69 -0
- package/vona/src/suite-vendor/a-vona/modules/a-metrics/src/types/context.ts +9 -0
- package/vona/src/suite-vendor/a-vona/modules/a-metrics/src/types/index.ts +2 -0
- package/vona/src/suite-vendor/a-vona/modules/a-metrics/src/types/metrics.ts +50 -0
- package/vona/src/suite-vendor/a-vona/modules/a-metrics/tsconfig.build.json +11 -0
- package/vona/src/suite-vendor/a-vona/modules/a-metrics/tsconfig.json +7 -0
- package/vona/src/suite-vendor/a-vona/package.json +2 -1
- package/zova/pnpm-lock.yaml +104 -89
- package/zova/src/suite/a-commerce/modules/commerce-trade/cli/openapi.config.ts +4 -0
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/.metadata/component/tableCellActionRefund.ts +31 -0
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/.metadata/index.ts +35 -6
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/api/commerceTradeOrder.ts +104 -0
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/api/openapi/schemas.ts +16 -0
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/api/openapi/types.ts +231 -2
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/apiSchema/commerceTradeOrder.ts +20 -0
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/bean/tableCell.actionRefund.tsx +40 -0
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/component/tableCellActionRefund/controller.tsx +106 -0
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/config/locale/en-us.ts +7 -0
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/config/locale/zh-cn.ts +7 -0
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/model/order.ts +45 -1
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/model/orderMine.ts +15 -0
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/page/order/controller.tsx +41 -0
- package/zova/src/suite/cabloy-basic/modules/basic-metrics/package.json +53 -0
- package/zova/src/suite/cabloy-basic/modules/basic-metrics/src/.metadata/index.ts +151 -0
- package/zova/src/suite/cabloy-basic/modules/basic-metrics/src/.metadata/page/dashboard.ts +9 -0
- package/zova/src/suite/cabloy-basic/modules/basic-metrics/src/.metadata/this.ts +1 -0
- package/zova/src/suite/cabloy-basic/modules/basic-metrics/src/api/basicMetricsMetrics.ts +41 -0
- package/zova/src/suite/cabloy-basic/modules/basic-metrics/src/index.ts +2 -0
- package/zova/src/suite/cabloy-basic/modules/basic-metrics/src/model/metrics.ts +16 -0
- package/zova/src/suite/cabloy-basic/modules/basic-metrics/src/page/dashboard/controller.tsx +95 -0
- package/zova/src/suite/cabloy-basic/modules/basic-metrics/src/routes.ts +5 -0
- package/zova/src/suite/cabloy-basic/modules/basic-metrics/tsconfig.build.json +13 -0
- package/zova/src/suite/cabloy-basic/modules/basic-metrics/tsconfig.json +5 -0
- package/zova/src/suite/cabloy-basic/package.json +1 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/test/testLock.ts +0 -11
|
@@ -7,13 +7,52 @@ import type {
|
|
|
7
7
|
} from 'vona-module-commerce-catalog';
|
|
8
8
|
|
|
9
9
|
import assert from 'node:assert';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { randomUUID } from 'node:crypto';
|
|
11
|
+
import { after, before, describe, it } from 'node:test';
|
|
12
|
+
import { acquireTestLock, app } from 'vona-mock';
|
|
13
|
+
|
|
14
|
+
interface IProductFixture {
|
|
15
|
+
categoryId?: number;
|
|
16
|
+
productIds: number[];
|
|
17
|
+
skuIds: number[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async function cleanupFixture(fixture: IProductFixture) {
|
|
21
|
+
const scopeCatalog = app.scope('commerce-catalog');
|
|
22
|
+
const scopeTrade = app.scope('commerce-trade');
|
|
23
|
+
for (const skuId of fixture.skuIds) {
|
|
24
|
+
await scopeTrade.model.stockAudit.delete({ skuId });
|
|
25
|
+
await scopeTrade.model.stockReservation.delete({ skuId });
|
|
26
|
+
await scopeTrade.model.stockBalance.delete({ skuId });
|
|
27
|
+
await scopeCatalog.model.sku.delete({ id: skuId });
|
|
28
|
+
}
|
|
29
|
+
for (const productId of fixture.productIds) {
|
|
30
|
+
await scopeCatalog.model.product.delete({ id: productId });
|
|
31
|
+
}
|
|
32
|
+
if (fixture.categoryId !== undefined) {
|
|
33
|
+
await scopeCatalog.model.category.delete({ id: fixture.categoryId });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
describe('product.test.ts', { concurrency: false }, () => {
|
|
38
|
+
let releaseTestLock: (() => void) | undefined;
|
|
39
|
+
|
|
40
|
+
before(async () => {
|
|
41
|
+
releaseTestLock = await acquireTestLock('a-commerce');
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
after(() => {
|
|
45
|
+
releaseTestLock?.();
|
|
46
|
+
});
|
|
12
47
|
|
|
13
|
-
describe('product.test.ts', () => {
|
|
14
48
|
it('action:product', async () => {
|
|
15
49
|
await app.bean.executor.mockCtx(async () => {
|
|
16
|
-
const
|
|
50
|
+
const fixture: IProductFixture = { productIds: [], skuIds: [] };
|
|
51
|
+
const suffix = randomUUID().slice(0, 12);
|
|
52
|
+
const categoryData: DtoCategoryCreate = {
|
|
53
|
+
name: `__ProductCategory-${suffix}__`,
|
|
54
|
+
published: true,
|
|
55
|
+
};
|
|
17
56
|
await app.bean.passport.signinMock();
|
|
18
57
|
try {
|
|
19
58
|
const categoryId = await app.bean.executor.performAction(
|
|
@@ -23,9 +62,10 @@ describe('product.test.ts', () => {
|
|
|
23
62
|
body: categoryData,
|
|
24
63
|
},
|
|
25
64
|
);
|
|
65
|
+
fixture.categoryId = categoryId;
|
|
26
66
|
const data: DtoProductCreate = {
|
|
27
67
|
categoryId,
|
|
28
|
-
title:
|
|
68
|
+
title: `__Tom-${suffix}__`,
|
|
29
69
|
published: false,
|
|
30
70
|
description: 'This is a test',
|
|
31
71
|
};
|
|
@@ -36,9 +76,10 @@ describe('product.test.ts', () => {
|
|
|
36
76
|
body: data,
|
|
37
77
|
},
|
|
38
78
|
);
|
|
79
|
+
fixture.productIds.push(productId);
|
|
39
80
|
const dataUpdate: DtoProductUpdate = {
|
|
40
81
|
categoryId,
|
|
41
|
-
title:
|
|
82
|
+
title: `__TomNew-${suffix}__`,
|
|
42
83
|
published: true,
|
|
43
84
|
description: 'This is a test',
|
|
44
85
|
};
|
|
@@ -75,6 +116,7 @@ describe('product.test.ts', () => {
|
|
|
75
116
|
});
|
|
76
117
|
assert.equal(product, undefined);
|
|
77
118
|
} finally {
|
|
119
|
+
await cleanupFixture(fixture);
|
|
78
120
|
await app.bean.passport.signout();
|
|
79
121
|
}
|
|
80
122
|
});
|
|
@@ -82,73 +124,85 @@ describe('product.test.ts', () => {
|
|
|
82
124
|
|
|
83
125
|
it('loads all skus and only available skus through Product relations', async () => {
|
|
84
126
|
await app.bean.executor.mockCtx(async () => {
|
|
85
|
-
const suffix =
|
|
127
|
+
const suffix = randomUUID().slice(0, 12);
|
|
128
|
+
const fixture: IProductFixture = { productIds: [], skuIds: [] };
|
|
86
129
|
const scopeCatalog = app.scope('commerce-catalog');
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const product = await scopeCatalog.model.product.insert({
|
|
92
|
-
categoryId: category.id,
|
|
93
|
-
title: `__ProductRelations-${suffix}__`,
|
|
94
|
-
published: true,
|
|
95
|
-
});
|
|
96
|
-
const productOther = await scopeCatalog.model.product.insert({
|
|
97
|
-
categoryId: category.id,
|
|
98
|
-
title: `__ProductRelationsOther-${suffix}__`,
|
|
99
|
-
published: true,
|
|
100
|
-
});
|
|
101
|
-
const activeAvailable = await scopeCatalog.model.sku.insert({
|
|
102
|
-
code: `__ProductRelationsActive-${suffix}__`,
|
|
103
|
-
productId: product.id,
|
|
104
|
-
priceCents: 100,
|
|
105
|
-
lifecycle: 'active',
|
|
106
|
-
});
|
|
107
|
-
const activeZero = await scopeCatalog.model.sku.insert({
|
|
108
|
-
code: `__ProductRelationsZero-${suffix}__`,
|
|
109
|
-
productId: product.id,
|
|
110
|
-
priceCents: 200,
|
|
111
|
-
lifecycle: 'active',
|
|
112
|
-
});
|
|
113
|
-
const inactiveAvailable = await scopeCatalog.model.sku.insert({
|
|
114
|
-
code: `__ProductRelationsInactive-${suffix}__`,
|
|
115
|
-
productId: product.id,
|
|
116
|
-
priceCents: 300,
|
|
117
|
-
lifecycle: 'inactive',
|
|
118
|
-
});
|
|
119
|
-
const otherAvailable = await scopeCatalog.model.sku.insert({
|
|
120
|
-
code: `__ProductRelationsOtherSku-${suffix}__`,
|
|
121
|
-
productId: productOther.id,
|
|
122
|
-
priceCents: 400,
|
|
123
|
-
lifecycle: 'active',
|
|
124
|
-
});
|
|
125
|
-
for (const skuId of [activeAvailable.id, inactiveAvailable.id, otherAvailable.id]) {
|
|
126
|
-
await app.scope('commerce-trade').service.stockBalance.adjustStock({
|
|
127
|
-
skuId,
|
|
128
|
-
delta: 1,
|
|
129
|
-
reason: 'product relation fixture',
|
|
130
|
-
correlationId: `product-relations-${skuId}`,
|
|
130
|
+
try {
|
|
131
|
+
const category = await scopeCatalog.model.category.insert({
|
|
132
|
+
name: `__ProductRelationsCategory-${suffix}__`,
|
|
133
|
+
published: true,
|
|
131
134
|
});
|
|
135
|
+
fixture.categoryId = category.id as number;
|
|
136
|
+
const product = await scopeCatalog.model.product.insert({
|
|
137
|
+
categoryId: category.id,
|
|
138
|
+
title: `__ProductRelations-${suffix}__`,
|
|
139
|
+
published: true,
|
|
140
|
+
});
|
|
141
|
+
fixture.productIds.push(product.id as number);
|
|
142
|
+
const productOther = await scopeCatalog.model.product.insert({
|
|
143
|
+
categoryId: category.id,
|
|
144
|
+
title: `__ProductRelationsOther-${suffix}__`,
|
|
145
|
+
published: true,
|
|
146
|
+
});
|
|
147
|
+
fixture.productIds.push(productOther.id as number);
|
|
148
|
+
const activeAvailable = await scopeCatalog.model.sku.insert({
|
|
149
|
+
code: `__ProductRelationsActive-${suffix}__`,
|
|
150
|
+
productId: product.id,
|
|
151
|
+
priceCents: 100,
|
|
152
|
+
lifecycle: 'active',
|
|
153
|
+
});
|
|
154
|
+
fixture.skuIds.push(activeAvailable.id as number);
|
|
155
|
+
const activeZero = await scopeCatalog.model.sku.insert({
|
|
156
|
+
code: `__ProductRelationsZero-${suffix}__`,
|
|
157
|
+
productId: product.id,
|
|
158
|
+
priceCents: 200,
|
|
159
|
+
lifecycle: 'active',
|
|
160
|
+
});
|
|
161
|
+
fixture.skuIds.push(activeZero.id as number);
|
|
162
|
+
const inactiveAvailable = await scopeCatalog.model.sku.insert({
|
|
163
|
+
code: `__ProductRelationsInactive-${suffix}__`,
|
|
164
|
+
productId: product.id,
|
|
165
|
+
priceCents: 300,
|
|
166
|
+
lifecycle: 'inactive',
|
|
167
|
+
});
|
|
168
|
+
fixture.skuIds.push(inactiveAvailable.id as number);
|
|
169
|
+
const otherAvailable = await scopeCatalog.model.sku.insert({
|
|
170
|
+
code: `__ProductRelationsOtherSku-${suffix}__`,
|
|
171
|
+
productId: productOther.id,
|
|
172
|
+
priceCents: 400,
|
|
173
|
+
lifecycle: 'active',
|
|
174
|
+
});
|
|
175
|
+
fixture.skuIds.push(otherAvailable.id as number);
|
|
176
|
+
for (const skuId of [activeAvailable.id, inactiveAvailable.id, otherAvailable.id]) {
|
|
177
|
+
await app.scope('commerce-trade').service.stockBalance.adjustStock({
|
|
178
|
+
skuId,
|
|
179
|
+
delta: 1,
|
|
180
|
+
reason: 'product relation fixture',
|
|
181
|
+
correlationId: `product-relations-${suffix}-${skuId}`,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
const products = await scopeCatalog.model.product.select({
|
|
185
|
+
where: { id: [product.id, productOther.id] },
|
|
186
|
+
orders: [['id', 'asc']],
|
|
187
|
+
include: { skus: true, skuAvailables: true },
|
|
188
|
+
});
|
|
189
|
+
const item = products.find(item => String(item.id) === String(product.id))!;
|
|
190
|
+
const itemOther = products.find(item => String(item.id) === String(productOther.id))!;
|
|
191
|
+
assert.deepEqual(
|
|
192
|
+
item.skus.map(sku => String(sku.id)).sort(),
|
|
193
|
+
[activeAvailable.id, activeZero.id, inactiveAvailable.id].map(String).sort(),
|
|
194
|
+
);
|
|
195
|
+
assert.deepEqual(
|
|
196
|
+
item.skuAvailables.map(sku => String(sku.id)),
|
|
197
|
+
[String(activeAvailable.id)],
|
|
198
|
+
);
|
|
199
|
+
assert.deepEqual(
|
|
200
|
+
itemOther.skuAvailables.map(sku => String(sku.id)),
|
|
201
|
+
[String(otherAvailable.id)],
|
|
202
|
+
);
|
|
203
|
+
} finally {
|
|
204
|
+
await cleanupFixture(fixture);
|
|
132
205
|
}
|
|
133
|
-
const products = await scopeCatalog.model.product.select({
|
|
134
|
-
where: { id: [product.id, productOther.id] },
|
|
135
|
-
orders: [['id', 'asc']],
|
|
136
|
-
include: { skus: true, skuAvailables: true },
|
|
137
|
-
});
|
|
138
|
-
const item = products.find(item => String(item.id) === String(product.id))!;
|
|
139
|
-
const itemOther = products.find(item => String(item.id) === String(productOther.id))!;
|
|
140
|
-
assert.deepEqual(
|
|
141
|
-
item.skus.map(sku => String(sku.id)).sort(),
|
|
142
|
-
[activeAvailable.id, activeZero.id, inactiveAvailable.id].map(String).sort(),
|
|
143
|
-
);
|
|
144
|
-
assert.deepEqual(
|
|
145
|
-
item.skuAvailables.map(sku => String(sku.id)),
|
|
146
|
-
[String(activeAvailable.id)],
|
|
147
|
-
);
|
|
148
|
-
assert.deepEqual(
|
|
149
|
-
itemOther.skuAvailables.map(sku => String(sku.id)),
|
|
150
|
-
[String(otherAvailable.id)],
|
|
151
|
-
);
|
|
152
206
|
});
|
|
153
207
|
});
|
|
154
208
|
});
|
|
@@ -5,14 +5,23 @@ import type { TableIdentity } from 'table-identity';
|
|
|
5
5
|
/** entity: begin */
|
|
6
6
|
export * from '../entity/paymentAttempt.tsx';
|
|
7
7
|
export * from '../entity/paymentAudit.tsx';
|
|
8
|
+
export * from '../entity/refundAttempt.tsx';
|
|
9
|
+
export * from '../entity/refundAudit.tsx';
|
|
10
|
+
export * from '../entity/refundRequest.tsx';
|
|
8
11
|
import type { IEntityOptionsPaymentAttempt } from '../entity/paymentAttempt.tsx';
|
|
9
12
|
import type { IEntityOptionsPaymentAudit } from '../entity/paymentAudit.tsx';
|
|
13
|
+
import type { IEntityOptionsRefundAttempt } from '../entity/refundAttempt.tsx';
|
|
14
|
+
import type { IEntityOptionsRefundAudit } from '../entity/refundAudit.tsx';
|
|
15
|
+
import type { IEntityOptionsRefundRequest } from '../entity/refundRequest.tsx';
|
|
10
16
|
import 'vona-module-a-orm';
|
|
11
17
|
declare module 'vona-module-a-orm' {
|
|
12
18
|
|
|
13
19
|
export interface IEntityRecord {
|
|
14
20
|
'commerce-payment:paymentAttempt': IEntityOptionsPaymentAttempt;
|
|
15
21
|
'commerce-payment:paymentAudit': IEntityOptionsPaymentAudit;
|
|
22
|
+
'commerce-payment:refundAttempt': IEntityOptionsRefundAttempt;
|
|
23
|
+
'commerce-payment:refundAudit': IEntityOptionsRefundAudit;
|
|
24
|
+
'commerce-payment:refundRequest': IEntityOptionsRefundRequest;
|
|
16
25
|
}
|
|
17
26
|
|
|
18
27
|
|
|
@@ -24,20 +33,35 @@ declare module 'vona-module-commerce-payment' {
|
|
|
24
33
|
/** entity: begin */
|
|
25
34
|
import type { EntityPaymentAttempt } from '../entity/paymentAttempt.tsx';
|
|
26
35
|
import type { EntityPaymentAudit } from '../entity/paymentAudit.tsx';
|
|
36
|
+
import type { EntityRefundAttempt } from '../entity/refundAttempt.tsx';
|
|
37
|
+
import type { EntityRefundAudit } from '../entity/refundAudit.tsx';
|
|
38
|
+
import type { EntityRefundRequest } from '../entity/refundRequest.tsx';
|
|
27
39
|
export interface IModuleEntity {
|
|
28
40
|
'paymentAttempt': EntityPaymentAttemptMeta;
|
|
29
41
|
'paymentAudit': EntityPaymentAuditMeta;
|
|
42
|
+
'refundAttempt': EntityRefundAttemptMeta;
|
|
43
|
+
'refundAudit': EntityRefundAuditMeta;
|
|
44
|
+
'refundRequest': EntityRefundRequestMeta;
|
|
30
45
|
}
|
|
31
46
|
/** entity: end */
|
|
32
47
|
/** entity: begin */
|
|
33
48
|
export type EntityPaymentAttemptTableName = 'commercePaymentAttempt';
|
|
34
49
|
export type EntityPaymentAuditTableName = 'commercePaymentAudit';
|
|
50
|
+
export type EntityRefundAttemptTableName = 'commercePaymentRefundAttempt';
|
|
51
|
+
export type EntityRefundAuditTableName = 'commercePaymentRefundAudit';
|
|
52
|
+
export type EntityRefundRequestTableName = 'commercePaymentRefundRequest';
|
|
35
53
|
export type EntityPaymentAttemptMeta=TypeEntityMeta<EntityPaymentAttempt,EntityPaymentAttemptTableName>;
|
|
36
54
|
export type EntityPaymentAuditMeta=TypeEntityMeta<EntityPaymentAudit,EntityPaymentAuditTableName>;
|
|
55
|
+
export type EntityRefundAttemptMeta=TypeEntityMeta<EntityRefundAttempt,EntityRefundAttemptTableName>;
|
|
56
|
+
export type EntityRefundAuditMeta=TypeEntityMeta<EntityRefundAudit,EntityRefundAuditTableName>;
|
|
57
|
+
export type EntityRefundRequestMeta=TypeEntityMeta<EntityRefundRequest,EntityRefundRequestTableName>;
|
|
37
58
|
declare module 'vona-module-a-orm' {
|
|
38
59
|
export interface ITableRecord {
|
|
39
60
|
'commercePaymentAttempt': EntityPaymentAttemptMeta;
|
|
40
61
|
'commercePaymentAudit': EntityPaymentAuditMeta;
|
|
62
|
+
'commercePaymentRefundAttempt': EntityRefundAttemptMeta;
|
|
63
|
+
'commercePaymentRefundAudit': EntityRefundAuditMeta;
|
|
64
|
+
'commercePaymentRefundRequest': EntityRefundRequestMeta;
|
|
41
65
|
}
|
|
42
66
|
}
|
|
43
67
|
declare module 'vona-module-commerce-payment' {
|
|
@@ -49,19 +73,40 @@ declare module 'vona-module-commerce-payment' {
|
|
|
49
73
|
export interface IEntityOptionsPaymentAudit {
|
|
50
74
|
fields?: TypeEntityOptionsFields<EntityPaymentAudit, IEntityOptionsPaymentAudit[TypeSymbolKeyFieldsMore]>;
|
|
51
75
|
}
|
|
76
|
+
|
|
77
|
+
export interface IEntityOptionsRefundAttempt {
|
|
78
|
+
fields?: TypeEntityOptionsFields<EntityRefundAttempt, IEntityOptionsRefundAttempt[TypeSymbolKeyFieldsMore]>;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface IEntityOptionsRefundAudit {
|
|
82
|
+
fields?: TypeEntityOptionsFields<EntityRefundAudit, IEntityOptionsRefundAudit[TypeSymbolKeyFieldsMore]>;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface IEntityOptionsRefundRequest {
|
|
86
|
+
fields?: TypeEntityOptionsFields<EntityRefundRequest, IEntityOptionsRefundRequest[TypeSymbolKeyFieldsMore]>;
|
|
87
|
+
}
|
|
52
88
|
}
|
|
53
89
|
/** entity: end */
|
|
54
90
|
/** model: begin */
|
|
55
91
|
export * from '../model/paymentAttempt.ts';
|
|
56
92
|
export * from '../model/paymentAudit.ts';
|
|
93
|
+
export * from '../model/refundAttempt.ts';
|
|
94
|
+
export * from '../model/refundAudit.ts';
|
|
95
|
+
export * from '../model/refundRequest.ts';
|
|
57
96
|
import type { IModelOptionsPaymentAttempt } from '../model/paymentAttempt.ts';
|
|
58
97
|
import type { IModelOptionsPaymentAudit } from '../model/paymentAudit.ts';
|
|
98
|
+
import type { IModelOptionsRefundAttempt } from '../model/refundAttempt.ts';
|
|
99
|
+
import type { IModelOptionsRefundAudit } from '../model/refundAudit.ts';
|
|
100
|
+
import type { IModelOptionsRefundRequest } from '../model/refundRequest.ts';
|
|
59
101
|
import 'vona-module-a-orm';
|
|
60
102
|
declare module 'vona-module-a-orm' {
|
|
61
103
|
|
|
62
104
|
export interface IModelRecord {
|
|
63
105
|
'commerce-payment:paymentAttempt': IModelOptionsPaymentAttempt;
|
|
64
106
|
'commerce-payment:paymentAudit': IModelOptionsPaymentAudit;
|
|
107
|
+
'commerce-payment:refundAttempt': IModelOptionsRefundAttempt;
|
|
108
|
+
'commerce-payment:refundAudit': IModelOptionsRefundAudit;
|
|
109
|
+
'commerce-payment:refundRequest': IModelOptionsRefundRequest;
|
|
65
110
|
}
|
|
66
111
|
|
|
67
112
|
|
|
@@ -88,15 +133,54 @@ declare module 'vona-module-commerce-payment' {
|
|
|
88
133
|
get $beanFullName(): 'commerce-payment.model.paymentAudit';
|
|
89
134
|
get $onionName(): 'commerce-payment:paymentAudit';
|
|
90
135
|
get $onionOptions(): IModelOptionsPaymentAudit;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export interface ModelRefundAttempt {
|
|
139
|
+
/** @internal */
|
|
140
|
+
get scope(): ScopeModuleCommercePayment;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface ModelRefundAttempt {
|
|
144
|
+
get $beanFullName(): 'commerce-payment.model.refundAttempt';
|
|
145
|
+
get $onionName(): 'commerce-payment:refundAttempt';
|
|
146
|
+
get $onionOptions(): IModelOptionsRefundAttempt;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface ModelRefundAudit {
|
|
150
|
+
/** @internal */
|
|
151
|
+
get scope(): ScopeModuleCommercePayment;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface ModelRefundAudit {
|
|
155
|
+
get $beanFullName(): 'commerce-payment.model.refundAudit';
|
|
156
|
+
get $onionName(): 'commerce-payment:refundAudit';
|
|
157
|
+
get $onionOptions(): IModelOptionsRefundAudit;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export interface ModelRefundRequest {
|
|
161
|
+
/** @internal */
|
|
162
|
+
get scope(): ScopeModuleCommercePayment;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export interface ModelRefundRequest {
|
|
166
|
+
get $beanFullName(): 'commerce-payment.model.refundRequest';
|
|
167
|
+
get $onionName(): 'commerce-payment:refundRequest';
|
|
168
|
+
get $onionOptions(): IModelOptionsRefundRequest;
|
|
91
169
|
}
|
|
92
170
|
}
|
|
93
171
|
/** model: end */
|
|
94
172
|
/** model: begin */
|
|
95
173
|
import type { ModelPaymentAttempt } from '../model/paymentAttempt.ts';
|
|
96
174
|
import type { ModelPaymentAudit } from '../model/paymentAudit.ts';
|
|
175
|
+
import type { ModelRefundAttempt } from '../model/refundAttempt.ts';
|
|
176
|
+
import type { ModelRefundAudit } from '../model/refundAudit.ts';
|
|
177
|
+
import type { ModelRefundRequest } from '../model/refundRequest.ts';
|
|
97
178
|
export interface IModuleModel {
|
|
98
179
|
'paymentAttempt': ModelPaymentAttempt;
|
|
99
180
|
'paymentAudit': ModelPaymentAudit;
|
|
181
|
+
'refundAttempt': ModelRefundAttempt;
|
|
182
|
+
'refundAudit': ModelRefundAudit;
|
|
183
|
+
'refundRequest': ModelRefundRequest;
|
|
100
184
|
}
|
|
101
185
|
/** model: end */
|
|
102
186
|
/** model: begin */
|
|
@@ -106,6 +190,9 @@ declare module 'vona' {
|
|
|
106
190
|
export interface IBeanRecordGeneral {
|
|
107
191
|
'commerce-payment.model.paymentAttempt': ModelPaymentAttempt;
|
|
108
192
|
'commerce-payment.model.paymentAudit': ModelPaymentAudit;
|
|
193
|
+
'commerce-payment.model.refundAttempt': ModelRefundAttempt;
|
|
194
|
+
'commerce-payment.model.refundAudit': ModelRefundAudit;
|
|
195
|
+
'commerce-payment.model.refundRequest': ModelRefundRequest;
|
|
109
196
|
}
|
|
110
197
|
}
|
|
111
198
|
/** model: end */
|
|
@@ -119,7 +206,17 @@ declare module 'vona-module-commerce-payment' {
|
|
|
119
206
|
[SymbolKeyEntityMeta]: EntityPaymentAttemptMeta;
|
|
120
207
|
[SymbolKeyModelOptions]: IModelOptionsPaymentAttempt;
|
|
121
208
|
get<T extends IModelGetOptions<EntityPaymentAttempt,ModelPaymentAttempt>>(where: TypeModelWhere<EntityPaymentAttempt>, options?: T): Promise<TypeModelRelationResult<EntityPaymentAttempt, ModelPaymentAttempt, T> | undefined>;
|
|
209
|
+
/**
|
|
210
|
+
* Retrieves one matching primary row with a pessimistic FOR UPDATE lock.
|
|
211
|
+
* Requires an active transaction. The lock is released when that transaction completes.
|
|
212
|
+
* Entity and query caches are bypassed.
|
|
213
|
+
*/
|
|
122
214
|
getForUpdate<T extends IModelGetOptions<EntityPaymentAttempt,ModelPaymentAttempt>>(where: TypeModelWhere<EntityPaymentAttempt>, options?: T): Promise<TypeModelRelationResult<EntityPaymentAttempt, ModelPaymentAttempt, T> | undefined>;
|
|
215
|
+
/**
|
|
216
|
+
* Retrieves a primary row by ID with the same pessimistic FOR UPDATE lock semantics.
|
|
217
|
+
* Requires an active transaction. The lock is released when that transaction completes.
|
|
218
|
+
* Entity and query caches are bypassed.
|
|
219
|
+
*/
|
|
123
220
|
getByIdForUpdate<T extends IModelGetOptions<EntityPaymentAttempt,ModelPaymentAttempt>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityPaymentAttempt, ModelPaymentAttempt, T> | undefined>;
|
|
124
221
|
mget<T extends IModelGetOptions<EntityPaymentAttempt,ModelPaymentAttempt>>(ids: TableIdentity[], options?: T): Promise<TypeModelRelationResult<EntityPaymentAttempt, ModelPaymentAttempt, T>[]>;
|
|
125
222
|
selectAndCount<T extends IModelSelectParams<EntityPaymentAttempt,ModelPaymentAttempt,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelSelectAndCount<EntityPaymentAttempt, ModelPaymentAttempt, T>>;
|
|
@@ -146,7 +243,17 @@ export interface ModelPaymentAudit {
|
|
|
146
243
|
[SymbolKeyEntityMeta]: EntityPaymentAuditMeta;
|
|
147
244
|
[SymbolKeyModelOptions]: IModelOptionsPaymentAudit;
|
|
148
245
|
get<T extends IModelGetOptions<EntityPaymentAudit,ModelPaymentAudit>>(where: TypeModelWhere<EntityPaymentAudit>, options?: T): Promise<TypeModelRelationResult<EntityPaymentAudit, ModelPaymentAudit, T> | undefined>;
|
|
246
|
+
/**
|
|
247
|
+
* Retrieves one matching primary row with a pessimistic FOR UPDATE lock.
|
|
248
|
+
* Requires an active transaction. The lock is released when that transaction completes.
|
|
249
|
+
* Entity and query caches are bypassed.
|
|
250
|
+
*/
|
|
149
251
|
getForUpdate<T extends IModelGetOptions<EntityPaymentAudit,ModelPaymentAudit>>(where: TypeModelWhere<EntityPaymentAudit>, options?: T): Promise<TypeModelRelationResult<EntityPaymentAudit, ModelPaymentAudit, T> | undefined>;
|
|
252
|
+
/**
|
|
253
|
+
* Retrieves a primary row by ID with the same pessimistic FOR UPDATE lock semantics.
|
|
254
|
+
* Requires an active transaction. The lock is released when that transaction completes.
|
|
255
|
+
* Entity and query caches are bypassed.
|
|
256
|
+
*/
|
|
150
257
|
getByIdForUpdate<T extends IModelGetOptions<EntityPaymentAudit,ModelPaymentAudit>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityPaymentAudit, ModelPaymentAudit, T> | undefined>;
|
|
151
258
|
mget<T extends IModelGetOptions<EntityPaymentAudit,ModelPaymentAudit>>(ids: TableIdentity[], options?: T): Promise<TypeModelRelationResult<EntityPaymentAudit, ModelPaymentAudit, T>[]>;
|
|
152
259
|
selectAndCount<T extends IModelSelectParams<EntityPaymentAudit,ModelPaymentAudit,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelSelectAndCount<EntityPaymentAudit, ModelPaymentAudit, T>>;
|
|
@@ -168,11 +275,125 @@ export interface ModelPaymentAudit {
|
|
|
168
275
|
updateById<T extends IModelUpdateOptions<EntityPaymentAudit,ModelPaymentAudit>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityPaymentAudit,ModelPaymentAudit, T>, options?: T): Promise<TypeModelMutateRelationData<EntityPaymentAudit,ModelPaymentAudit, T>>;
|
|
169
276
|
deleteById<T extends IModelDeleteOptions<EntityPaymentAudit,ModelPaymentAudit>>(id: TableIdentity, options?: T): Promise<void>;
|
|
170
277
|
}
|
|
278
|
+
export interface ModelRefundAttempt {
|
|
279
|
+
[SymbolKeyEntity]: EntityRefundAttempt;
|
|
280
|
+
[SymbolKeyEntityMeta]: EntityRefundAttemptMeta;
|
|
281
|
+
[SymbolKeyModelOptions]: IModelOptionsRefundAttempt;
|
|
282
|
+
get<T extends IModelGetOptions<EntityRefundAttempt,ModelRefundAttempt>>(where: TypeModelWhere<EntityRefundAttempt>, options?: T): Promise<TypeModelRelationResult<EntityRefundAttempt, ModelRefundAttempt, T> | undefined>;
|
|
283
|
+
/**
|
|
284
|
+
* Retrieves one matching primary row with a pessimistic FOR UPDATE lock.
|
|
285
|
+
* Requires an active transaction. The lock is released when that transaction completes.
|
|
286
|
+
* Entity and query caches are bypassed.
|
|
287
|
+
*/
|
|
288
|
+
getForUpdate<T extends IModelGetOptions<EntityRefundAttempt,ModelRefundAttempt>>(where: TypeModelWhere<EntityRefundAttempt>, options?: T): Promise<TypeModelRelationResult<EntityRefundAttempt, ModelRefundAttempt, T> | undefined>;
|
|
289
|
+
/**
|
|
290
|
+
* Retrieves a primary row by ID with the same pessimistic FOR UPDATE lock semantics.
|
|
291
|
+
* Requires an active transaction. The lock is released when that transaction completes.
|
|
292
|
+
* Entity and query caches are bypassed.
|
|
293
|
+
*/
|
|
294
|
+
getByIdForUpdate<T extends IModelGetOptions<EntityRefundAttempt,ModelRefundAttempt>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityRefundAttempt, ModelRefundAttempt, T> | undefined>;
|
|
295
|
+
mget<T extends IModelGetOptions<EntityRefundAttempt,ModelRefundAttempt>>(ids: TableIdentity[], options?: T): Promise<TypeModelRelationResult<EntityRefundAttempt, ModelRefundAttempt, T>[]>;
|
|
296
|
+
selectAndCount<T extends IModelSelectParams<EntityRefundAttempt,ModelRefundAttempt,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelSelectAndCount<EntityRefundAttempt, ModelRefundAttempt, T>>;
|
|
297
|
+
select<T extends IModelSelectParams<EntityRefundAttempt,ModelRefundAttempt,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityRefundAttempt, ModelRefundAttempt, T>[]>;
|
|
298
|
+
insert<T extends IModelInsertOptions<EntityRefundAttempt,ModelRefundAttempt>>(data?: TypeModelMutateRelationData<EntityRefundAttempt,ModelRefundAttempt, T>, options?: T): Promise<TypeModelMutateRelationData<EntityRefundAttempt,ModelRefundAttempt, T, true>>;
|
|
299
|
+
insertBulk<T extends IModelInsertOptions<EntityRefundAttempt,ModelRefundAttempt>>(items: TypeModelMutateRelationData<EntityRefundAttempt,ModelRefundAttempt, T>[], options?: T): Promise<TypeModelMutateRelationData<EntityRefundAttempt,ModelRefundAttempt, T, true>[]>;
|
|
300
|
+
update<T extends IModelUpdateOptions<EntityRefundAttempt,ModelRefundAttempt>>(data: TypeModelMutateRelationData<EntityRefundAttempt,ModelRefundAttempt, T>, options?: T): Promise<TypeModelMutateRelationData<EntityRefundAttempt,ModelRefundAttempt, T>>;
|
|
301
|
+
updateBulk<T extends IModelUpdateOptions<EntityRefundAttempt,ModelRefundAttempt>>(items: TypeModelMutateRelationData<EntityRefundAttempt,ModelRefundAttempt, T>[], options?: T): Promise<TypeModelMutateRelationData<EntityRefundAttempt,ModelRefundAttempt, T>[]>;
|
|
302
|
+
delete<T extends IModelDeleteOptions<EntityRefundAttempt,ModelRefundAttempt>>(where?: TypeModelWhere<EntityRefundAttempt>, options?: T): Promise<void>;
|
|
303
|
+
deleteBulk<T extends IModelDeleteOptions<EntityRefundAttempt,ModelRefundAttempt>>(ids: TableIdentity[], options?: T): Promise<void>;
|
|
304
|
+
mutate<T extends IModelMutateOptions<EntityRefundAttempt,ModelRefundAttempt>>(data?: TypeModelMutateRelationData<EntityRefundAttempt,ModelRefundAttempt, T>, options?: T): Promise<TypeModelMutateRelationData<EntityRefundAttempt,ModelRefundAttempt, T>>;
|
|
305
|
+
mutateBulk<T extends IModelMutateOptions<EntityRefundAttempt,ModelRefundAttempt>>(items: TypeModelMutateRelationData<EntityRefundAttempt,ModelRefundAttempt, T>[], options?: T): Promise<TypeModelMutateRelationData<EntityRefundAttempt,ModelRefundAttempt, T>[]>;
|
|
306
|
+
count<T extends IModelSelectCountParams<EntityRefundAttempt,ModelRefundAttempt,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<string | undefined>;
|
|
307
|
+
increment<T extends IModelIncrementParams<EntityRefundAttempt,ModelRefundAttempt,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<number>;
|
|
308
|
+
decrement<T extends IModelIncrementParams<EntityRefundAttempt,ModelRefundAttempt,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<number>;
|
|
309
|
+
aggregate<T extends IModelSelectAggrParams<EntityRefundAttempt,ModelRefundAttempt,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
310
|
+
group<T extends IModelSelectGroupParams<EntityRefundAttempt,ModelRefundAttempt,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityRefundAttempt, T>[]>;
|
|
311
|
+
getById<T extends IModelGetOptions<EntityRefundAttempt,ModelRefundAttempt>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityRefundAttempt, ModelRefundAttempt, T> | undefined>;
|
|
312
|
+
updateById<T extends IModelUpdateOptions<EntityRefundAttempt,ModelRefundAttempt>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityRefundAttempt,ModelRefundAttempt, T>, options?: T): Promise<TypeModelMutateRelationData<EntityRefundAttempt,ModelRefundAttempt, T>>;
|
|
313
|
+
deleteById<T extends IModelDeleteOptions<EntityRefundAttempt,ModelRefundAttempt>>(id: TableIdentity, options?: T): Promise<void>;
|
|
314
|
+
}
|
|
315
|
+
export interface ModelRefundAudit {
|
|
316
|
+
[SymbolKeyEntity]: EntityRefundAudit;
|
|
317
|
+
[SymbolKeyEntityMeta]: EntityRefundAuditMeta;
|
|
318
|
+
[SymbolKeyModelOptions]: IModelOptionsRefundAudit;
|
|
319
|
+
get<T extends IModelGetOptions<EntityRefundAudit,ModelRefundAudit>>(where: TypeModelWhere<EntityRefundAudit>, options?: T): Promise<TypeModelRelationResult<EntityRefundAudit, ModelRefundAudit, T> | undefined>;
|
|
320
|
+
/**
|
|
321
|
+
* Retrieves one matching primary row with a pessimistic FOR UPDATE lock.
|
|
322
|
+
* Requires an active transaction. The lock is released when that transaction completes.
|
|
323
|
+
* Entity and query caches are bypassed.
|
|
324
|
+
*/
|
|
325
|
+
getForUpdate<T extends IModelGetOptions<EntityRefundAudit,ModelRefundAudit>>(where: TypeModelWhere<EntityRefundAudit>, options?: T): Promise<TypeModelRelationResult<EntityRefundAudit, ModelRefundAudit, T> | undefined>;
|
|
326
|
+
/**
|
|
327
|
+
* Retrieves a primary row by ID with the same pessimistic FOR UPDATE lock semantics.
|
|
328
|
+
* Requires an active transaction. The lock is released when that transaction completes.
|
|
329
|
+
* Entity and query caches are bypassed.
|
|
330
|
+
*/
|
|
331
|
+
getByIdForUpdate<T extends IModelGetOptions<EntityRefundAudit,ModelRefundAudit>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityRefundAudit, ModelRefundAudit, T> | undefined>;
|
|
332
|
+
mget<T extends IModelGetOptions<EntityRefundAudit,ModelRefundAudit>>(ids: TableIdentity[], options?: T): Promise<TypeModelRelationResult<EntityRefundAudit, ModelRefundAudit, T>[]>;
|
|
333
|
+
selectAndCount<T extends IModelSelectParams<EntityRefundAudit,ModelRefundAudit,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelSelectAndCount<EntityRefundAudit, ModelRefundAudit, T>>;
|
|
334
|
+
select<T extends IModelSelectParams<EntityRefundAudit,ModelRefundAudit,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityRefundAudit, ModelRefundAudit, T>[]>;
|
|
335
|
+
insert<T extends IModelInsertOptions<EntityRefundAudit,ModelRefundAudit>>(data?: TypeModelMutateRelationData<EntityRefundAudit,ModelRefundAudit, T>, options?: T): Promise<TypeModelMutateRelationData<EntityRefundAudit,ModelRefundAudit, T, true>>;
|
|
336
|
+
insertBulk<T extends IModelInsertOptions<EntityRefundAudit,ModelRefundAudit>>(items: TypeModelMutateRelationData<EntityRefundAudit,ModelRefundAudit, T>[], options?: T): Promise<TypeModelMutateRelationData<EntityRefundAudit,ModelRefundAudit, T, true>[]>;
|
|
337
|
+
update<T extends IModelUpdateOptions<EntityRefundAudit,ModelRefundAudit>>(data: TypeModelMutateRelationData<EntityRefundAudit,ModelRefundAudit, T>, options?: T): Promise<TypeModelMutateRelationData<EntityRefundAudit,ModelRefundAudit, T>>;
|
|
338
|
+
updateBulk<T extends IModelUpdateOptions<EntityRefundAudit,ModelRefundAudit>>(items: TypeModelMutateRelationData<EntityRefundAudit,ModelRefundAudit, T>[], options?: T): Promise<TypeModelMutateRelationData<EntityRefundAudit,ModelRefundAudit, T>[]>;
|
|
339
|
+
delete<T extends IModelDeleteOptions<EntityRefundAudit,ModelRefundAudit>>(where?: TypeModelWhere<EntityRefundAudit>, options?: T): Promise<void>;
|
|
340
|
+
deleteBulk<T extends IModelDeleteOptions<EntityRefundAudit,ModelRefundAudit>>(ids: TableIdentity[], options?: T): Promise<void>;
|
|
341
|
+
mutate<T extends IModelMutateOptions<EntityRefundAudit,ModelRefundAudit>>(data?: TypeModelMutateRelationData<EntityRefundAudit,ModelRefundAudit, T>, options?: T): Promise<TypeModelMutateRelationData<EntityRefundAudit,ModelRefundAudit, T>>;
|
|
342
|
+
mutateBulk<T extends IModelMutateOptions<EntityRefundAudit,ModelRefundAudit>>(items: TypeModelMutateRelationData<EntityRefundAudit,ModelRefundAudit, T>[], options?: T): Promise<TypeModelMutateRelationData<EntityRefundAudit,ModelRefundAudit, T>[]>;
|
|
343
|
+
count<T extends IModelSelectCountParams<EntityRefundAudit,ModelRefundAudit,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<string | undefined>;
|
|
344
|
+
increment<T extends IModelIncrementParams<EntityRefundAudit,ModelRefundAudit,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<number>;
|
|
345
|
+
decrement<T extends IModelIncrementParams<EntityRefundAudit,ModelRefundAudit,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<number>;
|
|
346
|
+
aggregate<T extends IModelSelectAggrParams<EntityRefundAudit,ModelRefundAudit,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
347
|
+
group<T extends IModelSelectGroupParams<EntityRefundAudit,ModelRefundAudit,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityRefundAudit, T>[]>;
|
|
348
|
+
getById<T extends IModelGetOptions<EntityRefundAudit,ModelRefundAudit>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityRefundAudit, ModelRefundAudit, T> | undefined>;
|
|
349
|
+
updateById<T extends IModelUpdateOptions<EntityRefundAudit,ModelRefundAudit>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityRefundAudit,ModelRefundAudit, T>, options?: T): Promise<TypeModelMutateRelationData<EntityRefundAudit,ModelRefundAudit, T>>;
|
|
350
|
+
deleteById<T extends IModelDeleteOptions<EntityRefundAudit,ModelRefundAudit>>(id: TableIdentity, options?: T): Promise<void>;
|
|
351
|
+
}
|
|
352
|
+
export interface ModelRefundRequest {
|
|
353
|
+
[SymbolKeyEntity]: EntityRefundRequest;
|
|
354
|
+
[SymbolKeyEntityMeta]: EntityRefundRequestMeta;
|
|
355
|
+
[SymbolKeyModelOptions]: IModelOptionsRefundRequest;
|
|
356
|
+
get<T extends IModelGetOptions<EntityRefundRequest,ModelRefundRequest>>(where: TypeModelWhere<EntityRefundRequest>, options?: T): Promise<TypeModelRelationResult<EntityRefundRequest, ModelRefundRequest, T> | undefined>;
|
|
357
|
+
/**
|
|
358
|
+
* Retrieves one matching primary row with a pessimistic FOR UPDATE lock.
|
|
359
|
+
* Requires an active transaction. The lock is released when that transaction completes.
|
|
360
|
+
* Entity and query caches are bypassed.
|
|
361
|
+
*/
|
|
362
|
+
getForUpdate<T extends IModelGetOptions<EntityRefundRequest,ModelRefundRequest>>(where: TypeModelWhere<EntityRefundRequest>, options?: T): Promise<TypeModelRelationResult<EntityRefundRequest, ModelRefundRequest, T> | undefined>;
|
|
363
|
+
/**
|
|
364
|
+
* Retrieves a primary row by ID with the same pessimistic FOR UPDATE lock semantics.
|
|
365
|
+
* Requires an active transaction. The lock is released when that transaction completes.
|
|
366
|
+
* Entity and query caches are bypassed.
|
|
367
|
+
*/
|
|
368
|
+
getByIdForUpdate<T extends IModelGetOptions<EntityRefundRequest,ModelRefundRequest>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityRefundRequest, ModelRefundRequest, T> | undefined>;
|
|
369
|
+
mget<T extends IModelGetOptions<EntityRefundRequest,ModelRefundRequest>>(ids: TableIdentity[], options?: T): Promise<TypeModelRelationResult<EntityRefundRequest, ModelRefundRequest, T>[]>;
|
|
370
|
+
selectAndCount<T extends IModelSelectParams<EntityRefundRequest,ModelRefundRequest,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelSelectAndCount<EntityRefundRequest, ModelRefundRequest, T>>;
|
|
371
|
+
select<T extends IModelSelectParams<EntityRefundRequest,ModelRefundRequest,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelRelationResult<EntityRefundRequest, ModelRefundRequest, T>[]>;
|
|
372
|
+
insert<T extends IModelInsertOptions<EntityRefundRequest,ModelRefundRequest>>(data?: TypeModelMutateRelationData<EntityRefundRequest,ModelRefundRequest, T>, options?: T): Promise<TypeModelMutateRelationData<EntityRefundRequest,ModelRefundRequest, T, true>>;
|
|
373
|
+
insertBulk<T extends IModelInsertOptions<EntityRefundRequest,ModelRefundRequest>>(items: TypeModelMutateRelationData<EntityRefundRequest,ModelRefundRequest, T>[], options?: T): Promise<TypeModelMutateRelationData<EntityRefundRequest,ModelRefundRequest, T, true>[]>;
|
|
374
|
+
update<T extends IModelUpdateOptions<EntityRefundRequest,ModelRefundRequest>>(data: TypeModelMutateRelationData<EntityRefundRequest,ModelRefundRequest, T>, options?: T): Promise<TypeModelMutateRelationData<EntityRefundRequest,ModelRefundRequest, T>>;
|
|
375
|
+
updateBulk<T extends IModelUpdateOptions<EntityRefundRequest,ModelRefundRequest>>(items: TypeModelMutateRelationData<EntityRefundRequest,ModelRefundRequest, T>[], options?: T): Promise<TypeModelMutateRelationData<EntityRefundRequest,ModelRefundRequest, T>[]>;
|
|
376
|
+
delete<T extends IModelDeleteOptions<EntityRefundRequest,ModelRefundRequest>>(where?: TypeModelWhere<EntityRefundRequest>, options?: T): Promise<void>;
|
|
377
|
+
deleteBulk<T extends IModelDeleteOptions<EntityRefundRequest,ModelRefundRequest>>(ids: TableIdentity[], options?: T): Promise<void>;
|
|
378
|
+
mutate<T extends IModelMutateOptions<EntityRefundRequest,ModelRefundRequest>>(data?: TypeModelMutateRelationData<EntityRefundRequest,ModelRefundRequest, T>, options?: T): Promise<TypeModelMutateRelationData<EntityRefundRequest,ModelRefundRequest, T>>;
|
|
379
|
+
mutateBulk<T extends IModelMutateOptions<EntityRefundRequest,ModelRefundRequest>>(items: TypeModelMutateRelationData<EntityRefundRequest,ModelRefundRequest, T>[], options?: T): Promise<TypeModelMutateRelationData<EntityRefundRequest,ModelRefundRequest, T>[]>;
|
|
380
|
+
count<T extends IModelSelectCountParams<EntityRefundRequest,ModelRefundRequest,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<string | undefined>;
|
|
381
|
+
increment<T extends IModelIncrementParams<EntityRefundRequest,ModelRefundRequest,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<number>;
|
|
382
|
+
decrement<T extends IModelIncrementParams<EntityRefundRequest,ModelRefundRequest,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<number>;
|
|
383
|
+
aggregate<T extends IModelSelectAggrParams<EntityRefundRequest,ModelRefundRequest,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelAggrRelationResult<T>>;
|
|
384
|
+
group<T extends IModelSelectGroupParams<EntityRefundRequest,ModelRefundRequest,ModelJoins>, ModelJoins extends TypeModelsClassLikeGeneral | undefined = undefined>(params?: T, options?: IModelMethodOptions, modelJoins?: ModelJoins): Promise<TypeModelGroupRelationResult<EntityRefundRequest, T>[]>;
|
|
385
|
+
getById<T extends IModelGetOptions<EntityRefundRequest,ModelRefundRequest>>(id: TableIdentity, options?: T): Promise<TypeModelRelationResult<EntityRefundRequest, ModelRefundRequest, T> | undefined>;
|
|
386
|
+
updateById<T extends IModelUpdateOptions<EntityRefundRequest,ModelRefundRequest>>(id: TableIdentity, data: TypeModelMutateRelationData<EntityRefundRequest,ModelRefundRequest, T>, options?: T): Promise<TypeModelMutateRelationData<EntityRefundRequest,ModelRefundRequest, T>>;
|
|
387
|
+
deleteById<T extends IModelDeleteOptions<EntityRefundRequest,ModelRefundRequest>>(id: TableIdentity, options?: T): Promise<void>;
|
|
388
|
+
}
|
|
171
389
|
}
|
|
172
390
|
declare module 'vona-module-a-orm' {
|
|
173
391
|
export interface IModelClassRecord {
|
|
174
392
|
'commerce-payment:paymentAttempt': ModelPaymentAttempt;
|
|
175
393
|
'commerce-payment:paymentAudit': ModelPaymentAudit;
|
|
394
|
+
'commerce-payment:refundAttempt': ModelRefundAttempt;
|
|
395
|
+
'commerce-payment:refundAudit': ModelRefundAudit;
|
|
396
|
+
'commerce-payment:refundRequest': ModelRefundRequest;
|
|
176
397
|
}
|
|
177
398
|
}
|
|
178
399
|
/** model: end */
|
|
@@ -13,6 +13,18 @@ import { $tableColumns } from 'vona-module-a-ormutils';
|
|
|
13
13
|
...$tableColumns('commercePaymentAudit', 'paymentAttemptId'),
|
|
14
14
|
...$tableColumns('commercePaymentAudit', 'orderId'),
|
|
15
15
|
...$tableColumns('commercePaymentAudit', 'idempotencyKey'),
|
|
16
|
+
...$tableColumns('commercePaymentRefundRequest', 'orderId'),
|
|
17
|
+
...$tableColumns('commercePaymentRefundRequest', 'userId'),
|
|
18
|
+
...$tableColumns('commercePaymentRefundRequest', 'state'),
|
|
19
|
+
...$tableColumns('commercePaymentRefundRequest', 'correlationId'),
|
|
20
|
+
...$tableColumns('commercePaymentRefundAttempt', 'refundRequestId'),
|
|
21
|
+
...$tableColumns('commercePaymentRefundAttempt', 'orderId'),
|
|
22
|
+
...$tableColumns('commercePaymentRefundAttempt', 'state'),
|
|
23
|
+
...$tableColumns('commercePaymentRefundAudit', 'refundRequestId'),
|
|
24
|
+
...$tableColumns('commercePaymentRefundAudit', 'refundAttemptId'),
|
|
25
|
+
...$tableColumns('commercePaymentRefundAudit', 'orderId'),
|
|
26
|
+
...$tableColumns('commercePaymentRefundAudit', 'idempotencyKey'),
|
|
27
|
+
...$tableColumns('commercePaymentRefundAudit', 'correlationId'),
|
|
16
28
|
},
|
|
17
29
|
})
|
|
18
30
|
export class MetaIndex extends BeanBase {}
|