@dodobrands/pos-receipts-plugin-contracts 5.12.8

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.
@@ -0,0 +1,81 @@
1
+ {
2
+ "CashFromCustomer": 0,
3
+ "CashRegister": {
4
+ "Number": "31",
5
+ "ShouldCalculateTax": true,
6
+ "UUId": "0022487FBA1EBC6511EBA824DC4AE652"
7
+ },
8
+ "Customer": {
9
+ "Email": "pochta@mail.ru",
10
+ "Identifiers": {
11
+ "NIP": "1231216692"
12
+ },
13
+ "Name": "Tom Riddle"
14
+ },
15
+ "Taxpayer": {
16
+ "IdentificationNumber": null
17
+ },
18
+ "Order": {
19
+ "CreateDate": "2021-05-06T10:54:14.9342604+03:00",
20
+ "Id": "0022487FBA1EBC6A11EBAE400521DF20",
21
+ "Number": "4",
22
+ "PaymentType": "BankCard",
23
+ "PaymentTypeEnum": 0,
24
+ "OrderSource": 2,
25
+ "Price": {
26
+ "Discount": 0,
27
+ "TotalPrice": 95
28
+ },
29
+ "DeliveryDate": "2021-05-06T11:54:14.9342604+03:00",
30
+ "OrderType": 3,
31
+ "Products": [
32
+ {
33
+ "AddedIngredients": [],
34
+ "Id": "000D3A240C71BE9A11E719BE2AD13D0D",
35
+ "Name": "Coca Cola Zero 500 ml",
36
+ "PricePerProduct": {
37
+ "Discount": 95,
38
+ "Price": 95,
39
+ "Taxes": [
40
+ {
41
+ "Rate": 20,
42
+ "Type": "VAT"
43
+ }
44
+ ]
45
+ },
46
+ "Quantity": 1,
47
+ "RemovedIngredients": []
48
+ },
49
+ {
50
+ "AddedIngredients": [],
51
+ "Id": "000D3A23B0DC80DC11E7571ACB3BC29C",
52
+ "Name": "Fanta Orange 2 l",
53
+ "PricePerProduct": {
54
+ "Discount": 0,
55
+ "Price": 95,
56
+ "Taxes": [
57
+ {
58
+ "Rate": 20,
59
+ "Type": "VAT"
60
+ }
61
+ ]
62
+ },
63
+ "Quantity": 1,
64
+ "RemovedIngredients": []
65
+ }
66
+ ]
67
+ },
68
+ "Organization": {
69
+ "Address": "71-75 Shelton Street, London, WC2H 9JQ, United Kingdom",
70
+ "Name": "Yukon Ltd Limited",
71
+ "Requisites": {
72
+ "VAT": "123456",
73
+ "SOME-OTHER-REQ-1": "1166313070681",
74
+ "SOME-OTHER-REQ-2": ""
75
+ }
76
+ },
77
+ "Store": {
78
+ "Address": "Platform 8 7/4, Kings Cross Station, London, N1 9AP, United Kingdom"
79
+ },
80
+ "PreviousReceipts": []
81
+ }
@@ -0,0 +1,76 @@
1
+ {
2
+ "CashFromCustomer": 0,
3
+ "CashRegister": {
4
+ "Number": "31",
5
+ "ShouldCalculateTax": true,
6
+ "UUId": "0022487FBA1EBC6511EBA824DC4AE652"
7
+ },
8
+ "Customer": {
9
+ "Email": "pochta@mail.ru",
10
+ "Identifiers": {
11
+ "NIP": "1231216692"
12
+ },
13
+ "Name": "Tom Riddle"
14
+ },
15
+ "Taxpayer": {
16
+ "IdentificationNumber": null
17
+ },
18
+ "Order": {
19
+ "CreateDate": "2021-05-06T10:59:23.7925516+03:00",
20
+ "Id": "0022487FBA1EBC6A11EBAE40E2659A1A",
21
+ "Number": "5",
22
+ "PaymentType": "Cash",
23
+ "PaymentTypeEnum": 0,
24
+ "OrderSource": 2,
25
+ "Price": {
26
+ "Discount": 10430,
27
+ "TotalPrice": 0
28
+ },
29
+ "DeliveryDate": "2021-05-06T11:59:23.7925516+03:00",
30
+ "OrderType": 3,
31
+ "Products": [
32
+ {
33
+ "AddedIngredients": [],
34
+ "Id": "000D3A240C71BE9A11E719BE2AB17F88",
35
+ "Name": "The Mighty Meats 14 \"",
36
+ "PricePerProduct": {
37
+ "Discount": 0,
38
+ "Price": 745,
39
+ "Taxes": []
40
+ },
41
+ "Quantity": 14,
42
+ "RemovedIngredients": []
43
+ },
44
+ {
45
+ "AddedIngredients": [],
46
+ "Id": "11EA5A11B53111A0CB4BC59232AF6200",
47
+ "Name": "Fanta Orange 1.5 l",
48
+ "PricePerProduct": {
49
+ "Discount": 249,
50
+ "Price": 249,
51
+ "Taxes": [
52
+ {
53
+ "Rate": 14,
54
+ "Type": "VAT"
55
+ }
56
+ ]
57
+ },
58
+ "Quantity": 1,
59
+ "RemovedIngredients": []
60
+ }
61
+ ]
62
+ },
63
+ "Organization": {
64
+ "Address": "71-75 Shelton Street, London, WC2H 9JQ, United Kingdom",
65
+ "Name": "Yukon Ltd Limited",
66
+ "Requisites": {
67
+ "VAT": "123456",
68
+ "SOME-OTHER-REQ-1": "1166313070681",
69
+ "SOME-OTHER-REQ-2": ""
70
+ }
71
+ },
72
+ "Store": {
73
+ "Address": "Platform 8 7/4, Kings Cross Station, London, N1 9AP, United Kingdom"
74
+ },
75
+ "PreviousReceipts": []
76
+ }
@@ -0,0 +1,45 @@
1
+ # Examples
2
+
3
+ ## Description of contract fields
4
+
5
+ Most of the fields are described in the comments of the contract itself.
6
+
7
+ - `Receipt`: is the root type passed when printing a receipt.
8
+ - `Receipt.Organization.Requisites`: contains the requisites of the organization. This is a dictionary containing values: "requisite identifier" - "requisite value". The necessary requisites of the organization must be discussed.
9
+ - `Receipt.PreviousReceipts`: is an array of records of previously printed receipts for this order. Used to identify reprints. At the first print, the array is empty.
10
+
11
+ ## Description of examples
12
+
13
+ ### example-1
14
+
15
+ The order was paid in cash without change. There are three products in the order with different tax rates. 1 snack and 2 drinks.
16
+
17
+ ### example-2
18
+
19
+ The order was paid in cash with a change. There are different types of pizzas in different quantities. Ingredients were removed from one pizza.
20
+
21
+ ### example-3
22
+
23
+ The order was paid by card. The order contains a combo and one single pizza. Please note that although the type of pizza in the combo and outside the combo is the same (id: 000D3A39D824A82E11EA1CB2A6661ED2), their prices are different, because products in combo may be cheaper.
24
+
25
+ ### example-4
26
+
27
+ Order with a discount of 500 on the total order amount.
28
+
29
+ ### example-5
30
+
31
+ #### example-5.1
32
+
33
+ Purchased three identical pizzas (id: 000D3A240C71BE9A11E719BE2AB25A5D). Additional ingredients were added to one. Two pizzas have a product discount of 100.
34
+
35
+ #### example-5.2
36
+
37
+ Request to reprint a receipt.
38
+
39
+ ### example-6
40
+
41
+ Two drinks were purchased. One of them was received as a gift (100% discount).
42
+
43
+ ### example-7
44
+
45
+ Pizza and drink were purchased. The drink was received as a gift. A 100% discount was applied to the total order amount.
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@dodobrands/pos-receipts-plugin-contracts",
3
+ "version": "5.12.8",
4
+ "type": "module",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/dodopizza/kiosk.git"
8
+ },
9
+ "license": "Apache-2.0",
10
+ "main": "./dist/index.cjs",
11
+ "module": "./dist/index.js",
12
+ "types": "./dist/index.d.ts",
13
+ "exports": {
14
+ "import": {
15
+ "types": "./dist/index.d.ts",
16
+ "import": "./dist/index.js"
17
+ },
18
+ "require": {
19
+ "types": "./dist/index.d.cts",
20
+ "require": "./dist/index.cjs"
21
+ }
22
+ },
23
+ "files": [
24
+ "dist",
25
+ "examples",
26
+ "CHANGELOG.md"
27
+ ],
28
+ "publishConfig": {
29
+ "registry": "https://registry.npmjs.org/",
30
+ "access": "public"
31
+ },
32
+ "scripts": {
33
+ "build": "tsup src/index.ts --format cjs,esm --dts --clean --sourcemap",
34
+ "lint": "eslint \"{**/*,*}.{ts,tsx,js,jsx,json,mjs,cjs}\"",
35
+ "lint:fix": "yarn lint --fix",
36
+ "publish": "yarn npm publish"
37
+ },
38
+ "devDependencies": {
39
+ "@dodobrands/pos-plugins-shared-models": "workspace:*",
40
+ "@dodopizza/eslint-plugin": "3.0.1",
41
+ "@dodopizza/ts-config": "1.0.1",
42
+ "eslint": "9.8.0",
43
+ "tsup": "8.2.4",
44
+ "typescript": "5.6.3",
45
+ "typescript-eslint": "8.15.0"
46
+ }
47
+ }
package/readme.md ADDED
@@ -0,0 +1,18 @@
1
+ # pos-receipts-plugin-contracts
2
+
3
+ Public contracts for cash register plugins
4
+
5
+ ## Documentation
6
+
7
+ Please use auto-generated documentation available [here](https://dodopizza.github.io/cashierapp/)
8
+
9
+ ## Creating plugins
10
+ Start from the documentation related to [ICashRegister interface](\src\ICashRegister.ts)
11
+
12
+
13
+ ## Tech radar
14
+
15
+ We at Dodo have expertize at the following [Tech Radar](https://radar.thoughtworks.com/?sheetId=https%3A%2F%2Fdocs.google.com%2Fspreadsheets%2Fd%2F15B0mJaxj8gdS4opGCsn42w3PeIAV0YCfVeEFzzcFe5w%2Fpub%2Foutput%3Dcsv%26format%3D%252FDec%2C%202022)
16
+ and try to follow [Dodo NFRs](https://www.notion.so/dodobrands/Frontend-NFR-draft-535df248e84347d1b46147b8026a5250).
17
+
18
+ We present it here as a recommendation for all new contributors so that we can provide better support in the future.