cabloy 5.1.127 → 5.1.129
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 +23 -0
- package/cabloy-docs/backend/i18n-guide.md +86 -7
- package/e2e/specs/a-commerce/commerce.spec.ts +93 -8
- package/package.json +1 -1
- package/vona/env/.env +2 -0
- package/vona/env/.env.prod +6 -2
- package/vona/packages-cli/cabloy-cli/package.json +1 -1
- package/vona/packages-cli/cli/package.json +1 -1
- package/vona/packages-cli/cli-set-api/package.json +1 -1
- package/vona/packages-utils/module-glob/package.json +1 -1
- package/vona/packages-utils/utils/package.json +1 -1
- package/vona/packages-utils/utils/src/vona.ts +8 -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-mock/package.json +1 -1
- package/vona/pnpm-lock.yaml +142 -21
- package/vona/pnpm-workspace.yaml +1 -1
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/.metadata/index.ts +1 -1
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/dto/productSelectResItem.tsx +3 -1
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/dto/productView.tsx +3 -1
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/entity/product.tsx +23 -3
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/model/product.ts +1 -0
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/service/product.ts +7 -2
- package/vona/src/suite/a-commerce/modules/commerce-catalog/test/productPresentation.test.ts +214 -0
- package/vona/src/suite/a-commerce/modules/commerce-payment/src/bean/payScene.commerceOrder.ts +39 -3
- package/vona/src/suite/a-commerce/modules/commerce-payment/src/service/commercePayScene.ts +14 -1
- package/vona/src/suite/a-commerce/modules/commerce-payment/src/service/paymentAttempt.ts +5 -1
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/.metadata/index.ts +17 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/controller/checkout.ts +18 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/dto/checkoutCreate.tsx +3 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/dto/checkoutPaymentMethod.tsx +19 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/dto/checkoutPaymentMethods.tsx +17 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/service/order.ts +51 -0
- package/vona/src/suite/a-commerce/modules/commerce-trade/test/paymentOutcome.test.ts +2 -1
- package/vona/src/suite-vendor/a-pay/modules/a-pay/package.json +1 -1
- package/vona/src/suite-vendor/a-pay/modules/a-pay/src/.metadata/index.ts +94 -55
- package/vona/src/suite-vendor/a-pay/modules/a-pay/src/bean/bean.payScene.ts +65 -1
- package/vona/src/suite-vendor/a-pay/modules/a-pay/src/bean/meta.redlock.ts +2 -0
- package/vona/src/suite-vendor/a-pay/modules/a-pay/src/controller/paymentCallback.ts +32 -0
- package/vona/src/suite-vendor/a-pay/modules/a-pay/src/controller/paymentSession.ts +26 -8
- package/vona/src/suite-vendor/a-pay/modules/a-pay/src/service/paymentCallback.ts +99 -0
- package/vona/src/suite-vendor/a-pay/modules/a-pay/src/service/paymentSession.ts +26 -3
- package/vona/src/suite-vendor/a-pay/modules/a-pay/src/service/providerOperation.ts +214 -82
- package/vona/src/suite-vendor/a-pay/modules/a-pay/src/service/refundOperation.ts +27 -2
- package/vona/src/suite-vendor/a-pay/modules/a-pay/src/types/payScene.ts +9 -0
- package/vona/src/suite-vendor/a-pay/modules/a-pay/src/types/payment.ts +5 -0
- package/vona/src/suite-vendor/a-pay/modules/pay-mock/package.json +1 -1
- package/vona/src/suite-vendor/a-pay/modules/pay-mock/src/bean/payProvider.mock.ts +7 -0
- package/vona/src/suite-vendor/a-pay/modules/pay-paypal/package.json +1 -1
- package/vona/src/suite-vendor/a-pay/modules/pay-paypal/src/bean/payProvider.paypal.ts +395 -84
- package/vona/src/suite-vendor/a-pay/modules/pay-paypal/src/lib/index.ts +1 -1
- package/vona/src/suite-vendor/a-pay/modules/pay-paypal/src/lib/paypalGateway.ts +129 -0
- package/vona/src/suite-vendor/a-pay/modules/pay-paypal/src/types/index.ts +2 -0
- package/vona/src/suite-vendor/a-pay/modules/pay-stripe/package.json +1 -1
- package/vona/src/suite-vendor/a-pay/modules/pay-stripe/src/bean/payProvider.stripe.ts +7 -0
- package/vona/src/suite-vendor/a-pay/package.json +5 -5
- package/vona/src/suite-vendor/a-vona/modules/a-core/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/package.json +1 -1
- package/zova/packages-cli/cli/package.json +3 -3
- package/zova/packages-cli/cli-set-front/package.json +4 -4
- package/zova/packages-utils/zova-jsx/package.json +3 -3
- package/zova/packages-utils/zova-vite/package.json +2 -2
- package/zova/packages-zova/zova/package.json +3 -3
- package/zova/packages-zova/zova-core/package.json +2 -2
- package/zova/pnpm-lock.yaml +41 -41
- package/zova/src/suite/a-commerce/modules/commerce-member/src/api/openapi/schemas.ts +8 -0
- package/zova/src/suite/a-commerce/modules/commerce-member/src/api/openapi/types.ts +175 -0
- package/zova/src/suite/a-commerce/modules/commerce-trade/cli/openapi.config.ts +1 -0
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/api/commerceTradeCheckout.ts +16 -0
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/api/openapi/schemas.ts +8 -0
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/api/openapi/types.ts +177 -2
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/apiSchema/commerceTradeCheckout.ts +12 -1
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/model/cart.ts +11 -0
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/page/checkout/controller.tsx +25 -1
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/page/payment/controller.tsx +27 -4
- package/zova/src/suite-vendor/a-pay/modules/a-pay/cli/openapi.config.ts +1 -1
- package/zova/src/suite-vendor/a-pay/modules/a-pay/package.json +1 -1
- package/zova/src/suite-vendor/a-pay/modules/a-pay/src/api/openapi/schemas.ts +20 -8
- package/zova/src/suite-vendor/a-pay/modules/a-pay/src/api/openapi/types.ts +292 -32
- package/zova/src/suite-vendor/a-pay/modules/a-pay/src/api/paymentSession.ts +26 -4
- package/zova/src/suite-vendor/a-pay/modules/a-pay/src/apiSchema/paymentSession.ts +5 -0
- package/zova/src/suite-vendor/a-pay/modules/a-pay/src/component/paymentNextAction/controller.tsx +2 -1
- package/zova/src/suite-vendor/a-pay/modules/a-pay/src/model/paymentSession.ts +12 -0
- package/zova/src/suite-vendor/a-pay/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +4 -4
- package/zova/src/suite-vendor/a-zova/package.json +2 -2
- /package/vona/patches/{zova-core@5.1.81.patch → zova-core@5.1.82.patch} +0 -0
package/vona/pnpm-lock.yaml
CHANGED
|
@@ -16,7 +16,7 @@ overrides:
|
|
|
16
16
|
zod: npm:@cabloy/zod@4.3.8
|
|
17
17
|
|
|
18
18
|
patchedDependencies:
|
|
19
|
-
zova-core@5.1.
|
|
19
|
+
zova-core@5.1.82: ff659aa5f659be32501f56841b72f148c24acf1546f79cce551586e27fcde2ce
|
|
20
20
|
|
|
21
21
|
importers:
|
|
22
22
|
|
|
@@ -561,11 +561,11 @@ importers:
|
|
|
561
561
|
specifier: npm:@cabloy/zod@4.3.8
|
|
562
562
|
version: '@cabloy/zod@4.3.8'
|
|
563
563
|
zova:
|
|
564
|
-
specifier: ^5.1.
|
|
565
|
-
version: 5.1.
|
|
564
|
+
specifier: ^5.1.145
|
|
565
|
+
version: 5.1.145(typescript@5.9.3)(vue@3.5.39(typescript@5.9.3))
|
|
566
566
|
zova-jsx:
|
|
567
|
-
specifier: ^1.1.
|
|
568
|
-
version: 1.1.
|
|
567
|
+
specifier: ^1.1.82
|
|
568
|
+
version: 1.1.82(typescript@5.9.3)
|
|
569
569
|
zova-module-a-api:
|
|
570
570
|
specifier: ^5.1.21
|
|
571
571
|
version: 5.1.21
|
|
@@ -594,8 +594,8 @@ importers:
|
|
|
594
594
|
specifier: ^5.1.47
|
|
595
595
|
version: 5.1.47
|
|
596
596
|
zova-module-a-pay:
|
|
597
|
-
specifier: ^5.0.
|
|
598
|
-
version: 5.0.
|
|
597
|
+
specifier: ^5.0.3
|
|
598
|
+
version: 5.0.3
|
|
599
599
|
zova-module-a-router:
|
|
600
600
|
specifier: ^5.1.31
|
|
601
601
|
version: 5.1.31
|
|
@@ -639,11 +639,11 @@ importers:
|
|
|
639
639
|
specifier: npm:@cabloy/zod@4.3.8
|
|
640
640
|
version: '@cabloy/zod@4.3.8'
|
|
641
641
|
zova:
|
|
642
|
-
specifier: ^5.1.
|
|
643
|
-
version: 5.1.
|
|
642
|
+
specifier: ^5.1.145
|
|
643
|
+
version: 5.1.145(typescript@5.9.3)(vue@3.5.39(typescript@5.9.3))
|
|
644
644
|
zova-jsx:
|
|
645
|
-
specifier: ^1.1.
|
|
646
|
-
version: 1.1.
|
|
645
|
+
specifier: ^1.1.82
|
|
646
|
+
version: 1.1.82(typescript@5.9.3)
|
|
647
647
|
zova-module-a-api:
|
|
648
648
|
specifier: ^5.1.21
|
|
649
649
|
version: 5.1.21
|
|
@@ -672,8 +672,8 @@ importers:
|
|
|
672
672
|
specifier: ^5.1.47
|
|
673
673
|
version: 5.1.47
|
|
674
674
|
zova-module-a-pay:
|
|
675
|
-
specifier: ^5.0.
|
|
676
|
-
version: 5.0.
|
|
675
|
+
specifier: ^5.0.3
|
|
676
|
+
version: 5.0.3
|
|
677
677
|
zova-module-a-router:
|
|
678
678
|
specifier: ^5.1.31
|
|
679
679
|
version: 5.1.31
|
|
@@ -1834,16 +1834,16 @@ importers:
|
|
|
1834
1834
|
src/suite-vendor/a-pay:
|
|
1835
1835
|
dependencies:
|
|
1836
1836
|
vona-module-a-pay:
|
|
1837
|
-
specifier: ^5.0.
|
|
1837
|
+
specifier: ^5.0.4
|
|
1838
1838
|
version: link:modules/a-pay
|
|
1839
1839
|
vona-module-pay-mock:
|
|
1840
|
-
specifier: ^5.0.
|
|
1840
|
+
specifier: ^5.0.4
|
|
1841
1841
|
version: link:modules/pay-mock
|
|
1842
1842
|
vona-module-pay-paypal:
|
|
1843
|
-
specifier: ^5.0.
|
|
1843
|
+
specifier: ^5.0.4
|
|
1844
1844
|
version: link:modules/pay-paypal
|
|
1845
1845
|
vona-module-pay-stripe:
|
|
1846
|
-
specifier: ^5.0.
|
|
1846
|
+
specifier: ^5.0.4
|
|
1847
1847
|
version: link:modules/pay-stripe
|
|
1848
1848
|
|
|
1849
1849
|
src/suite-vendor/a-pay/modules/a-pay:
|
|
@@ -1922,7 +1922,7 @@ importers:
|
|
|
1922
1922
|
specifier: ^5.0.8
|
|
1923
1923
|
version: link:modules/test-file
|
|
1924
1924
|
vona-module-test-pay:
|
|
1925
|
-
specifier: ^5.0.
|
|
1925
|
+
specifier: ^5.0.3
|
|
1926
1926
|
version: link:modules/test-pay
|
|
1927
1927
|
|
|
1928
1928
|
src/suite-vendor/a-test/modules/test-auth:
|
|
@@ -8565,9 +8565,15 @@ packages:
|
|
|
8565
8565
|
zova-core@5.1.81:
|
|
8566
8566
|
resolution: {integrity: sha512-gLmLWXpd9xNmc+fXx33QEgRZ2ZsNjRlVWDC1HEQLLnq3ZCakDf87qXhfdk+JH5csS2BjGAdckfmbiLqGL15o1Q==}
|
|
8567
8567
|
|
|
8568
|
+
zova-core@5.1.82:
|
|
8569
|
+
resolution: {integrity: sha512-JAcdG5SYI+QqzCsynfe3GKYcx7MZIWhi8icA85yL8JL28cZOziP+p+PsWRZPKnk/f9lReBVsv5uyQWYvD6ydPQ==}
|
|
8570
|
+
|
|
8568
8571
|
zova-jsx@1.1.81:
|
|
8569
8572
|
resolution: {integrity: sha512-WVUc4DYsVcjPfcfWgFY2vQbiK8ARIwv2K6o6Auyqvts/vSfJ7BCzD4XqCVHANVY5yJ8povdJUzpiCIAhioWRkg==}
|
|
8570
8573
|
|
|
8574
|
+
zova-jsx@1.1.82:
|
|
8575
|
+
resolution: {integrity: sha512-Ri3skPn7JtP4n2hwChJzdtY+Z9FX/UsFZtm63dD5xZ0czAejNEgJJiEWpXlVhaXaNbgdes5WLkgpMmJGSvMoWg==}
|
|
8576
|
+
|
|
8571
8577
|
zova-module-a-api@5.1.21:
|
|
8572
8578
|
resolution: {integrity: sha512-qjm/hfjC4/+7Ap/uzJfBzV0PwRlp2idEmEKwCZYxquaXq6QtJBbTWTznw1iukT4lkJZip2KFkjOvXTzdvZA2UA==}
|
|
8573
8579
|
|
|
@@ -8616,6 +8622,9 @@ packages:
|
|
|
8616
8622
|
zova-module-a-pay@5.0.2:
|
|
8617
8623
|
resolution: {integrity: sha512-BOKkM7R//Kju54PhZxnyJ0O8gHnyKrwxXpAAr85wJurHQAl3NIsdRwINj+i+hIe3Btc+UJmi/H1kpg0d3YuoZQ==}
|
|
8618
8624
|
|
|
8625
|
+
zova-module-a-pay@5.0.3:
|
|
8626
|
+
resolution: {integrity: sha512-W2UZ0ojYk9q3P4i3ByXxhTCc2cZmegsdV61lKWY4vp/ZA3fuLntIewD2ENdWWIIzXKH00exEQcssjFmj444xcA==}
|
|
8627
|
+
|
|
8619
8628
|
zova-module-a-router@5.1.31:
|
|
8620
8629
|
resolution: {integrity: sha512-bTtj3JmJKGZwUYwWpsuhigXYseYab/gOmT18WyNw0KetZGY03Y+JnU74oidrK1KtIY384+my1ZQefBlbIZjNeg==}
|
|
8621
8630
|
|
|
@@ -8646,6 +8655,9 @@ packages:
|
|
|
8646
8655
|
zova-module-a-zova@5.1.96:
|
|
8647
8656
|
resolution: {integrity: sha512-lP6LgzbrSlHBqyA1QhMZ66B0DQBLcXcEcWBh3zESFnhFzbomlfABjG+cnju5ki771YhT2CuPeo3m9v01WYc3Bg==}
|
|
8648
8657
|
|
|
8658
|
+
zova-module-a-zova@5.1.97:
|
|
8659
|
+
resolution: {integrity: sha512-rBEWxwKQ86iT4dsSyJRYRKFzfUNk6zMXY4Ff5XYnkxJI6sVfCm5+3MZC27RavqnVU+odAtS8RFQLpR33kMKMtA==}
|
|
8660
|
+
|
|
8649
8661
|
zova-module-pay-mock@5.0.2:
|
|
8650
8662
|
resolution: {integrity: sha512-G6ld4ZZJ3crSUQ1fH+Tn2p9/05ngfJYtDtTtq7K1Xo9ei2fjbp13Jrbjh3cKR+dhWuK9Q1gwAs7xwhu7NIiTKA==}
|
|
8651
8663
|
|
|
@@ -8655,9 +8667,15 @@ packages:
|
|
|
8655
8667
|
zova-suite-a-zova@5.1.143:
|
|
8656
8668
|
resolution: {integrity: sha512-DMaYtWO1HVu0BIeNguAYqlcOGa9MVfejDLvLqw6mOqmPSSLrvGSSC+lzYGhI/J9xQBbGRFaWbIdMhetCpuZdwg==}
|
|
8657
8669
|
|
|
8670
|
+
zova-suite-a-zova@5.1.144:
|
|
8671
|
+
resolution: {integrity: sha512-viW0GA4BviNOllF72Yw6EQ5Kpqvqf6IiNWfG6t8DO8RpMAZsiWk2Sxc9V17cIhw4Hoc8sEfb2HjZUIWDgf3SUA==}
|
|
8672
|
+
|
|
8658
8673
|
zova@5.1.144:
|
|
8659
8674
|
resolution: {integrity: sha512-YEgsYl7hL635nK9134oH8GMUqHp41IAp0I+rWz27f2QCkp8QGLqvQIbrvXoFnYwJyuYmaCz/eBMMrl1y+mzs0w==}
|
|
8660
8675
|
|
|
8676
|
+
zova@5.1.145:
|
|
8677
|
+
resolution: {integrity: sha512-/iJ5Xs8vh3c7ykUvbQjZ6Kh9ZsQXqTqRgZJjBHQw9Ngs1i5N9Lp6NOU8v74m0X8hql+3yMeKjEV8iUDPKD2N2A==}
|
|
8678
|
+
|
|
8661
8679
|
zwitch@1.0.5:
|
|
8662
8680
|
resolution: {integrity: sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==}
|
|
8663
8681
|
|
|
@@ -14576,7 +14594,36 @@ snapshots:
|
|
|
14576
14594
|
dependencies:
|
|
14577
14595
|
zod: '@cabloy/zod@4.3.8'
|
|
14578
14596
|
|
|
14579
|
-
zova-core@5.1.81(
|
|
14597
|
+
zova-core@5.1.81(typescript@5.9.3):
|
|
14598
|
+
dependencies:
|
|
14599
|
+
'@cabloy/compose': link:packages-utils/compose
|
|
14600
|
+
'@cabloy/extend': link:packages-utils/extend
|
|
14601
|
+
'@cabloy/json5': link:packages-utils/json5
|
|
14602
|
+
'@cabloy/localeutil': link:packages-utils/localeutil
|
|
14603
|
+
'@cabloy/logger': 1.1.24
|
|
14604
|
+
'@cabloy/module-info': 2.0.3
|
|
14605
|
+
'@cabloy/utils': link:packages-utils/utils
|
|
14606
|
+
'@cabloy/vue-compiler-sfc': 3.5.14
|
|
14607
|
+
'@cabloy/vue-reactivity': 3.5.16
|
|
14608
|
+
'@cabloy/vue-router': 4.4.16(vue@3.5.39(typescript@5.9.3))
|
|
14609
|
+
'@cabloy/vue-runtime-core': 3.5.57
|
|
14610
|
+
'@cabloy/vue-runtime-dom': 3.5.13
|
|
14611
|
+
'@cabloy/vue-server-renderer': 3.5.18(vue@3.5.39(typescript@5.9.3))
|
|
14612
|
+
'@cabloy/word-utils': 2.1.14
|
|
14613
|
+
'@cabloy/zod-errors-custom': link:packages-utils/zod-errors-custom
|
|
14614
|
+
'@cabloy/zod-openapi': link:packages-utils/zod-openapi
|
|
14615
|
+
'@cabloy/zod-query': link:packages-utils/zod-query
|
|
14616
|
+
'@types/js-cookie': 3.0.6
|
|
14617
|
+
'@vue/shared': 3.5.36
|
|
14618
|
+
deep-equal: 2.2.3
|
|
14619
|
+
reflect-metadata: 0.2.2
|
|
14620
|
+
vue: 3.5.39(typescript@5.9.3)
|
|
14621
|
+
vue-plugin-render-freeze: 2.0.4(vue@3.5.39(typescript@5.9.3))
|
|
14622
|
+
zod: '@cabloy/zod@4.3.8'
|
|
14623
|
+
transitivePeerDependencies:
|
|
14624
|
+
- typescript
|
|
14625
|
+
|
|
14626
|
+
zova-core@5.1.82(patch_hash=ff659aa5f659be32501f56841b72f148c24acf1546f79cce551586e27fcde2ce)(typescript@5.9.3):
|
|
14580
14627
|
dependencies:
|
|
14581
14628
|
'@cabloy/compose': link:packages-utils/compose
|
|
14582
14629
|
'@cabloy/extend': link:packages-utils/extend
|
|
@@ -14612,7 +14659,18 @@ snapshots:
|
|
|
14612
14659
|
'@cabloy/word-utils': 2.1.14
|
|
14613
14660
|
typestyle: 2.4.0
|
|
14614
14661
|
vue: 3.5.39(typescript@5.9.3)
|
|
14615
|
-
zova-core: 5.1.81(
|
|
14662
|
+
zova-core: 5.1.81(typescript@5.9.3)
|
|
14663
|
+
transitivePeerDependencies:
|
|
14664
|
+
- typescript
|
|
14665
|
+
|
|
14666
|
+
zova-jsx@1.1.82(typescript@5.9.3):
|
|
14667
|
+
dependencies:
|
|
14668
|
+
'@cabloy/compose': link:packages-utils/compose
|
|
14669
|
+
'@cabloy/utils': link:packages-utils/utils
|
|
14670
|
+
'@cabloy/word-utils': 2.1.14
|
|
14671
|
+
typestyle: 2.4.0
|
|
14672
|
+
vue: 3.5.39(typescript@5.9.3)
|
|
14673
|
+
zova-core: 5.1.82(patch_hash=ff659aa5f659be32501f56841b72f148c24acf1546f79cce551586e27fcde2ce)(typescript@5.9.3)
|
|
14616
14674
|
transitivePeerDependencies:
|
|
14617
14675
|
- typescript
|
|
14618
14676
|
|
|
@@ -14677,6 +14735,8 @@ snapshots:
|
|
|
14677
14735
|
|
|
14678
14736
|
zova-module-a-pay@5.0.2: {}
|
|
14679
14737
|
|
|
14738
|
+
zova-module-a-pay@5.0.3: {}
|
|
14739
|
+
|
|
14680
14740
|
zova-module-a-router@5.1.31: {}
|
|
14681
14741
|
|
|
14682
14742
|
zova-module-a-routerstack@5.1.26: {}
|
|
@@ -14732,6 +14792,22 @@ snapshots:
|
|
|
14732
14792
|
- typescript
|
|
14733
14793
|
- vue
|
|
14734
14794
|
|
|
14795
|
+
zova-module-a-zova@5.1.97(typescript@5.9.3)(vue@3.5.39(typescript@5.9.3)):
|
|
14796
|
+
dependencies:
|
|
14797
|
+
'@cabloy/compose': link:packages-utils/compose
|
|
14798
|
+
'@cabloy/deps': link:packages-utils/deps
|
|
14799
|
+
'@cabloy/json5': link:packages-utils/json5
|
|
14800
|
+
'@cabloy/module-info': 2.0.3
|
|
14801
|
+
'@cabloy/utils': link:packages-utils/utils
|
|
14802
|
+
'@cabloy/vue-router': 4.4.16(vue@3.5.39(typescript@5.9.3))
|
|
14803
|
+
'@cabloy/word-utils': 2.1.14
|
|
14804
|
+
defu: 6.1.7
|
|
14805
|
+
luxon: 3.7.2
|
|
14806
|
+
zova-jsx: 1.1.82(typescript@5.9.3)
|
|
14807
|
+
transitivePeerDependencies:
|
|
14808
|
+
- typescript
|
|
14809
|
+
- vue
|
|
14810
|
+
|
|
14735
14811
|
zova-module-pay-mock@5.0.2: {}
|
|
14736
14812
|
|
|
14737
14813
|
zova-module-rest-resource@5.1.42: {}
|
|
@@ -14770,9 +14846,43 @@ snapshots:
|
|
|
14770
14846
|
- typescript
|
|
14771
14847
|
- vue
|
|
14772
14848
|
|
|
14849
|
+
zova-suite-a-zova@5.1.144(typescript@5.9.3)(vue@3.5.39(typescript@5.9.3)):
|
|
14850
|
+
dependencies:
|
|
14851
|
+
zova-module-a-api: 5.1.21
|
|
14852
|
+
zova-module-a-app: 5.1.25
|
|
14853
|
+
zova-module-a-bean: 5.1.32
|
|
14854
|
+
zova-module-a-behavior: 5.1.25
|
|
14855
|
+
zova-module-a-behaviors: 5.1.21
|
|
14856
|
+
zova-module-a-boundary: 5.1.21
|
|
14857
|
+
zova-module-a-command: 5.1.33
|
|
14858
|
+
zova-module-a-fetch: 5.1.24
|
|
14859
|
+
zova-module-a-form: 5.1.46(vue@3.5.39(typescript@5.9.3))
|
|
14860
|
+
zova-module-a-icon: 5.1.26
|
|
14861
|
+
zova-module-a-interceptor: 5.1.29
|
|
14862
|
+
zova-module-a-logger: 5.1.26
|
|
14863
|
+
zova-module-a-meta: 5.1.21
|
|
14864
|
+
zova-module-a-model: 5.1.33(vue@3.5.39(typescript@5.9.3))
|
|
14865
|
+
zova-module-a-openapi: 5.1.47
|
|
14866
|
+
zova-module-a-router: 5.1.31
|
|
14867
|
+
zova-module-a-routerstack: 5.1.26
|
|
14868
|
+
zova-module-a-routertabs: 5.1.33
|
|
14869
|
+
zova-module-a-ssr: 5.1.32
|
|
14870
|
+
zova-module-a-ssrhmr: 5.1.22
|
|
14871
|
+
zova-module-a-ssrserver: 5.1.23
|
|
14872
|
+
zova-module-a-style: 5.1.32
|
|
14873
|
+
zova-module-a-table: 5.1.37(vue@3.5.39(typescript@5.9.3))
|
|
14874
|
+
zova-module-a-zod: 5.1.36
|
|
14875
|
+
zova-module-a-zova: 5.1.97(typescript@5.9.3)(vue@3.5.39(typescript@5.9.3))
|
|
14876
|
+
transitivePeerDependencies:
|
|
14877
|
+
- '@vue/composition-api'
|
|
14878
|
+
- debug
|
|
14879
|
+
- supports-color
|
|
14880
|
+
- typescript
|
|
14881
|
+
- vue
|
|
14882
|
+
|
|
14773
14883
|
zova@5.1.144(typescript@5.9.3)(vue@3.5.39(typescript@5.9.3)):
|
|
14774
14884
|
dependencies:
|
|
14775
|
-
zova-core: 5.1.81(
|
|
14885
|
+
zova-core: 5.1.81(typescript@5.9.3)
|
|
14776
14886
|
zova-suite-a-zova: 5.1.143(typescript@5.9.3)(vue@3.5.39(typescript@5.9.3))
|
|
14777
14887
|
transitivePeerDependencies:
|
|
14778
14888
|
- '@vue/composition-api'
|
|
@@ -14781,6 +14891,17 @@ snapshots:
|
|
|
14781
14891
|
- typescript
|
|
14782
14892
|
- vue
|
|
14783
14893
|
|
|
14894
|
+
zova@5.1.145(typescript@5.9.3)(vue@3.5.39(typescript@5.9.3)):
|
|
14895
|
+
dependencies:
|
|
14896
|
+
zova-core: 5.1.82(patch_hash=ff659aa5f659be32501f56841b72f148c24acf1546f79cce551586e27fcde2ce)(typescript@5.9.3)
|
|
14897
|
+
zova-suite-a-zova: 5.1.144(typescript@5.9.3)(vue@3.5.39(typescript@5.9.3))
|
|
14898
|
+
transitivePeerDependencies:
|
|
14899
|
+
- '@vue/composition-api'
|
|
14900
|
+
- debug
|
|
14901
|
+
- supports-color
|
|
14902
|
+
- typescript
|
|
14903
|
+
- vue
|
|
14904
|
+
|
|
14784
14905
|
zwitch@1.0.5: {}
|
|
14785
14906
|
|
|
14786
14907
|
zwitch@2.0.4: {}
|
package/vona/pnpm-workspace.yaml
CHANGED
|
@@ -149,7 +149,7 @@ declare module 'vona-module-commerce-catalog' {
|
|
|
149
149
|
}
|
|
150
150
|
export interface IModelOptionsProduct {
|
|
151
151
|
relations: {
|
|
152
|
-
category: IModelRelationBelongsTo<'commerce-catalog:product', 'commerce-catalog:category', false, '
|
|
152
|
+
category: IModelRelationBelongsTo<'commerce-catalog:product', 'commerce-catalog:category', false, 'id'|'name'|'published'>;
|
|
153
153
|
skus: IModelRelationHasMany<'commerce-catalog:sku', 'productId', false, '*', undefined, undefined, undefined>;
|
|
154
154
|
skuAvailables: IModelRelationHasMany<'commerce-catalog:sku', 'productId', false, 'id'|'code'|'productId'|'priceCents', ['commerce-trade:stockBalance'], undefined, undefined>;
|
|
155
155
|
};
|
|
@@ -46,7 +46,9 @@ export interface IDtoOptionsProductSelectResItem extends IDecoratorDtoOptions {}
|
|
|
46
46
|
}),
|
|
47
47
|
],
|
|
48
48
|
})
|
|
49
|
-
export class DtoProductSelectResItem extends $Dto.get(() => ModelProduct
|
|
49
|
+
export class DtoProductSelectResItem extends $Dto.get(() => ModelProduct, {
|
|
50
|
+
include: { category: true },
|
|
51
|
+
}) {
|
|
50
52
|
@Api.field(
|
|
51
53
|
v.title($locale('Operations')),
|
|
52
54
|
ZovaRender.order(1, 'max'),
|
|
@@ -22,4 +22,6 @@ export interface IDtoOptionsProductView extends IDecoratorDtoOptions {}
|
|
|
22
22
|
}),
|
|
23
23
|
],
|
|
24
24
|
})
|
|
25
|
-
export class DtoProductView extends $Dto.get(() => ModelProduct
|
|
25
|
+
export class DtoProductView extends $Dto.get(() => ModelProduct, {
|
|
26
|
+
include: { category: true },
|
|
27
|
+
}) {}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { TableIdentity } from 'table-identity';
|
|
2
2
|
import type { IDecoratorEntityOptions } from 'vona-module-a-orm';
|
|
3
3
|
|
|
4
|
-
import { $makeMetadata, Api, v } from 'vona-module-a-openapiutils';
|
|
4
|
+
import { $makeMetadata, $resourceName, Api, v } from 'vona-module-a-openapiutils';
|
|
5
5
|
import { Entity, EntityBase } from 'vona-module-a-orm';
|
|
6
6
|
import { ZovaRender } from 'zova-rest-cabloy-basic-admin';
|
|
7
7
|
|
|
8
8
|
import { $locale } from '../.metadata/locales.ts';
|
|
9
|
+
import { categoryPublicationItems } from './category.tsx';
|
|
9
10
|
|
|
10
11
|
export interface IEntityOptionsProduct extends IDecoratorEntityOptions {}
|
|
11
12
|
|
|
@@ -37,10 +38,29 @@ export class EntityProduct extends EntityBase {
|
|
|
37
38
|
)
|
|
38
39
|
title: string;
|
|
39
40
|
|
|
40
|
-
@Api.field(
|
|
41
|
+
@Api.field(
|
|
42
|
+
v.title($locale('Category')),
|
|
43
|
+
v.required(),
|
|
44
|
+
ZovaRender.order(2),
|
|
45
|
+
ZovaRender.field('basic-resource:formFieldResourcePicker', {
|
|
46
|
+
resource: $resourceName('commerce-catalog:category'),
|
|
47
|
+
relationName: 'category',
|
|
48
|
+
}),
|
|
49
|
+
ZovaRender.cell('basic-resource:resourcePicker', {
|
|
50
|
+
resource: $resourceName('commerce-catalog:category'),
|
|
51
|
+
relationName: 'category',
|
|
52
|
+
}),
|
|
53
|
+
v.tableIdentity(),
|
|
54
|
+
)
|
|
41
55
|
categoryId: TableIdentity;
|
|
42
56
|
|
|
43
|
-
@Api.field(
|
|
57
|
+
@Api.field(
|
|
58
|
+
v.title($locale('Published')),
|
|
59
|
+
v.default(false),
|
|
60
|
+
ZovaRender.order(3),
|
|
61
|
+
ZovaRender.field('basic-select:formFieldSelect', { items: categoryPublicationItems }),
|
|
62
|
+
ZovaRender.cell('basic-select:select', { items: categoryPublicationItems }),
|
|
63
|
+
)
|
|
44
64
|
published: boolean;
|
|
45
65
|
|
|
46
66
|
@Api.field(v.title($locale('Description')), v.optional(), ZovaRender.order(4))
|
|
@@ -13,6 +13,7 @@ export interface IModelOptionsProduct extends IDecoratorModelOptions<EntityProdu
|
|
|
13
13
|
'commerce-catalog:product',
|
|
14
14
|
'commerce-catalog:category',
|
|
15
15
|
'categoryId',
|
|
16
|
+
{ columns: ['id', 'name', 'published'] },
|
|
16
17
|
),
|
|
17
18
|
skus: $relation.hasMany('commerce-catalog:sku', 'productId'),
|
|
18
19
|
skuAvailables: $relation.hasMany(
|
|
@@ -22,7 +22,10 @@ export class ServiceProduct extends BeanBase {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
async select(params?: IQueryParams<ModelProduct>): Promise<DtoProductSelectRes> {
|
|
25
|
-
return await this.scope.model.product.selectAndCount(
|
|
25
|
+
return await this.scope.model.product.selectAndCount({
|
|
26
|
+
...params,
|
|
27
|
+
include: { ...params?.include, category: true },
|
|
28
|
+
});
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
async selectPublic(params: IQueryParams<ModelProduct>): Promise<DtoProductPublicSelectRes> {
|
|
@@ -50,7 +53,9 @@ export class ServiceProduct extends BeanBase {
|
|
|
50
53
|
}
|
|
51
54
|
|
|
52
55
|
async view(id: TableIdentity): Promise<DtoProductView | undefined> {
|
|
53
|
-
return await this.scope.model.product.getById(id
|
|
56
|
+
return await this.scope.model.product.getById(id, {
|
|
57
|
+
include: { category: true },
|
|
58
|
+
});
|
|
54
59
|
}
|
|
55
60
|
|
|
56
61
|
async viewPublic(id: TableIdentity): Promise<DtoProductPublic | undefined> {
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import assert from 'node:assert';
|
|
2
|
+
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import { describe, it } from 'node:test';
|
|
4
|
+
import { app } from 'vona-mock';
|
|
5
|
+
import {
|
|
6
|
+
DtoProductCreate,
|
|
7
|
+
DtoProductSelectResItem,
|
|
8
|
+
DtoProductUpdate,
|
|
9
|
+
DtoProductView,
|
|
10
|
+
} from 'vona-module-commerce-catalog';
|
|
11
|
+
|
|
12
|
+
function findComponent(apiJson: any, predicate: (properties: any) => boolean) {
|
|
13
|
+
return Object.values(apiJson.components!.schemas as any).find(item => {
|
|
14
|
+
return predicate((item as any).properties);
|
|
15
|
+
}) as any;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function getEntryForm(component: any) {
|
|
19
|
+
const pageEntry = component?.rest?.blocks?.[0];
|
|
20
|
+
const formBlock = pageEntry?.options?.blocks?.[0];
|
|
21
|
+
const toolbarBlock = pageEntry?.options?.blocks?.[1];
|
|
22
|
+
assert.equal(pageEntry?.render, 'basic-pageentry:blockPageEntry');
|
|
23
|
+
assert.equal(formBlock?.render, 'basic-pageentry:blockForm');
|
|
24
|
+
assert.equal(toolbarBlock?.render, 'basic-pageentry:blockToolbarRow');
|
|
25
|
+
return toolbarBlock;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
describe('productPresentation.test.ts', () => {
|
|
29
|
+
it('action:product:presentationMetadata', async () => {
|
|
30
|
+
await app.bean.executor.mockCtx(async () => {
|
|
31
|
+
const createJson = await app.bean.openapi.generateJsonOfClass(DtoProductCreate);
|
|
32
|
+
const createComponent = findComponent(createJson, properties => {
|
|
33
|
+
return properties?.title && properties?.categoryId && properties?.published;
|
|
34
|
+
});
|
|
35
|
+
assert.deepEqual(Object.keys(createComponent.properties).sort(), [
|
|
36
|
+
'categoryId',
|
|
37
|
+
'description',
|
|
38
|
+
'published',
|
|
39
|
+
'title',
|
|
40
|
+
]);
|
|
41
|
+
assert.equal(
|
|
42
|
+
createComponent.properties.categoryId.rest.form.render,
|
|
43
|
+
'basic-resource:formFieldResourcePicker',
|
|
44
|
+
);
|
|
45
|
+
assert.deepEqual(createComponent.properties.categoryId.rest.form.options, {
|
|
46
|
+
resource: 'commerce-catalog:category',
|
|
47
|
+
relationName: 'category',
|
|
48
|
+
});
|
|
49
|
+
assert.equal(
|
|
50
|
+
createComponent.properties.published.rest.form.render,
|
|
51
|
+
'basic-select:formFieldSelect',
|
|
52
|
+
);
|
|
53
|
+
assert.deepEqual(
|
|
54
|
+
createComponent.properties.published.rest.form.options.items.map((item: any) => item.value),
|
|
55
|
+
[false, true],
|
|
56
|
+
);
|
|
57
|
+
const createToolbar = getEntryForm(createComponent);
|
|
58
|
+
assert.deepEqual(
|
|
59
|
+
createToolbar.options.actions.map((action: any) => action.render),
|
|
60
|
+
['basic-form:actionSubmit', 'basic-form:actionBack'],
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
const updateJson = await app.bean.openapi.generateJsonOfClass(DtoProductUpdate);
|
|
64
|
+
const updateComponent = findComponent(updateJson, properties => {
|
|
65
|
+
return properties?.title && properties?.categoryId && properties?.published;
|
|
66
|
+
});
|
|
67
|
+
assert.deepEqual(Object.keys(updateComponent.properties).sort(), [
|
|
68
|
+
'categoryId',
|
|
69
|
+
'description',
|
|
70
|
+
'published',
|
|
71
|
+
'title',
|
|
72
|
+
]);
|
|
73
|
+
assert.equal(
|
|
74
|
+
updateComponent.properties.categoryId.rest.form.render,
|
|
75
|
+
'basic-resource:formFieldResourcePicker',
|
|
76
|
+
);
|
|
77
|
+
assert.equal(
|
|
78
|
+
updateComponent.properties.published.rest.form.render,
|
|
79
|
+
'basic-select:formFieldSelect',
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
const viewJson = await app.bean.openapi.generateJsonOfClass(DtoProductView);
|
|
83
|
+
const viewComponent = findComponent(viewJson, properties => {
|
|
84
|
+
return (
|
|
85
|
+
properties?.id && properties?.categoryId && properties?.category && properties?.published
|
|
86
|
+
);
|
|
87
|
+
});
|
|
88
|
+
assert.deepEqual(Object.keys(viewComponent.properties.category.properties).sort(), [
|
|
89
|
+
'id',
|
|
90
|
+
'name',
|
|
91
|
+
'published',
|
|
92
|
+
]);
|
|
93
|
+
assert.equal(viewComponent.properties.iid.rest.visible, false);
|
|
94
|
+
assert.equal(viewComponent.properties.deleted.rest.visible, false);
|
|
95
|
+
assert.equal(
|
|
96
|
+
viewComponent.properties.categoryId.rest.form.render,
|
|
97
|
+
'basic-resource:formFieldResourcePicker',
|
|
98
|
+
);
|
|
99
|
+
assert.deepEqual(viewComponent.properties.categoryId.rest.form.options, {
|
|
100
|
+
resource: 'commerce-catalog:category',
|
|
101
|
+
relationName: 'category',
|
|
102
|
+
});
|
|
103
|
+
assert.equal(
|
|
104
|
+
viewComponent.properties.published.rest.form.render,
|
|
105
|
+
'basic-select:formFieldSelect',
|
|
106
|
+
);
|
|
107
|
+
const viewToolbar = getEntryForm(viewComponent);
|
|
108
|
+
assert.deepEqual(
|
|
109
|
+
viewToolbar.options.actions.map((action: any) => action.render),
|
|
110
|
+
['basic-form:actionBack'],
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
const listJson = await app.bean.openapi.generateJsonOfClass(DtoProductSelectResItem);
|
|
114
|
+
const listComponent = findComponent(listJson, properties => properties?._operationsRow);
|
|
115
|
+
assert.deepEqual(Object.keys(listComponent.properties.category.properties).sort(), [
|
|
116
|
+
'id',
|
|
117
|
+
'name',
|
|
118
|
+
'published',
|
|
119
|
+
]);
|
|
120
|
+
assert.equal(
|
|
121
|
+
listComponent.properties.categoryId.rest.table.render,
|
|
122
|
+
'basic-resource:resourcePicker',
|
|
123
|
+
);
|
|
124
|
+
assert.deepEqual(listComponent.properties.categoryId.rest.table.columnProps, {
|
|
125
|
+
resource: 'commerce-catalog:category',
|
|
126
|
+
relationName: 'category',
|
|
127
|
+
});
|
|
128
|
+
assert.equal(listComponent.properties.published.rest.table.render, 'basic-select:select');
|
|
129
|
+
assert.deepEqual(
|
|
130
|
+
listComponent.properties.published.rest.table.columnProps.items.map(
|
|
131
|
+
(item: any) => item.value,
|
|
132
|
+
),
|
|
133
|
+
[false, true],
|
|
134
|
+
);
|
|
135
|
+
assert.deepEqual(
|
|
136
|
+
listComponent.properties._operationsRow.rest.table.columnProps.actions.map(
|
|
137
|
+
(action: any) => action.render,
|
|
138
|
+
),
|
|
139
|
+
['basic-table:actionUpdate', 'basic-table:actionDelete'],
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
const filterBlock = listComponent.rest.blocks[0].options.blocks[0];
|
|
143
|
+
const filterLayout = filterBlock.options.blocks[0].options.formLayout;
|
|
144
|
+
const section = filterLayout.children[0];
|
|
145
|
+
assert.equal(section.type, 'section');
|
|
146
|
+
assert.equal(section.layout, 'flow');
|
|
147
|
+
assert.deepEqual(
|
|
148
|
+
section.children.slice(0, 2).map((field: any) => field.name),
|
|
149
|
+
['title', 'createdAt'],
|
|
150
|
+
);
|
|
151
|
+
assert.equal(section.children[2].block.render, 'basic-page:blockFilterActions');
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
it('action:product:categoryProjection', async () => {
|
|
156
|
+
await app.bean.executor.mockCtx(async () => {
|
|
157
|
+
const suffix = randomUUID().slice(0, 12);
|
|
158
|
+
let categoryId: number | string | undefined;
|
|
159
|
+
let productId: number | string | undefined;
|
|
160
|
+
await app.bean.passport.signinMock();
|
|
161
|
+
try {
|
|
162
|
+
categoryId = await app.bean.executor.performAction('post', '/commerce/catalog/category', {
|
|
163
|
+
body: { name: `presentation-product-category-${suffix}`, published: true },
|
|
164
|
+
});
|
|
165
|
+
productId = await app.bean.executor.performAction('post', '/commerce/catalog/product', {
|
|
166
|
+
body: {
|
|
167
|
+
categoryId,
|
|
168
|
+
title: `presentation-product-${suffix}`,
|
|
169
|
+
published: false,
|
|
170
|
+
},
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
const view: any = await app.bean.executor.performAction(
|
|
174
|
+
'get',
|
|
175
|
+
'/commerce/catalog/product/:id',
|
|
176
|
+
{
|
|
177
|
+
params: { id: productId },
|
|
178
|
+
},
|
|
179
|
+
);
|
|
180
|
+
assert.equal(String(view.categoryId), String(categoryId));
|
|
181
|
+
assert.deepEqual(view.category, {
|
|
182
|
+
id: categoryId,
|
|
183
|
+
name: `presentation-product-category-${suffix}`,
|
|
184
|
+
published: true,
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
const select: any = await app.bean.executor.performAction(
|
|
188
|
+
'get',
|
|
189
|
+
'/commerce/catalog/product',
|
|
190
|
+
);
|
|
191
|
+
const item = select.list.find((entry: any) => String(entry.id) === String(productId));
|
|
192
|
+
assert.ok(item);
|
|
193
|
+
assert.deepEqual(item.category, {
|
|
194
|
+
id: categoryId,
|
|
195
|
+
name: `presentation-product-category-${suffix}`,
|
|
196
|
+
published: true,
|
|
197
|
+
});
|
|
198
|
+
assert.equal(item.published, false);
|
|
199
|
+
} finally {
|
|
200
|
+
if (productId) {
|
|
201
|
+
await app.bean.executor.performAction('delete', '/commerce/catalog/product/:id', {
|
|
202
|
+
params: { id: productId },
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
if (categoryId) {
|
|
206
|
+
await app.bean.executor.performAction('delete', '/commerce/catalog/category/:id', {
|
|
207
|
+
params: { id: categoryId },
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
await app.bean.passport.signout();
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
});
|