@revenexx/cover 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +39 -0
- package/app/api/account.ts +8 -0
- package/app/api/categories.ts +3 -0
- package/app/api/checkout.ts +6 -0
- package/app/api/images.ts +4 -0
- package/app/api/markets.ts +3 -0
- package/app/api/product.ts +3 -0
- package/app/api/products.ts +4 -0
- package/app/api/search.ts +4 -0
- package/app/app.config.ts +29 -0
- package/app/assets/css/cover.css +25 -0
- package/app/components/account/AccountMenu.vue +30 -0
- package/app/components/account/AccountShell.vue +18 -0
- package/app/components/account/AccountSidebar.vue +90 -0
- package/app/components/account/address/AccountAddressCard.vue +287 -0
- package/app/components/account/carts/AccountCartsTable.vue +284 -0
- package/app/components/account/dashboard/AccountDashboard.vue +351 -0
- package/app/components/account/directorder/AccountDirectOrder.vue +512 -0
- package/app/components/account/governance/AccountApprovalLimitsTable.vue +221 -0
- package/app/components/account/governance/AccountCostCenterDetail.vue +276 -0
- package/app/components/account/governance/AccountCostCentersTable.vue +252 -0
- package/app/components/account/governance/AccountRequisitionDetail.vue +295 -0
- package/app/components/account/governance/AccountRequisitionsTable.vue +255 -0
- package/app/components/account/governance/AccountWorkflowDetail.vue +215 -0
- package/app/components/account/governance/AccountWorkflowsTable.vue +168 -0
- package/app/components/account/governance/GovernanceApprovalLimitModal.vue +183 -0
- package/app/components/account/governance/GovernanceCostCenterModal.vue +188 -0
- package/app/components/account/governance/GovernanceWorkflowModal.vue +191 -0
- package/app/components/account/orderlists/AccountOrderListDetail.vue +349 -0
- package/app/components/account/orderlists/AccountOrderListsTable.vue +352 -0
- package/app/components/account/orders/AccountOrderDetail.vue +376 -0
- package/app/components/account/orders/AccountOrdersTable.vue +281 -0
- package/app/components/account/preferences/AccountPreferences.vue +50 -0
- package/app/components/auth/AuthForgotPasswordPanel.vue +88 -0
- package/app/components/auth/AuthLoginPanel.vue +103 -0
- package/app/components/auth/AuthLoginTeaser.vue +24 -0
- package/app/components/auth/AuthPageHeader.vue +21 -0
- package/app/components/auth/AuthRegisterPanel.vue +431 -0
- package/app/components/auth/AuthRegisterTeaser.vue +24 -0
- package/app/components/auth/AuthResetPasswordPanel.vue +115 -0
- package/app/components/cart/CartButton.vue +42 -0
- package/app/components/cart/actions/CartCostCenterModal.vue +110 -0
- package/app/components/cart/actions/CartExportModal.vue +82 -0
- package/app/components/cart/actions/CartPositionTextsModal.vue +92 -0
- package/app/components/cart/actions/CartSaveToListModal.vue +177 -0
- package/app/components/cart/actions/CartWorkflowPickerModal.vue +64 -0
- package/app/components/cart/drawer/CartDrawer.vue +49 -0
- package/app/components/cart/item/CartItem.vue +318 -0
- package/app/components/cart/manage/CartNameModal.vue +68 -0
- package/app/components/cart/position/CartPosition.vue +369 -0
- package/app/components/cart/quickadd/CartQuickAdd.vue +145 -0
- package/app/components/cart/recommend/CartCrossSell.vue +102 -0
- package/app/components/cart/recommend/CartRecommendCard.vue +59 -0
- package/app/components/cart/recommend/CartReorderStrip.vue +108 -0
- package/app/components/cart/requisition/CartRequisitionGroup.vue +74 -0
- package/app/components/cart/skeleton/CartSkeleton.vue +18 -0
- package/app/components/cart/summary/CartSummary.vue +25 -0
- package/app/components/cart/summary/CartSummaryBreakdown.vue +35 -0
- package/app/components/cart/switcher/CartSwitcher.vue +147 -0
- package/app/components/cart/target/CartTargetModal.vue +129 -0
- package/app/components/cart/view/CartApprovalsPanel.vue +89 -0
- package/app/components/cart/view/CartListHeader.vue +86 -0
- package/app/components/cart/view/CartPositionList.vue +94 -0
- package/app/components/cart/view/CartSummaryPanel.vue +254 -0
- package/app/components/cart/view/CartView.vue +310 -0
- package/app/components/category/info/CategoryPrice.vue +47 -0
- package/app/components/category/info/CategorySku.vue +15 -0
- package/app/components/category/info/CategoryStock.vue +25 -0
- package/app/components/category/list/CategoryItemCount.vue +27 -0
- package/app/components/category/list/CategoryListPagination.vue +81 -0
- package/app/components/category/skeleton/CategoryDetailSkeleton.vue +12 -0
- package/app/components/category/skeleton/CategoryListSkeleton.vue +65 -0
- package/app/components/category/view/CategoryViewToggle.vue +33 -0
- package/app/components/category/view/GridView.vue +78 -0
- package/app/components/category/view/ListView.vue +80 -0
- package/app/components/checkout/confirmation/CheckoutConfirmationView.vue +289 -0
- package/app/components/checkout/form/CheckoutSchemaForm.vue +72 -0
- package/app/components/checkout/onepage/CheckoutAddressPickerModal.vue +260 -0
- package/app/components/checkout/onepage/CheckoutAddressSection.vue +186 -0
- package/app/components/checkout/onepage/CheckoutDeliverySection.vue +158 -0
- package/app/components/checkout/onepage/CheckoutGate.vue +67 -0
- package/app/components/checkout/onepage/CheckoutGuestDetailsSection.vue +154 -0
- package/app/components/checkout/onepage/CheckoutNotesSection.vue +62 -0
- package/app/components/checkout/onepage/CheckoutOnePageView.vue +77 -0
- package/app/components/checkout/onepage/CheckoutPaymentSection.vue +181 -0
- package/app/components/checkout/onepage/CheckoutSectionTitle.vue +18 -0
- package/app/components/checkout/onepage/CheckoutSummarySection.vue +211 -0
- package/app/components/checkout/onepage/CheckoutWorkflowPanel.vue +38 -0
- package/app/components/layout/AppLogo.vue +21 -0
- package/app/components/layout/footer/Footer.vue +148 -0
- package/app/components/layout/header/AppBar.vue +75 -0
- package/app/components/layout/header/CategoryNav.vue +93 -0
- package/app/components/layout/header/HeaderActionItem.vue +81 -0
- package/app/components/layout/header/LocaleSwitcher.vue +123 -0
- package/app/components/layout/header/MainNav.vue +61 -0
- package/app/components/layout/header/MobileMenu.vue +81 -0
- package/app/components/layout/header/TopBar.vue +63 -0
- package/app/components/listing/ListingView.vue +227 -0
- package/app/components/product/detail/ProductDetailAddToCart.vue +188 -0
- package/app/components/product/detail/ProductDetailDescription.vue +20 -0
- package/app/components/product/detail/ProductDetailImageGallery.vue +58 -0
- package/app/components/product/detail/ProductDetailPricing.vue +108 -0
- package/app/components/product/detail/ProductDetailSaveToList.vue +291 -0
- package/app/components/product/detail/ProductDetailSpecifications.vue +33 -0
- package/app/components/product/detail/ProductDetailStock.vue +36 -0
- package/app/components/search/filter/SearchFacets.vue +256 -0
- package/app/components/search/filter/SearchFacetsDrawer.vue +58 -0
- package/app/components/ui/AppShell.vue +7 -0
- package/app/components/ui/debug/PiniaStateCard.vue +106 -0
- package/app/components/ui/feedback/EmptyState.vue +30 -0
- package/app/components/ui/feedback/ErrorBoundary.vue +44 -0
- package/app/components/ui/feedback/NotFound.vue +34 -0
- package/app/components/ui/forms/CountrySelection.vue +14 -0
- package/app/components/ui/forms/FormKitDatePicker.vue +124 -0
- package/app/components/ui/forms/PasswordInput.vue +136 -0
- package/app/components/ui/forms/SearchInput.vue +213 -0
- package/app/components/ui/table/TableSortButton.vue +51 -0
- package/app/components/ui/table/TableToolbar.vue +66 -0
- package/app/composables/useAccount.ts +27 -0
- package/app/composables/useAccountAddresses.ts +116 -0
- package/app/composables/useAccountOrders.ts +18 -0
- package/app/composables/useAppUrl.ts +38 -0
- package/app/composables/useAuthStore.ts +202 -0
- package/app/composables/useB2BContext.ts +23 -0
- package/app/composables/useCartActions.ts +25 -0
- package/app/composables/useCartCalculation.ts +90 -0
- package/app/composables/useCartSelection.ts +46 -0
- package/app/composables/useCartStore.ts +837 -0
- package/app/composables/useCartSummaryFormatting.ts +28 -0
- package/app/composables/useCategories.ts +29 -0
- package/app/composables/useCheckoutOnePage.ts +438 -0
- package/app/composables/useCheckoutProfileSource.ts +8 -0
- package/app/composables/useCheckoutSchema.ts +28 -0
- package/app/composables/useDataTable.ts +14 -0
- package/app/composables/useFormValidation.ts +29 -0
- package/app/composables/useIcons.ts +17 -0
- package/app/composables/useLocalePreferences.ts +45 -0
- package/app/composables/useMarkets.ts +15 -0
- package/app/composables/useProduct.ts +89 -0
- package/app/composables/useProductCard.ts +8 -0
- package/app/composables/useProductCardActions.ts +106 -0
- package/app/composables/useProductImage.ts +12 -0
- package/app/composables/useProductListing.ts +210 -0
- package/app/composables/useProductUrl.ts +17 -0
- package/app/composables/useProducts.ts +130 -0
- package/app/composables/useSearch.ts +12 -0
- package/app/composables/useThemeStore.ts +81 -0
- package/app/composables/useViewMode.ts +18 -0
- package/app/config/countries.ts +74 -0
- package/app/config/icons.ts +283 -0
- package/app/config/navigation.ts +191 -0
- package/app/config/palette.ts +13 -0
- package/app/config/themes.ts +20 -0
- package/app/formkit.config.ts +50 -0
- package/app/interfaces/account/address-list.ts +34 -0
- package/app/interfaces/account/order-list.ts +47 -0
- package/app/interfaces/account/order-lists.ts +35 -0
- package/app/interfaces/account/profile.ts +17 -0
- package/app/interfaces/account.ts +3 -0
- package/app/interfaces/address.ts +9 -0
- package/app/interfaces/auth.ts +104 -0
- package/app/interfaces/b2b.ts +234 -0
- package/app/interfaces/cart-calculation.ts +131 -0
- package/app/interfaces/cart-item.ts +45 -0
- package/app/interfaces/checkout-draft.ts +4 -0
- package/app/interfaces/checkout.ts +43 -0
- package/app/interfaces/delivery.ts +13 -0
- package/app/interfaces/market.ts +24 -0
- package/app/interfaces/payment.ts +19 -0
- package/app/interfaces/persisted-cart.ts +10 -0
- package/app/interfaces/product-detail.ts +54 -0
- package/app/interfaces/product-list.ts +33 -0
- package/app/interfaces/search-facets.ts +14 -0
- package/app/interfaces/validation.ts +14 -0
- package/app/layouts/default.vue +78 -0
- package/app/layouts/focus.vue +80 -0
- package/app/plugins/formkit-locale.client.ts +23 -0
- package/app/shared/constants.ts +1 -0
- package/app/validations/companyName.ts +18 -0
- package/app/validations/emailFormat.ts +10 -0
- package/app/validations/formValidationConfig.ts +50 -0
- package/app/validations/maxLength.ts +12 -0
- package/app/validations/minLength.ts +9 -0
- package/app/validations/optionalCompanyName.ts +23 -0
- package/app/validations/passwordsMatch.ts +5 -0
- package/app/validations/phoneNumber.ts +19 -0
- package/app/validations/required.ts +11 -0
- package/app/validations/termsRequired.ts +4 -0
- package/app/validations/types.ts +10 -0
- package/app/validations/zipCode.ts +15 -0
- package/i18n/locales/de/account.json +458 -0
- package/i18n/locales/de/auth.json +155 -0
- package/i18n/locales/de/cart.json +263 -0
- package/i18n/locales/de/checkout.json +217 -0
- package/i18n/locales/de/common.json +80 -0
- package/i18n/locales/de/cover.json +33 -0
- package/i18n/locales/de/order.json +1 -0
- package/i18n/locales/de/product.json +71 -0
- package/i18n/locales/de/search.json +54 -0
- package/i18n/locales/de/validation.json +12 -0
- package/i18n/locales/en/account.json +458 -0
- package/i18n/locales/en/auth.json +155 -0
- package/i18n/locales/en/cart.json +263 -0
- package/i18n/locales/en/checkout.json +217 -0
- package/i18n/locales/en/common.json +80 -0
- package/i18n/locales/en/cover.json +33 -0
- package/i18n/locales/en/order.json +1 -0
- package/i18n/locales/en/product.json +71 -0
- package/i18n/locales/en/search.json +54 -0
- package/i18n/locales/en/validation.json +12 -0
- package/nuxt.config.ts +109 -0
- package/package.json +65 -0
- package/public/img/product-placeholder.svg +8 -0
- package/public/templates/direct-order-template.csv +3 -0
- package/public/templates/direct-order-template.xlsx +0 -0
- package/server/api/account/address/[id].delete.ts +51 -0
- package/server/api/account/address/[id].put.ts +83 -0
- package/server/api/account/address/index.post.ts +60 -0
- package/server/api/account/addresses.get.ts +25 -0
- package/server/api/account/context.get.ts +16 -0
- package/server/api/account/governance/[domain]/[id].put.ts +57 -0
- package/server/api/account/governance/[domain].post.ts +111 -0
- package/server/api/account/order-lists/[id].delete.ts +22 -0
- package/server/api/account/order-lists/[id].get.ts +17 -0
- package/server/api/account/order-lists/[id].put.ts +46 -0
- package/server/api/account/order-lists/index.get.ts +14 -0
- package/server/api/account/order-lists/index.post.ts +38 -0
- package/server/api/account/orders/[id].get.ts +35 -0
- package/server/api/account/orders.get.ts +35 -0
- package/server/api/account/profile.get.ts +56 -0
- package/server/api/account/profile.put.ts +128 -0
- package/server/api/account/requisitions/[id].get.ts +15 -0
- package/server/api/account/requisitions.get.ts +23 -0
- package/server/api/auth/login.post.ts +37 -0
- package/server/api/auth/logout.post.ts +4 -0
- package/server/api/auth/me.get.ts +3 -0
- package/server/api/auth/personas.get.ts +7 -0
- package/server/api/auth/recovery.post.ts +32 -0
- package/server/api/auth/recovery.put.ts +37 -0
- package/server/api/auth/register.post.ts +126 -0
- package/server/api/cart/calculate.post.ts +25 -0
- package/server/api/cart/export.post.ts +81 -0
- package/server/api/cart/index.delete.ts +10 -0
- package/server/api/cart/index.get.ts +10 -0
- package/server/api/cart/sync.post.ts +14 -0
- package/server/api/carts/[id]/activate.post.ts +18 -0
- package/server/api/carts/[id]/index.delete.ts +18 -0
- package/server/api/carts/[id]/index.put.ts +19 -0
- package/server/api/carts/[id]/items.post.ts +21 -0
- package/server/api/carts/index.get.ts +14 -0
- package/server/api/carts/index.post.ts +14 -0
- package/server/api/categories/[slug].get.ts +22 -0
- package/server/api/categories/index.get.ts +11 -0
- package/server/api/checkout/profile.get.ts +21 -0
- package/server/api/checkout/schema/[key].get.ts +19 -0
- package/server/api/checkout/session.post.ts +8 -0
- package/server/api/images/detail/[filename].get.ts +18 -0
- package/server/api/images/list/[filename].get.ts +17 -0
- package/server/api/markets.get.ts +9 -0
- package/server/api/orders/index.post.ts +376 -0
- package/server/api/payment/methods.post.ts +65 -0
- package/server/api/product/[id].get.ts +29 -0
- package/server/api/products/[id].get.ts +30 -0
- package/server/api/products/index.get.ts +21 -0
- package/server/api/requisitions/index.post.ts +67 -0
- package/server/api/shipping/rates.post.ts +70 -0
- package/server/api/themes/index.get.ts +9 -0
- package/server/api/typesense/drop.get.ts +22 -0
- package/server/api/typesense/health.get.ts +9 -0
- package/server/api/typesense/search.post.ts +199 -0
- package/server/api/typesense/seed.get.ts +112 -0
- package/server/api/typesense/suggest.post.ts +69 -0
- package/server/config/account/organization.json +146 -0
- package/server/config/account/personas.json +169 -0
- package/server/config/account/user.json +8 -0
- package/server/config/account/workflows.json +19 -0
- package/server/data/account/address-list.json +103 -0
- package/server/data/account/order-list.json +491 -0
- package/server/data/account/order-lists.json +149 -0
- package/server/data/account/profile.json +9 -0
- package/server/data/account/registration-requests.json +3 -0
- package/server/data/account/requisitions.json +686 -0
- package/server/data/categories.json +186 -0
- package/server/data/forms/checkout/add-address.json +24 -0
- package/server/data/list/5137-1.png +0 -0
- package/server/data/list/5498-1.png +0 -0
- package/server/data/list/5498-2.png +0 -0
- package/server/data/list/5498-3.png +0 -0
- package/server/data/list/5498-4.png +0 -0
- package/server/data/list/5498-5.png +0 -0
- package/server/data/list/5498-6.png +0 -0
- package/server/data/list/5519-1.png +0 -0
- package/server/data/list/5713-1.png +0 -0
- package/server/data/list/5789-1.png +0 -0
- package/server/data/list/5930-1.png +0 -0
- package/server/data/list/6127-1.png +0 -0
- package/server/data/list/6234-1.png +0 -0
- package/server/data/list/6238-1.png +0 -0
- package/server/data/list/6246-1.png +0 -0
- package/server/data/list/6270-1.png +0 -0
- package/server/data/list/6330-1.png +0 -0
- package/server/data/list/6336-1.png +0 -0
- package/server/data/list/6360-1.png +0 -0
- package/server/data/list/6363-1.png +0 -0
- package/server/data/list/6375-1.png +0 -0
- package/server/data/list/6385-1.png +0 -0
- package/server/data/list/6413-1.png +0 -0
- package/server/data/list/6418-1.png +0 -0
- package/server/data/list/6465-1.png +0 -0
- package/server/data/list/6477-1.png +0 -0
- package/server/data/list/6509-1.png +0 -0
- package/server/data/list/6545-1.png +0 -0
- package/server/data/list/6548-1.png +0 -0
- package/server/data/list/6566-1.png +0 -0
- package/server/data/list/6581-1.png +0 -0
- package/server/data/list/6609-1.png +0 -0
- package/server/data/list/6611-1.png +0 -0
- package/server/data/list/6641-1.png +0 -0
- package/server/data/list/6659-1.png +0 -0
- package/server/data/list/6662-1.png +0 -0
- package/server/data/list/6689-1.png +0 -0
- package/server/data/list/6698-1.png +0 -0
- package/server/data/list/6701-1.png +0 -0
- package/server/data/list/6752-1.png +0 -0
- package/server/data/list/6755-1.png +0 -0
- package/server/data/list/6837-1.png +0 -0
- package/server/data/list/6841-1.png +0 -0
- package/server/data/list/6844-1.png +0 -0
- package/server/data/list/6846-1.png +0 -0
- package/server/data/list/6886-1.png +0 -0
- package/server/data/list/6895-1.png +0 -0
- package/server/data/list/6897-1.png +0 -0
- package/server/data/list/6919-1.png +0 -0
- package/server/data/list/6977-1.png +0 -0
- package/server/data/list/6983-1.png +0 -0
- package/server/data/list/6984-1.png +0 -0
- package/server/data/list/6985-1.png +0 -0
- package/server/data/list/6986-1.png +0 -0
- package/server/data/list/6989-1.png +0 -0
- package/server/data/list/6995-1.png +0 -0
- package/server/data/list/6998-1.png +0 -0
- package/server/data/markets.json +24 -0
- package/server/data/product-detail.json +2450 -0
- package/server/data/product-list.json +2450 -0
- package/server/data/themes.json +8 -0
- package/server/interfaces/account.ts +20 -0
- package/server/interfaces/auth.ts +32 -0
- package/server/interfaces/b2bContext.ts +23 -0
- package/server/interfaces/cart.ts +46 -0
- package/server/interfaces/cartCalculation.ts +17 -0
- package/server/interfaces/category.ts +12 -0
- package/server/interfaces/checkoutProfile.ts +5 -0
- package/server/interfaces/log.ts +3 -0
- package/server/interfaces/market.ts +10 -0
- package/server/interfaces/product.ts +21 -0
- package/server/interfaces/schema.ts +20 -0
- package/server/interfaces/theme.ts +10 -0
- package/server/services/ApiAuthService.ts +138 -0
- package/server/services/ApiCartService.ts +254 -0
- package/server/services/ApiCategoryService.ts +25 -0
- package/server/services/ApiMarketService.ts +71 -0
- package/server/services/ApiProductService.ts +53 -0
- package/server/services/LocalFileCategoryService.ts +23 -0
- package/server/services/LocalFileCheckoutProfileService.ts +117 -0
- package/server/services/LocalFileProductService.ts +128 -0
- package/server/services/LocalFileSchemaService.ts +70 -0
- package/server/services/LocalFileThemeService.ts +18 -0
- package/server/services/LogService.ts +28 -0
- package/server/services/MockAccountService.ts +58 -0
- package/server/services/MockAuthService.ts +105 -0
- package/server/services/MockB2BContextService.ts +149 -0
- package/server/services/MockCartCalculationService.ts +395 -0
- package/server/services/MockMarketService.ts +18 -0
- package/server/services/SdkAccountService.ts +56 -0
- package/server/services/SdkAuthService.ts +83 -0
- package/server/services/SessionCartService.ts +31 -0
- package/server/utils/accountService.ts +30 -0
- package/server/utils/authCookie.ts +13 -0
- package/server/utils/authService.ts +43 -0
- package/server/utils/b2bService.ts +49 -0
- package/server/utils/cartService.ts +59 -0
- package/server/utils/categoryService.ts +19 -0
- package/server/utils/checkoutProfileService.ts +9 -0
- package/server/utils/checkoutSession.ts +38 -0
- package/server/utils/coverData.ts +84 -0
- package/server/utils/governanceStore.ts +38 -0
- package/server/utils/i18n.ts +76 -0
- package/server/utils/inventoryService.ts +14 -0
- package/server/utils/liveCatalog.ts +234 -0
- package/server/utils/liveInventories.ts +76 -0
- package/server/utils/liveOrders.ts +139 -0
- package/server/utils/livePrices.ts +93 -0
- package/server/utils/locale.ts +39 -0
- package/server/utils/logService.ts +19 -0
- package/server/utils/marketService.ts +24 -0
- package/server/utils/orderService.ts +14 -0
- package/server/utils/paymentService.ts +14 -0
- package/server/utils/priceService.ts +14 -0
- package/server/utils/productService.ts +28 -0
- package/server/utils/productsSchema.ts +30 -0
- package/server/utils/revenexxApi.ts +136 -0
- package/server/utils/schemaService.ts +25 -0
- package/server/utils/serviceMode.ts +70 -0
- package/server/utils/shippingService.ts +14 -0
- package/server/utils/shopSdk.ts +88 -0
- package/server/utils/themeService.ts +16 -0
- package/server/utils/typesense.ts +27 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const COLLECTION_NAME = "products";
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async () => {
|
|
4
|
+
const ts = useTypesense();
|
|
5
|
+
|
|
6
|
+
try {
|
|
7
|
+
const collections = await ts.collections().retrieve();
|
|
8
|
+
const exists = collections.some(c => c.name === COLLECTION_NAME);
|
|
9
|
+
|
|
10
|
+
if (!exists) {
|
|
11
|
+
return { deleted: false, message: `Collection '${COLLECTION_NAME}' does not exist.` };
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
await ts.collections(COLLECTION_NAME).delete();
|
|
15
|
+
|
|
16
|
+
return { deleted: true, message: `Collection '${COLLECTION_NAME}' deleted.` };
|
|
17
|
+
}
|
|
18
|
+
catch (err) {
|
|
19
|
+
getLogService().error("Typesense error: drop", toErrorContext(err));
|
|
20
|
+
throw createError({ statusCode: 503, message: "Search service unavailable" });
|
|
21
|
+
}
|
|
22
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default defineEventHandler(async () => {
|
|
2
|
+
try {
|
|
3
|
+
return await useTypesense().health.retrieve();
|
|
4
|
+
}
|
|
5
|
+
catch (err) {
|
|
6
|
+
getLogService().error("Typesense error: health", toErrorContext(err));
|
|
7
|
+
throw createError({ statusCode: 503, message: "Search service unavailable" });
|
|
8
|
+
}
|
|
9
|
+
});
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import type { ProductList } from "../../../app/interfaces/product-list";
|
|
2
|
+
import type { SearchFacet } from "../../../app/interfaces/search-facets";
|
|
3
|
+
|
|
4
|
+
import { FACET_FIELDS, PRODUCTS_COLLECTION } from "../../utils/productsSchema";
|
|
5
|
+
|
|
6
|
+
type SortOption = "relevance" | "price_asc" | "price_desc" | "name_asc" | "name_desc";
|
|
7
|
+
|
|
8
|
+
const SORT_MAP: Record<SortOption, string> = {
|
|
9
|
+
relevance: "_text_match:desc",
|
|
10
|
+
price_asc: "price:asc",
|
|
11
|
+
price_desc: "price:desc",
|
|
12
|
+
name_asc: "name:asc",
|
|
13
|
+
name_desc: "name:desc",
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
interface SearchBody {
|
|
17
|
+
q: string;
|
|
18
|
+
filters?: Record<string, string[]>;
|
|
19
|
+
priceRange?: { min?: number; max?: number };
|
|
20
|
+
sort?: SortOption;
|
|
21
|
+
page?: number;
|
|
22
|
+
perPage?: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default defineEventHandler(async (event) => {
|
|
26
|
+
const {
|
|
27
|
+
q,
|
|
28
|
+
filters,
|
|
29
|
+
priceRange,
|
|
30
|
+
sort = "relevance",
|
|
31
|
+
page = 1,
|
|
32
|
+
perPage = 20,
|
|
33
|
+
} = await readBody<SearchBody>(event);
|
|
34
|
+
|
|
35
|
+
if (!q?.trim()) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Live mode searches the platform's real Typesense index through the
|
|
40
|
+
// public API. The live collection has no price/stock fields (yet), so
|
|
41
|
+
// price filters and price sorts degrade to relevance gracefully.
|
|
42
|
+
if (resolveProductServiceKey(event) === "api") {
|
|
43
|
+
const locale = resolveLocale(event);
|
|
44
|
+
const liveFilterParts = [`locale:=${tsFilterValue(locale)}`, "enabled:=true"];
|
|
45
|
+
|
|
46
|
+
if (filters) {
|
|
47
|
+
// The storefront filters with the demo-schema field names; the
|
|
48
|
+
// live collection (search.json) names them differently. Category
|
|
49
|
+
// slugs ARE the live category codes, but products carry their
|
|
50
|
+
// LEAF code only — a top-level category expands to its children.
|
|
51
|
+
// Unknown fields are dropped instead of 400ing the request.
|
|
52
|
+
const categoryCodes: string[] = [];
|
|
53
|
+
const tree = await getLiveCategories(locale);
|
|
54
|
+
|
|
55
|
+
for (const [field, values] of Object.entries(filters)) {
|
|
56
|
+
if (!values?.length) {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
if (field === "categorySlug" || field === "subcategorySlug" || field === "categories") {
|
|
60
|
+
for (const value of values) {
|
|
61
|
+
const node = tree.find(c => c.slug === value);
|
|
62
|
+
categoryCodes.push(value, ...(node?.subcategories.map(s => s.slug) ?? []));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
else if (field === "manufacturer" || field === "kind") {
|
|
66
|
+
liveFilterParts.push(`${field}:=[${values.map(v => tsFilterValue(v)).join(",")}]`);
|
|
67
|
+
}
|
|
68
|
+
else if (field === "available" || field === "enabled") {
|
|
69
|
+
// enabled:=true is already pinned; an explicit "false" can
|
|
70
|
+
// never match — keep the pinned filter authoritative.
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (categoryCodes.length) {
|
|
75
|
+
liveFilterParts.push(`categories:=[${[...new Set(categoryCodes)].map(tsFilterValue).join(",")}]`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
try {
|
|
80
|
+
const results = await searchLiveProducts({
|
|
81
|
+
q,
|
|
82
|
+
queryBy: "name,sku,description,manufacturer",
|
|
83
|
+
filterBy: liveFilterParts.join(" && "),
|
|
84
|
+
// category_labels is a locale-templated field and not a facet in
|
|
85
|
+
// the deployed schema — categories (codes) is the stable facet.
|
|
86
|
+
facetBy: "manufacturer,kind,categories",
|
|
87
|
+
page,
|
|
88
|
+
perPage,
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
let products: ProductList[] = (results.hits ?? []).map(hit => mapLiveDocToProduct(hit.document));
|
|
92
|
+
if (resolvePriceServiceKey(event) === "api") {
|
|
93
|
+
products = await enrichProductsWithLivePrices(event, products);
|
|
94
|
+
}
|
|
95
|
+
if (resolveInventoryServiceKey(event) === "api") {
|
|
96
|
+
products = await enrichProductsWithLiveAvailability(event, products);
|
|
97
|
+
}
|
|
98
|
+
const facets: SearchFacet[] = (results.facet_counts ?? []).map(fc => ({
|
|
99
|
+
fieldName: fc.field_name,
|
|
100
|
+
counts: (fc.counts ?? []).map(c => ({ value: c.value, count: c.count })),
|
|
101
|
+
}));
|
|
102
|
+
|
|
103
|
+
return {
|
|
104
|
+
products,
|
|
105
|
+
facets,
|
|
106
|
+
found: results.found,
|
|
107
|
+
page: results.page ?? page,
|
|
108
|
+
perPage,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
catch (err) {
|
|
112
|
+
getLogService().error("API error: search", apiErrorContext(err));
|
|
113
|
+
throw createError({ statusCode: 503, message: "Search service unavailable" });
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const ts = useTypesense();
|
|
118
|
+
|
|
119
|
+
const filterParts: string[] = [];
|
|
120
|
+
|
|
121
|
+
if (filters) {
|
|
122
|
+
for (const [field, values] of Object.entries(filters)) {
|
|
123
|
+
if (values?.length) {
|
|
124
|
+
const isBool = values.every(v => v === "true" || v === "false");
|
|
125
|
+
const joined = isBool
|
|
126
|
+
? values.join(",")
|
|
127
|
+
: values.map(v => `\`${v}\``).join(",");
|
|
128
|
+
filterParts.push(`${field}:=[${joined}]`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// priceRange values are in euros; multiply by 100 to match stored cents
|
|
134
|
+
if (priceRange?.min !== undefined) {
|
|
135
|
+
filterParts.push(`price:>=${priceRange.min * 100}`);
|
|
136
|
+
}
|
|
137
|
+
if (priceRange?.max !== undefined) {
|
|
138
|
+
filterParts.push(`price:<=${priceRange.max * 100}`);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const sortBy = SORT_MAP[sort] ?? SORT_MAP.relevance;
|
|
142
|
+
|
|
143
|
+
try {
|
|
144
|
+
const results = await ts.collections(PRODUCTS_COLLECTION).documents().search({
|
|
145
|
+
q,
|
|
146
|
+
query_by: "name,sku",
|
|
147
|
+
facet_by: FACET_FIELDS.join(","),
|
|
148
|
+
num_typos: 2,
|
|
149
|
+
...(filterParts.length ? { filter_by: filterParts.join(" && ") } : {}),
|
|
150
|
+
sort_by: sortBy,
|
|
151
|
+
page,
|
|
152
|
+
per_page: perPage,
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
// The index stores a flattened document (prices as one map, taxRate
|
|
156
|
+
// and stockQuantity as scalars) — normalize back to the ProductList
|
|
157
|
+
// contract here so cards can price, tax and add-to-cart the hits.
|
|
158
|
+
const products: ProductList[] = (results.hits ?? []).map((hit) => {
|
|
159
|
+
const doc = hit.document as unknown as Omit<ProductList, "id" | "prices" | "tax"> & {
|
|
160
|
+
id: string;
|
|
161
|
+
prices?: Record<string, number> | Record<string, number>[];
|
|
162
|
+
taxRate?: number;
|
|
163
|
+
stockQuantity?: number;
|
|
164
|
+
};
|
|
165
|
+
const prices = Array.isArray(doc.prices)
|
|
166
|
+
? doc.prices
|
|
167
|
+
: doc.prices
|
|
168
|
+
? [doc.prices]
|
|
169
|
+
: [];
|
|
170
|
+
return {
|
|
171
|
+
...doc,
|
|
172
|
+
id: String(doc.id),
|
|
173
|
+
prices,
|
|
174
|
+
tax: { rate: doc.taxRate ?? 19 },
|
|
175
|
+
isOutOfStock: (doc.stockQuantity ?? 0) <= 0,
|
|
176
|
+
};
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
const facets: SearchFacet[] = (results.facet_counts ?? []).map(fc => ({
|
|
180
|
+
fieldName: fc.field_name,
|
|
181
|
+
counts: (fc.counts ?? []).map(c => ({
|
|
182
|
+
value: c.value,
|
|
183
|
+
count: c.count,
|
|
184
|
+
})),
|
|
185
|
+
}));
|
|
186
|
+
|
|
187
|
+
return {
|
|
188
|
+
products,
|
|
189
|
+
facets,
|
|
190
|
+
found: results.found,
|
|
191
|
+
page: results.page ?? page,
|
|
192
|
+
perPage,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
catch (err) {
|
|
196
|
+
getLogService().error("Typesense error: search", toErrorContext(err));
|
|
197
|
+
throw createError({ statusCode: 503, message: "Search service unavailable" });
|
|
198
|
+
}
|
|
199
|
+
});
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import productsData from "../../data/product-list.json";
|
|
2
|
+
import { PRODUCTS_COLLECTION, productsSchema } from "../../utils/productsSchema";
|
|
3
|
+
|
|
4
|
+
const MAX_COUNT = 5000;
|
|
5
|
+
|
|
6
|
+
function mapEntry(entry: (typeof productsData)[number], idOffset: number) {
|
|
7
|
+
const product = entry.product[0];
|
|
8
|
+
const stock = entry.stocks[0];
|
|
9
|
+
const prices = entry.prices[0] as Record<string, number>;
|
|
10
|
+
const longDescription = entry.descriptions.find(d => d.type === "long");
|
|
11
|
+
const mainCategory = entry.categories.find(c => c.type === "main");
|
|
12
|
+
const subcategory = entry.categories.find(c => c.type === "subcategory");
|
|
13
|
+
const slugCategory = entry.categories.find(c => c.type === "slug");
|
|
14
|
+
const mainImage = entry.images.find(i => i.priority === 1);
|
|
15
|
+
const basePrice = prices["1"] ?? Object.values(prices)[0] ?? 0;
|
|
16
|
+
|
|
17
|
+
const slugPath = slugCategory?.name ?? "";
|
|
18
|
+
const slugSegments = slugPath.split("/").filter(Boolean);
|
|
19
|
+
const categorySlug = slugSegments[0] ?? "";
|
|
20
|
+
const candidateSubcategory = slugSegments[1];
|
|
21
|
+
const subcategorySlug = candidateSubcategory
|
|
22
|
+
&& candidateSubcategory !== "product"
|
|
23
|
+
&& candidateSubcategory !== "products"
|
|
24
|
+
? candidateSubcategory
|
|
25
|
+
: undefined;
|
|
26
|
+
|
|
27
|
+
const id = idOffset === 0 ? product.id : product.id + idOffset * 100_000;
|
|
28
|
+
const suffix = idOffset === 0 ? "" : ` #${idOffset}`;
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
id: String(id),
|
|
32
|
+
name: `${product.name}${suffix}`,
|
|
33
|
+
sku: idOffset === 0 ? product.sku : `${product.sku}-${idOffset}`,
|
|
34
|
+
manufacturer: product.manufacturer,
|
|
35
|
+
available: stock.quantity > 0,
|
|
36
|
+
stockQuantity: stock.quantity,
|
|
37
|
+
price: basePrice,
|
|
38
|
+
prices,
|
|
39
|
+
description: longDescription?.content,
|
|
40
|
+
category: mainCategory?.name ?? "",
|
|
41
|
+
categorySlug,
|
|
42
|
+
subcategory: subcategory?.name,
|
|
43
|
+
...(subcategorySlug ? { subcategorySlug } : {}),
|
|
44
|
+
slug: idOffset === 0 ? slugPath : `${slugPath}-${idOffset}`,
|
|
45
|
+
image: mainImage?.url,
|
|
46
|
+
taxRate: entry.tax.rate,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default defineEventHandler(async (event) => {
|
|
51
|
+
const query = getQuery(event);
|
|
52
|
+
const requestedCount = parseInt(String(query.count ?? "0"), 10);
|
|
53
|
+
const targetCount = requestedCount > 0
|
|
54
|
+
? Math.min(requestedCount, MAX_COUNT)
|
|
55
|
+
: productsData.length;
|
|
56
|
+
|
|
57
|
+
const ts = useTypesense();
|
|
58
|
+
|
|
59
|
+
try {
|
|
60
|
+
const collections = await ts.collections().retrieve();
|
|
61
|
+
const exists = collections.some(c => c.name === PRODUCTS_COLLECTION);
|
|
62
|
+
if (exists) {
|
|
63
|
+
await ts.collections(PRODUCTS_COLLECTION).delete();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
await ts.collections().create(productsSchema);
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
getLogService().error("Typesense error: seed collection setup", toErrorContext(err));
|
|
70
|
+
throw createError({ statusCode: 503, message: "Search service unavailable" });
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const documents: ReturnType<typeof mapEntry>[] = [];
|
|
74
|
+
let idOffset = 0;
|
|
75
|
+
|
|
76
|
+
while (documents.length < targetCount) {
|
|
77
|
+
for (const entry of productsData) {
|
|
78
|
+
if (documents.length >= targetCount) {
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
documents.push(mapEntry(entry, idOffset));
|
|
82
|
+
}
|
|
83
|
+
idOffset++;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
let result: { success: boolean; error?: string; document?: unknown }[] = [];
|
|
87
|
+
|
|
88
|
+
try {
|
|
89
|
+
result = await ts.collections(PRODUCTS_COLLECTION).documents().import(
|
|
90
|
+
documents,
|
|
91
|
+
{ action: "upsert" },
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
catch (e: unknown) {
|
|
95
|
+
if (e && typeof e === "object" && "importResults" in e) {
|
|
96
|
+
result = (e as { importResults: typeof result }).importResults;
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
getLogService().error("Typesense error: seed import", toErrorContext(e));
|
|
100
|
+
throw e;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const failed = result.filter(r => !r.success);
|
|
105
|
+
|
|
106
|
+
return {
|
|
107
|
+
total: documents.length,
|
|
108
|
+
indexed: documents.length - failed.length,
|
|
109
|
+
failed: failed.length,
|
|
110
|
+
errors: failed,
|
|
111
|
+
};
|
|
112
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export default defineEventHandler(async (event) => {
|
|
2
|
+
const { q } = await readBody<{ q: string }>(event);
|
|
3
|
+
|
|
4
|
+
if (!q?.trim()) {
|
|
5
|
+
return { suggestions: [] };
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// Live mode queries the platform's real Typesense index through the
|
|
9
|
+
// public API; the local docker index stays the mock implementation.
|
|
10
|
+
if (resolveProductServiceKey(event) === "api") {
|
|
11
|
+
const locale = resolveLocale(event);
|
|
12
|
+
try {
|
|
13
|
+
const results = await searchLiveProducts({
|
|
14
|
+
q,
|
|
15
|
+
queryBy: "name,sku",
|
|
16
|
+
filterBy: `locale:=${tsFilterValue(locale)} && enabled:=true`,
|
|
17
|
+
perPage: 6,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
suggestions: (results.hits ?? []).map((hit) => {
|
|
22
|
+
const doc = hit.document;
|
|
23
|
+
return {
|
|
24
|
+
id: doc.entity_id,
|
|
25
|
+
name: doc.name,
|
|
26
|
+
sku: doc.sku,
|
|
27
|
+
category: doc.category_labels?.[0] ?? doc.categories?.[0] ?? "",
|
|
28
|
+
categorySlug: doc.categories?.[0] ?? "",
|
|
29
|
+
subcategorySlug: undefined,
|
|
30
|
+
};
|
|
31
|
+
}),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
getLogService().error("API error: suggest", apiErrorContext(err));
|
|
36
|
+
throw createError({ statusCode: 503, message: "Search service unavailable" });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const ts = useTypesense();
|
|
41
|
+
|
|
42
|
+
try {
|
|
43
|
+
const results = await ts.collections("products").documents().search({
|
|
44
|
+
q,
|
|
45
|
+
query_by: "name,sku",
|
|
46
|
+
per_page: 6,
|
|
47
|
+
prefix: true,
|
|
48
|
+
num_typos: 2,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
return {
|
|
52
|
+
suggestions: (results.hits ?? []).map((hit) => {
|
|
53
|
+
const doc = hit.document as Record<string, unknown>;
|
|
54
|
+
return {
|
|
55
|
+
id: String(doc.id),
|
|
56
|
+
name: doc.name as string,
|
|
57
|
+
sku: doc.sku as string,
|
|
58
|
+
category: doc.category as string,
|
|
59
|
+
categorySlug: doc.categorySlug as string,
|
|
60
|
+
subcategorySlug: doc.subcategorySlug as string | undefined,
|
|
61
|
+
};
|
|
62
|
+
}),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
getLogService().error("Typesense error: suggest", toErrorContext(err));
|
|
67
|
+
throw createError({ statusCode: 503, message: "Search service unavailable" });
|
|
68
|
+
}
|
|
69
|
+
});
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Demo GmbH",
|
|
3
|
+
"settings": {
|
|
4
|
+
"costCenters": {
|
|
5
|
+
"enabled": true,
|
|
6
|
+
"required": false
|
|
7
|
+
},
|
|
8
|
+
"workflows": {
|
|
9
|
+
"enabled": true
|
|
10
|
+
},
|
|
11
|
+
"cart": {
|
|
12
|
+
"exportEnabled": true,
|
|
13
|
+
"priceDisplay": "net",
|
|
14
|
+
"minOrderValue": 250,
|
|
15
|
+
"multipleCarts": true
|
|
16
|
+
},
|
|
17
|
+
"approvals": {
|
|
18
|
+
"enabled": true
|
|
19
|
+
},
|
|
20
|
+
"checkout": {
|
|
21
|
+
"guestOrdering": {
|
|
22
|
+
"b2b": true,
|
|
23
|
+
"b2c": true
|
|
24
|
+
},
|
|
25
|
+
"orderNumberRequired": false
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"costCenters": [
|
|
29
|
+
{
|
|
30
|
+
"id": "cc-1",
|
|
31
|
+
"code": "CC-100",
|
|
32
|
+
"label": "Marketing"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"id": "cc-2",
|
|
36
|
+
"code": "CC-200",
|
|
37
|
+
"label": "Engineering",
|
|
38
|
+
"limit": {
|
|
39
|
+
"id": "lim-cc-2",
|
|
40
|
+
"type": "budget",
|
|
41
|
+
"subject": {
|
|
42
|
+
"type": "cost-center",
|
|
43
|
+
"costCenterId": "cc-2"
|
|
44
|
+
},
|
|
45
|
+
"label": "Kostenstellen-Budget Engineering",
|
|
46
|
+
"totalBudget": 2000,
|
|
47
|
+
"availableBudget": 450,
|
|
48
|
+
"currency": "EUR",
|
|
49
|
+
"active": true,
|
|
50
|
+
"approval": {
|
|
51
|
+
"required": true,
|
|
52
|
+
"approverId": "persona-approver",
|
|
53
|
+
"approverName": "Achim Approver",
|
|
54
|
+
"deputyId": "persona-admin",
|
|
55
|
+
"deputyName": "Ada Admin",
|
|
56
|
+
"deputyTimeLimitHours": 24,
|
|
57
|
+
"timeLimitHours": 48
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"id": "cc-3",
|
|
63
|
+
"code": "CC-300",
|
|
64
|
+
"label": "Operations"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"id": "cc-4",
|
|
68
|
+
"code": "CC-400",
|
|
69
|
+
"label": "Vertrieb Außendienst",
|
|
70
|
+
"limit": {
|
|
71
|
+
"id": "lim-cc-4",
|
|
72
|
+
"type": "budget",
|
|
73
|
+
"subject": {
|
|
74
|
+
"type": "cost-center",
|
|
75
|
+
"costCenterId": "cc-4"
|
|
76
|
+
},
|
|
77
|
+
"label": "Budget Vertrieb Außendienst",
|
|
78
|
+
"totalBudget": 15000,
|
|
79
|
+
"availableBudget": 11200,
|
|
80
|
+
"currency": "EUR",
|
|
81
|
+
"active": true,
|
|
82
|
+
"approval": {
|
|
83
|
+
"required": true,
|
|
84
|
+
"approverId": "persona-admin",
|
|
85
|
+
"approverName": "Ada Admin",
|
|
86
|
+
"timeLimitHours": 72
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"id": "cc-5",
|
|
92
|
+
"code": "CC-500",
|
|
93
|
+
"label": "IT & Infrastruktur",
|
|
94
|
+
"limit": {
|
|
95
|
+
"id": "lim-cc-5",
|
|
96
|
+
"type": "budget",
|
|
97
|
+
"subject": {
|
|
98
|
+
"type": "cost-center",
|
|
99
|
+
"costCenterId": "cc-5"
|
|
100
|
+
},
|
|
101
|
+
"label": "IT-Budget Q2",
|
|
102
|
+
"totalBudget": 25000,
|
|
103
|
+
"availableBudget": 3100,
|
|
104
|
+
"currency": "EUR",
|
|
105
|
+
"active": true,
|
|
106
|
+
"approval": {
|
|
107
|
+
"required": true,
|
|
108
|
+
"approverId": "persona-approver",
|
|
109
|
+
"approverName": "Achim Approver",
|
|
110
|
+
"deputyId": "persona-admin",
|
|
111
|
+
"deputyName": "Ada Admin",
|
|
112
|
+
"deputyTimeLimitHours": 24,
|
|
113
|
+
"timeLimitHours": 24
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"id": "cc-6",
|
|
119
|
+
"code": "CC-600",
|
|
120
|
+
"label": "Fuhrpark"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"id": "cc-7",
|
|
124
|
+
"code": "CC-700",
|
|
125
|
+
"label": "Arbeitssicherheit",
|
|
126
|
+
"limit": {
|
|
127
|
+
"id": "lim-cc-7",
|
|
128
|
+
"type": "budget",
|
|
129
|
+
"subject": {
|
|
130
|
+
"type": "cost-center",
|
|
131
|
+
"costCenterId": "cc-7"
|
|
132
|
+
},
|
|
133
|
+
"label": "Budget Arbeitssicherheit",
|
|
134
|
+
"totalBudget": 8000,
|
|
135
|
+
"availableBudget": 7650,
|
|
136
|
+
"currency": "EUR",
|
|
137
|
+
"active": true,
|
|
138
|
+
"approval": {
|
|
139
|
+
"required": false,
|
|
140
|
+
"approverId": "persona-admin",
|
|
141
|
+
"approverName": "Ada Admin"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
}
|