printer-core 0.0.2__tar.gz → 0.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {printer_core-0.0.2 → printer_core-0.0.4}/.gitignore +207 -207
- {printer_core-0.0.2 → printer_core-0.0.4}/PKG-INFO +1 -1
- {printer_core-0.0.2 → printer_core-0.0.4}/README.md +2 -2
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/__init__.py +1 -1
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/algorithms/__init__.py +3 -3
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/algorithms/products_modifiers_multiprinter.py +59 -59
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/algorithms/products_modifiers_multiprinter_family.py +53 -53
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/algorithms/products_modifiers_unique_ticket.py +30 -30
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/builders/__init__.py +4 -4
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/builders/client_ticket_builder.py +97 -97
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/builders/header_builder.py +26 -26
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/builders/kitchen_ticket_payload_builder.py +99 -99
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/builders/printer_products_grouper.py +19 -19
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/clock.py +6 -6
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/context/__init__.py +1 -1
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/context/ticket_context_builder.py +55 -55
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/dispatchers/__init__.py +2 -2
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/dispatchers/kitchen_ticket_dispatcher.py +34 -34
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/dispatchers/payload_dispatcher.py +18 -18
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/entities/__init__.py +53 -53
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/entities/print_context.py +15 -15
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/entities/print_models.py +230 -230
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/formatters/__init__.py +1 -1
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/formatters/discount_formatter.py +17 -17
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/ports.py +45 -45
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/selectors/__init__.py +1 -1
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/selectors/family_product_selector.py +33 -33
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/services/__init__.py +12 -12
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/services/flows/__init__.py +5 -5
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/services/flows/base.py +26 -26
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/services/flows/client.py +101 -97
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/services/flows/kitchen.py +113 -113
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/services/march_printer_service.py +61 -61
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/services/multi_printer_family_service.py +102 -102
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/services/multi_printer_service.py +49 -49
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/services/order_print_service.py +81 -82
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/services/print_policy.py +73 -72
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/services/unique_ticket_service.py +52 -52
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/tests/unitaries/helpers.py +188 -188
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/tests/unitaries/test_cases_output.py +189 -189
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/tests/unitaries/test_client_ticket_builder.py +78 -78
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/tests/unitaries/test_discount_formatter.py +37 -37
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/tests/unitaries/test_family_product_selector.py +28 -28
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/tests/unitaries/test_flows.py +170 -141
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/tests/unitaries/test_header_builder_foodeo_printers.py +87 -87
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/tests/unitaries/test_kitchen_ticket_dispatcher.py +61 -61
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/tests/unitaries/test_kitchen_ticket_payload_builder.py +113 -113
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/tests/unitaries/test_march_printer_service.py +31 -31
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/tests/unitaries/test_multi_printer_family_service.py +53 -53
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/tests/unitaries/test_multi_printer_service.py +51 -51
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/tests/unitaries/test_order_print_service.py +124 -124
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/tests/unitaries/test_payload_dispatcher.py +61 -61
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/tests/unitaries/test_print_policy.py +45 -45
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/tests/unitaries/test_printer_helpers.py +71 -71
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/tests/unitaries/test_printer_products_grouper.py +20 -20
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/tests/unitaries/test_products_modifiers.py +102 -102
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/tests/unitaries/test_ticket_context_builder.py +71 -71
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/tests/unitaries/test_unique_ticket_service.py +24 -24
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/utils/__init__.py +1 -1
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/utils/printer_helpers.py +42 -42
- {printer_core-0.0.2 → printer_core-0.0.4}/pyproject.toml +44 -44
- {printer_core-0.0.2 → printer_core-0.0.4}/scripts/link_backend_env.sh +0 -0
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/tests/__init__.py +0 -0
- {printer_core-0.0.2 → printer_core-0.0.4}/printer_core/tests/unitaries/__init__.py +0 -0
|
@@ -1,207 +1,207 @@
|
|
|
1
|
-
# Byte-compiled / optimized / DLL files
|
|
2
|
-
__pycache__/
|
|
3
|
-
*.py[codz]
|
|
4
|
-
*$py.class
|
|
5
|
-
|
|
6
|
-
# C extensions
|
|
7
|
-
*.so
|
|
8
|
-
|
|
9
|
-
# Distribution / packaging
|
|
10
|
-
.Python
|
|
11
|
-
build/
|
|
12
|
-
develop-eggs/
|
|
13
|
-
dist/
|
|
14
|
-
downloads/
|
|
15
|
-
eggs/
|
|
16
|
-
.eggs/
|
|
17
|
-
lib/
|
|
18
|
-
lib64/
|
|
19
|
-
parts/
|
|
20
|
-
sdist/
|
|
21
|
-
var/
|
|
22
|
-
wheels/
|
|
23
|
-
share/python-wheels/
|
|
24
|
-
*.egg-info/
|
|
25
|
-
.installed.cfg
|
|
26
|
-
*.egg
|
|
27
|
-
MANIFEST
|
|
28
|
-
.idea/
|
|
29
|
-
# PyInstaller
|
|
30
|
-
# Usually these files are written by a python script from a template
|
|
31
|
-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
-
*.manifest
|
|
33
|
-
*.spec
|
|
34
|
-
|
|
35
|
-
# Installer logs
|
|
36
|
-
pip-log.txt
|
|
37
|
-
pip-delete-this-directory.txt
|
|
38
|
-
|
|
39
|
-
# Unit test / coverage reports
|
|
40
|
-
htmlcov/
|
|
41
|
-
.tox/
|
|
42
|
-
.nox/
|
|
43
|
-
.coverage
|
|
44
|
-
.coverage.*
|
|
45
|
-
.cache
|
|
46
|
-
nosetests.xml
|
|
47
|
-
coverage.xml
|
|
48
|
-
*.cover
|
|
49
|
-
*.py.cover
|
|
50
|
-
.hypothesis/
|
|
51
|
-
.pytest_cache/
|
|
52
|
-
cover/
|
|
53
|
-
|
|
54
|
-
# Translations
|
|
55
|
-
*.mo
|
|
56
|
-
*.pot
|
|
57
|
-
|
|
58
|
-
# Django stuff:
|
|
59
|
-
*.log
|
|
60
|
-
local_settings.py
|
|
61
|
-
db.sqlite3
|
|
62
|
-
db.sqlite3-journal
|
|
63
|
-
|
|
64
|
-
# Flask stuff:
|
|
65
|
-
instance/
|
|
66
|
-
.webassets-cache
|
|
67
|
-
|
|
68
|
-
# Scrapy stuff:
|
|
69
|
-
.scrapy
|
|
70
|
-
|
|
71
|
-
# Sphinx documentation
|
|
72
|
-
docs/_build/
|
|
73
|
-
|
|
74
|
-
# PyBuilder
|
|
75
|
-
.pybuilder/
|
|
76
|
-
target/
|
|
77
|
-
|
|
78
|
-
# Jupyter Notebook
|
|
79
|
-
.ipynb_checkpoints
|
|
80
|
-
|
|
81
|
-
# IPython
|
|
82
|
-
profile_default/
|
|
83
|
-
ipython_config.py
|
|
84
|
-
|
|
85
|
-
# pyenv
|
|
86
|
-
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
-
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
-
# .python-version
|
|
89
|
-
|
|
90
|
-
# pipenv
|
|
91
|
-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
-
# install all needed dependencies.
|
|
95
|
-
#Pipfile.lock
|
|
96
|
-
|
|
97
|
-
# UV
|
|
98
|
-
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
-
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
-
# commonly ignored for libraries.
|
|
101
|
-
#uv.lock
|
|
102
|
-
|
|
103
|
-
# poetry
|
|
104
|
-
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
-
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
-
# commonly ignored for libraries.
|
|
107
|
-
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
-
#poetry.lock
|
|
109
|
-
#poetry.toml
|
|
110
|
-
|
|
111
|
-
# pdm
|
|
112
|
-
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
-
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
114
|
-
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
115
|
-
#pdm.lock
|
|
116
|
-
#pdm.toml
|
|
117
|
-
.pdm-python
|
|
118
|
-
.pdm-build/
|
|
119
|
-
|
|
120
|
-
# pixi
|
|
121
|
-
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
122
|
-
#pixi.lock
|
|
123
|
-
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
124
|
-
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
125
|
-
.pixi
|
|
126
|
-
|
|
127
|
-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
128
|
-
__pypackages__/
|
|
129
|
-
|
|
130
|
-
# Celery stuff
|
|
131
|
-
celerybeat-schedule
|
|
132
|
-
celerybeat.pid
|
|
133
|
-
|
|
134
|
-
# SageMath parsed files
|
|
135
|
-
*.sage.py
|
|
136
|
-
|
|
137
|
-
# Environments
|
|
138
|
-
.env
|
|
139
|
-
.envrc
|
|
140
|
-
.venv
|
|
141
|
-
env/
|
|
142
|
-
venv/
|
|
143
|
-
ENV/
|
|
144
|
-
env.bak/
|
|
145
|
-
venv.bak/
|
|
146
|
-
|
|
147
|
-
# Spyder project settings
|
|
148
|
-
.spyderproject
|
|
149
|
-
.spyproject
|
|
150
|
-
|
|
151
|
-
# Rope project settings
|
|
152
|
-
.ropeproject
|
|
153
|
-
|
|
154
|
-
# mkdocs documentation
|
|
155
|
-
/site
|
|
156
|
-
|
|
157
|
-
# mypy
|
|
158
|
-
.mypy_cache/
|
|
159
|
-
.dmypy.json
|
|
160
|
-
dmypy.json
|
|
161
|
-
|
|
162
|
-
# Pyre type checker
|
|
163
|
-
.pyre/
|
|
164
|
-
|
|
165
|
-
# pytype static type analyzer
|
|
166
|
-
.pytype/
|
|
167
|
-
|
|
168
|
-
# Cython debug symbols
|
|
169
|
-
cython_debug/
|
|
170
|
-
|
|
171
|
-
# PyCharm
|
|
172
|
-
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
173
|
-
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
174
|
-
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
175
|
-
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
176
|
-
#.idea/
|
|
177
|
-
|
|
178
|
-
# Abstra
|
|
179
|
-
# Abstra is an AI-powered process automation framework.
|
|
180
|
-
# Ignore directories containing user credentials, local state, and settings.
|
|
181
|
-
# Learn more at https://abstra.io/docs
|
|
182
|
-
.abstra/
|
|
183
|
-
|
|
184
|
-
# Visual Studio Code
|
|
185
|
-
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
186
|
-
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
187
|
-
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
188
|
-
# you could uncomment the following to ignore the entire vscode folder
|
|
189
|
-
# .vscode/
|
|
190
|
-
|
|
191
|
-
# Ruff stuff:
|
|
192
|
-
.ruff_cache/
|
|
193
|
-
|
|
194
|
-
# PyPI configuration file
|
|
195
|
-
.pypirc
|
|
196
|
-
|
|
197
|
-
# Cursor
|
|
198
|
-
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
199
|
-
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
200
|
-
# refer to https://docs.cursor.com/context/ignore-files
|
|
201
|
-
.cursorignore
|
|
202
|
-
.cursorindexingignore
|
|
203
|
-
|
|
204
|
-
# Marimo
|
|
205
|
-
marimo/_static/
|
|
206
|
-
marimo/_lsp/
|
|
207
|
-
__marimo__/
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
.idea/
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
#uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
#poetry.toml
|
|
110
|
+
|
|
111
|
+
# pdm
|
|
112
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
114
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
115
|
+
#pdm.lock
|
|
116
|
+
#pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# pixi
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
122
|
+
#pixi.lock
|
|
123
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
124
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
125
|
+
.pixi
|
|
126
|
+
|
|
127
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
128
|
+
__pypackages__/
|
|
129
|
+
|
|
130
|
+
# Celery stuff
|
|
131
|
+
celerybeat-schedule
|
|
132
|
+
celerybeat.pid
|
|
133
|
+
|
|
134
|
+
# SageMath parsed files
|
|
135
|
+
*.sage.py
|
|
136
|
+
|
|
137
|
+
# Environments
|
|
138
|
+
.env
|
|
139
|
+
.envrc
|
|
140
|
+
.venv
|
|
141
|
+
env/
|
|
142
|
+
venv/
|
|
143
|
+
ENV/
|
|
144
|
+
env.bak/
|
|
145
|
+
venv.bak/
|
|
146
|
+
|
|
147
|
+
# Spyder project settings
|
|
148
|
+
.spyderproject
|
|
149
|
+
.spyproject
|
|
150
|
+
|
|
151
|
+
# Rope project settings
|
|
152
|
+
.ropeproject
|
|
153
|
+
|
|
154
|
+
# mkdocs documentation
|
|
155
|
+
/site
|
|
156
|
+
|
|
157
|
+
# mypy
|
|
158
|
+
.mypy_cache/
|
|
159
|
+
.dmypy.json
|
|
160
|
+
dmypy.json
|
|
161
|
+
|
|
162
|
+
# Pyre type checker
|
|
163
|
+
.pyre/
|
|
164
|
+
|
|
165
|
+
# pytype static type analyzer
|
|
166
|
+
.pytype/
|
|
167
|
+
|
|
168
|
+
# Cython debug symbols
|
|
169
|
+
cython_debug/
|
|
170
|
+
|
|
171
|
+
# PyCharm
|
|
172
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
173
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
174
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
175
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
176
|
+
#.idea/
|
|
177
|
+
|
|
178
|
+
# Abstra
|
|
179
|
+
# Abstra is an AI-powered process automation framework.
|
|
180
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
181
|
+
# Learn more at https://abstra.io/docs
|
|
182
|
+
.abstra/
|
|
183
|
+
|
|
184
|
+
# Visual Studio Code
|
|
185
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
186
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
187
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
188
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
189
|
+
# .vscode/
|
|
190
|
+
|
|
191
|
+
# Ruff stuff:
|
|
192
|
+
.ruff_cache/
|
|
193
|
+
|
|
194
|
+
# PyPI configuration file
|
|
195
|
+
.pypirc
|
|
196
|
+
|
|
197
|
+
# Cursor
|
|
198
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
199
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
200
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
201
|
+
.cursorignore
|
|
202
|
+
.cursorindexingignore
|
|
203
|
+
|
|
204
|
+
# Marimo
|
|
205
|
+
marimo/_static/
|
|
206
|
+
marimo/_lsp/
|
|
207
|
+
__marimo__/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
# printer-core
|
|
2
|
-
Foodeo Printer Core
|
|
1
|
+
# printer-core
|
|
2
|
+
Foodeo Printer Core
|
|
@@ -1 +1 @@
|
|
|
1
|
-
# printer_core package
|
|
1
|
+
# printer_core package
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
from .products_modifiers_multiprinter import ProductsModifiersMultiPrinter
|
|
2
|
-
from .products_modifiers_multiprinter_family import ProductsModifiersMultiprinterFamily
|
|
3
|
-
from .products_modifiers_unique_ticket import ProductsModifiersUniqueTicket
|
|
1
|
+
from .products_modifiers_multiprinter import ProductsModifiersMultiPrinter
|
|
2
|
+
from .products_modifiers_multiprinter_family import ProductsModifiersMultiprinterFamily
|
|
3
|
+
from .products_modifiers_unique_ticket import ProductsModifiersUniqueTicket
|
{printer_core-0.0.2 → printer_core-0.0.4}/printer_core/algorithms/products_modifiers_multiprinter.py
RENAMED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
from typing import Any
|
|
2
|
-
|
|
3
|
-
from printer_core.entities import KitchenProductLine, PrintProductData, PrintRequestData, PrinterData
|
|
4
|
-
from printer_core.formatters.discount_formatter import DiscountFormatter
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class ProductsModifiersMultiPrinter:
|
|
8
|
-
def __init__(self, formatter: DiscountFormatter):
|
|
9
|
-
self._formatter = formatter
|
|
10
|
-
|
|
11
|
-
def build(
|
|
12
|
-
self,
|
|
13
|
-
request: PrintRequestData,
|
|
14
|
-
products: list[PrintProductData],
|
|
15
|
-
kitchen_ticket_settings: Any,
|
|
16
|
-
main_printer: PrinterData | dict[str, Any],
|
|
17
|
-
) -> list[KitchenProductLine]:
|
|
18
|
-
list_products_own_printer: list[KitchenProductLine] = []
|
|
19
|
-
fallback_printer = self._resolve_printer(main_printer)
|
|
20
|
-
for product in products:
|
|
21
|
-
printers = list(product.printer or [])
|
|
22
|
-
if not printers:
|
|
23
|
-
printers = [fallback_printer]
|
|
24
|
-
for actual_printer in printers:
|
|
25
|
-
printer_payload = self._resolve_printer(actual_printer)
|
|
26
|
-
name = product.product_name
|
|
27
|
-
if kitchen_ticket_settings.show_price_per_unit and not request.all_discounted:
|
|
28
|
-
name += self._formatter.format(product, request.currency or "")
|
|
29
|
-
line = KitchenProductLine(
|
|
30
|
-
name=name,
|
|
31
|
-
qty=int(product.qty),
|
|
32
|
-
option=product.option,
|
|
33
|
-
printer_r=printer_payload.name,
|
|
34
|
-
printer_w=printer_payload.printer_width,
|
|
35
|
-
details=product.details or "",
|
|
36
|
-
order=product.order or "",
|
|
37
|
-
tpv=printer_payload.tpv,
|
|
38
|
-
order_readable=product.order_readable or "",
|
|
39
|
-
)
|
|
40
|
-
if kitchen_ticket_settings.show_price_per_unit:
|
|
41
|
-
line = line.model_copy(update={
|
|
42
|
-
"price": product.total_price,
|
|
43
|
-
"unitary_price": product.product_price,
|
|
44
|
-
})
|
|
45
|
-
list_products_own_printer.append(line)
|
|
46
|
-
return list_products_own_printer
|
|
47
|
-
|
|
48
|
-
def _resolve_printer(self, printer: PrinterData | dict[str, Any]) -> PrinterData:
|
|
49
|
-
if isinstance(printer, PrinterData):
|
|
50
|
-
return printer
|
|
51
|
-
if isinstance(printer, dict):
|
|
52
|
-
return PrinterData(**printer)
|
|
53
|
-
if hasattr(printer, "model_dump"):
|
|
54
|
-
return PrinterData(**printer.model_dump(mode="json", exclude_none=True))
|
|
55
|
-
return PrinterData(
|
|
56
|
-
name=printer.name,
|
|
57
|
-
printer_width=printer.printer_width,
|
|
58
|
-
tpv=getattr(printer, "tpv", None),
|
|
59
|
-
)
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
from printer_core.entities import KitchenProductLine, PrintProductData, PrintRequestData, PrinterData
|
|
4
|
+
from printer_core.formatters.discount_formatter import DiscountFormatter
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ProductsModifiersMultiPrinter:
|
|
8
|
+
def __init__(self, formatter: DiscountFormatter):
|
|
9
|
+
self._formatter = formatter
|
|
10
|
+
|
|
11
|
+
def build(
|
|
12
|
+
self,
|
|
13
|
+
request: PrintRequestData,
|
|
14
|
+
products: list[PrintProductData],
|
|
15
|
+
kitchen_ticket_settings: Any,
|
|
16
|
+
main_printer: PrinterData | dict[str, Any],
|
|
17
|
+
) -> list[KitchenProductLine]:
|
|
18
|
+
list_products_own_printer: list[KitchenProductLine] = []
|
|
19
|
+
fallback_printer = self._resolve_printer(main_printer)
|
|
20
|
+
for product in products:
|
|
21
|
+
printers = list(product.printer or [])
|
|
22
|
+
if not printers:
|
|
23
|
+
printers = [fallback_printer]
|
|
24
|
+
for actual_printer in printers:
|
|
25
|
+
printer_payload = self._resolve_printer(actual_printer)
|
|
26
|
+
name = product.product_name
|
|
27
|
+
if kitchen_ticket_settings.show_price_per_unit and not request.all_discounted:
|
|
28
|
+
name += self._formatter.format(product, request.currency or "")
|
|
29
|
+
line = KitchenProductLine(
|
|
30
|
+
name=name,
|
|
31
|
+
qty=int(product.qty),
|
|
32
|
+
option=product.option,
|
|
33
|
+
printer_r=printer_payload.name,
|
|
34
|
+
printer_w=printer_payload.printer_width,
|
|
35
|
+
details=product.details or "",
|
|
36
|
+
order=product.order or "",
|
|
37
|
+
tpv=printer_payload.tpv,
|
|
38
|
+
order_readable=product.order_readable or "",
|
|
39
|
+
)
|
|
40
|
+
if kitchen_ticket_settings.show_price_per_unit:
|
|
41
|
+
line = line.model_copy(update={
|
|
42
|
+
"price": product.total_price,
|
|
43
|
+
"unitary_price": product.product_price,
|
|
44
|
+
})
|
|
45
|
+
list_products_own_printer.append(line)
|
|
46
|
+
return list_products_own_printer
|
|
47
|
+
|
|
48
|
+
def _resolve_printer(self, printer: PrinterData | dict[str, Any]) -> PrinterData:
|
|
49
|
+
if isinstance(printer, PrinterData):
|
|
50
|
+
return printer
|
|
51
|
+
if isinstance(printer, dict):
|
|
52
|
+
return PrinterData(**printer)
|
|
53
|
+
if hasattr(printer, "model_dump"):
|
|
54
|
+
return PrinterData(**printer.model_dump(mode="json", exclude_none=True))
|
|
55
|
+
return PrinterData(
|
|
56
|
+
name=printer.name,
|
|
57
|
+
printer_width=printer.printer_width,
|
|
58
|
+
tpv=getattr(printer, "tpv", None),
|
|
59
|
+
)
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
from typing import Any
|
|
2
|
-
|
|
3
|
-
from printer_core.entities import KitchenProductLine, PrintProductData, PrintRequestData, PrinterData
|
|
4
|
-
from printer_core.formatters.discount_formatter import DiscountFormatter
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class ProductsModifiersMultiprinterFamily:
|
|
8
|
-
def __init__(self, formatter: DiscountFormatter):
|
|
9
|
-
self._formatter = formatter
|
|
10
|
-
|
|
11
|
-
def append_product(self,
|
|
12
|
-
list_products_own_printer: list[KitchenProductLine],
|
|
13
|
-
product: PrintProductData,
|
|
14
|
-
request: PrintRequestData,
|
|
15
|
-
kitchen_ticket_settings: Any,
|
|
16
|
-
) -> None:
|
|
17
|
-
for actual_printer in product.printer:
|
|
18
|
-
printer_payload = self._resolve_printer(actual_printer)
|
|
19
|
-
name_with_discount: str = product.product_name
|
|
20
|
-
if not request.all_discounted:
|
|
21
|
-
name_with_discount += self._formatter.format(product, request.currency or "")
|
|
22
|
-
line = KitchenProductLine(
|
|
23
|
-
name=name_with_discount,
|
|
24
|
-
qty=int(product.qty),
|
|
25
|
-
option=product.option,
|
|
26
|
-
printer_r=printer_payload.name,
|
|
27
|
-
printer_w=printer_payload.printer_width,
|
|
28
|
-
details=product.details or "",
|
|
29
|
-
order=product.order or "",
|
|
30
|
-
tpv=printer_payload.tpv,
|
|
31
|
-
order_readable=product.order_readable or "",
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
if kitchen_ticket_settings.show_price_per_unit:
|
|
35
|
-
line = line.model_copy(update={
|
|
36
|
-
"price": product.total_price,
|
|
37
|
-
"unitary_price": product.product_price,
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
list_products_own_printer.append(line)
|
|
41
|
-
|
|
42
|
-
def _resolve_printer(self, printer: PrinterData | dict[str, Any]) -> PrinterData:
|
|
43
|
-
if isinstance(printer, PrinterData):
|
|
44
|
-
return printer
|
|
45
|
-
if isinstance(printer, dict):
|
|
46
|
-
return PrinterData(**printer)
|
|
47
|
-
if hasattr(printer, "model_dump"):
|
|
48
|
-
return PrinterData(**printer.model_dump(mode="json", exclude_none=True))
|
|
49
|
-
return PrinterData(
|
|
50
|
-
name=printer.name,
|
|
51
|
-
printer_width=printer.printer_width,
|
|
52
|
-
tpv=getattr(printer, "tpv", None),
|
|
53
|
-
)
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
from printer_core.entities import KitchenProductLine, PrintProductData, PrintRequestData, PrinterData
|
|
4
|
+
from printer_core.formatters.discount_formatter import DiscountFormatter
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ProductsModifiersMultiprinterFamily:
|
|
8
|
+
def __init__(self, formatter: DiscountFormatter):
|
|
9
|
+
self._formatter = formatter
|
|
10
|
+
|
|
11
|
+
def append_product(self,
|
|
12
|
+
list_products_own_printer: list[KitchenProductLine],
|
|
13
|
+
product: PrintProductData,
|
|
14
|
+
request: PrintRequestData,
|
|
15
|
+
kitchen_ticket_settings: Any,
|
|
16
|
+
) -> None:
|
|
17
|
+
for actual_printer in product.printer:
|
|
18
|
+
printer_payload = self._resolve_printer(actual_printer)
|
|
19
|
+
name_with_discount: str = product.product_name
|
|
20
|
+
if not request.all_discounted:
|
|
21
|
+
name_with_discount += self._formatter.format(product, request.currency or "")
|
|
22
|
+
line = KitchenProductLine(
|
|
23
|
+
name=name_with_discount,
|
|
24
|
+
qty=int(product.qty),
|
|
25
|
+
option=product.option,
|
|
26
|
+
printer_r=printer_payload.name,
|
|
27
|
+
printer_w=printer_payload.printer_width,
|
|
28
|
+
details=product.details or "",
|
|
29
|
+
order=product.order or "",
|
|
30
|
+
tpv=printer_payload.tpv,
|
|
31
|
+
order_readable=product.order_readable or "",
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
if kitchen_ticket_settings.show_price_per_unit:
|
|
35
|
+
line = line.model_copy(update={
|
|
36
|
+
"price": product.total_price,
|
|
37
|
+
"unitary_price": product.product_price,
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
list_products_own_printer.append(line)
|
|
41
|
+
|
|
42
|
+
def _resolve_printer(self, printer: PrinterData | dict[str, Any]) -> PrinterData:
|
|
43
|
+
if isinstance(printer, PrinterData):
|
|
44
|
+
return printer
|
|
45
|
+
if isinstance(printer, dict):
|
|
46
|
+
return PrinterData(**printer)
|
|
47
|
+
if hasattr(printer, "model_dump"):
|
|
48
|
+
return PrinterData(**printer.model_dump(mode="json", exclude_none=True))
|
|
49
|
+
return PrinterData(
|
|
50
|
+
name=printer.name,
|
|
51
|
+
printer_width=printer.printer_width,
|
|
52
|
+
tpv=getattr(printer, "tpv", None),
|
|
53
|
+
)
|