Skip to content

Commit

Permalink
✨add erp order expenses and item prices (#446)
Browse files Browse the repository at this point in the history
  • Loading branch information
julianzimmermann authored Oct 2, 2023
1 parent 65daa56 commit acd13d4
Show file tree
Hide file tree
Showing 10 changed files with 190 additions and 5 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI

on:
push:
branches: [ main ]

jobs:
continous-integration:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: [ "8.0", "8.1", "8.2" ]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo, pgsql, json
coverage: xdebug #optional
- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies and run ci tasks
run: make install ci
30 changes: 30 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.PHONY: install
install:
composer install

.PHONY: phpcs
phpcs:
./vendor/bin/phpcs --standard=./vendor/spryker/code-sniffer/Spryker/ruleset.xml ./src/FondOfOryx/* ./tests/*

.PHONY: phpcbf
phpcbf:
./vendor/bin/phpcbf --standard=./vendor/spryker/code-sniffer/Spryker/ruleset.xml ./src/FondOfOryx/* ./tests/*

.PHONY: phpstan
phpstan:
./vendor/bin/phpstan --memory-limit=-1 analyse ./src/FondOfOryx ./tests

.PHONY: codeception
codeception:
./vendor/bin/codecept run --env standalone

.PHONY: ci
ci: phpcs codeception phpstan

.PHONY: clean
clean:
rm -Rf composer.lock
rm -Rf ./vendor
find ./tests/_output/ -not -name .gitignore -not -name .gitkeep -delete
rm -Rf src/Generated/*
rm -Rf src/Orm/*
8 changes: 5 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
"php": ">=8.0"
},
"require-dev": {
"fond-of-codeception/spryker": "^2.0.0",
"spryker/code-sniffer": "^0.12"
"fond-of-codeception/spryker": "*",
"spryker/code-sniffer": "*",
"spryker-sdk/phpstan-spryker": "*"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand All @@ -25,7 +26,8 @@
"autoload-dev": {
"psr-4": {
"FondOfOryx\\": "tests/FondOfOryx/",
"Generated\\": "src/Generated/"
"Generated\\": "src/Generated/",
"Orm\\Zed\\": "src/Orm/Zed/"
}
},
"config": {
Expand Down
7 changes: 7 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
parameters:
level: 5
reportUnmatchedIgnoredErrors: false
scanDirectories:
- src/Orm/Zed
ignoreErrors:
- '#.* on an unknown class Generated\\(Client|Glue|Service|Yves|Zed)\\.*#'
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<transfers xmlns="spryker:transfer-01"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="spryker:transfer-01 https://static.spryker.com/transfer-01.xsd">
<transfer name="ErpOrderAddress" />
<transfer name="ErpOrderAmount" />
<transfer name="ErpOrder" />
<transfer name="ErpOrderExpense" />
<transfer name="ErpOrderItem" />
<transfer name="ErpOrderTotals" />
</transfers>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace FondOfOryx\Zed\ErpOrderExtension\Dependency\Plugin;

use Generated\Shared\Transfer\ErpOrderAmountTransfer;
use Generated\Shared\Transfer\ErpOrderTransfer;

interface ErpOrderAmountPostSavePluginInterface
{
/**
* Specification:
* - Plugin is triggered after erp invoice total object was saved.
*
* @api
*
* @param \Generated\Shared\Transfer\ErpOrderAmountTransfer $erpOrderAmountTransfer
* @param \Generated\Shared\Transfer\ErpOrderTransfer|null $existingErpOrderTransfer
*
* @return \Generated\Shared\Transfer\ErpOrderAmountTransfer
*/
public function postSave(
ErpOrderAmountTransfer $erpOrderAmountTransfer,
?ErpOrderTransfer $existingErpOrderTransfer = null
): ErpOrderAmountTransfer;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace FondOfOryx\Zed\ErpOrderExtension\Dependency\Plugin;

use Generated\Shared\Transfer\ErpOrderAmountTransfer;
use Generated\Shared\Transfer\ErpOrderTransfer;

interface ErpOrderAmountPreSavePluginInterface
{
/**
* Specification:
* - Plugin is triggered before erp invoice amount object is saved.
*
* @api
*
* @param \Generated\Shared\Transfer\ErpOrderAmountTransfer $erpOrderAmountTransfer
* @param \Generated\Shared\Transfer\ErpOrderTransfer|null $existingErpOrderTransfer
*
* @return \Generated\Shared\Transfer\ErpOrderAmountTransfer
*/
public function preSave(
ErpOrderAmountTransfer $erpOrderAmountTransfer,
?ErpOrderTransfer $existingErpOrderTransfer = null
): ErpOrderAmountTransfer;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace FondOfOryx\Zed\ErpOrderExtension\Dependency\Plugin;

use Generated\Shared\Transfer\ErpOrderExpenseTransfer;
use Generated\Shared\Transfer\ErpOrderTransfer;

interface ErpOrderExpensePostSavePluginInterface
{
/**
* Specification:
* - Plugin is triggered after erp invoice expense object was saved.
*
* @api
*
* @param \Generated\Shared\Transfer\ErpOrderExpenseTransfer $erpOrderExpenseTransfer
* @param \Generated\Shared\Transfer\ErpOrderTransfer|null $existingErpOrderTransfer
*
* @return \Generated\Shared\Transfer\ErpOrderExpenseTransfer
*/
public function postSave(
ErpOrderExpenseTransfer $erpOrderExpenseTransfer,
?ErpOrderTransfer $existingErpOrderTransfer = null
): ErpOrderExpenseTransfer;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace FondOfOryx\Zed\ErpOrderExtension\Dependency\Plugin;

use Generated\Shared\Transfer\ErpOrderExpenseTransfer;
use Generated\Shared\Transfer\ErpOrderTransfer;

interface ErpOrderExpensePreSavePluginInterface
{
/**
* Specification:
* - Plugin is triggered before erp invoice expense object is saved.
*
* @api
*
* @param \Generated\Shared\Transfer\ErpOrderExpenseTransfer $erpOrderExpenseTransfer
* @param \Generated\Shared\Transfer\ErpOrderTransfer|null $existingErpOrderTransfer
*
* @return \Generated\Shared\Transfer\ErpOrderExpenseTransfer
*/
public function preSave(
ErpOrderExpenseTransfer $erpOrderExpenseTransfer,
?ErpOrderTransfer $existingErpOrderTransfer = null
): ErpOrderExpenseTransfer;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ interface ErpOrderItemPreSavePluginInterface
*
* @api
*
* @param \Generated\Shared\Transfer\ErpOrderItemTransfer $erpOrderTransfer
* @param \Generated\Shared\Transfer\ErpOrderItemTransfer $erpOrderItemTransfer
*
* @return \Generated\Shared\Transfer\ErpOrderItemTransfer
*/
public function preSave(ErpOrderItemTransfer $erpOrderTransfer): ErpOrderItemTransfer;
public function preSave(ErpOrderItemTransfer $erpOrderItemTransfer): ErpOrderItemTransfer;
}

0 comments on commit acd13d4

Please sign in to comment.