Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into de-receipt-case-definitions
- Loading branch information
Showing
4 changed files
with
260 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
syntax = "proto3"; | ||
|
||
package fiskaltrust.ifPOS.v1; | ||
option csharp_namespace = "fiskaltrust.ifPOS.v1"; | ||
|
||
import "bcl.proto"; | ||
|
||
service POS { | ||
rpc Echo(EchoRequest) returns (EchoResponse) {} | ||
rpc Journal(JournalRequest) returns (JournalResponse) {} | ||
rpc Sign(ReceiptRequest) returns (ReceiptResponse) {} | ||
} | ||
|
||
message EchoRequest { | ||
string Message = 1; | ||
} | ||
|
||
message EchoResponse { | ||
string Message = 1; | ||
} | ||
|
||
message JournalRequest { | ||
int64 ftJournalType = 1; | ||
int64 From = 2; | ||
int64 To = 3; | ||
} | ||
|
||
message JournalResponse { | ||
repeated uint32 Chunk = 1 [packed = false]; | ||
} | ||
|
||
message ChargeItem { | ||
int64 Position = 5; | ||
.bcl.Decimal Quantity = 10; | ||
string Description = 20; | ||
.bcl.Decimal Amount = 30; | ||
.bcl.Decimal VATRate = 40; | ||
int64 ftChargeItemCase = 50; | ||
string ftChargeItemCaseData = 60; | ||
.bcl.Decimal VATAmount = 70; | ||
string AccountNumber = 80; | ||
string CostCenter = 90; | ||
string ProductGroup = 100; | ||
string ProductNumber = 110; | ||
string ProductBarcode = 120; | ||
string Unit = 130; | ||
.bcl.Decimal UnitQuantity = 140; | ||
.bcl.Decimal UnitPrice = 150; | ||
.bcl.DateTime Moment = 160; | ||
} | ||
|
||
message PayItem { | ||
int64 Position = 5; | ||
.bcl.Decimal Quantity = 10; | ||
string Description = 20; | ||
.bcl.Decimal Amount = 30; | ||
int64 ftPayItemCase = 40; | ||
string ftPayItemCaseData = 50; | ||
string AccountNumber = 60; | ||
string CostCenter = 70; | ||
string MoneyGroup = 80; | ||
string MoneyNumber = 90; | ||
.bcl.DateTime Moment = 100; | ||
} | ||
|
||
message ReceiptRequest { | ||
string ftCashBoxID = 10; | ||
string ftQueueID = 15; | ||
string ftPosSystemId = 16; | ||
string cbTerminalID = 20; | ||
string cbReceiptReference = 30; | ||
.bcl.DateTime cbReceiptMoment = 40; | ||
repeated ChargeItem cbChargeItems = 50; | ||
repeated PayItem cbPayItems = 60; | ||
int64 ftReceiptCase = 70; | ||
string ftReceiptCaseData = 80; | ||
.bcl.Decimal cbReceiptAmount = 90; | ||
string cbUser = 100; | ||
string cbArea = 110; | ||
string cbCustomer = 120; | ||
string cbSettlement = 130; | ||
string cbPreviousReceiptReference = 140; | ||
} | ||
|
||
message ReceiptResponse { | ||
string ftCashBoxID = 10; | ||
string ftQueueID = 14; | ||
string ftQueueItemID = 15; | ||
int64 ftQueueRow = 16; | ||
string cbTerminalID = 20; | ||
string cbReceiptReference = 30; | ||
string ftCashBoxIdentification = 35; | ||
string ftReceiptIdentification = 40; | ||
.bcl.DateTime ftReceiptMoment = 50; | ||
repeated string ftReceiptHeader = 60; | ||
repeated ChargeItem ftChargeItems = 70; | ||
repeated string ftChargeLines = 80; | ||
repeated PayItem ftPayItems = 90; | ||
repeated string ftPayLines = 100; | ||
repeated SignaturItem ftSignatures = 110; | ||
repeated string ftReceiptFooter = 120; | ||
int64 ftState = 130; | ||
string ftStateData = 140; | ||
} | ||
|
||
message SignaturItem { | ||
int64 ftSignatureFormat = 10; | ||
int64 ftSignatureType = 20; | ||
string Caption = 30; | ||
string Data = 40; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// Taken from https://github.com/protobuf-net/protobuf-net/blob/master/src/Tools/bcl.proto | ||
// The types in here indicate how protobuf-net represents certain types when using protobuf-net specific | ||
// library features. Note that it is not *required* to use any of these types, and cross-platform code | ||
// should usually avoid them completely (ideally starting from a .proto schema) | ||
|
||
// Some of these are ugly, sorry. The TimeSpan / DateTime dates here pre-date the introduction of Timestamp | ||
// and Duration, and the "well known" types should be preferred when possible. Guids are particularly | ||
// awkward - it turns out that there are multiple guid representations, and I accidentally used one that | ||
// I can only call... "crazy-endian". Just make sure you check the order! | ||
|
||
// It should not be necessary to use bcl.proto from code that uses protobuf-net | ||
|
||
syntax = "proto3"; | ||
|
||
option csharp_namespace = "ProtoBuf.Bcl"; | ||
|
||
package bcl; | ||
|
||
message TimeSpan { | ||
sint64 value = 1; // the size of the timespan (in units of the selected scale) | ||
TimeSpanScale scale = 2; // the scale of the timespan [default = DAYS] | ||
enum TimeSpanScale { | ||
DAYS = 0; | ||
HOURS = 1; | ||
MINUTES = 2; | ||
SECONDS = 3; | ||
MILLISECONDS = 4; | ||
TICKS = 5; | ||
|
||
MINMAX = 15; // dubious | ||
} | ||
} | ||
|
||
message DateTime { | ||
sint64 value = 1; // the offset (in units of the selected scale) from 1970/01/01 | ||
TimeSpanScale scale = 2; // the scale of the timespan [default = DAYS] | ||
DateTimeKind kind = 3; // the kind of date/time being represented [default = UNSPECIFIED] | ||
enum TimeSpanScale { | ||
DAYS = 0; | ||
HOURS = 1; | ||
MINUTES = 2; | ||
SECONDS = 3; | ||
MILLISECONDS = 4; | ||
TICKS = 5; | ||
|
||
MINMAX = 15; // dubious | ||
} | ||
enum DateTimeKind | ||
{ | ||
// The time represented is not specified as either local time or Coordinated Universal Time (UTC). | ||
UNSPECIFIED = 0; | ||
// The time represented is UTC. | ||
UTC = 1; | ||
// The time represented is local time. | ||
LOCAL = 2; | ||
} | ||
} | ||
|
||
message NetObjectProxy { | ||
int32 existingObjectKey = 1; // for a tracked object, the key of the **first** time this object was seen | ||
int32 newObjectKey = 2; // for a tracked object, a **new** key, the first time this object is seen | ||
int32 existingTypeKey = 3; // for dynamic typing, the key of the **first** time this type was seen | ||
int32 newTypeKey = 4; // for dynamic typing, a **new** key, the first time this type is seen | ||
string typeName = 8; // for dynamic typing, the name of the type (only present along with newTypeKey) | ||
bytes payload = 10; // the new string/value (only present along with newObjectKey) | ||
} | ||
|
||
message Guid { | ||
fixed64 lo = 1; // the first 8 bytes of the guid (note:crazy-endian) | ||
fixed64 hi = 2; // the second 8 bytes of the guid (note:crazy-endian) | ||
} | ||
|
||
message Decimal { | ||
uint64 lo = 1; // the first 64 bits of the underlying value | ||
uint32 hi = 2; // the last 32 bis of the underlying value | ||
uint32 signScale = 3; // the number of decimal digits (bits 1-16), and the sign (bit 0) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,79 @@ | ||
## Info-Order - Implicit Flow | ||
|
||
info-order | ||
implicit flow | ||
This is used to persist orders | ||
|
||
this is unsed to persist orders | ||
|
||
same `cbReceiptReference` in multiple receiptrequest/receiptresponse (sign-calls) can be used to connect multiple actions into a business-action. each `cbReceiptReference` can only be used once within a explicit flow. this also meanse only one time start-transaction can be done with one specific `cbReceiptReference`, because it is mapped 1:1 to the ongoing transaction of the (tse). | ||
Same `cbReceiptReference` in multiple receiptrequest/receiptresponse (sign-calls) can be used to connect multiple actions into a business-action. each `cbReceiptReference` can only be used once within a explicit flow. this also meanse only one time start-transaction can be done with one specific `cbReceiptReference`, because it is mapped 1:1 to the ongoing transaction of the (tse). | ||
the implicit flow uses start-transaction and finish-transaction within the same receiptrequest/receiptresponse. therefore in this case the `cbReceiptReference` has no impact on already ongoing transactions as long as there wasn't a start-transaction with same `cbReceiptReference` before. | ||
|
||
and additional method to connect multiple actions to a ongoing business-action is to reference a previouse action by `cbPreviouseReceiptReference`. | ||
|
||
|
||
Request | ||
An additional method to connect multiple actions to a ongoing business-action is to reference a previouse action by `cbPreviouseReceiptReference`. | ||
|
||
```json | ||
{ | ||
"ftCashBoxID": "cashboxid-guid", | ||
"ftPosSystemId": "possystemid-guid", | ||
"cbTerminalID": "terminalid", | ||
"cbReceiptReference": "233348", | ||
"cbReceiptMoment": "2019-07-19T12:52:34.9609375Z", | ||
"cbChargeItems": [ | ||
{ | ||
"Quantity": 2.0, | ||
"Description": "0,5 Soda Zitrone", | ||
"Amount": 5.6, | ||
"VATRate":19.0000, | ||
"ftChargeItemCase":4919338167972134913 | ||
} | ||
], | ||
"cbPayItems": [ | ||
{ | ||
"Quantity": 1.0, | ||
"Description": "Internal", | ||
"Amount": 5.6, | ||
// 0x4445 0000 0000 000A (internal / material consumption) | ||
"ftPayItemCase": 4919338167972134922 | ||
"ftCashBoxID":"cashboxid-guid", | ||
"ftPosSystemId":"possystemid-guid", | ||
"cbTerminalID":"terminalid", | ||
"cbReceiptReference":"233348", | ||
"cbReceiptMoment":"2019-07-19T12:52:34.9609375Z", | ||
"cbChargeItems":[ | ||
{ | ||
"Quantity":2.0, | ||
"Description":"0,5 Soda Zitrone", | ||
"Amount":5.6, | ||
"VATRate":19.0000, | ||
"ftChargeItemCase":4919338167972134913 | ||
} | ||
], | ||
"cbPayItems":[ | ||
{ | ||
"Quantity":1.0, | ||
"Description":"Internal", | ||
"Amount":5.6, | ||
// 0x4445 0000 0000 000A (internal / material consumption) | ||
"ftPayItemCase":4919338167972134922 | ||
} | ||
], | ||
// 0x4445 0000 0000 0010 (info-order) + 0000 0001 0000 0000 (implicit flow) | ||
"ftReceiptCase":4919338172267102224, | ||
"cbArea":"Tisch 56", | ||
"cbPreviousReceiptReference":"233347" | ||
} | ||
], | ||
// 0x4445 0000 0000 0010 (info-order) + 0000 0001 0000 0000 (implicit flow) | ||
"ftReceiptCase":4919338172267102224, | ||
"cbArea": "Tisch 56", | ||
"cbPreviousReceiptReference": "233347" | ||
} | ||
|
||
``` | ||
|
||
Response | ||
```json | ||
{ | ||
"ftCashBoxID": "cashboxid-guid", | ||
"ftPosSystemId": "possystemid-guid", | ||
"cbTerminalID": "terminalid", | ||
"cbReceiptReference": "233348", | ||
|
||
"ftQueueID":"queueid-guid", | ||
"ftQueueItemID":"queueitemid-guid", | ||
"ftQueueRow":"queuerow", | ||
"ftReceiptMoment":"2019-10-25T13:48:04.323Z", | ||
|
||
"ftCashboxIdentification":"fiskaltrust1=tse-client-id", | ||
"ftReceiptIdentification":"ft[queue-receiptnumerator-hex]#IT[tse-transaction]" | ||
|
||
ftSignatures[ | ||
{ | ||
"ftSignatureFormat":13, | ||
//0x4445000000000010 (start-transaction-result) | ||
"ftSignatureType": 4919338167972134928, | ||
"caption": "start-transaction-signature", | ||
"data": "[startTransactionResult]" | ||
}, | ||
{ | ||
"ftSignatureFormat":13, | ||
//0x4445000000000011 (finish-transaction-payload) | ||
"ftSignatureType": 4919338167972134929, | ||
"caption": "finish-transaction-payload", | ||
"data": "[finishTransactionPayload]" | ||
}, | ||
{ | ||
"ftSignatureFormat": 13, | ||
//0x4445000000000012 (finish-transaction-result) | ||
"ftSignatureType": 4919338167972134930, | ||
"caption": "finish-transaction-payload", | ||
"data": "[finishTransactionResult]" | ||
} | ||
] | ||
|
||
"ftCashBoxID":"cashboxid-guid", | ||
"ftPosSystemId":"possystemid-guid", | ||
"cbTerminalID":"terminalid", | ||
"cbReceiptReference":"233348", | ||
"ftQueueID":"queueid-guid", | ||
"ftQueueItemID":"queueitemid-guid", | ||
"ftQueueRow":"queuerow", | ||
"ftReceiptMoment":"2019-10-25T13:48:04.323Z", | ||
"ftCashboxIdentification":"fiskaltrust1=tse-client-id", | ||
"ftReceiptIdentification":"ft[queue-receiptnumerator-hex]#IT[tse-transaction]" | ||
"ftSignatures"[ | ||
{ | ||
"ftSignatureFormat":13, | ||
//0x4445000000000010 (start-transaction-result) | ||
"ftSignatureType":4919338167972134928, | ||
"caption":"start-transaction-signature", | ||
"data":"[startTransactionResult]" | ||
}, | ||
{ | ||
"ftSignatureFormat":13, | ||
//0x4445000000000011 (finish-transaction-payload) | ||
"ftSignatureType":4919338167972134929, | ||
"caption":"finish-transaction-payload", | ||
"data":"[finishTransactionPayload]" | ||
}, | ||
{ | ||
"ftSignatureFormat":13, | ||
//0x4445000000000012 (finish-transaction-result) | ||
"ftSignatureType":4919338167972134930, | ||
"caption":"finish-transaction-payload", | ||
"data":"[finishTransactionResult]" | ||
} | ||
] | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters