Implement new schedule system for seasonal shop

This commit is contained in:
Phillip Thelen
2024-01-31 23:30:26 +01:00
committed by Sabe Jones
parent 736ef16430
commit db4bec37e3
3 changed files with 167 additions and 116 deletions
@@ -106,6 +106,12 @@ export default async function purchase (user, req = {}, analytics) {
if (!matchers.match(item.key)) {
throw new NotAuthorized(i18n.t('messageNotAvailable', req.language));
}
} else if (item.event && item.event.gear) {
const matchers = getScheduleMatchingGroup('seasonalGear');
console.log(matchers);
if (!matchers.match(item.set)) {
throw new NotAuthorized(i18n.t('messageNotAvailable', req.language));
}
} else if (!item.canBuy(user)) {
throw new NotAuthorized(i18n.t('messageNotAvailable', req.language));
}