Fixes
Some checks failed
Gitea Actions / Run-Tests-On-Arm64 (push) Failing after 1m22s
Gitea Actions / Run-Tests-On-Amd64 (push) Failing after 2m48s

This commit is contained in:
Thomas 2025-03-04 15:32:33 +01:00
parent 9d5a7522b9
commit e2357ad09f
12 changed files with 105 additions and 34 deletions

View File

@ -2,6 +2,8 @@ version: '3.7'
services: services:
application: application:
volumes:
- ${APP_CODE_PATH_HOST?}:${APP_CODE_PATH_CONTAINER?}
environment: environment:
- APP_ENV=test - APP_ENV=test
php-cron: php-cron:

View File

@ -0,0 +1,21 @@
version: '3.7'
services:
application:
environment:
- APP_ENV=dev
volumes:
- ${APP_CODE_PATH_HOST?}:${APP_CODE_PATH_CONTAINER?}
php-cron:
environment:
- APP_ENV=dev
volumes:
- ${APP_CODE_PATH_HOST?}:${APP_CODE_PATH_CONTAINER?}
web:
volumes:
- ${APP_CODE_PATH_HOST?}:${APP_CODE_PATH_CONTAINER?}
php-fpm:
volumes:
- ${APP_CODE_PATH_HOST?}:${APP_CODE_PATH_CONTAINER?}
environment:
- APP_ENV=test

View File

@ -22,8 +22,6 @@ services:
- "SYS_PTRACE" - "SYS_PTRACE"
security_opt: security_opt:
- "seccomp=unconfined" - "seccomp=unconfined"
volumes:
- ${APP_CODE_PATH_HOST?}:${APP_CODE_PATH_CONTAINER?}
networks: networks:
- network - network
extra_hosts: extra_hosts:
@ -31,8 +29,6 @@ services:
php-cron: php-cron:
environment: environment:
- PHP_IDE_CONFIG=${PHP_IDE_CONFIG?} - PHP_IDE_CONFIG=${PHP_IDE_CONFIG?}
volumes:
- ${APP_CODE_PATH_HOST?}:${APP_CODE_PATH_CONTAINER?}
networks: networks:
- network - network
cap_add: cap_add:
@ -43,8 +39,6 @@ services:
- host.docker.internal:host-gateway - host.docker.internal:host-gateway
web: web:
volumes:
- ${APP_CODE_PATH_HOST?}:${APP_CODE_PATH_CONTAINER?}
ports: ports:
- "${NGINX_HOST_HTTP_PORT:-80}:80" - "${NGINX_HOST_HTTP_PORT:-80}:80"
- "${NGINX_HOST_HTTPS_PORT:-443}:443" - "${NGINX_HOST_HTTPS_PORT:-443}:443"
@ -106,8 +100,6 @@ services:
- "SYS_PTRACE" - "SYS_PTRACE"
security_opt: security_opt:
- "seccomp=unconfined" - "seccomp=unconfined"
volumes:
- ${APPLICATION_CODE_PATH_HOST?}:${APPLICATION_CODE_PATH_CONTAINER?}
ports: ports:
- "${APPLICATION_SSH_HOST_PORT:-2222}:22" - "${APPLICATION_SSH_HOST_PORT:-2222}:22"
- "${APPLICATION_PANTHER_HOST_PORT:-9001}:9001" - "${APPLICATION_PANTHER_HOST_PORT:-9001}:9001"
@ -118,6 +110,8 @@ services:
- host.docker.internal:host-gateway - host.docker.internal:host-gateway
depends_on: depends_on:
- chrome - chrome
- mysql
- mongodb
mongodb: mongodb:
image: mongo:${MONGODB_VERSION?} image: mongo:${MONGODB_VERSION?}
#volumes: #volumes:

View File

