{ "version": 3, "sources": ["apps/business-center-client/src/app/orders/confirmation/util.ts", "apps/business-center-client/src/app/orders/conversion-utils.ts", "apps/business-center-client/src/app/orders/order.service.ts"], "sourcesContent": ["import { BillingFrequency, Currency, formatBillingFrequency, formatDisplayPrice } from '@vendasta/shared';\nimport { Pipe, PipeTransform } from '@angular/core';\nimport { LineItem } from '@vendasta/sales-orders';\n\n@Pipe({\n name: 'price',\n standalone: false,\n})\nexport class PricePipe implements PipeTransform {\n transform(\n value: any,\n currency: Currency,\n billingFrequency?: BillingFrequency,\n isCents = true,\n translateZero = true,\n displaySymbol = true,\n ): any {\n return formatDisplayPrice(value, currency, billingFrequency, isCents, translateZero, displaySymbol);\n }\n}\n\n@Pipe({\n name: 'formatBillingFrequency',\n standalone: false,\n})\nexport class FormatBillingFrequencyPipe implements PipeTransform {\n transform(value: string): string {\n return formatBillingFrequency(value);\n }\n}\n\nexport function getTotalPriceForLineItems(lineItems: LineItem[]): number {\n return lineItems.reduce((total, lineItem) => {\n const liTotal = lineItem.currentRevenue.revenueComponents.reduce((rcTotal, revenueComponent) => {\n return rcTotal + (revenueComponent.value || 0);\n }, 0);\n return total + (liTotal || 0) * (lineItem.quantity || 1);\n }, 0);\n}\n", "import {\n AddonKey as SalesOrderAddonKey,\n LineItem,\n LineItemInterface,\n Revenue,\n RevenueComponent,\n RevenuePeriod,\n} from '@vendasta/sales-orders';\nimport {\n AddonKey as MarketplaceAddonKey,\n Currency as MarketplaceCurrency,\n Frequency,\n Package as MarketplacePackage,\n Price,\n Pricing,\n} from '@vendasta/marketplace-packages';\nimport { AppKey } from '@galaxy/marketplace-apps';\nimport { ProductPricing, Currency as BillingCurrency, Frequency as BillingFrequency } from '@galaxy/billing';\n\nexport function convertMarketplacePricingToSalesOrderRevenue(pricing: Pricing): Revenue {\n return pricing && pricing.prices\n ? new Revenue({\n revenueComponents: pricing.prices.map(\n (price) =>\n new RevenueComponent({\n value: price.price > 0 ? price.price : 0,\n period: convertMarketplaceFrequencyToSalesOrderRevenuePeriod(price.frequency),\n isStartingRevenue: price.isStartingPrice || false,\n }),\n ),\n })\n : new Revenue();\n}\n\nexport function convertBillingRetailPriceToSalesOrderRevenue(productPricing: ProductPricing): Revenue {\n return productPricing\n ? new Revenue({\n revenueComponents: [\n new RevenueComponent({\n value: productPricing.pricingRules?.length > 0 ? productPricing.pricingRules[0].price : 0,\n period: convertBillingFrequencyToSalesOrderRevenuePeriod(productPricing.frequency),\n isStartingRevenue: false,\n }),\n ],\n })\n : new Revenue();\n}\n\nexport function convertMarketplaceCurrencyToCurrencyCode(currency: MarketplaceCurrency): string {\n if (MarketplaceCurrency[currency]) {\n return MarketplaceCurrency[currency];\n }\n return 'USD';\n}\n\nexport function convertBillingCurrencyToCurrencyCode(currency: BillingCurrency): string {\n if (BillingCurrency[currency]) {\n return BillingCurrency[currency];\n }\n return 'USD';\n}\n\nexport function convertMarketplaceFrequencyToSalesOrderRevenuePeriod(freq: Frequency): RevenuePeriod {\n switch (freq) {\n case Frequency.ONCE:\n return RevenuePeriod.ONETIME;\n case Frequency.DAILY:\n return RevenuePeriod.DAILY;\n case Frequency.WEEKLY:\n return RevenuePeriod.WEEKLY;\n case Frequency.MONTHLY:\n return RevenuePeriod.MONTHLY;\n case Frequency.YEARLY:\n return RevenuePeriod.YEARLY;\n default:\n // Default to monthly\n // Frequency.OTHER and RevenuePeriod.BIWEEKLY don't have associated counterparts.\n return RevenuePeriod.MONTHLY;\n }\n}\n\nexport function convertBillingFrequencyToSalesOrderRevenuePeriod(freq: BillingFrequency): RevenuePeriod {\n switch (freq) {\n case BillingFrequency.OneTime:\n return RevenuePeriod.ONETIME;\n case BillingFrequency.Monthly:\n return RevenuePeriod.MONTHLY;\n case BillingFrequency.Yearly:\n return RevenuePeriod.YEARLY;\n default:\n // Default to monthly\n // Frequency.OTHER and RevenuePeriod.BIWEEKLY don't have associated counterparts.\n return RevenuePeriod.MONTHLY;\n }\n}\n\nexport function convertMarketplaceAddonKeyToSalesOrderAddonKey(addonKey: MarketplaceAddonKey): SalesOrderAddonKey {\n return new SalesOrderAddonKey({\n appId: addonKey.appId,\n addonId: addonKey.addonId,\n });\n}\n\nexport interface PackagedItem {\n package: MarketplacePackage;\n lineItem: LineItemInterface;\n}\n\nexport function packagesToLineItems(pckgdItems: PackagedItem[]): LineItem[] {\n return pckgdItems.map((pkgdItem) => {\n const pckg = pkgdItem.package;\n const lineItem = pkgdItem.lineItem;\n return new LineItem({\n packageId: pckg.packageId,\n currencyCode: pckg.pricing ? convertMarketplaceCurrencyToCurrencyCode(pckg.pricing.currency) : 'USD',\n currentRevenue: convertMarketplacePricingToSalesOrderRevenue(pckg.pricing),\n quantity: lineItem?.quantity > 0 ? lineItem.quantity : 1,\n });\n });\n}\n\nexport function addPricingToLineItems(\n lineItems: LineItemInterface[],\n priceByApp: { key: AppKey; pricing: ProductPricing }[],\n): LineItem[] {\n return lineItems.map((li) => {\n const price = priceByApp.find((p) => p.key.appId === li.appKey.appId && p.key.editionId === li.appKey.editionId);\n const productPricing: ProductPricing = price ? price.pricing : null;\n const revenue = convertBillingRetailPriceToSalesOrderRevenue(productPricing);\n return new LineItem({\n appKey: li.appKey,\n currencyCode: convertBillingCurrencyToCurrencyCode(productPricing?.currency),\n currentRevenue: revenue,\n quantity: li.quantity > 0 ? li.quantity : 1,\n isTrial: li.isTrial,\n });\n });\n}\n\nexport function convertCurrencyCodeToMPCurrency(currencyCode: string): MarketplaceCurrency {\n if (MarketplaceCurrency[currencyCode]) {\n return MarketplaceCurrency[currencyCode];\n }\n return MarketplaceCurrency.USD;\n}\n\nexport function convertOrderRevenuePeriodToMPFrequency(revenuePeriod: RevenuePeriod): Frequency {\n // TODO: Unify Frequency between orders and packages\n switch (revenuePeriod) {\n case undefined: // proto doesn't transmit 0 enum, but the default should not be Onetime\n case RevenuePeriod.ONETIME:\n return Frequency.ONCE;\n case RevenuePeriod.DAILY:\n return Frequency.DAILY;\n case RevenuePeriod.WEEKLY:\n return Frequency.WEEKLY;\n case RevenuePeriod.MONTHLY:\n return Frequency.MONTHLY;\n case RevenuePeriod.YEARLY:\n return Frequency.YEARLY;\n case RevenuePeriod.BIWEEKLY: // No MP equivalent...?\n default:\n return Frequency.OTHER;\n }\n}\n\nexport function getPackagePricingFromLineItem(lineItem: LineItem): Pricing {\n let prices: Price[] = [];\n if (!!lineItem.currentRevenue && !!lineItem.currentRevenue.revenueComponents) {\n prices = lineItem.currentRevenue.revenueComponents.map((c) => {\n return new Price({\n price: c.value,\n frequency: convertOrderRevenuePeriodToMPFrequency(c.period),\n });\n });\n }\n\n return new Pricing({\n currency: convertCurrencyCodeToMPCurrency(lineItem.currencyCode),\n prices: prices,\n });\n}\n", "import { Injectable } from '@angular/core';\nimport { BillingService, ProductPricing } from '@galaxy/billing';\nimport { App, AppKey, AppPartnerService } from '@galaxy/marketplace-apps';\nimport { TranslateService } from '@ngx-translate/core';\nimport { Package, PricingDisplayOption } from '@vendasta/marketplace-packages';\nimport {\n CommonField,\n ConfigInterface,\n CustomField,\n CustomerSalesOrdersService,\n Field,\n FieldInterface,\n LineItem,\n LineItemInterface,\n Order,\n RevenueComponent,\n RevenuePeriod,\n SalesOrdersService,\n Status,\n UserInterface,\n} from '@vendasta/sales-orders';\nimport { SalesOrderStoreService } from '@vendasta/sales-ui';\nimport { BehaviorSubject, Observable, Subject, combineLatest, of } from 'rxjs';\nimport {\n catchError,\n distinctUntilChanged,\n filter,\n map,\n publishReplay,\n refCount,\n shareReplay,\n startWith,\n switchMap,\n switchMapTo,\n tap,\n withLatestFrom,\n} from 'rxjs/operators';\nimport { AccountGroup, AccountGroupService } from '../account-group';\nimport { PackageService } from '../core/package.service';\nimport { getTotalPriceForLineItems } from './confirmation/util';\nimport { addPricingToLineItems, getPackagePricingFromLineItem, packagesToLineItems } from './conversion-utils';\n\n@Injectable()\nexport class OrderService {\n static readonly fileUploadUrl = '/ajax/v1/marketplace/file/upload/';\n\n private orderId$$: BehaviorSubject = new BehaviorSubject(null);\n private specifiedLineItems$$: BehaviorSubject = new BehaviorSubject(null);\n private readonly orderPermissionDenied$$: BehaviorSubject = new BehaviorSubject(false);\n private readonly orderId$: Observable;\n readonly specifiedLineItems$: Observable;\n readonly order$: Observable;\n readonly readOnly$: Observable;\n readonly orderPermissionDenied$: Observable = this.orderPermissionDenied$$.asObservable();\n readonly allAppsInTheOrder$: Observable;\n readonly lineItems$: Observable;\n readonly orderTotal$: Observable;\n readonly cannotBIYPackageWarning$: Observable;\n readonly commonFormSectionsSaved$$: Subject = new Subject(); // used to refresh saved order form values.\n readonly customFieldsSaved$$: Subject = new Subject(); // used to refresh saved order form values.\n readonly extraFieldsSaved$$: Subject = new Subject(); // used to refresh saved order form values.\n readonly requiresPartnerInputSaved$$: Subject = new Subject(); // used to refresh saved order form values.\n readonly orderConfig$: Observable;\n savedCommonFormFields$: Observable;\n savedCustomFields$: Observable;\n savedExtraFields$: Observable;\n savedRequiresPartnerInput$: Observable;\n users$: Observable<{ [key: string]: UserInterface }>;\n\n constructor(\n private accountGroupService: AccountGroupService,\n private packageService: PackageService,\n private salesOrdersService: SalesOrdersService,\n private orderStoreService: SalesOrderStoreService,\n private customerSalesOrdersService: CustomerSalesOrdersService,\n private appSdk: AppPartnerService,\n private translateService: TranslateService,\n private billingService: BillingService,\n ) {\n const agid$ = this.accountGroupService.currentAccountGroupId$.pipe(\n filter((agid) => !!agid),\n distinctUntilChanged(),\n );\n this.orderId$ = this.orderId$$.pipe(\n filter((orderId) => !!orderId),\n distinctUntilChanged(),\n );\n\n this.specifiedLineItems$ = this.specifiedLineItems$$.pipe(\n filter((orderItems) => orderItems !== null),\n distinctUntilChanged(),\n );\n\n this.order$ = combineLatest([agid$, this.orderId$]).pipe(\n filter(([agid, orderId]) => !!orderId && !!agid),\n switchMap(([agid, orderId]) => {\n return this.customerSalesOrdersService.get(orderId, agid);\n }),\n tap(() => {\n this.orderPermissionDenied$$.next(false);\n }),\n catchError(() => {\n this.orderPermissionDenied$$.next(true);\n return of(null);\n }),\n startWith(null),\n publishReplay(1),\n refCount(),\n );\n\n this.readOnly$ = this.order$.pipe(map((order) => calculateReadOnlyOrderform(order)));\n\n this.users$ = this.order$.pipe(\n filter((o) => !!o),\n switchMap((o) => this.customerSalesOrdersService.getUsers(o.orderId, o.businessId)),\n startWith({}),\n );\n\n this.orderConfig$ = this.accountGroupService.currentAccountGroup$.pipe(\n switchMap((a) => {\n return this.salesOrdersService.getConfig(a.partnerId, a.marketId);\n }),\n publishReplay(1),\n refCount(),\n );\n\n const packageIds$ = combineLatest([this.specifiedLineItems$, this.order$]).pipe(\n map(([orderItems, order]) => {\n if (order) {\n return order.lineItems.filter((li) => !!li.packageId).map((li) => li.packageId);\n }\n return orderItems.map((orderItem) => orderItem.packageId).filter((id) => !!id);\n }),\n );\n\n const packages$: Observable = packageIds$.pipe(\n switchMap((packageIds) => {\n return packageIds.length > 0 ? this.packageService.getMulti(packageIds) : of([]);\n }),\n withLatestFrom(this.order$),\n map(([packages, order]) => {\n if (order) {\n packages = order.lineItems\n .map((li) => {\n const orderPackage = packages.find((x) => x.packageId === li.packageId);\n\n if (orderPackage) {\n orderPackage.pricing = getPackagePricingFromLineItem(li);\n }\n\n return orderPackage;\n })\n .filter((li) => !!li);\n }\n return packages;\n }),\n publishReplay(1),\n refCount(),\n // TODO: prevent creating order with a package in other markets\n );\n\n this.cannotBIYPackageWarning$ = packages$.pipe(\n map((packages) => {\n const packagesNotUsingBillingPricing = packages.filter(\n (pkg) =>\n pkg.pricingDisplayOption === PricingDisplayOption.PRICING_DISPLAY_OPTION_CONTACT_SALES ||\n pkg.pricingDisplayOption === PricingDisplayOption.PRICING_DISPLAY_OPTION_STARTING_AT,\n );\n if (packagesNotUsingBillingPricing.length > 0) {\n return this.createCannotBIYPackageWarning(packagesNotUsingBillingPricing);\n }\n return '';\n }),\n );\n\n this.allAppsInTheOrder$ = combineLatest([packages$, this.specifiedLineItems$]).pipe(\n map(([packages, specifiedLineItems]) => {\n let lineItems = [];\n packages.map((p) => (lineItems = lineItems.concat(p.lineItems.lineItems || [])));\n const appKeysFromPackages = lineItems.map((li) => new AppKey({ appId: li.id, editionId: li.editionId }));\n return appKeysFromPackages.concat(\n specifiedLineItems.filter((li) => !!li.appKey).map((li) => new AppKey(li.appKey)),\n );\n }),\n withLatestFrom(this.accountGroupService.currentAccountGroup$),\n switchMap(([keys, accountGroup]) => {\n const filteredKeys = (keys || []).filter((k) => !!k);\n if (filteredKeys.length === 0) {\n return of([]);\n }\n return this.appSdk.getMulti(filteredKeys, accountGroup.partnerId, accountGroup.marketId, null, true);\n }),\n publishReplay(1),\n refCount(),\n );\n\n const billingRetailPrices$: Observable<{ key: AppKey; pricing: ProductPricing }[]> = combineLatest([\n this.specifiedLineItems$,\n this.accountGroupService.currentAccountGroup$,\n this.allAppsInTheOrder$,\n ]).pipe(\n switchMap(([specifiedLineItems, accountGroup, apps]: [LineItemInterface[], AccountGroup, App[]]) => {\n const specifiedApps: LineItemInterface[] = specifiedLineItems.filter((l) => !!l.appKey);\n if (specifiedApps.length === 0) {\n return of([]);\n }\n const appKeysBySku: { [sku: string]: AppKey } = getAppKeysBySkus(specifiedApps, apps);\n return this.billingService\n .getMultiRetailPricing(accountGroup.partnerId, null, Object.keys(appKeysBySku), accountGroup.marketId)\n .pipe(\n map((pricings) => {\n return Object.keys(pricings).map((sku) => {\n const productPricing: ProductPricing = pricings[sku];\n const appKey: AppKey = appKeysBySku[sku];\n return { key: appKey, pricing: productPricing };\n });\n }),\n );\n }),\n shareReplay({ refCount: true, bufferSize: 1 }),\n );\n\n this.lineItems$ = combineLatest([this.order$, billingRetailPrices$, this.specifiedLineItems$, packages$]).pipe(\n map(([order, prices, specifiedLineItems, packages]) => {\n if (order) {\n return order.lineItems;\n }\n const orderConfItems = packagesToLineItems(\n packages.map((pkg) => ({\n package: pkg,\n lineItem: specifiedLineItems.find((lineItem) => !!lineItem && lineItem.packageId === pkg.packageId),\n })),\n );\n const appItems = addPricingToLineItems(\n specifiedLineItems.filter((li) => !!li.appKey),\n prices,\n );\n const concatOrderConfItems = orderConfItems.concat(appItems);\n concatOrderConfItems.forEach((li) => {\n li.currentRevenue.revenueComponents.sort(sortRevenuesByFrequency);\n });\n return concatOrderConfItems;\n }),\n publishReplay(1),\n refCount(),\n );\n\n this.orderTotal$ = this.lineItems$.pipe(map((lineItems) => getTotalPriceForLineItems(lineItems)));\n\n this.savedCommonFormFields$ = this.commonFormSectionsSaved$$.pipe(\n startWith(undefined as void), // ensure we get the initial value\n switchMapTo(agid$),\n map((accountGroupId) => {\n const key = buildCommonFieldsKey(accountGroupId);\n const orderFormJson = window.sessionStorage.getItem(key);\n if (orderFormJson) {\n return JSON.parse(orderFormJson);\n }\n }),\n );\n this.savedCustomFields$ = this.customFieldsSaved$$.pipe(\n startWith(undefined as void), // ensure we get the initial value\n switchMapTo(agid$),\n map((accountGroupId) => {\n const key = buildCustomFieldsKey(accountGroupId);\n const orderFormJson = window.sessionStorage.getItem(key);\n let jsonFields: CustomField[];\n if (orderFormJson) {\n jsonFields = JSON.parse(orderFormJson);\n }\n\n return jsonFields\n ? jsonFields.map((customField) => {\n const returnField = new CustomField(customField);\n returnField.fields = returnField.fields.map((field) => {\n return new Field(field);\n });\n return returnField;\n })\n : [];\n }),\n );\n this.savedExtraFields$ = this.extraFieldsSaved$$.pipe(\n startWith(undefined as void),\n switchMapTo(agid$),\n map((accountGroupId) => {\n const key = buildExtraFieldsKey(accountGroupId);\n const orderFormJson = window.sessionStorage.getItem(key);\n if (orderFormJson) {\n return JSON.parse(orderFormJson);\n } else {\n return [];\n }\n }),\n );\n\n this.savedRequiresPartnerInput$ = this.requiresPartnerInputSaved$$.pipe(\n startWith(undefined as void),\n switchMapTo(agid$),\n map((accountGroupId) => {\n const key = buildRequiresPartnerInputKey(accountGroupId);\n const requiresPartnerInputJson = window.sessionStorage.getItem(key);\n if (requiresPartnerInputJson) {\n return JSON.parse(requiresPartnerInputJson);\n } else {\n return false;\n }\n }),\n );\n }\n\n // Different products can have order form fields with the same fieldID, which will cause problem.\n // Please refer to https://github.com/vendasta/business-center-client/pull/1002\n // We will prefix the fieldID with uuid, and take it off before we same the order form into session storage\n static decodeCustomFieldId(fieldId: string): string {\n return fieldId.replace(new RegExp('(.*#)'), '');\n }\n\n private createCannotBIYPackageWarning(packages: Package[]): string {\n const namesOfPackages = packages.map((pkg) => pkg.name);\n return this.translateService.instant('STORE.ORDER_CONFIRMATION.CANNOT_BIY_PACKAGE_WARNING', {\n package_names: namesOfPackages.join('\\n \\u2022 '),\n });\n }\n\n initialize(orderId: string, specifiedLineItems: LineItemInterface[]): void {\n this.orderId$$.next(orderId);\n this.specifiedLineItems$$.next(specifiedLineItems);\n }\n\n saveCommonFields(commonFields: CommonField[], accountGroupId: string): void {\n const key = buildCommonFieldsKey(accountGroupId);\n const orderFormJson = JSON.stringify(commonFields);\n window.sessionStorage.setItem(key, orderFormJson);\n this.commonFormSectionsSaved$$.next();\n }\n\n saveCustomFields(fields: CustomField[], accountGroupId: string): void {\n const key = buildCustomFieldsKey(accountGroupId);\n const orderFormJson = JSON.stringify(fields);\n window.sessionStorage.setItem(key, orderFormJson);\n this.customFieldsSaved$$.next();\n }\n\n saveExtraFields(fields: FieldInterface[], accountGroupId: string): void {\n const key = buildExtraFieldsKey(accountGroupId);\n const orderFormJson = JSON.stringify(fields);\n window.sessionStorage.setItem(key, orderFormJson);\n this.extraFieldsSaved$$.next();\n }\n\n saveRequiresPartnerInput(requiresPartnerInput: boolean, accountGroupId: string): void {\n const key = buildRequiresPartnerInputKey(accountGroupId);\n const requiresPartnerInputJson = JSON.stringify(requiresPartnerInput);\n window.sessionStorage.setItem(key, requiresPartnerInputJson);\n this.requiresPartnerInputSaved$$.next();\n }\n\n refreshOrder(orderId: string, accountGroupId: string): void {\n this.orderId$$.next(orderId);\n this.orderStoreService.refreshOrder(orderId, accountGroupId);\n }\n}\n\nfunction buildCustomFieldsKey(accountGroupId: string): string {\n return `custom-${accountGroupId}`;\n}\n\nfunction buildCommonFieldsKey(accountGroupId: string): string {\n return `common-${accountGroupId}`;\n}\n\nfunction buildExtraFieldsKey(accountGroupId: string): string {\n return `extra-${accountGroupId}`;\n}\n\nfunction buildRequiresPartnerInputKey(accountGroupId: string): string {\n return `req-partner-input-${accountGroupId}`;\n}\n\nfunction getAppKeysBySkus(specifiedApps: LineItemInterface[], apps: App[]): { [sku: string]: AppKey } {\n const appKeysBySku: { [sku: string]: AppKey } = {};\n specifiedApps.forEach((specifiedApp) => {\n const app: App = apps.find((a) => a.key.appId === specifiedApp.appKey.appId);\n if (specifiedApp.appKey.editionId && app?.editionInformation?.editions?.length > 0) {\n const edition = app.editionInformation.editions.find((e) => e.appKey.editionId === specifiedApp.appKey.editionId);\n if (edition?.billingId) {\n appKeysBySku[edition.billingId] = new AppKey(specifiedApp.appKey);\n }\n } else {\n appKeysBySku[app.externalIdentifiers.billingId] = new AppKey(specifiedApp.appKey);\n }\n });\n return appKeysBySku;\n}\n\n// This function is used for sorting revenues by frequency into the order: Monthly, Yearly, Once\nexport function sortRevenuesByFrequency(revenueA: RevenueComponent, revenueB: RevenueComponent): number {\n const revenueFrequencyComparisonMap: Map> = new Map<\n RevenuePeriod,\n Map\n >([\n [\n RevenuePeriod.MONTHLY,\n new Map([\n [RevenuePeriod.MONTHLY, 0],\n [RevenuePeriod.YEARLY, -1],\n [RevenuePeriod.ONETIME, -1],\n ]),\n ],\n [\n RevenuePeriod.YEARLY,\n new Map([\n [RevenuePeriod.MONTHLY, 1],\n [RevenuePeriod.YEARLY, 0],\n [RevenuePeriod.ONETIME, -1],\n ]),\n ],\n [\n RevenuePeriod.ONETIME,\n new Map([\n [RevenuePeriod.MONTHLY, 1],\n [RevenuePeriod.YEARLY, 1],\n [RevenuePeriod.ONETIME, 0],\n ]),\n ],\n ]);\n\n if (revenueFrequencyComparisonMap.get(revenueA.period) === undefined) {\n return 0;\n }\n\n const compareVal = revenueFrequencyComparisonMap.get(revenueA.period).get(revenueB.period);\n return compareVal ? compareVal : 0;\n}\n\n// The specifiedAppKeys can have an empty edition. If this is the case and the actual app is our O&O then the default edition id is used\nexport function findAppFromOrderItems(specifiedAppKeys: AppKey[], apps: App[]): App[] {\n return specifiedAppKeys\n .map((key) => {\n let app = apps.find((a) => a.key.appId === key.appId && a.key.editionId === key.editionId);\n if (!app && key.editionId === '') {\n app = apps.find((a) => a.key.appId === key.appId);\n }\n return app;\n })\n .filter((a) => !!a);\n}\n\n// an order can only be edited by an smb user if the status set to waiting for their approval\nexport function calculateReadOnlyOrderform(o: Order): boolean {\n let readOnly = false;\n if (o) {\n readOnly = o.status !== Status.SUBMITTED_FOR_CUSTOMER_APPROVAL;\n }\n return readOnly;\n}\n"], "mappings": "gwBA+BM,SAAUA,GAA0BC,EAAqB,CAC7D,OAAOA,EAAUC,OAAO,CAACC,EAAOC,IAAY,CAC1C,IAAMC,EAAUD,EAASE,eAAeC,kBAAkBL,OAAO,CAACM,EAASC,IAClED,GAAWC,EAAiBC,OAAS,GAC3C,CAAC,EACJ,OAAOP,GAASE,GAAW,IAAMD,EAASO,UAAY,EACxD,EAAG,CAAC,CACN,CAtCA,IAAAC,GAAAC,EAAA,QCmBM,SAAUC,GAA6CC,EAAgB,CAC3E,OAAOA,GAAWA,EAAQC,OACtB,IAAIC,EAAQ,CACVC,kBAAmBH,EAAQC,OAAOG,IAC/BC,GACC,IAAIC,EAAiB,CACnBC,MAAOF,EAAMA,MAAQ,EAAIA,EAAMA,MAAQ,EACvCG,OAAQC,GAAqDJ,EAAMK,SAAS,EAC5EC,kBAAmBN,EAAMO,iBAAmB,GAC7C,CAAC,EAEP,EACD,IAAIV,CACV,CAEM,SAAUW,GAA6CC,EAA8B,CACzF,OAAOA,EACH,IAAIZ,EAAQ,CACVC,kBAAmB,CACjB,IAAIG,EAAiB,CACnBC,MAAOO,EAAeC,cAAcC,OAAS,EAAIF,EAAeC,aAAa,CAAC,EAAEV,MAAQ,EACxFG,OAAQS,GAAiDH,EAAeJ,SAAS,EACjFC,kBAAmB,GACpB,CAAC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C,eAAe4B,QAAQlL,EAAKoJ,CAAa,EAChD,KAAKzF,oBAAoBiB,KAAI,CAC/B,CAEAwG,gBAAgBrB,EAA0B5K,EAAsB,CAC9D,IAAMa,EAAMX,GAAoBF,CAAc,EACxCiK,EAAgBI,KAAKyB,UAAUlB,CAAM,EAC3CV,OAAOC,eAAe4B,QAAQlL,EAAKoJ,CAAa,EAChD,KAAKxF,mBAAmBgB,KAAI,CAC9B,CAEAyG,yBAAyBC,EAA+BnM,EAAsB,CAC5E,IAAMa,EAAMV,GAA6BH,CAAc,EACjDiL,EAA2BZ,KAAKyB,UAAUK,CAAoB,EACpEjC,OAAOC,eAAe4B,QAAQlL,EAAKoK,CAAwB,EAC3D,KAAKvG,4BAA4Be,KAAI,CACvC,CAEA2G,aAAalH,EAAiBlF,EAAsB,CAClD,KAAKgE,UAAUyB,KAAKP,CAAO,EAC3B,KAAKvB,kBAAkByI,aAAalH,EAASlF,CAAc,CAC7D,iDA9TW4C,GAAYyJ,EAAAC,EAAA,EAAAD,EAAAE,EAAA,EAAAF,EAAAG,EAAA,EAAAH,EAAAI,EAAA,EAAAJ,EAAAK,EAAA,EAAAL,EAAAM,CAAA,EAAAN,EAAAO,CAAA,EAAAP,EAAAQ,CAAA,CAAA,CAAA,CAAA,iCAAZjK,EAAYkK,QAAZlK,EAAYmK,SAAA,CAAA,CAAA,SAAZnK,CAAY,GAAA", "names": ["getTotalPriceForLineItems", "lineItems", "reduce", "total", "lineItem", "liTotal", "currentRevenue", "revenueComponents", "rcTotal", "revenueComponent", "value", "quantity", "init_util", "__esmMin", "convertMarketplacePricingToSalesOrderRevenue", "pricing", "prices", "Revenue", "revenueComponents", "map", "price", "RevenueComponent", "value", "period", "convertMarketplaceFrequencyToSalesOrderRevenuePeriod", "frequency", "isStartingRevenue", "isStartingPrice", "convertBillingRetailPriceToSalesOrderRevenue", "productPricing", "pricingRules", "length", "convertBillingFrequencyToSalesOrderRevenuePeriod", "convertMarketplaceCurrencyToCurrencyCode", "currency", "MarketplaceCurrency", "convertBillingCurrencyToCurrencyCode", "BillingCurrency", "freq", "Frequency", "ONCE", "RevenuePeriod", "ONETIME", "DAILY", "WEEKLY", "MONTHLY", "YEARLY", "BillingFrequency", "OneTime", "Monthly", "Yearly", "packagesToLineItems", "pckgdItems", "pkgdItem", "pckg", "package", "lineItem", "LineItem", "packageId", "currencyCode", "currentRevenue", "quantity", "addPricingToLineItems", "lineItems", "priceByApp", "li", "find", "p", "key", "appId", "appKey", "editionId", "revenue", "isTrial", "convertCurrencyCodeToMPCurrency", "USD", "convertOrderRevenuePeriodToMPFrequency", "revenuePeriod", "undefined", "BIWEEKLY", "OTHER", "getPackagePricingFromLineItem", "c", "Price", "Pricing", "init_conversion_utils", "__esmMin", "init_vendasta_sales_orders", "init_vendasta_marketplace_packages", "init_src", "buildCustomFieldsKey", "accountGroupId", "buildCommonFieldsKey", "buildExtraFieldsKey", "buildRequiresPartnerInputKey", "getAppKeysBySkus", "specifiedApps", "apps", "appKeysBySku", "forEach", "specifiedApp", "app", "find", "a", "key", "appId", "appKey", "editionId", "editionInformation", "editions", "length", "edition", "e", "billingId", "AppKey", "externalIdentifiers", "sortRevenuesByFrequency", "revenueA", "revenueB", "revenueFrequencyComparisonMap", "Map", "RevenuePeriod", "MONTHLY", "YEARLY", "ONETIME", "get", "period", "undefined", "compareVal", "calculateReadOnlyOrderform", "o", "readOnly", "status", "Status", "SUBMITTED_FOR_CUSTOMER_APPROVAL", "OrderService", "init_order_service", "__esmMin", "init_src", "init_vendasta_marketplace_packages", "init_vendasta_sales_orders", "init_esm", "init_operators", "init_util", "init_conversion_utils", "fileUploadUrl", "constructor", "accountGroupService", "packageService", "salesOrdersService", "orderStoreService", "customerSalesOrdersService", "appSdk", "translateService", "billingService", "orderId$$", "BehaviorSubject", "specifiedLineItems$$", "orderPermissionDenied$$", "orderPermissionDenied$", "asObservable", "commonFormSectionsSaved$$", "Subject", "customFieldsSaved$$", "extraFieldsSaved$$", "requiresPartnerInputSaved$$", "agid$", "currentAccountGroupId$", "pipe", "filter", "agid", "distinctUntilChanged", "orderId$", "orderId", "specifiedLineItems$", "orderItems", "order$", "combineLatest", "switchMap", "tap", "next", "catchError", "of", "startWith", "publishReplay", "refCount", "readOnly$", "map", "order", "users$", "getUsers", "businessId", "orderConfig$", "currentAccountGroup$", "getConfig", "partnerId", "marketId", "packages$", "lineItems", "li", "packageId", "orderItem", "id", "packageIds", "getMulti", "withLatestFrom", "packages", "orderPackage", "x", "pricing", "getPackagePricingFromLineItem", "cannotBIYPackageWarning$", "packagesNotUsingBillingPricing", "pkg", "pricingDisplayOption", "PricingDisplayOption", "PRICING_DISPLAY_OPTION_CONTACT_SALES", "PRICING_DISPLAY_OPTION_STARTING_AT", "createCannotBIYPackageWarning", "allAppsInTheOrder$", "specifiedLineItems", "p", "concat", "keys", "accountGroup", "filteredKeys", "k", "billingRetailPrices$", "l", "getMultiRetailPricing", "Object", "pricings", "sku", "productPricing", "shareReplay", "bufferSize", "lineItems$", "prices", "orderConfItems", "packagesToLineItems", "package", "lineItem", "appItems", "addPricingToLineItems", "concatOrderConfItems", "currentRevenue", "revenueComponents", "sort", "orderTotal$", "getTotalPriceForLineItems", "savedCommonFormFields$", "switchMapTo", "orderFormJson", "window", "sessionStorage", "getItem", "JSON", "parse", "savedCustomFields$", "jsonFields", "customField", "returnField", "CustomField", "fields", "field", "Field", "savedExtraFields$", "savedRequiresPartnerInput$", "requiresPartnerInputJson", "decodeCustomFieldId", "fieldId", "replace", "RegExp", "namesOfPackages", "name", "instant", "package_names", "join", "initialize", "saveCommonFields", "commonFields", "stringify", "setItem", "saveCustomFields", "saveExtraFields", "saveRequiresPartnerInput", "requiresPartnerInput", "refreshOrder", "\u0275\u0275inject", "AccountGroupService", "PackageService", "SalesOrdersService", "SalesOrderStoreService", "CustomerSalesOrdersService", "AppPartnerService", "TranslateService", "BillingService", "factory", "\u0275fac"] }