├── .env ├── .gitignore ├── README.md ├── docker-compose.yml ├── inventory ├── .eslintrc.js ├── .gitignore ├── .prettierrc ├── Dockerfile ├── nest-cli.json ├── package.json ├── src │ ├── app.module.ts │ ├── config │ │ └── index.ts │ ├── entities │ │ └── product.ts │ ├── main.ts │ ├── repositories │ │ ├── memory │ │ │ └── product.repository.ts │ │ └── product.repository.interface.ts │ ├── services │ │ ├── product.service.interface.ts │ │ └── product.service.ts │ └── usecases │ │ ├── fetch-availible-products │ │ └── check-products-availiblity.controller.ts │ │ └── update-stock │ │ └── update-stock.controller.ts ├── test │ ├── app.e2e-spec.ts │ └── jest-e2e.json ├── tsconfig.build.json ├── tsconfig.json └── yarn.lock ├── order ├── .eslintrc.js ├── .gitignore ├── .prettierrc ├── Dockerfile ├── nest-cli.json ├── package.json ├── src │ ├── app.module.ts │ ├── config │ │ └── index.ts │ ├── entities │ │ ├── order-item.ts │ │ ├── order-status.ts │ │ └── order.ts │ ├── exceptions │ │ ├── base_error.ts │ │ ├── http │ │ │ └── payment_required_exception.ts │ │ ├── out_of_stock_error.ts │ │ └── payment_not_successful.ts │ ├── main.ts │ ├── repositories │ │ ├── memory │ │ │ └── order.repository.ts │ │ └── order.repository.interface.ts │ ├── services │ │ ├── order.service.interface.ts │ │ └── order.service.ts │ └── usecases │ │ └── create-order │ │ ├── create-order.controller.ts │ │ ├── dtos │ │ └── create-order-dto.ts │ │ └── saga │ │ ├── create-order.saga.ts │ │ └── steps │ │ ├── authorize-payment.step.ts │ │ ├── check-product-availibilty.step.ts │ │ ├── confirm-order.step.ts │ │ ├── place-order.step.ts │ │ ├── step.ts │ │ └── update-stock.step.ts ├── tsconfig.build.json ├── tsconfig.json └── yarn.lock └── payment ├── .eslintrc.js ├── .prettierrc ├── Dockerfile ├── nest-cli.json ├── package.json ├── src ├── app.module.ts ├── config │ └── index.ts ├── entities │ ├── payment-status.ts │ └── payment.ts ├── main.ts ├── repositories │ ├── memory │ │ └── payment.repository.ts │ └── payment.repository.interface.ts ├── services │ ├── payment.service.interface.ts │ └── payment.service.ts └── usecases │ └── authorize-payment │ └── authorize-payment.controller.ts ├── test ├── app.e2e-spec.ts └── jest-e2e.json ├── tsconfig.build.json ├── tsconfig.json └── yarn.lock /.env: -------------------------------------------------------------------------------- 1 | NODEJS_DOCKER_IMAGE=node:18.19.0-slim 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/.gitignore -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/README.md -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/docker-compose.yml -------------------------------------------------------------------------------- /inventory/.eslintrc.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/inventory/.eslintrc.js -------------------------------------------------------------------------------- /inventory/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/inventory/.gitignore -------------------------------------------------------------------------------- /inventory/.prettierrc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/inventory/.prettierrc -------------------------------------------------------------------------------- /inventory/Dockerfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/inventory/Dockerfile -------------------------------------------------------------------------------- /inventory/nest-cli.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/inventory/nest-cli.json -------------------------------------------------------------------------------- /inventory/package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/inventory/package.json -------------------------------------------------------------------------------- /inventory/src/app.module.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/inventory/src/app.module.ts -------------------------------------------------------------------------------- /inventory/src/config/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/inventory/src/config/index.ts -------------------------------------------------------------------------------- /inventory/src/entities/product.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/inventory/src/entities/product.ts -------------------------------------------------------------------------------- /inventory/src/main.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/inventory/src/main.ts -------------------------------------------------------------------------------- /inventory/src/repositories/memory/product.repository.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/inventory/src/repositories/memory/product.repository.ts -------------------------------------------------------------------------------- /inventory/src/repositories/product.repository.interface.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/inventory/src/repositories/product.repository.interface.ts -------------------------------------------------------------------------------- /inventory/src/services/product.service.interface.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/inventory/src/services/product.service.interface.ts -------------------------------------------------------------------------------- /inventory/src/services/product.service.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/inventory/src/services/product.service.ts -------------------------------------------------------------------------------- /inventory/src/usecases/fetch-availible-products/check-products-availiblity.controller.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/inventory/src/usecases/fetch-availible-products/check-products-availiblity.controller.ts -------------------------------------------------------------------------------- /inventory/src/usecases/update-stock/update-stock.controller.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/inventory/src/usecases/update-stock/update-stock.controller.ts -------------------------------------------------------------------------------- /inventory/test/app.e2e-spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/inventory/test/app.e2e-spec.ts -------------------------------------------------------------------------------- /inventory/test/jest-e2e.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/inventory/test/jest-e2e.json -------------------------------------------------------------------------------- /inventory/tsconfig.build.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/inventory/tsconfig.build.json -------------------------------------------------------------------------------- /inventory/tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/inventory/tsconfig.json -------------------------------------------------------------------------------- /inventory/yarn.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/inventory/yarn.lock -------------------------------------------------------------------------------- /order/.eslintrc.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/.eslintrc.js -------------------------------------------------------------------------------- /order/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/.gitignore -------------------------------------------------------------------------------- /order/.prettierrc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/.prettierrc -------------------------------------------------------------------------------- /order/Dockerfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/Dockerfile -------------------------------------------------------------------------------- /order/nest-cli.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/nest-cli.json -------------------------------------------------------------------------------- /order/package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/package.json -------------------------------------------------------------------------------- /order/src/app.module.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/src/app.module.ts -------------------------------------------------------------------------------- /order/src/config/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/src/config/index.ts -------------------------------------------------------------------------------- /order/src/entities/order-item.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/src/entities/order-item.ts -------------------------------------------------------------------------------- /order/src/entities/order-status.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/src/entities/order-status.ts -------------------------------------------------------------------------------- /order/src/entities/order.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/src/entities/order.ts -------------------------------------------------------------------------------- /order/src/exceptions/base_error.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/src/exceptions/base_error.ts -------------------------------------------------------------------------------- /order/src/exceptions/http/payment_required_exception.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/src/exceptions/http/payment_required_exception.ts -------------------------------------------------------------------------------- /order/src/exceptions/out_of_stock_error.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/src/exceptions/out_of_stock_error.ts -------------------------------------------------------------------------------- /order/src/exceptions/payment_not_successful.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/src/exceptions/payment_not_successful.ts -------------------------------------------------------------------------------- /order/src/main.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/src/main.ts -------------------------------------------------------------------------------- /order/src/repositories/memory/order.repository.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/src/repositories/memory/order.repository.ts -------------------------------------------------------------------------------- /order/src/repositories/order.repository.interface.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/src/repositories/order.repository.interface.ts -------------------------------------------------------------------------------- /order/src/services/order.service.interface.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/src/services/order.service.interface.ts -------------------------------------------------------------------------------- /order/src/services/order.service.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/src/services/order.service.ts -------------------------------------------------------------------------------- /order/src/usecases/create-order/create-order.controller.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/src/usecases/create-order/create-order.controller.ts -------------------------------------------------------------------------------- /order/src/usecases/create-order/dtos/create-order-dto.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/src/usecases/create-order/dtos/create-order-dto.ts -------------------------------------------------------------------------------- /order/src/usecases/create-order/saga/create-order.saga.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/src/usecases/create-order/saga/create-order.saga.ts -------------------------------------------------------------------------------- /order/src/usecases/create-order/saga/steps/authorize-payment.step.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/src/usecases/create-order/saga/steps/authorize-payment.step.ts -------------------------------------------------------------------------------- /order/src/usecases/create-order/saga/steps/check-product-availibilty.step.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/src/usecases/create-order/saga/steps/check-product-availibilty.step.ts -------------------------------------------------------------------------------- /order/src/usecases/create-order/saga/steps/confirm-order.step.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/src/usecases/create-order/saga/steps/confirm-order.step.ts -------------------------------------------------------------------------------- /order/src/usecases/create-order/saga/steps/place-order.step.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/src/usecases/create-order/saga/steps/place-order.step.ts -------------------------------------------------------------------------------- /order/src/usecases/create-order/saga/steps/step.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/src/usecases/create-order/saga/steps/step.ts -------------------------------------------------------------------------------- /order/src/usecases/create-order/saga/steps/update-stock.step.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/src/usecases/create-order/saga/steps/update-stock.step.ts -------------------------------------------------------------------------------- /order/tsconfig.build.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/tsconfig.build.json -------------------------------------------------------------------------------- /order/tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/tsconfig.json -------------------------------------------------------------------------------- /order/yarn.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/order/yarn.lock -------------------------------------------------------------------------------- /payment/.eslintrc.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/payment/.eslintrc.js -------------------------------------------------------------------------------- /payment/.prettierrc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/payment/.prettierrc -------------------------------------------------------------------------------- /payment/Dockerfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/payment/Dockerfile -------------------------------------------------------------------------------- /payment/nest-cli.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/payment/nest-cli.json -------------------------------------------------------------------------------- /payment/package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/payment/package.json -------------------------------------------------------------------------------- /payment/src/app.module.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/payment/src/app.module.ts -------------------------------------------------------------------------------- /payment/src/config/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/payment/src/config/index.ts -------------------------------------------------------------------------------- /payment/src/entities/payment-status.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/payment/src/entities/payment-status.ts -------------------------------------------------------------------------------- /payment/src/entities/payment.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/payment/src/entities/payment.ts -------------------------------------------------------------------------------- /payment/src/main.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/payment/src/main.ts -------------------------------------------------------------------------------- /payment/src/repositories/memory/payment.repository.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/payment/src/repositories/memory/payment.repository.ts -------------------------------------------------------------------------------- /payment/src/repositories/payment.repository.interface.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/payment/src/repositories/payment.repository.interface.ts -------------------------------------------------------------------------------- /payment/src/services/payment.service.interface.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/payment/src/services/payment.service.interface.ts -------------------------------------------------------------------------------- /payment/src/services/payment.service.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/payment/src/services/payment.service.ts -------------------------------------------------------------------------------- /payment/src/usecases/authorize-payment/authorize-payment.controller.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/payment/src/usecases/authorize-payment/authorize-payment.controller.ts -------------------------------------------------------------------------------- /payment/test/app.e2e-spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/payment/test/app.e2e-spec.ts -------------------------------------------------------------------------------- /payment/test/jest-e2e.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/payment/test/jest-e2e.json -------------------------------------------------------------------------------- /payment/tsconfig.build.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/payment/tsconfig.build.json -------------------------------------------------------------------------------- /payment/tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/payment/tsconfig.json -------------------------------------------------------------------------------- /payment/yarn.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KaoutharAsma/nestjs-kafka-saga-pattern/HEAD/payment/yarn.lock --------------------------------------------------------------------------------