Skip to content

Commit

Permalink
Merge pull request #766 from vonpoland/uni-799
Browse files Browse the repository at this point in the history
UNI-799: Backend - ATM ticket selector for single/day tickets
  • Loading branch information
vonpoland authored Nov 14, 2023
2 parents bf32e92 + 5d7df42 commit 7c40a89
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion maas-schemas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "maas-schemas",
"version": "20.6.0",
"version": "20.7.0",
"description": "Schemas for MaaS infrastructure",
"main": "index.js",
"engine": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@
"type": "object",
"additionalProperties": false,
"properties": {
"filters": {
"type": "string",
"pattern": "[a-zA-Z_]+==[\\-a-zA-Z0-9]+(?=[;,]|$)",
"description": "Schema for client filters which are passed to TSP-adapter. Based on https://developers.google.com/analytics/devguides/reporting/core/v3/reference#filters",
"examples": [
"ticketZone==ATM-m1,ticketZone==ATM-m2",
"ticketType==daily;ticketZone==ATM-m2"
]
},
"mode": {
"$ref": "https://schemas.maas.global/core/components/travel-mode.json"
},
Expand Down
12 changes: 12 additions & 0 deletions maas-schemas/src/io-ts/_translation.log
Original file line number Diff line number Diff line change
Expand Up @@ -1464,6 +1464,12 @@ WARNING: pattern field not supported outside top-level definitions
in schemas/maas-backend/bookings/bookings-list/request.json
WARNING: minItems field not supported outside top-level definitions
in schemas/maas-backend/bookings/bookings-list/response.json
INFO: primitive type "string" used outside top-level definitions
in schemas/maas-backend/bookings/bookings-options/request.json
WARNING: pattern field not supported outside top-level definitions
in schemas/maas-backend/bookings/bookings-options/request.json
WARNING: examples field not supported outside top-level definitions
in schemas/maas-backend/bookings/bookings-options/request.json
WARNING: unexpected key in a $ref object
in schemas/maas-backend/bookings/bookings-options/request.json
INFO: primitive type "string" used outside top-level definitions
Expand All @@ -1474,6 +1480,12 @@ WARNING: maxLength field not supported outside top-level definitions
in schemas/maas-backend/bookings/bookings-options/request.json
WARNING: patternProperty support has limitations
in schemas/maas-backend/bookings/bookings-options/request.json
INFO: primitive type "string" used outside top-level definitions
in schemas/maas-backend/bookings/bookings-options/request.json
WARNING: pattern field not supported outside top-level definitions
in schemas/maas-backend/bookings/bookings-options/request.json
WARNING: examples field not supported outside top-level definitions
in schemas/maas-backend/bookings/bookings-options/request.json
WARNING: unexpected key in a $ref object
in schemas/maas-backend/bookings/bookings-options/request.json
INFO: primitive type "string" used outside top-level definitions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const schemaId =
// The purpose of this remains a mystery
export type Payload = t.Branded<
{
filters?: string;
mode?: TravelMode_5e34_.TravelMode;
startTime?: Units_c404_.Time;
endTime?: Units_c404_.Time;
Expand All @@ -57,6 +58,7 @@ export type Payload = t.Branded<
code?: string;
} & Record<
string,
| string
| TravelMode_5e34_.TravelMode
| Units_c404_.Time
| Units_c404_.Time
Expand All @@ -80,6 +82,7 @@ export type PayloadC = t.BrandC<
t.IntersectionC<
[
t.PartialC<{
filters: t.StringC;
mode: typeof TravelMode_5e34_.TravelMode;
startTime: typeof Units_c404_.Time;
endTime: typeof Units_c404_.Time;
Expand All @@ -100,6 +103,7 @@ export type PayloadC = t.BrandC<
t.StringC,
t.UnionC<
[
t.StringC,
typeof TravelMode_5e34_.TravelMode,
typeof Units_c404_.Time,
typeof Units_c404_.Time,
Expand All @@ -126,6 +130,7 @@ export type PayloadC = t.BrandC<
export const Payload: PayloadC = t.brand(
t.intersection([
t.partial({
filters: t.string,
mode: TravelMode_5e34_.TravelMode,
startTime: Units_c404_.Time,
endTime: Units_c404_.Time,
Expand All @@ -145,6 +150,7 @@ export const Payload: PayloadC = t.brand(
t.record(
t.string,
t.union([
t.string,
TravelMode_5e34_.TravelMode,
Units_c404_.Time,
Units_c404_.Time,
Expand All @@ -168,6 +174,7 @@ export const Payload: PayloadC = t.brand(
x,
): x is t.Branded<
{
filters?: string;
mode?: TravelMode_5e34_.TravelMode;
startTime?: Units_c404_.Time;
endTime?: Units_c404_.Time;
Expand All @@ -185,6 +192,7 @@ export const Payload: PayloadC = t.brand(
code?: string;
} & Record<
string,
| string
| TravelMode_5e34_.TravelMode
| Units_c404_.Time
| Units_c404_.Time
Expand Down

0 comments on commit 7c40a89

Please sign in to comment.