🆙 Fix Catalog editor

This commit is contained in:
duckietm
2026-04-17 13:51:46 +02:00
parent b0967d7eaf
commit 88117d937f
6 changed files with 23 additions and 10 deletions
+5
View File
@@ -117,4 +117,9 @@ export class FurnitureOffer implements IPurchasableOffer
{
return true;
}
public get itemIds(): string
{
return String(this._furniData?.id ?? '');
}
}
+1
View File
@@ -22,4 +22,5 @@ export interface IPurchasableOffer
localizationDescription: string;
isLazy: boolean;
products: IProduct[];
itemIds: string;
}
+9 -2
View File
@@ -30,8 +30,9 @@ export class Offer implements IPurchasableOffer
private _products: IProduct[];
private _badgeCode: string;
private _bundlePurchaseAllowed: boolean = false;
private _itemIds: string = '';
constructor(offerId: number, localizationId: string, isRentOffer: boolean, priceInCredits: number, priceInActivityPoints: number, activityPointType: number, giftable: boolean, clubLevel: number, products: IProduct[], bundlePurchaseAllowed: boolean)
constructor(offerId: number, localizationId: string, isRentOffer: boolean, priceInCredits: number, priceInActivityPoints: number, activityPointType: number, giftable: boolean, clubLevel: number, products: IProduct[], bundlePurchaseAllowed: boolean, itemIds: string = '')
{
this._offerId = offerId;
this._localizationId = localizationId;
@@ -43,6 +44,7 @@ export class Offer implements IPurchasableOffer
this._clubLevel = clubLevel;
this._products = products;
this._bundlePurchaseAllowed = bundlePurchaseAllowed;
this._itemIds = itemIds || '';
this.setPricingModelForProducts();
this.setPricingType();
@@ -174,6 +176,11 @@ export class Offer implements IPurchasableOffer
return this._products;
}
public get itemIds(): string
{
return this._itemIds;
}
private setPricingModelForProducts(): void
{
const products = Product.stripAddonProducts(this._products);
@@ -236,7 +243,7 @@ export class Offer implements IPurchasableOffer
products.push(new Product(product.productType, product.productClassId, product.extraParam, product.productCount, productData, furnitureData));
}
const offer = new Offer(this.offerId, this.localizationId, this.isRentOffer, this.priceInCredits, this.priceInActivityPoints, this.activityPointType, this.giftable, this.clubLevel, products, this.bundlePurchaseAllowed);
const offer = new Offer(this.offerId, this.localizationId, this.isRentOffer, this.priceInCredits, this.priceInActivityPoints, this.activityPointType, this.giftable, this.clubLevel, products, this.bundlePurchaseAllowed, this.itemIds);
offer.page = this.page;