Skip to content

Commit

Permalink
FRW-7443 Implemented Store Context functionality. (#10950)
Browse files Browse the repository at this point in the history
FRW-7443 Implemented Store Context functionality.
  • Loading branch information
geega authored Jun 18, 2024
0 parents commit 80d8de9
Show file tree
Hide file tree
Showing 78 changed files with 4,357 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
coverage_clover: tests/_output/coverage.xml
json_path: tests/_output/coveralls-upload.json
service_name: travis-ci
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at https://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.bat]
end_of_line = crlf

36 changes: 36 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Define the line ending behavior of the different file extensions
# Set the default behavior, in case people don't have core.autocrlf set.
* text text=auto eol=lf

*.php diff=php

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.gif binary
*.jpeg binary
*.zip binary
*.phar binary
*.ttf binary
*.woff binary
*.woff2 binary
*.eot binary
*.ico binary
*.mo binary
*.pdf binary
*.xsd binary
*.exe binary

# Remove files for archives generated using `git archive`
dependency.json export-ignore
phpstan.json export-ignore
phpstan.neon export-ignore
psalm-report.json export-ignore linguist-generated=true
tooling.yml export-ignore
.coveralls.yml export-ignore
.travis.yml export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.github/ export-ignore
architecture-baseline.json export-ignore
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI

on:
push:
branches:
- 'master'
pull_request:
workflow_dispatch:

jobs:
validation:
name: Validation
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: mbstring, intl, bcmath
coverage: none

- name: Composer Install
run: composer install --prefer-dist --no-interaction --profile

- name: Run validation
run: composer validate

- name: Syntax check
run: find ./src -path src -prune -o -type f -name '*.php' -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" )

lowest:
name: Prefer Lowest
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mbstring, intl, bcmath
coverage: none

- name: Composer Install
run: composer install --prefer-dist --no-interaction --profile

- name: Composer Update
run: composer update --prefer-lowest --prefer-dist --no-interaction --profile -vvv
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# IDEs
/.idea
/.project
/nbproject
/.buildpath
/.settings
*.sublime-*
*.AppleDouble
*.AppleDB
*.AppleDesktop

# OS
.DS_Store

/vendor
composer.lock
.phpunit.result.cache

# tests
tests/**/_generated/
tests/_output/*
!tests/_output/.gitkeep
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# StoreContext Changelog

[Release Changelog](https://github.com/spryker/store-context/releases)
40 changes: 40 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
SPRYKER SYSTEMS GMBH EVALUATION LICENSE AGREEMENT

SPRYKER SYSTEMS GMBH, REGISTERED WITH THE COMMERCIAL REGISTER OF THE LOWER COURT OF HAMBURG UNDER HRB 134310
("WE" OR "SPRYKER")GRANTS YOU (THE "LICENSEE") THE RIGHT TO USE THE SOFTWARE (AS DEFINED BELOW)
UNDER THE PROVISIONS OF THIS EVALUATION LICENSE AGREEMENT (THE "AGREEMENT").

The "Software" includes any software owned and distributed by Spryker under this Agreement. The Software
contains elements of open source components, to which different license terms apply respectively.
These open source components are needed to be installed separately.

Spryker grants to Licensee, during the 45-calendar-day period (the "Evaluation Period") following the download of the Software,
the nontransferable, nonexclusive limited, free of charge license to permit Licensee's employees to internally use the Software
to test and evaluate the Software in connection with potentially purchasing non-evaluation licenses to the Software.

Licensee shall not (i) use the Software to set up a productive live system, for development purposes or any other purposes apart
from evaluating the Software; (ii) copy any part of the Software except to make one copy for back-up purposes; (iii) distribute,
disclose, market, rent, lease, or transfer the Software or act as a service bureau with respect to the Software; (iv) export the
Software or install it in multiple locations; (v) disclose any confidential information provided by Spryker; (vi) modify or make
derivative works of the Software; or (vii) allow others to make or obtain copies of the Software.

THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND. SPRYKER DISCLAIMS ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, TITLE, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. SPRYKER WILL NOT
BE LIABLE FOR ANY DAMAGES ASSOCIATED WITH THE SOFTWARE, INCLUDING WITHOUT LIMITATION ORDINARY, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL
DAMAGES OF ANY KIND, INCLUDING BUT NOT LIMITED TO DAMAGES RELATING TO LOST DATA OR LOST PROFITS, EVEN IF SPRYKER HAS BEEN ADVISED OF
THE POSSIBILITY OF SUCH DAMAGES.

Licensee's license to use the Software shall terminate on the earlier of (i) the expiration of the Evaluation Period, or (ii) the date
both parties enter into a definitive agreement for the provision by Spryker to Licensee of a non-evaluation license to the Software.
Upon termination of the license as provided above, Licensee shall promptly destroy the Software and any back-up copy of the Software
made during the Evaluation Period if Spryker and the Licensee have not agreed a non-evaluation license to the Software.

This Agreement shall be governed by the laws of Germany to the exclusion of IPR (International Law) and the United Nations Convention
on Contracts for the International Sale of Goods (CISG). The parties consent to the jurisdiction of the courts in Berlin (Germany).

This Agreement is not assignable or transferable by Licensee and any attempt to do so is null and void.

This Agreement constitutes the entire agreement between the parties concerning Licensee's use of the Software. This Agreement supersedes
any prior verbal understanding between the parties and any Licensee purchase order or other ordering document, regardless of whether such
document is received by Spryker before or after execution of this Agreement. This Agreement may be amended only in a writing signed by
an authorized officer of Spryker.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# StoreContext Module
[![Latest Stable Version](https://poser.pugx.org/spryker/store-context/v/stable.svg)](https://packagist.org/packages/spryker/store-context)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%208.1-8892BF.svg)](https://php.net/)

Module provides store context functionality.

## Installation

```
composer require spryker/store-context
```

## Documentation

[Spryker Documentation](https://docs.spryker.com)
1 change: 1 addition & 0 deletions architecture-baseline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
14 changes: 14 additions & 0 deletions codeception.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace: StoreContext
include:
- tests/SprykerTest/Zed/StoreContext
paths:
tests: tests
output: tests/_output
data: tests/_data
support: tests/_support
envs: tests/_envs
settings:
suite_class: \PHPUnit\Framework\TestSuite
colors: true
memory_limit: 1024M
log: true
48 changes: 48 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"name": "spryker/store-context",
"type": "library",
"description": "StoreContext module",
"license": "proprietary",
"require": {
"php": ">=8.1",
"spryker/kernel": "^3.30.0",
"spryker/store": "^1.25.0",
"spryker/store-extension": "^1.0.0",
"spryker/transfer": "^3.27.0",
"spryker/util-encoding": "^2.0.0"
},
"require-dev": {
"spryker/application": "*",
"spryker/code-sniffer": "*",
"spryker/container": "*",
"spryker/propel": "*",
"spryker/testify": "*"
},
"autoload": {
"psr-4": {
"Spryker\\": "src/Spryker/"
}
},
"autoload-dev": {
"psr-4": {
"SprykerTest\\": "tests/SprykerTest/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"cs-check": "phpcs -p -s --standard=vendor/spryker/code-sniffer/SprykerStrict/ruleset.xml src/ tests/",
"cs-fix": "phpcbf -p --standard=vendor/spryker/code-sniffer/SprykerStrict/ruleset.xml src/ tests/"
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"config": {
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
8 changes: 8 additions & 0 deletions data/translation/Zed/de_DE.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"Application %application% is not valid.","Anwendung %application% ist ungültig."
"Default store context do not exist in the store context collection.","Standardeinstellungen sind in der Store-Einstellungen Collection nicht vorhanden."
"Application %application% is used more than once.","Anwendung %application% wird mehr als einmal verwendet."
"Timezone %timezone% is not valid.","Zeitzone %timezone% ist ungültig."
"Store context already exist for id: %id%.","Speichereinstellungen existieren bereits für ID: %id%."
"Store context not found for store id: %id%.","Speichereinstellungen für Store-ID: %id% nicht gefunden."
"Store context collection is missing.","Die Sammlung der Speichereinstellungen fehlt."
"Store is missing in store context.","Der Store fehlt im Store-Kontext."
8 changes: 8 additions & 0 deletions data/translation/Zed/en_US.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"Application %application% is not valid.","Application %application% is not valid."
"Default store context do not exist in the store context collection.","Default settings do not exist in the store settings collection."
"Application %application% is used more than once.","Application %application% is used more than once."
"Timezone %timezone% is not valid.","Timezone %timezone% is not valid."
"Store context already exist for id: %id%.","Store settings already exist for id: %id%."
"Store context not found for store id: %id%.","Store settings not found for store id: %id%."
"Store context collection is missing.","Store settings collection is missing."
"Store is missing in store context.","Store is missing in store context."
5 changes: 5 additions & 0 deletions dependency.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"include": {
"spryker/transfer": "Provides transfer objects definition with strict types."
}
}
3 changes: 3 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
parameters:
level: 8
checkGenericClassInNonGenericObjectType: false
5 changes: 5 additions & 0 deletions psalm-report.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0"?>
<transfers xmlns="spryker:transfer-01" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="spryker:transfer-01 http://static.spryker.com/transfer-01.xsd">
<transfer name="StoreApplicationContext" strict="true">
<property name="application" type="string"/>
<property name="timezone" type="string"/>
</transfer>

<transfer name="StoreApplicationContextCollection" strict="true">
<property name="applicationContexts" type="StoreApplicationContext[]" singular="applicationContext"/>
</transfer>

<transfer name="StoreContext" strict="true">
<property name="applicationContextCollection" type="StoreApplicationContextCollection"/>
<property name="store" type="Store"/>
</transfer>

<transfer name="StoreContextCollection" strict="true">
<property name="contexts" type="StoreContext[]" singular="context"/>
</transfer>

<transfer name="Store">
<property name="applicationContextCollection" type="StoreApplicationContextCollection" strict="true"/>
<property name="name" type="string"/>
<property name="idStore" type="int"/>
</transfer>

<transfer name="StoreStorage">
<property name="applicationContextCollection" type="StoreApplicationContextCollection"/>
</transfer>

<transfer name="StoreCollection">
<property name="stores" type="Store[]" singular="store"/>
</transfer>

<transfer name="StoreResponse">
<property name="store" type="Store"/>
<property name="isSuccessful" type="bool"/>
<property name="messages" type="Message[]" singular="message"/>
</transfer>

<transfer name="Error">
<property name="message" type="string"/>
<property name="entityIdentifier" type="string"/>
<property name="parameters" type="array" singular="parameter"/>
</transfer>

<transfer name="StoreContextCollectionRequest">
<property name="contexts" type="StoreContext[]" singular="context"/>
</transfer>
<transfer name="StoreContextCollectionResponse">
<property name="contexts" type="StoreContext[]" singular="context"/>
<property name="errors" type="Error[]" singular="error"/>
</transfer>

<transfer name="Message">
<property name="value" type="string"/>
<property name="message" type="string"/>
<property name="parameters" type="array" singular="parameters"/>
</transfer>
</transfers>
Loading

0 comments on commit 80d8de9

Please sign in to comment.