Merge branch 'staging'

This commit is contained in:
skeris 2024-10-20 17:05:11 +03:00
commit c141d50f5a
5 changed files with 17 additions and 15 deletions

@ -5,10 +5,13 @@ include:
file: "/templates/docker/deploy-template.gitlab-ci.yml"
- project: "devops/pena-continuous-integration"
file: "/templates/docker/golint.gitlab-ci.yml"
- project: "devops/pena-continuous-integration"
file: "/templates/docker/service-discovery.gitlab-ci.yml"
stages:
- lint
- build
- deploy
- service-discovery
lint:
extends: .golint_template
@ -26,6 +29,8 @@ deploy-to-prod:
- if: "$CI_COMMIT_BRANCH == $PRODUCTION_BRANCH"
tags:
- prod
after_script:
- ls
extends: .deploy_template
service-discovery:
extends: .sd_artefacts_template

@ -4,6 +4,7 @@ INTERNAL:
- Добавлено версионирование модели данных. На данный момент модель под версией 1
FIX:
- При пустой корзине во время оплаты(/cart/pay) больше не будет возвращаться 500, а будет возвращаться 406

@ -1,5 +1,5 @@
# BUILD
FROM golang:1.22.0-alpine AS build
FROM penahub.gitlab.yandexcloud.net:5050/devops/dockerhub-backup/golang:main.3862 AS build
# Update packages and clear cache
RUN apk add --no-cache curl
@ -21,7 +21,7 @@ RUN go mod download
RUN GOOS=linux go build -o bin ./...
# PRODUCTION
FROM alpine:3.18.3 AS production
FROM penahub.gitlab.yandexcloud.net:5050/devops/dockerhub-backup/alpine:main.3862 AS production
# Install packages
RUN apk --no-cache add ca-certificates

@ -2,10 +2,12 @@ version: "3.3"
services:
customer-app-stagingv1.0.1:
hostname: customer-service-stagingv1.0.1
container_name: customer-service-stagingv1.0.1
hostname: customerv1.0.1
container_name: customerv1.0.1
image: $CI_REGISTRY_IMAGE/staging:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID
tty: true
labels:
com.pena.allowed_headers: content-type,authorization,response-type
environment:
- CLIENT_HTTP_HOST=0.0.0.0
- CLIENT_HTTP_PORT=8065
@ -16,7 +18,7 @@ services:
- GRPC_PORT=9065
- GRPC_DOMEN=10.8.0.6:9060
- MONGO_HOST=10.8.0.6
- MONGO_HOST=10.7.0.4
- MONGO_PORT=27017
- MONGO_USER=$MONGO_USER
- MONGO_PASSWORD=$MONGO_PASSWORD
@ -31,7 +33,7 @@ services:
- CURRENCY_MICROSERVICE_TRANSLATE_URL=http://10.8.0.6:3131/change
- DISCOUNT_MICROSERVICE_GRPC_HOST=10.8.0.6:9001
- PAYMENT_MICROSERVICE_GRPC_HOST=10.8.0.6:9085
- VERIFICATION_MICROSERVICE_USER_URL=http://10.8.0.6:7035/verification
- VERIFICATION_MICROSERVICE_USER_URL=http://10.8.0.6:7036/verification
- TEMPLATEGEN_MICROSERVICE_URL=http://10.6.0.17/generator/service
- API_URL=https://api.smtp.bz/v1/smtp/send
- CODEWORD_MICROSERVICE_GRPC_HOST=10.8.0.6:59665

@ -2,9 +2,9 @@ package wallet_client
import (
"context"
"fmt"
"github.com/gofiber/fiber/v2"
"go.uber.org/zap"
"fmt"
"penahub.gitlab.yandexcloud.net/backend/penahub_common/log_mw"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/client"
@ -395,18 +395,12 @@ func (receiver *WalletController) PostWalletRspay(ctx *fiber.Ctx) error {
return receiver.middleWare.Error(ctx, fiber.StatusForbidden, "not allowed for non organizations")
}
token := ctx.Get("Authorization")
fmt.Println("HEADERS", ctx.Request().Header)
verification, err := receiver.verifyClient.GetVerification(ctx.Context(), token, userID)
if err == errors.ErrNotFound {
return receiver.middleWare.Error(ctx, fiber.StatusForbidden, "no verification data found")
}
if (user.Status == models.AccountStatusOrg && len(verification.Files) != 3) ||
(user.Status == models.AccountStatusNko && len(verification.Files) != 4) {
return receiver.middleWare.Error(ctx, fiber.StatusForbidden, "not enough verification files")
}
authData, err := receiver.authClient.GetUser(ctx.Context(), userID)
if err != nil {
return receiver.middleWare.ErrorOld(ctx, err)