qeai-sdk 2.0.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/dist/constants/auth-commands.constant.d.ts +25 -0
- package/dist/constants/auth-commands.constant.js +25 -0
- package/dist/constants/category-commands.constant.d.ts +35 -0
- package/dist/constants/category-commands.constant.js +35 -0
- package/dist/constants/chain-commands.constant.d.ts +35 -0
- package/dist/constants/chain-commands.constant.js +35 -0
- package/dist/constants/index.d.ts +29 -0
- package/dist/constants/index.js +39 -0
- package/dist/constants/ingredient-commands.constant.d.ts +38 -0
- package/dist/constants/ingredient-commands.constant.js +38 -0
- package/dist/constants/order-commands.constant.d.ts +34 -0
- package/dist/constants/order-commands.constant.js +34 -0
- package/dist/constants/payment-commands.constant.d.ts +31 -0
- package/dist/constants/payment-commands.constant.js +31 -0
- package/dist/constants/payment-events.constant.d.ts +17 -0
- package/dist/constants/payment-events.constant.js +17 -0
- package/dist/constants/product-commands.constant.d.ts +119 -0
- package/dist/constants/product-commands.constant.js +126 -0
- package/dist/constants/product-events.constant.d.ts +32 -0
- package/dist/constants/product-events.constant.js +32 -0
- package/dist/constants/question-commands.constant.d.ts +43 -0
- package/dist/constants/question-commands.constant.js +43 -0
- package/dist/constants/restaurant-commands.constant.d.ts +33 -0
- package/dist/constants/restaurant-commands.constant.js +33 -0
- package/dist/constants/tag-commands.constant.d.ts +44 -0
- package/dist/constants/tag-commands.constant.js +44 -0
- package/dist/dtos/auth/index.d.ts +10 -0
- package/dist/dtos/auth/index.js +10 -0
- package/dist/dtos/auth/login-user.dto.d.ts +24 -0
- package/dist/dtos/auth/login-user.dto.js +44 -0
- package/dist/dtos/auth/register-user.dto.d.ts +30 -0
- package/dist/dtos/auth/register-user.dto.js +56 -0
- package/dist/dtos/categories/create-category.dto.d.ts +38 -0
- package/dist/dtos/categories/create-category.dto.js +69 -0
- package/dist/dtos/categories/delete-category.dto.d.ts +24 -0
- package/dist/dtos/categories/delete-category.dto.js +44 -0
- package/dist/dtos/categories/index.d.ts +11 -0
- package/dist/dtos/categories/index.js +11 -0
- package/dist/dtos/categories/update-category.dto.d.ts +26 -0
- package/dist/dtos/categories/update-category.dto.js +48 -0
- package/dist/dtos/chain/create-chain.dto.d.ts +43 -0
- package/dist/dtos/chain/create-chain.dto.js +75 -0
- package/dist/dtos/chain/delete-chain.dto.d.ts +24 -0
- package/dist/dtos/chain/delete-chain.dto.js +44 -0
- package/dist/dtos/chain/index.d.ts +11 -0
- package/dist/dtos/chain/index.js +11 -0
- package/dist/dtos/chain/update-chain.dto.d.ts +26 -0
- package/dist/dtos/chain/update-chain.dto.js +48 -0
- package/dist/dtos/common/index.d.ts +9 -0
- package/dist/dtos/common/index.js +9 -0
- package/dist/dtos/common/pagination.dto.d.ts +27 -0
- package/dist/dtos/common/pagination.dto.js +50 -0
- package/dist/dtos/index.d.ts +28 -0
- package/dist/dtos/index.js +40 -0
- package/dist/dtos/ingredients/create-ingredient.dto.d.ts +31 -0
- package/dist/dtos/ingredients/create-ingredient.dto.js +58 -0
- package/dist/dtos/ingredients/delete-ingredient.dto.d.ts +24 -0
- package/dist/dtos/ingredients/delete-ingredient.dto.js +44 -0
- package/dist/dtos/ingredients/index.d.ts +12 -0
- package/dist/dtos/ingredients/index.js +12 -0
- package/dist/dtos/ingredients/search-by-name.dto.d.ts +18 -0
- package/dist/dtos/ingredients/search-by-name.dto.js +33 -0
- package/dist/dtos/ingredients/update-ingredient.dto.d.ts +26 -0
- package/dist/dtos/ingredients/update-ingredient.dto.js +48 -0
- package/dist/dtos/orders/change-order-status.dto.d.ts +25 -0
- package/dist/dtos/orders/change-order-status.dto.js +43 -0
- package/dist/dtos/orders/create-order.dto.d.ts +62 -0
- package/dist/dtos/orders/create-order.dto.js +111 -0
- package/dist/dtos/orders/index.d.ts +14 -0
- package/dist/dtos/orders/index.js +14 -0
- package/dist/dtos/orders/order-item.dto.d.ts +65 -0
- package/dist/dtos/orders/order-item.dto.js +120 -0
- package/dist/dtos/orders/order-pagination.dto.d.ts +19 -0
- package/dist/dtos/orders/order-pagination.dto.js +34 -0
- package/dist/dtos/orders/paid-order.dto.d.ts +30 -0
- package/dist/dtos/orders/paid-order.dto.js +54 -0
- package/dist/dtos/orders/update-order.dto.d.ts +13 -0
- package/dist/dtos/orders/update-order.dto.js +13 -0
- package/dist/dtos/payments/index.d.ts +11 -0
- package/dist/dtos/payments/index.js +11 -0
- package/dist/dtos/payments/payment-session-item.dto.d.ts +70 -0
- package/dist/dtos/payments/payment-session-item.dto.js +129 -0
- package/dist/dtos/payments/payment-session.dto.d.ts +63 -0
- package/dist/dtos/payments/payment-session.dto.js +111 -0
- package/dist/dtos/payments/webhook-data.dto.d.ts +39 -0
- package/dist/dtos/payments/webhook-data.dto.js +68 -0
- package/dist/dtos/products/create-product.dto.d.ts +54 -0
- package/dist/dtos/products/create-product.dto.js +99 -0
- package/dist/dtos/products/delete-product.dto.d.ts +24 -0
- package/dist/dtos/products/delete-product.dto.js +44 -0
- package/dist/dtos/products/index.d.ts +12 -0
- package/dist/dtos/products/index.js +13 -0
- package/dist/dtos/products/submodules/index.d.ts +6 -0
- package/dist/dtos/products/submodules/index.js +7 -0
- package/dist/dtos/products/submodules/product-image/bulk-create-product-image.dto.d.ts +26 -0
- package/dist/dtos/products/submodules/product-image/bulk-create-product-image.dto.js +50 -0
- package/dist/dtos/products/submodules/product-image/create-product-image.dto.d.ts +32 -0
- package/dist/dtos/products/submodules/product-image/create-product-image.dto.js +59 -0
- package/dist/dtos/products/submodules/product-image/index.d.ts +12 -0
- package/dist/dtos/products/submodules/product-image/index.js +12 -0
- package/dist/dtos/products/submodules/product-image/set-primary-image.dto.d.ts +24 -0
- package/dist/dtos/products/submodules/product-image/set-primary-image.dto.js +46 -0
- package/dist/dtos/products/submodules/product-image/update-product-image.dto.d.ts +30 -0
- package/dist/dtos/products/submodules/product-image/update-product-image.dto.js +57 -0
- package/dist/dtos/products/submodules/product-question/create-product-question.dto.d.ts +40 -0
- package/dist/dtos/products/submodules/product-question/create-product-question.dto.js +76 -0
- package/dist/dtos/products/submodules/product-question/find-by-product-id-and-type.dto.d.ts +25 -0
- package/dist/dtos/products/submodules/product-question/find-by-product-id-and-type.dto.js +47 -0
- package/dist/dtos/products/submodules/product-question/index.d.ts +12 -0
- package/dist/dtos/products/submodules/product-question/index.js +12 -0
- package/dist/dtos/products/submodules/product-question/replace-by-product-id.dto.d.ts +27 -0
- package/dist/dtos/products/submodules/product-question/replace-by-product-id.dto.js +51 -0
- package/dist/dtos/products/submodules/product-question/update-product-question.dto.d.ts +32 -0
- package/dist/dtos/products/submodules/product-question/update-product-question.dto.js +63 -0
- package/dist/dtos/products/submodules/product-recipe/create-product-recipe.dto.d.ts +38 -0
- package/dist/dtos/products/submodules/product-recipe/create-product-recipe.dto.js +70 -0
- package/dist/dtos/products/submodules/product-recipe/index.d.ts +11 -0
- package/dist/dtos/products/submodules/product-recipe/index.js +11 -0
- package/dist/dtos/products/submodules/product-recipe/replace-by-product-id.dto.d.ts +27 -0
- package/dist/dtos/products/submodules/product-recipe/replace-by-product-id.dto.js +51 -0
- package/dist/dtos/products/submodules/product-recipe/update-product-recipe.dto.d.ts +37 -0
- package/dist/dtos/products/submodules/product-recipe/update-product-recipe.dto.js +71 -0
- package/dist/dtos/products/submodules/product-schedule/create-product-schedule.dto.d.ts +38 -0
- package/dist/dtos/products/submodules/product-schedule/create-product-schedule.dto.js +78 -0
- package/dist/dtos/products/submodules/product-schedule/index.d.ts +12 -0
- package/dist/dtos/products/submodules/product-schedule/index.js +12 -0
- package/dist/dtos/products/submodules/product-schedule/is-available-at-time.dto.d.ts +31 -0
- package/dist/dtos/products/submodules/product-schedule/is-available-at-time.dto.js +60 -0
- package/dist/dtos/products/submodules/product-schedule/replace-by-product-id.dto.d.ts +27 -0
- package/dist/dtos/products/submodules/product-schedule/replace-by-product-id.dto.js +51 -0
- package/dist/dtos/products/submodules/product-schedule/update-product-schedule.dto.d.ts +38 -0
- package/dist/dtos/products/submodules/product-schedule/update-product-schedule.dto.js +79 -0
- package/dist/dtos/products/submodules/product-size/create-product-size.dto.d.ts +39 -0
- package/dist/dtos/products/submodules/product-size/create-product-size.dto.js +73 -0
- package/dist/dtos/products/submodules/product-size/index.d.ts +12 -0
- package/dist/dtos/products/submodules/product-size/index.js +12 -0
- package/dist/dtos/products/submodules/product-size/product-size-data.dto.d.ts +32 -0
- package/dist/dtos/products/submodules/product-size/product-size-data.dto.js +60 -0
- package/dist/dtos/products/submodules/product-size/replace-by-product-id.dto.d.ts +27 -0
- package/dist/dtos/products/submodules/product-size/replace-by-product-id.dto.js +51 -0
- package/dist/dtos/products/submodules/product-size/update-product-size.dto.d.ts +37 -0
- package/dist/dtos/products/submodules/product-size/update-product-size.dto.js +72 -0
- package/dist/dtos/products/submodules/product-tag/create-product-tag.dto.d.ts +24 -0
- package/dist/dtos/products/submodules/product-tag/create-product-tag.dto.js +46 -0
- package/dist/dtos/products/submodules/product-tag/find-product-tag.dto.d.ts +24 -0
- package/dist/dtos/products/submodules/product-tag/find-product-tag.dto.js +46 -0
- package/dist/dtos/products/submodules/product-tag/index.d.ts +12 -0
- package/dist/dtos/products/submodules/product-tag/index.js +12 -0
- package/dist/dtos/products/submodules/product-tag/remove-product-tag.dto.d.ts +24 -0
- package/dist/dtos/products/submodules/product-tag/remove-product-tag.dto.js +46 -0
- package/dist/dtos/products/submodules/product-tag/replace-by-product-id.dto.d.ts +26 -0
- package/dist/dtos/products/submodules/product-tag/replace-by-product-id.dto.js +48 -0
- package/dist/dtos/products/update-product.dto.d.ts +27 -0
- package/dist/dtos/products/update-product.dto.js +48 -0
- package/dist/dtos/questions/create-question.dto.d.ts +54 -0
- package/dist/dtos/questions/create-question.dto.js +96 -0
- package/dist/dtos/questions/delete-question.dto.d.ts +24 -0
- package/dist/dtos/questions/delete-question.dto.js +44 -0
- package/dist/dtos/questions/index.d.ts +12 -0
- package/dist/dtos/questions/index.js +12 -0
- package/dist/dtos/questions/search-by-name.dto.d.ts +18 -0
- package/dist/dtos/questions/search-by-name.dto.js +33 -0
- package/dist/dtos/questions/update-question.dto.d.ts +26 -0
- package/dist/dtos/questions/update-question.dto.js +48 -0
- package/dist/dtos/restaurants/create-restaurant.dto.d.ts +57 -0
- package/dist/dtos/restaurants/create-restaurant.dto.js +100 -0
- package/dist/dtos/restaurants/delete-restaurant.dto.d.ts +24 -0
- package/dist/dtos/restaurants/delete-restaurant.dto.js +44 -0
- package/dist/dtos/restaurants/index.d.ts +11 -0
- package/dist/dtos/restaurants/index.js +11 -0
- package/dist/dtos/restaurants/update-restaurant.dto.d.ts +26 -0
- package/dist/dtos/restaurants/update-restaurant.dto.js +48 -0
- package/dist/dtos/tags/create-tag.dto.d.ts +24 -0
- package/dist/dtos/tags/create-tag.dto.js +46 -0
- package/dist/dtos/tags/delete-tag.dto.d.ts +24 -0
- package/dist/dtos/tags/delete-tag.dto.js +44 -0
- package/dist/dtos/tags/index.d.ts +12 -0
- package/dist/dtos/tags/index.js +12 -0
- package/dist/dtos/tags/search-by-name.dto.d.ts +18 -0
- package/dist/dtos/tags/search-by-name.dto.js +33 -0
- package/dist/dtos/tags/update-tag.dto.d.ts +26 -0
- package/dist/dtos/tags/update-tag.dto.js +48 -0
- package/dist/dtos/translations/create-translation.dto.d.ts +36 -0
- package/dist/dtos/translations/create-translation.dto.js +74 -0
- package/dist/dtos/translations/delete-translation.dto.d.ts +10 -0
- package/dist/dtos/translations/delete-translation.dto.js +25 -0
- package/dist/dtos/translations/find-translations-by-entity.dto.d.ts +16 -0
- package/dist/dtos/translations/find-translations-by-entity.dto.js +35 -0
- package/dist/dtos/translations/index.d.ts +4 -0
- package/dist/dtos/translations/index.js +4 -0
- package/dist/dtos/translations/update-translation.dto.d.ts +12 -0
- package/dist/dtos/translations/update-translation.dto.js +27 -0
- package/dist/enums/auth-provider.enum.d.ts +68 -0
- package/dist/enums/auth-provider.enum.js +69 -0
- package/dist/enums/currency.enum.d.ts +21 -0
- package/dist/enums/currency.enum.js +22 -0
- package/dist/enums/http-status-code.enum.d.ts +78 -0
- package/dist/enums/http-status-code.enum.js +84 -0
- package/dist/enums/http-status-text.enum.d.ts +91 -0
- package/dist/enums/http-status-text.enum.js +92 -0
- package/dist/enums/index.d.ts +12 -0
- package/dist/enums/index.js +12 -0
- package/dist/enums/language-code.enum.d.ts +19 -0
- package/dist/enums/language-code.enum.js +20 -0
- package/dist/enums/order-status.enum.d.ts +68 -0
- package/dist/enums/order-status.enum.js +69 -0
- package/dist/enums/order-type.enum.d.ts +45 -0
- package/dist/enums/order-type.enum.js +46 -0
- package/dist/enums/product-status.enum.d.ts +55 -0
- package/dist/enums/product-status.enum.js +56 -0
- package/dist/enums/question-product-type.enum.d.ts +37 -0
- package/dist/enums/question-product-type.enum.js +38 -0
- package/dist/enums/question-type.enum.d.ts +52 -0
- package/dist/enums/question-type.enum.js +53 -0
- package/dist/enums/role.enum.d.ts +67 -0
- package/dist/enums/role.enum.js +68 -0
- package/dist/enums/translation-entity-type.enum.d.ts +42 -0
- package/dist/enums/translation-entity-type.enum.js +43 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/interfaces/auth/access-token.interface.d.ts +24 -0
- package/dist/interfaces/auth/access-token.interface.js +1 -0
- package/dist/interfaces/auth/access-user.interface.d.ts +17 -0
- package/dist/interfaces/auth/access-user.interface.js +1 -0
- package/dist/interfaces/auth/account.interface.d.ts +85 -0
- package/dist/interfaces/auth/account.interface.js +1 -0
- package/dist/interfaces/auth/full-token.interface.d.ts +12 -0
- package/dist/interfaces/auth/full-token.interface.js +1 -0
- package/dist/interfaces/auth/index.d.ts +17 -0
- package/dist/interfaces/auth/index.js +18 -0
- package/dist/interfaces/auth/payload-jwt.interface.d.ts +39 -0
- package/dist/interfaces/auth/payload-jwt.interface.js +1 -0
- package/dist/interfaces/auth/refresh-token.interface.d.ts +25 -0
- package/dist/interfaces/auth/refresh-token.interface.js +1 -0
- package/dist/interfaces/auth/responses/auth-response.interface.d.ts +37 -0
- package/dist/interfaces/auth/responses/auth-response.interface.js +1 -0
- package/dist/interfaces/auth/responses/index.d.ts +2 -0
- package/dist/interfaces/auth/responses/index.js +2 -0
- package/dist/interfaces/auth/responses/refresh-token-response.interface.d.ts +29 -0
- package/dist/interfaces/auth/responses/refresh-token-response.interface.js +1 -0
- package/dist/interfaces/auth/user.interface.d.ts +53 -0
- package/dist/interfaces/auth/user.interface.js +1 -0
- package/dist/interfaces/auth/validate-user.interface.d.ts +36 -0
- package/dist/interfaces/auth/validate-user.interface.js +1 -0
- package/dist/interfaces/categories/categories-list-response.interface.d.ts +17 -0
- package/dist/interfaces/categories/categories-list-response.interface.js +1 -0
- package/dist/interfaces/categories/category-response.interface.d.ts +16 -0
- package/dist/interfaces/categories/category-response.interface.js +1 -0
- package/dist/interfaces/categories/category.interface.d.ts +76 -0
- package/dist/interfaces/categories/category.interface.js +1 -0
- package/dist/interfaces/categories/index.d.ts +11 -0
- package/dist/interfaces/categories/index.js +11 -0
- package/dist/interfaces/chains/chain-response.interface.d.ts +16 -0
- package/dist/interfaces/chains/chain-response.interface.js +1 -0
- package/dist/interfaces/chains/chain.interface.d.ts +79 -0
- package/dist/interfaces/chains/chain.interface.js +1 -0
- package/dist/interfaces/chains/chains-list-response.interface.d.ts +17 -0
- package/dist/interfaces/chains/chains-list-response.interface.js +1 -0
- package/dist/interfaces/chains/index.d.ts +11 -0
- package/dist/interfaces/chains/index.js +11 -0
- package/dist/interfaces/common/api-error-response.interface.d.ts +26 -0
- package/dist/interfaces/common/api-error-response.interface.js +1 -0
- package/dist/interfaces/common/api-error.interface.d.ts +43 -0
- package/dist/interfaces/common/api-error.interface.js +1 -0
- package/dist/interfaces/common/api-pagination-response.interface.d.ts +9 -0
- package/dist/interfaces/common/api-pagination-response.interface.js +1 -0
- package/dist/interfaces/common/api-response.interface.d.ts +36 -0
- package/dist/interfaces/common/api-response.interface.js +1 -0
- package/dist/interfaces/common/index.d.ts +13 -0
- package/dist/interfaces/common/index.js +13 -0
- package/dist/interfaces/common/rpc-error.interface.d.ts +36 -0
- package/dist/interfaces/common/rpc-error.interface.js +1 -0
- package/dist/interfaces/index.d.ts +30 -0
- package/dist/interfaces/index.js +42 -0
- package/dist/interfaces/ingredients/index.d.ts +11 -0
- package/dist/interfaces/ingredients/index.js +11 -0
- package/dist/interfaces/ingredients/ingredient-response.interface.d.ts +16 -0
- package/dist/interfaces/ingredients/ingredient-response.interface.js +1 -0
- package/dist/interfaces/ingredients/ingredient.interface.d.ts +79 -0
- package/dist/interfaces/ingredients/ingredient.interface.js +1 -0
- package/dist/interfaces/ingredients/ingredients-list-response.interface.d.ts +17 -0
- package/dist/interfaces/ingredients/ingredients-list-response.interface.js +1 -0
- package/dist/interfaces/orders/index.d.ts +14 -0
- package/dist/interfaces/orders/index.js +15 -0
- package/dist/interfaces/orders/order-created.interface.d.ts +46 -0
- package/dist/interfaces/orders/order-created.interface.js +1 -0
- package/dist/interfaces/orders/order-creation-strategy.interface.d.ts +17 -0
- package/dist/interfaces/orders/order-creation-strategy.interface.js +1 -0
- package/dist/interfaces/orders/order-item.interface.d.ts +70 -0
- package/dist/interfaces/orders/order-item.interface.js +1 -0
- package/dist/interfaces/orders/order-with-products.interface.d.ts +34 -0
- package/dist/interfaces/orders/order-with-products.interface.js +1 -0
- package/dist/interfaces/orders/order.interface.d.ts +114 -0
- package/dist/interfaces/orders/order.interface.js +1 -0
- package/dist/interfaces/orders/responses/change-order-status-response.interface.d.ts +5 -0
- package/dist/interfaces/orders/responses/change-order-status-response.interface.js +1 -0
- package/dist/interfaces/orders/responses/create-order-response.interface.d.ts +7 -0
- package/dist/interfaces/orders/responses/create-order-response.interface.js +1 -0
- package/dist/interfaces/orders/responses/index.d.ts +4 -0
- package/dist/interfaces/orders/responses/index.js +4 -0
- package/dist/interfaces/orders/responses/order-with-products-response.interface.d.ts +5 -0
- package/dist/interfaces/orders/responses/order-with-products-response.interface.js +1 -0
- package/dist/interfaces/orders/responses/orders-list-response.interface.d.ts +6 -0
- package/dist/interfaces/orders/responses/orders-list-response.interface.js +1 -0
- package/dist/interfaces/payments/audit-storage-strategy.interface.d.ts +19 -0
- package/dist/interfaces/payments/audit-storage-strategy.interface.js +1 -0
- package/dist/interfaces/payments/culqi-session-response.interface.d.ts +7 -0
- package/dist/interfaces/payments/culqi-session-response.interface.js +1 -0
- package/dist/interfaces/payments/index.d.ts +17 -0
- package/dist/interfaces/payments/index.js +18 -0
- package/dist/interfaces/payments/payment-audit-data.interface.d.ts +81 -0
- package/dist/interfaces/payments/payment-audit-data.interface.js +1 -0
- package/dist/interfaces/payments/payment-method-config.interface.d.ts +86 -0
- package/dist/interfaces/payments/payment-method-config.interface.js +1 -0
- package/dist/interfaces/payments/payment-provider.interface.d.ts +27 -0
- package/dist/interfaces/payments/payment-provider.interface.js +1 -0
- package/dist/interfaces/payments/payment-session-item.interface.d.ts +30 -0
- package/dist/interfaces/payments/payment-session-item.interface.js +1 -0
- package/dist/interfaces/payments/payment-succeeded-payload.interface.d.ts +29 -0
- package/dist/interfaces/payments/payment-succeeded-payload.interface.js +1 -0
- package/dist/interfaces/payments/responses/payment-callback-response.interface.d.ts +8 -0
- package/dist/interfaces/payments/responses/payment-callback-response.interface.js +1 -0
- package/dist/interfaces/payments/stripe-session-response.interface.d.ts +29 -0
- package/dist/interfaces/payments/stripe-session-response.interface.js +1 -0
- package/dist/interfaces/products/index.d.ts +16 -0
- package/dist/interfaces/products/index.js +17 -0
- package/dist/interfaces/products/product-image.interface.d.ts +55 -0
- package/dist/interfaces/products/product-image.interface.js +1 -0
- package/dist/interfaces/products/product-recipe.interface.d.ts +50 -0
- package/dist/interfaces/products/product-recipe.interface.js +1 -0
- package/dist/interfaces/products/product-schedule.interface.d.ts +45 -0
- package/dist/interfaces/products/product-schedule.interface.js +1 -0
- package/dist/interfaces/products/product-size.interface.d.ts +62 -0
- package/dist/interfaces/products/product-size.interface.js +1 -0
- package/dist/interfaces/products/product-tag.interface.d.ts +28 -0
- package/dist/interfaces/products/product-tag.interface.js +1 -0
- package/dist/interfaces/products/product-translation.interface.d.ts +43 -0
- package/dist/interfaces/products/product-translation.interface.js +1 -0
- package/dist/interfaces/products/product.interface.d.ts +113 -0
- package/dist/interfaces/products/product.interface.js +1 -0
- package/dist/interfaces/products/response/complete-product-response.interface.d.ts +5 -0
- package/dist/interfaces/products/response/complete-product-response.interface.js +1 -0
- package/dist/interfaces/products/response/index.d.ts +6 -0
- package/dist/interfaces/products/response/index.js +6 -0
- package/dist/interfaces/products/response/product-response.interface.d.ts +5 -0
- package/dist/interfaces/products/response/product-response.interface.js +1 -0
- package/dist/interfaces/products/response/products-list-response.interface.d.ts +6 -0
- package/dist/interfaces/products/response/products-list-response.interface.js +1 -0
- package/dist/interfaces/products/response/simple-product-response.interface.d.ts +3 -0
- package/dist/interfaces/products/response/simple-product-response.interface.js +1 -0
- package/dist/interfaces/products/response/sub-resources/create-tag-response.interface.d.ts +4 -0
- package/dist/interfaces/products/response/sub-resources/create-tag-response.interface.js +1 -0
- package/dist/interfaces/products/response/sub-resources/delete-sub-resource-response.interface.d.ts +9 -0
- package/dist/interfaces/products/response/sub-resources/delete-sub-resource-response.interface.js +1 -0
- package/dist/interfaces/products/response/sub-resources/find-product-image-response.interface.d.ts +4 -0
- package/dist/interfaces/products/response/sub-resources/find-product-image-response.interface.js +1 -0
- package/dist/interfaces/products/response/sub-resources/find-product-question-response.interface.d.ts +4 -0
- package/dist/interfaces/products/response/sub-resources/find-product-question-response.interface.js +1 -0
- package/dist/interfaces/products/response/sub-resources/find-product-recipe-response.interface.d.ts +4 -0
- package/dist/interfaces/products/response/sub-resources/find-product-recipe-response.interface.js +1 -0
- package/dist/interfaces/products/response/sub-resources/find-product-schedule-response.interface.d.ts +4 -0
- package/dist/interfaces/products/response/sub-resources/find-product-schedule-response.interface.js +1 -0
- package/dist/interfaces/products/response/sub-resources/find-product-size-response.interface.d.ts +4 -0
- package/dist/interfaces/products/response/sub-resources/find-product-size-response.interface.js +1 -0
- package/dist/interfaces/products/response/sub-resources/find-product-tag-response.interface.d.ts +4 -0
- package/dist/interfaces/products/response/sub-resources/find-product-tag-response.interface.js +1 -0
- package/dist/interfaces/products/response/sub-resources/find-sub-resource-response.interface.d.ts +4 -0
- package/dist/interfaces/products/response/sub-resources/find-sub-resource-response.interface.js +1 -0
- package/dist/interfaces/products/response/sub-resources/index.d.ts +25 -0
- package/dist/interfaces/products/response/sub-resources/index.js +25 -0
- package/dist/interfaces/products/response/sub-resources/list-product-images-response.interface.d.ts +4 -0
- package/dist/interfaces/products/response/sub-resources/list-product-images-response.interface.js +1 -0
- package/dist/interfaces/products/response/sub-resources/list-product-questions-response.interface.d.ts +4 -0
- package/dist/interfaces/products/response/sub-resources/list-product-questions-response.interface.js +1 -0
- package/dist/interfaces/products/response/sub-resources/list-product-recipes-response.interface.d.ts +4 -0
- package/dist/interfaces/products/response/sub-resources/list-product-recipes-response.interface.js +1 -0
- package/dist/interfaces/products/response/sub-resources/list-product-schedules-response.interface.d.ts +4 -0
- package/dist/interfaces/products/response/sub-resources/list-product-schedules-response.interface.js +1 -0
- package/dist/interfaces/products/response/sub-resources/list-product-sizes-response.interface.d.ts +4 -0
- package/dist/interfaces/products/response/sub-resources/list-product-sizes-response.interface.js +1 -0
- package/dist/interfaces/products/response/sub-resources/list-sub-resource-response.interface.d.ts +8 -0
- package/dist/interfaces/products/response/sub-resources/list-sub-resource-response.interface.js +1 -0
- package/dist/interfaces/products/response/sub-resources/product-schedule-availability.interface.d.ts +7 -0
- package/dist/interfaces/products/response/sub-resources/product-schedule-availability.interface.js +1 -0
- package/dist/interfaces/products/response/sub-resources/question-relationship.interface.d.ts +7 -0
- package/dist/interfaces/products/response/sub-resources/question-relationship.interface.js +1 -0
- package/dist/interfaces/products/response/sub-resources/recipe-relationship.interface.d.ts +9 -0
- package/dist/interfaces/products/response/sub-resources/recipe-relationship.interface.js +1 -0
- package/dist/interfaces/products/response/sub-resources/replace-sub-products-response.interface.d.ts +9 -0
- package/dist/interfaces/products/response/sub-resources/replace-sub-products-response.interface.js +1 -0
- package/dist/interfaces/products/response/sub-resources/sub-resource-response.interface.d.ts +10 -0
- package/dist/interfaces/products/response/sub-resources/sub-resource-response.interface.js +1 -0
- package/dist/interfaces/products/response/sub-resources/write-image-response.interface.d.ts +12 -0
- package/dist/interfaces/products/response/sub-resources/write-image-response.interface.js +1 -0
- package/dist/interfaces/products/response/sub-resources/write-question-product-response.interface.d.ts +4 -0
- package/dist/interfaces/products/response/sub-resources/write-question-product-response.interface.js +1 -0
- package/dist/interfaces/products/response/sub-resources/write-recipe-response.interface.d.ts +4 -0
- package/dist/interfaces/products/response/sub-resources/write-recipe-response.interface.js +1 -0
- package/dist/interfaces/products/response/sub-resources/write-schedule-response.interface.d.ts +4 -0
- package/dist/interfaces/products/response/sub-resources/write-schedule-response.interface.js +1 -0
- package/dist/interfaces/products/response/sub-resources/write-size-response.interface.d.ts +4 -0
- package/dist/interfaces/products/response/sub-resources/write-size-response.interface.js +1 -0
- package/dist/interfaces/questions/index.d.ts +3 -0
- package/dist/interfaces/questions/index.js +3 -0
- package/dist/interfaces/questions/question-response.interface.d.ts +16 -0
- package/dist/interfaces/questions/question-response.interface.js +1 -0
- package/dist/interfaces/questions/question.interface.d.ts +15 -0
- package/dist/interfaces/questions/question.interface.js +1 -0
- package/dist/interfaces/questions/questions-list-response.interface.d.ts +17 -0
- package/dist/interfaces/questions/questions-list-response.interface.js +1 -0
- package/dist/interfaces/restaurants/index.d.ts +11 -0
- package/dist/interfaces/restaurants/index.js +11 -0
- package/dist/interfaces/restaurants/restaurant-response.interface.d.ts +16 -0
- package/dist/interfaces/restaurants/restaurant-response.interface.js +1 -0
- package/dist/interfaces/restaurants/restaurant.interface.d.ts +96 -0
- package/dist/interfaces/restaurants/restaurant.interface.js +1 -0
- package/dist/interfaces/restaurants/restaurants-list-response.interface.d.ts +17 -0
- package/dist/interfaces/restaurants/restaurants-list-response.interface.js +1 -0
- package/dist/interfaces/tags/index.d.ts +11 -0
- package/dist/interfaces/tags/index.js +11 -0
- package/dist/interfaces/tags/tag-response.interface.d.ts +16 -0
- package/dist/interfaces/tags/tag-response.interface.js +1 -0
- package/dist/interfaces/tags/tag.interface.d.ts +64 -0
- package/dist/interfaces/tags/tag.interface.js +1 -0
- package/dist/interfaces/tags/tags-list-response.interface.d.ts +17 -0
- package/dist/interfaces/tags/tags-list-response.interface.js +1 -0
- package/dist/interfaces/translations/index.d.ts +11 -0
- package/dist/interfaces/translations/index.js +11 -0
- package/dist/interfaces/translations/translation-response.interface.d.ts +16 -0
- package/dist/interfaces/translations/translation-response.interface.js +1 -0
- package/dist/interfaces/translations/translation.interface.d.ts +77 -0
- package/dist/interfaces/translations/translation.interface.js +1 -0
- package/dist/interfaces/translations/translations-list-response.interface.d.ts +16 -0
- package/dist/interfaces/translations/translations-list-response.interface.js +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/order-mode.type.d.ts +14 -0
- package/dist/types/order-mode.type.js +1 -0
- package/package.json +27 -0
- package/tsconfig.json +25 -0
- package/tsconfig.node.json +9 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { StripeSessionResponse } from "../payments";
|
|
2
|
+
import { CulqiSessionResponse } from "../payments/culqi-session-response.interface";
|
|
3
|
+
import { OrderWithProducts } from "./order-with-products.interface";
|
|
4
|
+
/**
|
|
5
|
+
* Order created interface.
|
|
6
|
+
*
|
|
7
|
+
* Represents the response structure after successfully creating an order.
|
|
8
|
+
* Includes the created order and process information.
|
|
9
|
+
*
|
|
10
|
+
* @since 2.0.0
|
|
11
|
+
*/
|
|
12
|
+
export interface OrderCreated {
|
|
13
|
+
/**
|
|
14
|
+
* The created order with all associated products.
|
|
15
|
+
*/
|
|
16
|
+
order: OrderWithProducts;
|
|
17
|
+
/**
|
|
18
|
+
* Process or workflow information related to order creation, or a payment session
|
|
19
|
+
* payload if payment via an external provider is required.
|
|
20
|
+
*
|
|
21
|
+
* For DINE_IN mode:
|
|
22
|
+
* - Returns a string representing the QR code on Base64 format.
|
|
23
|
+
* For DELIVERY or PICKUP modes:
|
|
24
|
+
* - Returns the payload from the payment provider, which may include URLs or payment metadata.
|
|
25
|
+
*
|
|
26
|
+
* Stripe example:
|
|
27
|
+
* {
|
|
28
|
+
* url: "https://checkout.stripe.com/pay/...",
|
|
29
|
+
* successUrl: "https://domain.com/success",
|
|
30
|
+
* cancelUrl: "https://domain.com/cancel"
|
|
31
|
+
* }
|
|
32
|
+
*
|
|
33
|
+
* Culqi example:
|
|
34
|
+
* {
|
|
35
|
+
* provider: "culqi",
|
|
36
|
+
* orderId: "order-uuid",
|
|
37
|
+
* transactionId: "txn-123",
|
|
38
|
+
* receiptUrl: "https://culqi.com/receipt/...",
|
|
39
|
+
* message: "Payment successful via Culqi"
|
|
40
|
+
* }
|
|
41
|
+
*
|
|
42
|
+
* @example "data:image/png;base64,..."
|
|
43
|
+
* @example { url: "https://checkout.stripe.com/pay/..." }
|
|
44
|
+
*/
|
|
45
|
+
process: string | CulqiSessionResponse | StripeSessionResponse;
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Order creation strategy interface.
|
|
3
|
+
*
|
|
4
|
+
* Defines the contract for order creation strategies using the Strategy pattern.
|
|
5
|
+
* Different strategies can handle different order types or business rules.
|
|
6
|
+
*
|
|
7
|
+
* @since 2.0.0
|
|
8
|
+
*/
|
|
9
|
+
export interface OrderCreationStrategy {
|
|
10
|
+
/**
|
|
11
|
+
* Processes an order creation request.
|
|
12
|
+
*
|
|
13
|
+
* @param orderData - The order data to process (structure depends on implementation)
|
|
14
|
+
* @returns Promise resolving to the created order or order result
|
|
15
|
+
*/
|
|
16
|
+
processOrder(orderData: any): Promise<any>;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Order item interface.
|
|
3
|
+
*
|
|
4
|
+
* Represents a single line item in an order with product details,
|
|
5
|
+
* size variant, pricing, and optional notes.
|
|
6
|
+
*
|
|
7
|
+
* @since 2.0.0
|
|
8
|
+
*/
|
|
9
|
+
export interface OrderItem {
|
|
10
|
+
/**
|
|
11
|
+
* Unique identifier of the product.
|
|
12
|
+
*
|
|
13
|
+
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
14
|
+
*/
|
|
15
|
+
productId: string;
|
|
16
|
+
/**
|
|
17
|
+
* Optional name of the size variant.
|
|
18
|
+
*
|
|
19
|
+
* @example "Large"
|
|
20
|
+
* @example "Medium"
|
|
21
|
+
*/
|
|
22
|
+
sizeName?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Optional price for the size variant.
|
|
25
|
+
*
|
|
26
|
+
* @example 12.99
|
|
27
|
+
*/
|
|
28
|
+
sizePrice?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Current status of the order item.
|
|
31
|
+
*
|
|
32
|
+
* @example "pending"
|
|
33
|
+
* @example "cooking"
|
|
34
|
+
* @example "ready"
|
|
35
|
+
*/
|
|
36
|
+
itemStatus: string;
|
|
37
|
+
/**
|
|
38
|
+
* Optional notes or special instructions for this item.
|
|
39
|
+
*
|
|
40
|
+
* @example "No onions, extra cheese"
|
|
41
|
+
*/
|
|
42
|
+
notes?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Unit price for this item.
|
|
45
|
+
*
|
|
46
|
+
* @example 9.99
|
|
47
|
+
*/
|
|
48
|
+
price: number;
|
|
49
|
+
/**
|
|
50
|
+
* Quantity of this item in the order.
|
|
51
|
+
*
|
|
52
|
+
* @example 2
|
|
53
|
+
*/
|
|
54
|
+
quantity: number;
|
|
55
|
+
/**
|
|
56
|
+
* Product name.
|
|
57
|
+
*
|
|
58
|
+
* @example "Big Mac"
|
|
59
|
+
*/
|
|
60
|
+
name: string;
|
|
61
|
+
/**
|
|
62
|
+
* Child items for this order item, used for combos or nested options.
|
|
63
|
+
* For example, a combo meal could have child items for a drink and side.
|
|
64
|
+
*
|
|
65
|
+
* @type {OrderItem[]}
|
|
66
|
+
* @default []
|
|
67
|
+
* @example [ { name: "Coke", quantity: 1, ... }, { name: "Fries", quantity: 1, ... } ]
|
|
68
|
+
*/
|
|
69
|
+
childItems: OrderItem[];
|
|
70
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { OrderItem } from "./order-item.interface";
|
|
2
|
+
import { Order } from "./order.interface";
|
|
3
|
+
/**
|
|
4
|
+
* Represents a complete restaurant order with its associated products.
|
|
5
|
+
*
|
|
6
|
+
* Extends the base Order interface by including the full details of each
|
|
7
|
+
* ordered item (with product reference and relevant metadata).
|
|
8
|
+
* This interface is commonly used when fetching order information that requires
|
|
9
|
+
* itemized product details, for example in admin dashboards, kitchen systems,
|
|
10
|
+
* or customer order history queries.
|
|
11
|
+
*
|
|
12
|
+
* @extends Order
|
|
13
|
+
* @since 2.0.0
|
|
14
|
+
*/
|
|
15
|
+
export interface OrderWithProducts extends Order {
|
|
16
|
+
/**
|
|
17
|
+
* List of all items belonging to this order, each including
|
|
18
|
+
* detailed product information and order-specific item data.
|
|
19
|
+
*
|
|
20
|
+
* @type {OrderItem[]}
|
|
21
|
+
* @example [
|
|
22
|
+
* {
|
|
23
|
+
* productId: "prod-uuid-1",
|
|
24
|
+
* name: "Traditional Pizza",
|
|
25
|
+
* quantity: 2,
|
|
26
|
+
* price: 12.99,
|
|
27
|
+
* notes: "No onions",
|
|
28
|
+
* // ...
|
|
29
|
+
* },
|
|
30
|
+
* // More items...
|
|
31
|
+
* ]
|
|
32
|
+
*/
|
|
33
|
+
OrderItem: OrderItem[];
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { OrderStatus } from '../../enums';
|
|
2
|
+
import { OrderMode } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Represents a restaurant order within the QeHay system.
|
|
5
|
+
* Each order includes its metadata, payment information, state, and fulfillment mode.
|
|
6
|
+
* Depending on the type of order (DINE_IN, DELIVERY, or PICKUP), some fields may be null or unused.
|
|
7
|
+
*
|
|
8
|
+
* @since 2.0.0
|
|
9
|
+
*/
|
|
10
|
+
export interface Order {
|
|
11
|
+
/**
|
|
12
|
+
* Unique identifier of the order.
|
|
13
|
+
*
|
|
14
|
+
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
15
|
+
*/
|
|
16
|
+
id: string;
|
|
17
|
+
/**
|
|
18
|
+
* Indicates the mode in which the order is placed: DINE_IN, PICKUP, or DELIVERY.
|
|
19
|
+
*
|
|
20
|
+
* @example "DELIVERY"
|
|
21
|
+
*/
|
|
22
|
+
type: OrderMode;
|
|
23
|
+
/**
|
|
24
|
+
* Current status of the order, following QeHay's workflow enumeration.
|
|
25
|
+
*
|
|
26
|
+
* @example OrderStatus.CONFIRMED
|
|
27
|
+
* @example OrderStatus.COOKING
|
|
28
|
+
*/
|
|
29
|
+
status: OrderStatus;
|
|
30
|
+
/**
|
|
31
|
+
* Total amount to be paid for the order, including all applicable taxes and discounts.
|
|
32
|
+
*
|
|
33
|
+
* @example 29.99
|
|
34
|
+
*/
|
|
35
|
+
totalAmount: number;
|
|
36
|
+
/**
|
|
37
|
+
* Total number of individual items in the order.
|
|
38
|
+
*
|
|
39
|
+
* @example 3
|
|
40
|
+
*/
|
|
41
|
+
totalItems: number;
|
|
42
|
+
/**
|
|
43
|
+
* Flag indicating if the order has been paid.
|
|
44
|
+
*
|
|
45
|
+
* @example true
|
|
46
|
+
* @example false
|
|
47
|
+
*/
|
|
48
|
+
paid: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Timestamp reflecting when the payment for this order was completed.
|
|
51
|
+
* If the order is unpaid, this value is null.
|
|
52
|
+
*
|
|
53
|
+
* @example "2024-01-15T18:30:00Z"
|
|
54
|
+
* @example null
|
|
55
|
+
*/
|
|
56
|
+
paidAt?: Date;
|
|
57
|
+
/**
|
|
58
|
+
* Payment transaction or charge identifier from the payment provider (if paid).
|
|
59
|
+
* May be null if the order is unpaid or if the payment method does not provide an external reference.
|
|
60
|
+
*
|
|
61
|
+
* @example "ch_1234567890abcdef"
|
|
62
|
+
* @example null
|
|
63
|
+
*/
|
|
64
|
+
paymentChargeId?: string;
|
|
65
|
+
/**
|
|
66
|
+
* For dine-in orders, this indicates the table number assigned.
|
|
67
|
+
* For pickup or delivery orders, this will be null.
|
|
68
|
+
*
|
|
69
|
+
* @example "Table 5"
|
|
70
|
+
* @example null
|
|
71
|
+
*/
|
|
72
|
+
tableNumber?: string;
|
|
73
|
+
/**
|
|
74
|
+
* For pickup orders, this indicates the scheduled pick-up time.
|
|
75
|
+
* For dine-in or delivery orders, this field will be null.
|
|
76
|
+
*
|
|
77
|
+
* @example "2024-01-15T18:30:00Z"
|
|
78
|
+
* @example null
|
|
79
|
+
*/
|
|
80
|
+
pickupTime?: Date;
|
|
81
|
+
/**
|
|
82
|
+
* For delivery orders, this contains the delivery address.
|
|
83
|
+
* For dine-in or pickup, this will be null.
|
|
84
|
+
*
|
|
85
|
+
* @example "123 Main St, Downtown"
|
|
86
|
+
* @example null
|
|
87
|
+
*/
|
|
88
|
+
deliveryAddress?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Unique identifier of the customer who placed the order.
|
|
91
|
+
*
|
|
92
|
+
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
93
|
+
*/
|
|
94
|
+
customerId: string;
|
|
95
|
+
/**
|
|
96
|
+
* Identifier for the selected payment method.
|
|
97
|
+
* Can reference either a saved method or a one-time use token depending on the payment provider.
|
|
98
|
+
*
|
|
99
|
+
* @example "payment-method-uuid-123"
|
|
100
|
+
*/
|
|
101
|
+
paymentMethodId: string;
|
|
102
|
+
/**
|
|
103
|
+
* Timestamp for when the order was created in the system.
|
|
104
|
+
*
|
|
105
|
+
* @example "2024-01-15T10:30:00Z"
|
|
106
|
+
*/
|
|
107
|
+
createdAt: Date;
|
|
108
|
+
/**
|
|
109
|
+
* Last updated timestamp for the order record.
|
|
110
|
+
*
|
|
111
|
+
* @example "2024-01-15T11:00:00Z"
|
|
112
|
+
*/
|
|
113
|
+
updatedAt: Date;
|
|
114
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ApiResponse } from "../../common";
|
|
2
|
+
import { PaginationResponse } from "../../common/api-pagination-response.interface";
|
|
3
|
+
import { Order } from "../order.interface";
|
|
4
|
+
export interface OrdersListResponse extends ApiResponse {
|
|
5
|
+
data: PaginationResponse<Order>;
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PaymentAuditData } from './payment-audit-data.interface';
|
|
2
|
+
/**
|
|
3
|
+
* Audit storage strategy interface.
|
|
4
|
+
*
|
|
5
|
+
* Defines the contract for audit storage strategies using the Strategy pattern.
|
|
6
|
+
* Different implementations handle different storage systems
|
|
7
|
+
* (e.g., DynamoDB, S3, local file system).
|
|
8
|
+
*
|
|
9
|
+
* @since 2.0.0
|
|
10
|
+
*/
|
|
11
|
+
export interface AuditStorageStrategy {
|
|
12
|
+
/**
|
|
13
|
+
* Stores payment audit data using the specific strategy.
|
|
14
|
+
*
|
|
15
|
+
* @param auditData - The audit data to store (format depends on storage type)
|
|
16
|
+
* @returns Promise resolving to true if storage was successful, false otherwise
|
|
17
|
+
*/
|
|
18
|
+
store(auditData: PaymentAuditData): Promise<boolean>;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Payment interfaces.
|
|
3
|
+
*
|
|
4
|
+
* This module exports interfaces used for payment processing,
|
|
5
|
+
* payment provider integration, and audit logging in the Payments microservice.
|
|
6
|
+
*
|
|
7
|
+
* @since 2.0.0
|
|
8
|
+
*/
|
|
9
|
+
export * from "./payment-session-item.interface";
|
|
10
|
+
export * from "./payment-method-config.interface";
|
|
11
|
+
export * from "./payment-provider.interface";
|
|
12
|
+
export * from "./payment-succeeded-payload.interface";
|
|
13
|
+
export * from "./stripe-session-response.interface";
|
|
14
|
+
export * from "./culqi-session-response.interface";
|
|
15
|
+
export * from "./payment-audit-data.interface";
|
|
16
|
+
export * from "./audit-storage-strategy.interface";
|
|
17
|
+
export * from "./responses/payment-callback-response.interface";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Payment interfaces.
|
|
3
|
+
*
|
|
4
|
+
* This module exports interfaces used for payment processing,
|
|
5
|
+
* payment provider integration, and audit logging in the Payments microservice.
|
|
6
|
+
*
|
|
7
|
+
* @since 2.0.0
|
|
8
|
+
*/
|
|
9
|
+
export * from "./payment-session-item.interface";
|
|
10
|
+
export * from "./payment-method-config.interface";
|
|
11
|
+
export * from "./payment-provider.interface";
|
|
12
|
+
export * from "./payment-succeeded-payload.interface";
|
|
13
|
+
export * from "./stripe-session-response.interface";
|
|
14
|
+
export * from "./culqi-session-response.interface";
|
|
15
|
+
export * from "./payment-audit-data.interface";
|
|
16
|
+
export * from "./audit-storage-strategy.interface";
|
|
17
|
+
// Responses
|
|
18
|
+
export * from "./responses/payment-callback-response.interface";
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Payment audit data interface.
|
|
3
|
+
*
|
|
4
|
+
* Represents audit data for payment transactions and operations.
|
|
5
|
+
* Used for logging, monitoring, and compliance purposes.
|
|
6
|
+
* This data is stored in audit storage systems (e.g., DynamoDB, S3).
|
|
7
|
+
*
|
|
8
|
+
* @since 2.0.0
|
|
9
|
+
*/
|
|
10
|
+
export interface PaymentAuditData {
|
|
11
|
+
/**
|
|
12
|
+
* Unique transaction identifier.
|
|
13
|
+
*
|
|
14
|
+
* @example "txn_1234567890abcdef"
|
|
15
|
+
*/
|
|
16
|
+
transactionId: string;
|
|
17
|
+
/**
|
|
18
|
+
* Unique identifier of the order associated with this transaction.
|
|
19
|
+
*
|
|
20
|
+
* @example "550e8400-e29b-41d4-a716-446655440000"
|
|
21
|
+
*/
|
|
22
|
+
orderId: string;
|
|
23
|
+
/**
|
|
24
|
+
* Payment provider name.
|
|
25
|
+
*
|
|
26
|
+
* @example "stripe"
|
|
27
|
+
* @example "paypal"
|
|
28
|
+
*/
|
|
29
|
+
provider: string;
|
|
30
|
+
/**
|
|
31
|
+
* API endpoint that was called.
|
|
32
|
+
*
|
|
33
|
+
* @example "/v1/payment_intents"
|
|
34
|
+
*/
|
|
35
|
+
endpoint: string;
|
|
36
|
+
/**
|
|
37
|
+
* HTTP method used.
|
|
38
|
+
*
|
|
39
|
+
* @example "POST"
|
|
40
|
+
* @example "GET"
|
|
41
|
+
*/
|
|
42
|
+
method: string;
|
|
43
|
+
/**
|
|
44
|
+
* HTTP status code of the response.
|
|
45
|
+
*
|
|
46
|
+
* @example 200
|
|
47
|
+
* @example 400
|
|
48
|
+
* @example 500
|
|
49
|
+
*/
|
|
50
|
+
statusCode: number;
|
|
51
|
+
/**
|
|
52
|
+
* Status of the transaction.
|
|
53
|
+
*
|
|
54
|
+
* @example "succeeded"
|
|
55
|
+
* @example "failed"
|
|
56
|
+
* @example "pending"
|
|
57
|
+
*/
|
|
58
|
+
status: string;
|
|
59
|
+
/**
|
|
60
|
+
* Duration of the operation in milliseconds.
|
|
61
|
+
*
|
|
62
|
+
* @example 1250
|
|
63
|
+
*/
|
|
64
|
+
durationMs: number;
|
|
65
|
+
/**
|
|
66
|
+
* Optional IP address of the client.
|
|
67
|
+
*
|
|
68
|
+
* @example "192.168.1.1"
|
|
69
|
+
*/
|
|
70
|
+
ipAddress?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Optional request body sent to the provider.
|
|
73
|
+
* May be omitted for sensitive data.
|
|
74
|
+
*/
|
|
75
|
+
requestBody?: Record<string, any>;
|
|
76
|
+
/**
|
|
77
|
+
* Optional response body received from the provider.
|
|
78
|
+
* May be omitted for sensitive data.
|
|
79
|
+
*/
|
|
80
|
+
responseBody?: Record<string, any>;
|
|
81
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Payment method configuration interface.
|
|
3
|
+
*
|
|
4
|
+
* Represents payment method configuration stored in DynamoDB.
|
|
5
|
+
* Contains credentials, settings, and metadata for payment providers
|
|
6
|
+
* configured for specific restaurants or chains.
|
|
7
|
+
*
|
|
8
|
+
* @since 2.0.0
|
|
9
|
+
*/
|
|
10
|
+
export interface PaymentMethodConfig {
|
|
11
|
+
/**
|
|
12
|
+
* Primary key (Partition Key) in DynamoDB.
|
|
13
|
+
* Typically a compound key like restaurantId#paymentMethodId.
|
|
14
|
+
*
|
|
15
|
+
* @example "restaurant-123#payment-method-456"
|
|
16
|
+
*/
|
|
17
|
+
PK: string;
|
|
18
|
+
/**
|
|
19
|
+
* Sort key in DynamoDB.
|
|
20
|
+
* Used for additional querying capabilities.
|
|
21
|
+
*
|
|
22
|
+
* @example "CONFIG"
|
|
23
|
+
*/
|
|
24
|
+
SK: string;
|
|
25
|
+
/**
|
|
26
|
+
* Configuration settings for the payment method.
|
|
27
|
+
* Key-value pairs of configuration options.
|
|
28
|
+
*
|
|
29
|
+
* @example { "testMode": "true", "timeout": "30000" }
|
|
30
|
+
*/
|
|
31
|
+
configs: Record<string, string>;
|
|
32
|
+
/**
|
|
33
|
+
* Credentials for the payment provider.
|
|
34
|
+
* Contains sensitive information like API keys.
|
|
35
|
+
*
|
|
36
|
+
* @example { "apiKey": "sk_test_...", "secretKey": "..." }
|
|
37
|
+
*/
|
|
38
|
+
credentials: Record<string, string>;
|
|
39
|
+
/**
|
|
40
|
+
* Currency code for payments.
|
|
41
|
+
* Should follow ISO 4217 format.
|
|
42
|
+
*
|
|
43
|
+
* @example "PEN"
|
|
44
|
+
* @example "USD"
|
|
45
|
+
*/
|
|
46
|
+
currency: string;
|
|
47
|
+
/**
|
|
48
|
+
* Whether this payment method is enabled.
|
|
49
|
+
*
|
|
50
|
+
* @example true
|
|
51
|
+
* @example false
|
|
52
|
+
*/
|
|
53
|
+
enabled: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Unique identifier of the payment method.
|
|
56
|
+
*
|
|
57
|
+
* @example "payment-method-uuid-123"
|
|
58
|
+
*/
|
|
59
|
+
paymentMethodId: string;
|
|
60
|
+
/**
|
|
61
|
+
* Unique identifier of the restaurant.
|
|
62
|
+
*
|
|
63
|
+
* @example "restaurant-uuid-123"
|
|
64
|
+
*/
|
|
65
|
+
restaurantId: string;
|
|
66
|
+
/**
|
|
67
|
+
* Provider key/identifier.
|
|
68
|
+
* Identifies which payment provider this configuration is for.
|
|
69
|
+
*
|
|
70
|
+
* @example "stripe"
|
|
71
|
+
* @example "paypal"
|
|
72
|
+
*/
|
|
73
|
+
providerKey: string;
|
|
74
|
+
/**
|
|
75
|
+
* Date and time when the configuration was created.
|
|
76
|
+
*
|
|
77
|
+
* @example "2024-01-15T10:30:00Z"
|
|
78
|
+
*/
|
|
79
|
+
createdAt: Date;
|
|
80
|
+
/**
|
|
81
|
+
* Date and time when the configuration was last updated.
|
|
82
|
+
*
|
|
83
|
+
* @example "2024-01-15T11:00:00Z"
|
|
84
|
+
*/
|
|
85
|
+
updatedAt: Date;
|
|
86
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { PaymentSessionDto } from '../../dtos/payments/payment-session.dto';
|
|
2
|
+
import { WebhookDataDto } from '../../dtos/payments/webhook-data.dto';
|
|
3
|
+
/**
|
|
4
|
+
* Payment provider interface.
|
|
5
|
+
*
|
|
6
|
+
* Defines the contract for payment providers using the Strategy pattern.
|
|
7
|
+
* Different implementations handle different payment providers
|
|
8
|
+
* (e.g., Stripe, PayPal, local payment methods).
|
|
9
|
+
*
|
|
10
|
+
* @since 2.0.0
|
|
11
|
+
*/
|
|
12
|
+
export interface PaymentProvider {
|
|
13
|
+
/**
|
|
14
|
+
* Creates a payment session with the payment provider.
|
|
15
|
+
*
|
|
16
|
+
* @param paymentSessionDto - Payment session data including order details
|
|
17
|
+
* @returns Promise resolving to payment session response (structure depends on provider)
|
|
18
|
+
*/
|
|
19
|
+
createPaymentSession(paymentSessionDto: PaymentSessionDto): Promise<any>;
|
|
20
|
+
/**
|
|
21
|
+
* Handles webhook events from the payment provider.
|
|
22
|
+
*
|
|
23
|
+
* @param requestData - Webhook data including raw body, signature, and headers
|
|
24
|
+
* @returns Promise resolving to processed webhook result
|
|
25
|
+
*/
|
|
26
|
+
handleWebhook(requestData: WebhookDataDto): Promise<any>;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Payment session item interface.
|
|
3
|
+
*
|
|
4
|
+
* Represents a flattened payment session item used internally by payment providers.
|
|
5
|
+
* This interface is used when sending item data to external payment providers
|
|
6
|
+
* (e.g., Stripe) in a simplified format.
|
|
7
|
+
*
|
|
8
|
+
* @since 2.0.0
|
|
9
|
+
*/
|
|
10
|
+
export interface PaymentSessionItem {
|
|
11
|
+
/**
|
|
12
|
+
* Product/item name.
|
|
13
|
+
*
|
|
14
|
+
* @example "Big Mac"
|
|
15
|
+
* @example "Large Coke"
|
|
16
|
+
*/
|
|
17
|
+
name: string;
|
|
18
|
+
/**
|
|
19
|
+
* Unit price for this item.
|
|
20
|
+
*
|
|
21
|
+
* @example 9.99
|
|
22
|
+
*/
|
|
23
|
+
price: number;
|
|
24
|
+
/**
|
|
25
|
+
* Quantity of this item.
|
|
26
|
+
*
|
|
27
|
+
* @example 2
|
|
28
|
+
*/
|
|
29
|
+
quantity: number;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|