update local deployment

This commit is contained in:
Pavel 2024-03-11 21:19:39 +03:00
parent d4fc763816
commit 5264dcc64e
12 changed files with 32 additions and 19 deletions

@ -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

@ -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,

@ -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"},
})

@ -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 {

@ -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)},
})

@ -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,
})

@ -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 {

@ -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)

@ -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 {

@ -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},
})

@ -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

@ -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)},
})