Skip to content

Commit

Permalink
Added custom summary metrics and additional properties for fiscal
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonid Rubakhin committed Oct 26, 2023
1 parent 551f347 commit c2fc37b
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 8 deletions.
4 changes: 0 additions & 4 deletions business-unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ RetailBusinessUnit:
description: |
The name of the Business Unit.
type: string
fiscalBusinessUnitID:
description: |
A specific fiscal unique identifier for the Business Unit.
type: string
businessUnitNumber:
description: |
A unique value assigned to a certain type of Business Unit.
Expand Down
4 changes: 4 additions & 0 deletions common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,10 @@ TransactionLink:
such as register number.
type: integer
format: int32
workstationID:
description: |
A unique identifier of a workstation.
type: string
businessDayDate:
description: |
System date that Transaction is assigned to. It can be diffrent
Expand Down
96 changes: 96 additions & 0 deletions summary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -374,3 +374,99 @@ TradeTenderTypeMetricsCollection:
type: array
items:
$ref: "#/TradeTenderTypeMetrics"

CustomMetricGroup:
description: |
A group of related metrics.
type: object
properties:
groupName:
description: |
Name for the group of related metrics.
type: string
metrics:
description: |
Collection of custom metrics
$ref: "#/CustomMetricCollection"
additionalProperties: false

CustomMetricGroupCollection:
description: |
A collection of custom metrics groups.
type: array
items:
$ref: "#/CustomMetricGroup"

CustomMetric:
description: |
A custom metric defined by a retailer.
type: object
properties:
name:
description: |
Name for the custom metrics.
type: string
parameters:
description: |
Collection of parameters defining context for the metric.
$ref: "#/CustomMetricParameterCollection"
measure:
description: |
Quantitive value of the metric.
$ref: "#/CustomMetricMeasure"
additionalProperties: false
required:
- name
- parameters

CustomMetricMeasure:
description: |
Value for the custom metric. Initially we support amounts and
counts but in the future we can more properties to express
percentages (percent) and generic decimal values (decimalValue).
type: object
properties:
amount:
description: |
Monetary value of custom metric.
$ref: "common.yaml#/MonetaryAmount"
count:
description: |
Integer value of custom metric representing a count.
type: integer
format: int32
additionalProperties: false

CustomMetricParameter:
description: |
A key-value pairs to specify a parameter for custom metrics.
Such paremeters define context for the metric. For example, if
a metric shows amount of a certain tender, the parameter can
specify the tender ID.
type: object
properties:
name:
description: |
Parameter name.
type: string
value:
description: |
Parameter value.
type: string
additionalProperties: false
required:
- name

CustomMetricParameterCollection:
description: |
A collection of custom metric parameters.
type: array
items:
$ref: "#/CustomMetricParameter"

CustomMetricCollection:
description: |
A collection of custom metric .
type: array
items:
$ref: "#/CustomMetric"
2 changes: 2 additions & 0 deletions totals.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ TransactionTotalTypeCodeEnum:
Fee taxes are added to taxable fees excluding tax to get actual amount
to be included into grand total.
Grand - grand total. The final amount after everything is added up.
LineItemCount - total number of line items.
Grand Total formula:
Total-ExcludingTax
+
Expand Down Expand Up @@ -93,6 +94,7 @@ TransactionTotalTypeCodeEnum:
- TaxableFeesExcludingTax
- FeesTax
- Grand
- LineItemCount
- Custom

TotalCollection:
Expand Down
4 changes: 4 additions & 0 deletions trade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ Trade:
description: |
Line items within retail transaction.
$ref: "trade-lineitem.yaml#/TradeLineItemCollection"
totals:
description: |
Collection of transaction totals.
$ref: "totals.yaml#/TotalCollection"
additionalProperties: false

TradeTypeEnum:
Expand Down
8 changes: 4 additions & 4 deletions transaction.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ Transaction:
access a server and some functionality might not be available.
type: boolean
default: false
fiscalData:
description: |
Fiscal data for the transaction.
$ref: "fiscal.yaml#/FiscalData"
suspendedFlag:
description: |
A flag that indicates that the Transaction was suspended.
Expand Down Expand Up @@ -211,10 +215,6 @@ Transaction:
(TillToSafe). Transaction performed in the middle of the day that
are neither initial nor final can be classified as intermediate.
$ref: "#/TransactionStageCodeEnum"
totals:
description: |
Collection of transaction totals.
$ref: "totals.yaml#/TotalCollection"
suspended:
description: |
Data associated with suspended transaction.
Expand Down

0 comments on commit c2fc37b

Please sign in to comment.