@ -24,12 +24,12 @@ jobs:
run: | run: |
make make-init ENVS="ENV=ci TAG=latest" make make-init ENVS="ENV=ci TAG=latest"
make docker-compose-init-test make docker-compose-init-test
- name: Build Images - name: Build Application Image
run: | run: |
make docker-compose-build make docker-compose-build DOCKER_SERVICE_NAME=application
- name: Run Server - name: Run Application Image
run: | run: |
make docker-compose-up make docker-compose-up DOCKER_SERVICE_NAME=application
- name: Load Data - name: Load Data
run: | run: |
docker exec -i psc_ci-mongodb-1 /usr/bin/mongorestore --archive < ./dev_db/mongodb.dump docker exec -i psc_ci-mongodb-1 /usr/bin/mongorestore --archive < ./dev_db/mongodb.dump
@ -44,6 +44,12 @@ jobs:
- name: Generate Token - name: Generate Token
run: | run: |
make console ARGS="lexik:jwt:generate-keypair" make console ARGS="lexik:jwt:generate-keypair"
- name: Build Images
run: |
make docker-compose-build
- name: Run Server
run: |
make docker-compose-up
- name: Run Tests - name: Run Tests
run: | run: |
make test make test
@ -72,12 +78,12 @@ jobs:
run: | run: |
make make-init ENVS="ENV=ci TAG=latest" make make-init ENVS="ENV=ci TAG=latest"
make docker-compose-init-test make docker-compose-init-test
- name: Build Images - name: Build Application Image
run: | run: |
make docker-compose-build make docker-compose-build DOCKER_SERVICE_NAME=application
- name: Run Server - name: Run Application Image
run: | run: |
make docker-compose-up make docker-compose-up DOCKER_SERVICE_NAME=application
- name: Load Data - name: Load Data
run: | run: |
docker exec -i psc_ci-mongodb-1 /usr/bin/mongorestore --archive < ./dev_db/mongodb.dump docker exec -i psc_ci-mongodb-1 /usr/bin/mongorestore --archive < ./dev_db/mongodb.dump
@ -92,6 +98,12 @@ jobs:
- name: Generate Token - name: Generate Token
run: | run: |
make console ARGS="lexik:jwt:generate-keypair" make console ARGS="lexik:jwt:generate-keypair"
- name: Build Images
run: |
make docker-compose-build
- name: Run Server
run: |
make docker-compose-up
- name: Run Tests - name: Run Tests
run: | run: |
make test make test

View File

@ -21,6 +21,7 @@ DOCKER_COMPOSE_DIR:=$(DOCKER_DIR)/docker-compose
DOCKER_COMPOSE_FILE_LOCAL_CI_PROD:=$(DOCKER_COMPOSE_DIR)/docker-compose.local.ci.prod.yml DOCKER_COMPOSE_FILE_LOCAL_CI_PROD:=$(DOCKER_COMPOSE_DIR)/docker-compose.local.ci.prod.yml
DOCKER_COMPOSE_FILE_LOCAL_CI:=$(DOCKER_COMPOSE_DIR)/docker-compose.local.ci.yml DOCKER_COMPOSE_FILE_LOCAL_CI:=$(DOCKER_COMPOSE_DIR)/docker-compose.local.ci.yml
DOCKER_COMPOSE_FILE_LOCAL_PROD:=$(DOCKER_COMPOSE_DIR)/docker-compose.local.prod.yml DOCKER_COMPOSE_FILE_LOCAL_PROD:=$(DOCKER_COMPOSE_DIR)/docker-compose.local.prod.yml
DOCKER_COMPOSE_FILE_LOCAL_DEV:=$(DOCKER_COMPOSE_DIR)/docker-compose.local.dev.yml
DOCKER_COMPOSE_FILE_LOCAL:=$(DOCKER_COMPOSE_DIR)/docker-compose.local.yml DOCKER_COMPOSE_FILE_LOCAL:=$(DOCKER_COMPOSE_DIR)/docker-compose.local.yml
DOCKER_COMPOSE_FILE_PHP_BASE:=$(DOCKER_COMPOSE_DIR)/docker-compose-php-base.yml DOCKER_COMPOSE_FILE_PHP_BASE:=$(DOCKER_COMPOSE_DIR)/docker-compose-php-base.yml
DOCKER_COMPOSE_PROJECT_NAME:=psc_$(ENV) DOCKER_COMPOSE_PROJECT_NAME:=psc_$(ENV)
@ -32,7 +33,7 @@ ifeq ($(ENV),prod)
else ifeq ($(ENV),ci) else ifeq ($(ENV),ci)
DOCKER_COMPOSE_FILES:=-f $(DOCKER_COMPOSE_FILE_LOCAL_CI_PROD) -f $(DOCKER_COMPOSE_FILE_LOCAL_CI) -f $(DOCKER_COMPOSE_FILE_LOCAL_PROD) -f $(DOCKER_COMPOSE_FILE_LOCAL) DOCKER_COMPOSE_FILES:=-f $(DOCKER_COMPOSE_FILE_LOCAL_CI_PROD) -f $(DOCKER_COMPOSE_FILE_LOCAL_CI) -f $(DOCKER_COMPOSE_FILE_LOCAL_PROD) -f $(DOCKER_COMPOSE_FILE_LOCAL)
else ifeq ($(ENV),local) else ifeq ($(ENV),local)
DOCKER_COMPOSE_FILES:=-f $(DOCKER_COMPOSE_FILE_LOCAL_PROD) -f $(DOCKER_COMPOSE_FILE_LOCAL) DOCKER_COMPOSE_FILES:=-f $(DOCKER_COMPOSE_FILE_LOCAL_DEV) -f $(DOCKER_COMPOSE_FILE_LOCAL_PROD) -f $(DOCKER_COMPOSE_FILE_LOCAL)
endif endif
# We need a couple of environment variables for docker compose so we define a make variable that we can # We need a couple of environment variables for docker compose so we define a make variable that we can

View File

@ -153,6 +153,9 @@ class Voucher
*/ */
#[ORM\Column(name: 'wert', type: 'float')] #[ORM\Column(name: 'wert', type: 'float')]
protected $value; protected $value;
#[ORM\Column(name: 'min_basket_value', type: 'float')]
protected $minBasketValue;
/** /**
* Code * Code
* *
@ -191,6 +194,7 @@ class Voucher
$this->toDate = new \DateTime(); $this->toDate = new \DateTime();
$this->createdAt = new \DateTime(); $this->createdAt = new \DateTime();
$this->updatedAt = new \DateTime(); $this->updatedAt = new \DateTime();
$this->minBasketValue = 0;
} }
@ -506,6 +510,14 @@ class Voucher
$this->zeroPayment = $zeroPayment; $this->zeroPayment = $zeroPayment;
} }
public function setMinBasketValue(float $minBasketValue): void
{
$this->minBasketValue = $minBasketValue;
}
public function getMinBasketValue(): float
{
return $this->minBasketValue;
}
} }

View File

@ -46,6 +46,7 @@ class VoucherType extends AbstractType
->add('more', CheckboxType::class, ['label' => 'notindividualcodes', 'required' => false]) ->add('more', CheckboxType::class, ['label' => 'notindividualcodes', 'required' => false])
->add('value', NumberType::class, ['label' => 'Value', 'required' => false]) ->add('value', NumberType::class, ['label' => 'Value', 'required' => false])
->add('count', NumberType::class, ['label' => 'Count', 'required' => false]) ->add('count', NumberType::class, ['label' => 'Count', 'required' => false])
->add('minBasketValue', NumberType::class, ['label' => 'min BasketValue', 'required' => false])
->add('code', TextType::class, ['label' => 'Code', 'required' => false]) ->add('code', TextType::class, ['label' => 'Code', 'required' => false])
->add('mode', ChoiceType::class, array( ->add('mode', ChoiceType::class, array(
'label' => 'Modus', 'label' => 'Modus',
@ -61,7 +62,7 @@ class VoucherType extends AbstractType
->add('zeroPayment', CheckboxType::class, ['label' => 'Zero Payment', 'required' => false]) ->add('zeroPayment', CheckboxType::class, ['label' => 'Zero Payment', 'required' => false])
->add('productIds', TextType::class, ['label' => 'ProductID', 'required' => false]) ->add('productIds', TextType::class, ['label' => 'ProductID', 'required' => false])
->add('productGroupIds', TextType::class, ['label' => 'ProductgroupID', 'required' => false]) ->add('productGroupIds', TextType::class, ['label' => 'ProductgroupID', 'required' => false])
; ;
foreach ($this->fields->getFields(\PSC\System\PluginBundle\Form\Interfaces\Field::Voucher) as $field) { foreach ($this->fields->getFields(\PSC\System\PluginBundle\Form\Interfaces\Field::Voucher) as $field) {
$field->buildForm($builder, $options); $field->buildForm($builder, $options);
} }

View File

@ -1,6 +1,7 @@
Uid: Uid Uid: Uid
active: Aktiv active: Aktiv
Name: Name Name: Name
min BasketValue: ab Warenkorb Wert
General: Allgemein General: Allgemein
from: von from: von
to: bis to: bis
@ -20,4 +21,4 @@ Totalshoppingcart: Gesamter Warenkorb
Calculationvalue: Kalkulationswert (calc_voucher) Calculationvalue: Kalkulationswert (calc_voucher)
Payment: Zahlartkosten reduzieren Payment: Zahlartkosten reduzieren
Shipping: Versandkosten reduzieren Shipping: Versandkosten reduzieren
create: erstellen create: erstellen

View File

@ -164,6 +164,14 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-4">
<div class="row mb-3">
<label class="col-md-3 form-control-label">{{ form_label(form.minBasketValue) }}</label>
<div class="col-md-9">
{{ form_widget(form.minBasketValue) }}
</div>
</div>
</div>
</div> </div>
</div> </div>
<div class="tab-pane" id="add" role="tabpanel"> <div class="tab-pane" id="add" role="tabpanel">

View File

@ -146,6 +146,14 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-4">
<div class="row mb-3">
<label class="col-md-3 form-control-label">{{ form_label(form.minBasketValue) }}</label>
<div class="col-md-9">
{{ form_widget(form.minBasketValue) }}
</div>
</div>
</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">

View File

@ -17,20 +17,20 @@ class Version20250303120815 extends Base
{ {
public function migrateDatabase() public function migrateDatabase()
{ {
$this->entityManager->getConnection()->exec("ALTER TABLE order MODIFY preis float default 0"); $this->entityManager->getConnection()->exec("ALTER TABLE orders MODIFY preis float default 0;");
$this->entityManager->getConnection()->exec("ALTER TABLE order MODIFY enable tinyint(1) default 1"); $this->entityManager->getConnection()->exec("ALTER TABLE orders MODIFY enable tinyint(1) default 1;");
$this->entityManager->getConnection()->exec("ALTER TABLE order MODIFY delivery_same int(1) default 0"); $this->entityManager->getConnection()->exec("ALTER TABLE orders MODIFY delivery_same int(1) default 0;");
$this->entityManager->getConnection()->exec("ALTER TABLE order MODIFY sender_same int(1) default 0"); $this->entityManager->getConnection()->exec("ALTER TABLE orders MODIFY sender_same int(1) default 0;");
$this->entityManager->getConnection()->exec("ALTER TABLE order MODIFY invoice_same int(1) default 0"); $this->entityManager->getConnection()->exec("ALTER TABLE orders MODIFY invoice_same int(1) default 0;");
$this->entityManager->getConnection()->exec("ALTER TABLE order MODIFY zahlkosten float default 0"); $this->entityManager->getConnection()->exec("ALTER TABLE orders MODIFY zahlkosten float default 0;");
$this->entityManager->getConnection()->exec("ALTER TABLE order MODIFY versandkosten float default 0"); $this->entityManager->getConnection()->exec("ALTER TABLE orders MODIFY versandkosten float default 0;");
$this->entityManager->getConnection()->exec("ALTER TABLE order MODIFY gutscheinabzugtyp int(1) default 0"); $this->entityManager->getConnection()->exec("ALTER TABLE orders MODIFY gutscheinabzugtyp int(1) default 0;");
$this->entityManager->getConnection()->exec("ALTER TABLE order MODIFY use_account_as_invoice int(1) default 0"); $this->entityManager->getConnection()->exec("ALTER TABLE orders MODIFY use_account_as_invoice int(1) default 0;");
$this->entityManager->getConnection()->exec("ALTER TABLE order MODIFY mwertalle mediumtext default null"); $this->entityManager->getConnection()->exec("ALTER TABLE orders MODIFY mwertalle mediumtext default null;");
$this->entityManager->getConnection()->exec("ALTER TABLE order MODIFY version int(5) default 1"); $this->entityManager->getConnection()->exec("ALTER TABLE orders MODIFY version int(5) default 1;");
$this->entityManager->getConnection()->exec("ALTER TABLE orderpos MODIFY resale_price float default 0"); $this->entityManager->getConnection()->exec("ALTER TABLE orderspos MODIFY resale_price float default 0;");
$this->entityManager->getConnection()->exec("ALTER TABLE orderpos MODIFY status int(3) default 10"); $this->entityManager->getConnection()->exec("ALTER TABLE orderspos MODIFY status int(3) default 10;");
$this->entityManager->getConnection()->exec("ALTER TABLE orderpos MODIFY layouter_mode int(1) default 0"); $this->entityManager->getConnection()->exec("ALTER TABLE orderspos MODIFY layouter_mode int(1) default 0;");
$this->entityManager->getConnection()->exec("ALTER TABLE orderpos MODIFY render_print int(1) default 0"); $this->entityManager->getConnection()->exec("ALTER TABLE orderspos MODIFY render_print int(1) default 0;");
} }
} }

View File

@ -0,0 +1,11 @@
<?php
namespace PSC\System\UpdateBundle\Migrations;
class Version20250304145512 extends Base
{
public function migrateDatabase(): void
{
$this->entityManager->getConnection()->exec("ALTER TABLE credit_system ADD min_basket_value float null default 0;");
}
}