printer-core 0.0.1__tar.gz → 0.0.2__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.1 → printer_core-0.0.2}/PKG-INFO +1 -1
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/services/order_print_service.py +2 -18
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_order_print_service.py +0 -20
- {printer_core-0.0.1 → printer_core-0.0.2}/pyproject.toml +2 -2
- {printer_core-0.0.1 → printer_core-0.0.2}/.gitignore +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/README.md +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/__init__.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/algorithms/__init__.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/algorithms/products_modifiers_multiprinter.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/algorithms/products_modifiers_multiprinter_family.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/algorithms/products_modifiers_unique_ticket.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/builders/__init__.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/builders/client_ticket_builder.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/builders/header_builder.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/builders/kitchen_ticket_payload_builder.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/builders/printer_products_grouper.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/clock.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/context/__init__.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/context/ticket_context_builder.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/dispatchers/__init__.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/dispatchers/kitchen_ticket_dispatcher.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/dispatchers/payload_dispatcher.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/entities/__init__.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/entities/print_context.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/entities/print_models.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/formatters/__init__.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/formatters/discount_formatter.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/ports.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/selectors/__init__.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/selectors/family_product_selector.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/services/__init__.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/services/flows/__init__.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/services/flows/base.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/services/flows/client.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/services/flows/kitchen.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/services/march_printer_service.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/services/multi_printer_family_service.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/services/multi_printer_service.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/services/print_policy.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/services/unique_ticket_service.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/__init__.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/__init__.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/helpers.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_cases_output.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_client_ticket_builder.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_discount_formatter.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_family_product_selector.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_flows.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_header_builder_foodeo_printers.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_kitchen_ticket_dispatcher.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_kitchen_ticket_payload_builder.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_march_printer_service.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_multi_printer_family_service.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_multi_printer_service.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_payload_dispatcher.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_print_policy.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_printer_helpers.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_printer_products_grouper.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_products_modifiers.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_ticket_context_builder.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_unique_ticket_service.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/utils/__init__.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/printer_core/utils/printer_helpers.py +0 -0
- {printer_core-0.0.1 → printer_core-0.0.2}/scripts/link_backend_env.sh +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from decimal import Decimal
|
|
4
|
-
from typing import Any
|
|
4
|
+
from typing import Any
|
|
5
5
|
|
|
6
6
|
from printer_core.clock import SystemClock
|
|
7
7
|
from printer_core.entities import (
|
|
@@ -13,26 +13,10 @@ from printer_core.entities import (
|
|
|
13
13
|
from printer_core.services.flows import PrintFlow
|
|
14
14
|
from printer_core.services.print_policy import FlowTarget, PrintPolicy
|
|
15
15
|
from printer_core.utils.printer_helpers import build_iva_data
|
|
16
|
-
from printer_core.ports import FamilyCategoryProvider, HeaderProvider, PrinterGateway, PrintSettingsBuilder
|
|
17
16
|
|
|
18
17
|
|
|
19
18
|
class OrderPrintService:
|
|
20
|
-
def __init__(
|
|
21
|
-
self,
|
|
22
|
-
gateway: PrinterGateway,
|
|
23
|
-
header_provider: HeaderProvider,
|
|
24
|
-
print_settings_builder: PrintSettingsBuilder,
|
|
25
|
-
family_provider: FamilyCategoryProvider,
|
|
26
|
-
currency_symbol_resolver: Callable[[str], str],
|
|
27
|
-
flows: list[PrintFlow],
|
|
28
|
-
domicile_service_label: str = "Domicile Service",
|
|
29
|
-
):
|
|
30
|
-
self._gateway = gateway
|
|
31
|
-
self._family_provider = family_provider
|
|
32
|
-
self._currency_symbol_resolver = currency_symbol_resolver
|
|
33
|
-
self._header_provider = header_provider
|
|
34
|
-
self._print_settings_builder = print_settings_builder
|
|
35
|
-
self._domicile_service_label = domicile_service_label
|
|
19
|
+
def __init__(self, flows: list[PrintFlow]):
|
|
36
20
|
self._clock = SystemClock()
|
|
37
21
|
self._flows = flows
|
|
38
22
|
|
{printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_order_print_service.py
RENAMED
|
@@ -36,11 +36,6 @@ class OrderPrintServiceTest(unittest.TestCase):
|
|
|
36
36
|
kitchen_flow = FakeFlow(FlowTarget.KITCHEN, return_value=[{"kitchen": True}])
|
|
37
37
|
client_flow = FakeFlow(FlowTarget.CLIENT, return_value=[{"client": True}])
|
|
38
38
|
service = OrderPrintService(
|
|
39
|
-
gateway=object(),
|
|
40
|
-
header_provider=object(),
|
|
41
|
-
print_settings_builder=object(),
|
|
42
|
-
family_provider=object(),
|
|
43
|
-
currency_symbol_resolver=lambda _: "",
|
|
44
39
|
flows=[kitchen_flow, client_flow],
|
|
45
40
|
)
|
|
46
41
|
request = make_request(
|
|
@@ -69,11 +64,6 @@ class OrderPrintServiceTest(unittest.TestCase):
|
|
|
69
64
|
def test_print_job_domicile_total_includes_service_price(self):
|
|
70
65
|
kitchen_flow = FakeFlow(FlowTarget.KITCHEN, return_value=[])
|
|
71
66
|
service = OrderPrintService(
|
|
72
|
-
gateway=object(),
|
|
73
|
-
header_provider=object(),
|
|
74
|
-
print_settings_builder=object(),
|
|
75
|
-
family_provider=object(),
|
|
76
|
-
currency_symbol_resolver=lambda _: "",
|
|
77
67
|
flows=[kitchen_flow],
|
|
78
68
|
)
|
|
79
69
|
service._clock = FakeClock("2024-05-01 08:00")
|
|
@@ -98,11 +88,6 @@ class OrderPrintServiceTest(unittest.TestCase):
|
|
|
98
88
|
def test_print_job_overrides_created_at_for_barra(self):
|
|
99
89
|
kitchen_flow = FakeFlow(FlowTarget.KITCHEN, return_value=[])
|
|
100
90
|
service = OrderPrintService(
|
|
101
|
-
gateway=object(),
|
|
102
|
-
header_provider=object(),
|
|
103
|
-
print_settings_builder=object(),
|
|
104
|
-
family_provider=object(),
|
|
105
|
-
currency_symbol_resolver=lambda _: "",
|
|
106
91
|
flows=[kitchen_flow],
|
|
107
92
|
)
|
|
108
93
|
service._clock = FakeClock("2024-05-01 08:00")
|
|
@@ -122,11 +107,6 @@ class OrderPrintServiceTest(unittest.TestCase):
|
|
|
122
107
|
def test_print_job_skips_flows_when_disabled(self):
|
|
123
108
|
kitchen_flow = FakeFlow(FlowTarget.KITCHEN, return_value=[])
|
|
124
109
|
service = OrderPrintService(
|
|
125
|
-
gateway=object(),
|
|
126
|
-
header_provider=object(),
|
|
127
|
-
print_settings_builder=object(),
|
|
128
|
-
family_provider=object(),
|
|
129
|
-
currency_symbol_resolver=lambda _: "",
|
|
130
110
|
flows=[kitchen_flow],
|
|
131
111
|
)
|
|
132
112
|
request = make_request(request_type="local")
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "printer-core"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.2"
|
|
8
8
|
description = "Foodeo Printer Core Domain."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -41,4 +41,4 @@ Repository = "https://github.com/Foodeo/printer-core"
|
|
|
41
41
|
Issues = "https://github.com/Foodeo/printer-core/issues"
|
|
42
42
|
|
|
43
43
|
[tool.hatch.build.targets.wheel]
|
|
44
|
-
packages = ["printer_core"]
|
|
44
|
+
packages = ["printer_core"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{printer_core-0.0.1 → printer_core-0.0.2}/printer_core/algorithms/products_modifiers_multiprinter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{printer_core-0.0.1 → printer_core-0.0.2}/printer_core/builders/kitchen_ticket_payload_builder.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{printer_core-0.0.1 → printer_core-0.0.2}/printer_core/dispatchers/kitchen_ticket_dispatcher.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{printer_core-0.0.1 → printer_core-0.0.2}/printer_core/services/multi_printer_family_service.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_client_ticket_builder.py
RENAMED
|
File without changes
|
{printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_discount_formatter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_march_printer_service.py
RENAMED
|
File without changes
|
|
File without changes
|
{printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_multi_printer_service.py
RENAMED
|
File without changes
|
{printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_payload_dispatcher.py
RENAMED
|
File without changes
|
|
File without changes
|
{printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_printer_helpers.py
RENAMED
|
File without changes
|
|
File without changes
|
{printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_products_modifiers.py
RENAMED
|
File without changes
|
|
File without changes
|
{printer_core-0.0.1 → printer_core-0.0.2}/printer_core/tests/unitaries/test_unique_ticket_service.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|