diff --git a/deployments/local/docker-compose.yaml b/deployments/local/docker-compose.yaml index fb4eb5a..6f980cc 100644 --- a/deployments/local/docker-compose.yaml +++ b/deployments/local/docker-compose.yaml @@ -32,11 +32,19 @@ services: - KAFKA_BROKERS=customer-redpanda:9092 - KAFKA_TOPIC_TARIFF=tariffs - - AUTH_MICROSERVICE_USER_URL=http://pena-auth-service:8000/user - - HUBADMIN_MICROSERVICE_TARIFF_URL=http://hub-admin-backend-service:8000/tariff - - CURRENCY_MICROSERVICE_TRANSLATE_URL=http://cbrfworker-service:8000/change - - DISCOUNT_MICROSERVICE_GRPC_HOST=discount-service:9000 - - PAYMENT_MICROSERVICE_GRPC_HOST=treasurer-service:9085 + - AUTH_MICROSERVICE_USER_URL=http://10.6.0.11:59300/user + - HUBADMIN_MICROSERVICE_TARIFF_URL=http://10.6.0.11:59303/tariff + - CURRENCY_MICROSERVICE_TRANSLATE_URL=http://10.6.0.11:3131/change + - DISCOUNT_MICROSERVICE_GRPC_HOST=10.6.0.11:9001 + - PAYMENT_MICROSERVICE_GRPC_HOST=10.6.0.11:9085 + - VERIFICATION_MICROSERVICE_USER_URL=http://10.6.0.11:7035/verification + - TEMPLATEGEN_MICROSERVICE_URL=10.6.0.17 + - API_URL=https://api.smtp.bz/v1/smtp/send + - MAIL_SENDER=noreply@mailing.pena.digital + - MAIL_API_KEY=P0YsjUB137upXrr1NiJefHmXVKW1hmBWlpev + - MAIL_AUTH_USERNAME=kotilion.95@gmail.com + - MAIL_AUTH_PASSWORD=vWwbCSg4bf0p + - MAIL_ADDRESS=sells@pena.digital ports: - 8082:8000 - 9092:9000 diff --git a/internal/app/app.go b/internal/app/app.go index 301553d..b2498d3 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -66,6 +66,11 @@ func Run(config *models.Config, logger *zap.Logger) (appErr error) { TariffClient: kafkaTariffClient, }) + err = kafkaTariffClient.Ping(ctx) + if err != nil { + return err + } + clients := initialize.NewClients(initialize.ClientsDeps{ Logger: logger, AuthURL: &config.Service.AuthMicroservice.URL, diff --git a/tests/e2e/addAccount_test.go b/tests/e2e/addAccount_test.go index c31c3a4..013919a 100644 --- a/tests/e2e/addAccount_test.go +++ b/tests/e2e/addAccount_test.go @@ -25,7 +25,7 @@ func TestAddAccount(t *testing.T) { } responseAddAccount, errAddAccount := client.Post[models.Account, models.ResponseErrorHTTP](ctx, &client.RequestSettings{ - URL: "http://localhost:8000/account", + URL: "http://localhost:8082/account", Headers: map[string]string{"Authorization": fmt.Sprintf("Bearer %s", token)}, QueryParams: map[string]string{"id": "64e5d9830fcca0596d82c0c1"}, }) diff --git a/tests/e2e/buy_tariff_test.go b/tests/e2e/buy_tariff_test.go index fb663b1..66dd24b 100644 --- a/tests/e2e/buy_tariff_test.go +++ b/tests/e2e/buy_tariff_test.go @@ -25,7 +25,7 @@ func TestBuyTariff(t *testing.T) { } responseAddCart, errAddCart := client.Patch[models.Account, models.ResponseErrorHTTP](ctx, &client.RequestSettings{ - URL: "http://localhost:8000/cart", + URL: "http://localhost:8082/cart", Headers: map[string]string{"Authorization": fmt.Sprintf("Bearer %s", token)}, QueryParams: map[string]string{"id": "64e6105384368b75221a5c3e"}, }) @@ -42,7 +42,7 @@ func TestBuyTariff(t *testing.T) { if isUserIDValid && isCartItemValid && isCartLengthValid { responsePay, errPay := client.Post[models.Account, models.ResponseErrorHTTP](ctx, &client.RequestSettings{ - URL: "http://localhost:8000/cart/pay", + URL: "http://localhost:8082/cart/pay", Headers: map[string]string{"Authorization": fmt.Sprintf("Bearer %s", token)}, }) if isNoError := assert.NoError(t, errPay); !isNoError { diff --git a/tests/e2e/calculateLTV_test.go b/tests/e2e/calculateLTV_test.go index 6515648..cf7eb26 100644 --- a/tests/e2e/calculateLTV_test.go +++ b/tests/e2e/calculateLTV_test.go @@ -37,7 +37,7 @@ func TestCalculateLTV(t *testing.T) { fmt.Println(from, to) response, err := client.Post[interface{}, models.ResponseErrorHTTP](ctx, &client.RequestSettings{ - URL: "http://localhost:8000/history/ltv", + URL: "http://localhost:8082/history/ltv", Body: swagger.CalculateLTVJSONBody{From: from, To: to}, Headers: map[string]string{"Authorization": fmt.Sprintf("Bearer %s", token)}, }) diff --git a/tests/e2e/changeAccount_test.go b/tests/e2e/changeAccount_test.go index bcfcea9..e084173 100644 --- a/tests/e2e/changeAccount_test.go +++ b/tests/e2e/changeAccount_test.go @@ -32,7 +32,7 @@ func TestChangeAccount(t *testing.T) { } responseChangeAccount, errChangeAccount := client.Patch[models.Account, models.ResponseErrorHTTP](ctx, &client.RequestSettings{ - URL: "http://localhost:8000/account", + URL: "http://localhost:8082/account", Headers: map[string]string{"Authorization": fmt.Sprintf("Bearer %s", token)}, Body: updateRequest, }) @@ -64,7 +64,7 @@ func TestChangeAccount(t *testing.T) { } responseStatusAccount, errStatusAccount := client.Patch[models.Account, models.ResponseErrorHTTP](ctx, &client.RequestSettings{ - URL: "http://localhost:8000/account/64e5d9830fcca0596d82c0c7", + URL: "http://localhost:8082/account/64e5d9830fcca0596d82c0c7", Headers: map[string]string{"Authorization": fmt.Sprintf("Bearer %s", token)}, Body: statusRequest, }) diff --git a/tests/e2e/getAccount_test.go b/tests/e2e/getAccount_test.go index 4038444..20ff6ad 100644 --- a/tests/e2e/getAccount_test.go +++ b/tests/e2e/getAccount_test.go @@ -25,7 +25,7 @@ func TestGetAccount(t *testing.T) { } responseGetAccount, errGetAccount := client.Get[models.Account, models.ResponseErrorHTTP](ctx, &client.RequestSettings{ - URL: "http://localhost:8000/account", + URL: "http://localhost:8082/account", Headers: map[string]string{"Authorization": fmt.Sprintf("Bearer %s", token)}, }) if isNoError := assert.NoError(t, errGetAccount); !isNoError { @@ -48,7 +48,7 @@ func TestGetAccount(t *testing.T) { } responseGetAccount, errGetAccount := client.Get[models.Account, models.ResponseErrorHTTP](ctx, &client.RequestSettings{ - URL: "http://localhost:8000/account/64e5d9830fcca0596d82c0c7", + URL: "http://localhost:8082/account/64e5d9830fcca0596d82c0c7", Headers: map[string]string{"Authorization": fmt.Sprintf("Bearer %s", token)}, }) if isNoError := assert.NoError(t, errGetAccount); !isNoError { @@ -75,7 +75,7 @@ func TestGetAccount(t *testing.T) { } responseGetAccount, errGetAccount := client.Get[models.PaginationResponse[models.Account], models.ResponseErrorHTTP](ctx, &client.RequestSettings{ - URL: "http://localhost:8000/accounts", + URL: "http://localhost:8082/accounts", Body: params, }) if isNoError := assert.NoError(t, errGetAccount); !isNoError { diff --git a/tests/e2e/recentTariffs_test.go b/tests/e2e/recentTariffs_test.go index fdae68b..ea3a116 100644 --- a/tests/e2e/recentTariffs_test.go +++ b/tests/e2e/recentTariffs_test.go @@ -24,7 +24,7 @@ func TestGetRecentTariffs(t *testing.T) { assert.NoError(t, tokenErr) responseGetRecentTariffs, errGetRecentTariffs := client.Get[[]models.TariffID, models.ResponseErrorHTTP](ctx, &client.RequestSettings{ - URL: "http://localhost:8000/recent", + URL: "http://localhost:8082/recent", Headers: map[string]string{"Authorization": fmt.Sprintf("Bearer %s", token)}, }) assert.NoError(t, errGetRecentTariffs) diff --git a/tests/e2e/rspay_test.go b/tests/e2e/rspay_test.go index 7f558f9..c2af109 100644 --- a/tests/e2e/rspay_test.go +++ b/tests/e2e/rspay_test.go @@ -24,7 +24,7 @@ func TestGetAccount(t *testing.T) { } response, err := client.Post[interface{}, models.ResponseErrorHTTP](ctx, &client.RequestSettings{ - URL: "http://localhost:8000/wallet/rspay", + URL: "http://localhost:8082/wallet/rspay", Headers: map[string]string{"Authorization": fmt.Sprintf("Bearer %s", token)}, }) if isNoError := assert.NoError(t, err); !isNoError { diff --git a/tests/e2e/sendReport_test.go b/tests/e2e/sendReport_test.go index 6b2ef25..ca6c2f0 100644 --- a/tests/e2e/sendReport_test.go +++ b/tests/e2e/sendReport_test.go @@ -26,7 +26,7 @@ func TestSendReport(t *testing.T) { assert.NoError(t, tokenErr) responseSendReport, errSendReport := client.Post[interface{}, models.ResponseErrorHTTP](ctx, &client.RequestSettings{ - URL: "http://localhost:8000/sendReport", + URL: "http://localhost:8082/sendReport", Headers: map[string]string{"Authorization": fmt.Sprintf("Bearer %s", token)}, Body: map[string]interface{}{"id": historyID}, }) diff --git a/tests/e2e/сurrencies_test.go b/tests/e2e/сurrencies_test.go index a2adec6..3e1e83b 100644 --- a/tests/e2e/сurrencies_test.go +++ b/tests/e2e/сurrencies_test.go @@ -17,7 +17,7 @@ func TestCurrencies(t *testing.T) { assert.NotPanics(t, func() { responseGetCurrencies, errCurrencies := client.Get[[]models.CurrencyList, models.ResponseErrorHTTP](ctx, &client.RequestSettings{ - URL: "http://localhost:8000/currencies", + URL: "http://localhost:8082/currencies", }) if isNoError := assert.NoError(t, errCurrencies); !isNoError { return diff --git a/tests/integration/history_report_test.go b/tests/integration/history_report_test.go index 7a99e2d..4f0e2d3 100644 --- a/tests/integration/history_report_test.go +++ b/tests/integration/history_report_test.go @@ -22,7 +22,7 @@ func TestHistoryReport(t *testing.T) { } response, err := client.Post[struct{}, models.ResponseErrorHTTP](ctx, &client.RequestSettings{ - URL: "http://" + "localhost:8000" + "/sendReport", + URL: "http://" + "localhost:8082" + "/sendReport", Body: swagger.SendReportJSONBody{Id: "10002"}, Headers: map[string]string{"Authorization": fmt.Sprintf("Bearer %s", token)}, })