Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
240 changes: 0 additions & 240 deletions schema-definitions/mobility.json
Original file line number Diff line number Diff line change
Expand Up @@ -675,246 +675,6 @@
}
]
}
},
"bonusProducts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"isActive": {
"type": "boolean"
},
"operatorId": {
"type": "string",
"minLength": 1
},
"formFactors": {
"minItems": 1,
"type": "array",
"items": {
"anyOf": [
{
"type": "string",
"const": "SCOOTER"
},
{
"type": "string",
"const": "SCOOTER_STANDING"
},
{
"type": "string",
"const": "BICYCLE"
},
{
"type": "string",
"const": "CAR"
}
]
}
},
"price": {
"type": "object",
"properties": {
"amount": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"currencyCode": {
"type": "string",
"const": "ATB_BONUS_POINT"
}
},
"required": ["amount", "currencyCode"]
},
"paymentDescription": {
"minItems": 1,
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"lang": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": ["lang", "value"]
},
{
"type": "object",
"properties": {
"language": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
]
}
},
"productDescription": {
"type": "object",
"properties": {
"title": {
"minItems": 1,
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"lang": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": ["lang", "value"]
},
{
"type": "object",
"properties": {
"language": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
]
}
},
"description": {
"minItems": 1,
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"lang": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": ["lang", "value"]
},
{
"type": "object",
"properties": {
"language": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
]
}
}
},
"required": ["title"]
}
},
"required": [
"id",
"isActive",
"operatorId",
"formFactors",
"price",
"paymentDescription",
"productDescription"
]
}
},
"bonusTexts": {
"type": "object",
"properties": {
"howBonusWorks": {
"type": "object",
"properties": {
"title": {
"minItems": 1,
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"lang": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": ["lang", "value"]
},
{
"type": "object",
"properties": {
"language": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
]
}
},
"description": {
"minItems": 1,
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"lang": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": ["lang", "value"]
},
{
"type": "object",
"properties": {
"language": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
]
}
}
},
"required": ["title", "description"]
}
},
"required": ["howBonusWorks"]
}
},
"required": ["operators"]
Expand Down
21 changes: 0 additions & 21 deletions src/mobility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,24 +118,3 @@ export const ConsentLine = z.object({
});

export type ConsentLineType = z.infer<typeof ConsentLine>;

export const BonusProduct = z.object({
id: z.string().nonempty(),
isActive: z.boolean(),
operatorId: MobilityOperator.shape.id,
formFactors: z.array(FormFactor).nonempty(),
price: z.object({
amount: z.number().int().positive(),
currencyCode: z.literal('ATB_BONUS_POINT'),
}),
paymentDescription: LanguageAndTextTypeArray.nonempty(),
productDescription: titleAndOptionalDescription,
});

export type BonusProductType = z.infer<typeof BonusProduct>;

export const BonusTexts = z.object({
howBonusWorks: titleAndDescription,
});

export type BonusTextsType = z.infer<typeof BonusTexts>;
4 changes: 0 additions & 4 deletions src/tools/specifications-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import {z} from 'zod';
import {FareProductGroup, FareProductTypeConfig} from '../fare-product-type';
import {TravelSearchFilters} from '../travel-search-filters';
import {
BonusProduct,
BonusTexts,
ConsentLine,
MobilityOperator,
OperatorBenefitId,
Expand Down Expand Up @@ -66,8 +64,6 @@ export const schemaTypes = {
scooterConsentLines: z.array(ConsentLine).optional(),
bicycleConsentLines: z.array(ConsentLine).optional(),
benefitIdsRequiringValueCode: z.array(OperatorBenefitId).optional(),
bonusProducts: z.array(BonusProduct).optional(),
bonusTexts: BonusTexts.optional(),
})
.meta({title: 'MobilityOperator'}),
other: Other,
Expand Down
Loading