Fixed EventDateInfo Joi schema

This commit is contained in:
Alexander Cerutti
2025-10-31 18:36:29 +01:00
parent e7a3a76874
commit ecabc51539

View File

@@ -62,37 +62,39 @@ export interface EventDateInfo {
undetermined?: boolean; undetermined?: boolean;
} }
export const EventDateInfo = Joi.alternatives( export const EventDateInfo = Joi.object<EventDateInfo>().keys({
Joi.object<EventDateInfo>().keys({ date: Joi.string().isoDate(),
date: Joi.string().isoDate().required(), ignoreTimeComponents: Joi.boolean(),
ignoreTimeComponents: Joi.boolean(), timeZone: Joi.string(),
timeZone: Joi.string(),
/** /**
* @iOSVersion 18.1 * @iOSVersion 18.1
* *
* Indicates that the date was not announced yet. * Indicates that the time was not announced yet.
* Leads to showing "TBA" in the UI when `date` is set. * Leads to showing "TBA" in the UI when `date` is set.
* Setting `ignoreTimeComponents` to true, has higher priority * Setting `ignoreTimeComponents` to true, has higher priority
* over this property. * over this property.
*/ *
unannounced: Joi.boolean(), * When both `date` and `semantics.eventStartDate` are unset,
}), * `Date: TBA` will be shown in the UI.
Joi.object<EventDateInfo>().keys({ */
date: Joi.string().isoDate(), unannounced: Joi.boolean(),
/**
* @iOSVersion 18.1 /**
* * @iOSVersion 18.1
* Indicates that the time of the event has not been determined yet. *
* Leads to showing "TBD" in the UI when `date` is set. * Indicates that the time of the event has not been determined yet.
* Setting `ignoreTimeComponents` to true, has higher priority * Leads to showing "TBD" in the UI when `date` is set.
* over this property. * Setting `ignoreTimeComponents` to true, has higher priority
* * over this property.
* This property has higher priority over `unannounced`. *
*/ * This property has higher priority over `unannounced`.
undetermined: Joi.boolean().required(), *
}), * When both `date` and `semantics.eventStartDate` are unset,
); * `Date: TBD` will be shown in the UI.
*/
undetermined: Joi.boolean(),
});
/** /**
* @see https://developer.apple.com/documentation/walletpasses/semantictagtype/location-data.dictionary * @see https://developer.apple.com/documentation/walletpasses/semantictagtype/location-data.dictionary