{ "version": 3, "sources": ["src/app/services/subscription.service.ts", "src/app/services/shared.service.ts"], "sourcesContent": ["import { Injectable } from '@angular/core';\r\nimport { Observable, map, of } from 'rxjs';\r\nimport { environment } from '../../environments/environment';\r\nimport { HttpClient, HttpParams } from '@angular/common/http';\r\nimport { SubscriptionModel } from '../models/subscription.model';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class SubscriptionService {\r\n baseUrl = environment.apiUrl;\r\n menuList!: any[];\r\n constructor(private http: HttpClient) {}\r\n\r\n SubscriptionInformation(countryCode: string): Observable {\r\n let parameter = new HttpParams();\r\n\r\n if (countryCode) {\r\n parameter = parameter.set('CountryCode', countryCode.toString());\r\n }\r\n\r\n if (countryCode == 'BD') {\r\n return this.http\r\n .get(`${this.baseUrl}/api/User/Subscription`, {\r\n params: parameter,\r\n })\r\n .pipe(\r\n map((products) => ({\r\n content: products.content.map((product: SubscriptionModel) => ({\r\n yearlyDiscountPer: product.yearlyDiscountPer,\r\n subscriptionDetailId: product.subscriptionDetailId,\r\n subscriptionPckgMasterId: product.subscriptionPckgMasterId,\r\n moduleId: product.moduleId,\r\n moduleName: product.moduleName,\r\n isDefault: product.isDefault,\r\n monthlyPrice: product.monthlyBDPrice,\r\n yearlyPrice: product.yearlyBDPrice,\r\n countryCode: countryCode,\r\n })),\r\n isSuccess: products.isSuccess,\r\n message: products.message,\r\n code: products.code,\r\n }))\r\n );\r\n } else {\r\n return this.http\r\n .get(`${this.baseUrl}/api/User/Subscription`, {\r\n params: parameter,\r\n })\r\n .pipe(\r\n map((products) => ({\r\n content: products.content.map((product: SubscriptionModel) => ({\r\n yearlyDiscountPer: product.yearlyDiscountPer,\r\n subscriptionDetailId: product.subscriptionDetailId,\r\n subscriptionPckgMasterId: product.subscriptionPckgMasterId,\r\n moduleId: product.moduleId,\r\n moduleName: product.moduleName,\r\n isDefault: product.isDefault,\r\n monthlyPrice: product.monthlyUSDPrice,\r\n yearlyPrice: product.yearlyUSDPrice,\r\n countryCode: countryCode,\r\n })),\r\n isSuccess: products.isSuccess,\r\n message: products.message,\r\n code: products.code,\r\n }))\r\n );\r\n }\r\n }\r\n\r\n EntityWiseSubscription(data: any): Observable {\r\n console.log('data form service', data);\r\n\r\n return this.http.post(\r\n `${this.baseUrl}/api/User/EntityWiseSubscription`,\r\n data\r\n );\r\n }\r\n\r\n EntityWiseSubscriptionInvoice(data: any): Observable {\r\n console.log('data form service', data);\r\n\r\n return this.http.post(\r\n `${this.baseUrl}/api/User/EntityWiseSubscriptionInvoiceDownload`,\r\n data,\r\n { responseType: 'blob' as 'json' }\r\n );\r\n }\r\n\r\n SubscriptionCoupon(data: any): Observable {\r\n console.log('data', data);\r\n\r\n let parameter = new HttpParams();\r\n\r\n if (data.couponCode) {\r\n parameter = parameter.set('CouponCode', data.couponCode.toString());\r\n }\r\n\r\n if (data.paymentType) {\r\n parameter = parameter.set('PaymentType', data.paymentType.toString());\r\n }\r\n\r\n return this.http.get(`${this.baseUrl}/api/User/SubscriptionCoupon`, {\r\n params: parameter,\r\n });\r\n }\r\n\r\n PaymentTypeInfo(): Observable {\r\n return this.http.get(\r\n `${this.baseUrl}/api/User/PaymentTypeInfo`\r\n );\r\n }\r\n\r\n EntitywiseSubscriptionMaster(masterId:number):Observable{\r\n let parameter = new HttpParams();\r\n\r\n\r\n if (masterId) {\r\n parameter = parameter.set('MasterId', masterId.toString());\r\n }\r\n return this.http.get(\r\n `${this.baseUrl}/api/User/EntitywiseSubscriptionMaster`,{params:parameter}\r\n );\r\n }\r\n}\r\n", "import { Injectable } from '@angular/core';\r\nimport { BehaviorSubject } from 'rxjs';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class SharedService {\r\n private subscriptionData = new BehaviorSubject<{ success: boolean; data: any } | null>(null);\r\n\r\n // Observable for subscription data\r\n subscriptionData$ = this.subscriptionData.asObservable();\r\n\r\n /**\r\n * Updates the subscription data\r\n * @param data The data to be shared\r\n */\r\n updateSubscriptionData(data: { success: boolean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AKD,CAAI,CACjC,yCAZWP,EAAa,wBAAbA,EAAaS,QAAbT,EAAaU,UAAAC,WAFZ,MAAM,CAAA,EAEd,IAAOX,EAAPY,SAAOZ,CAAa,GAAA", "names": ["SubscriptionService", "constructor", "http", "baseUrl", "environment", "apiUrl", "SubscriptionInformation", "countryCode", "parameter", "HttpParams", "set", "toString", "get", "params", "pipe", "map", "products", "content", "product", "yearlyDiscountPer", "subscriptionDetailId", "subscriptionPckgMasterId", "moduleId", "moduleName", "isDefault", "monthlyPrice", "monthlyBDPrice", "yearlyPrice", "yearlyBDPrice", "isSuccess", "message", "code", "monthlyUSDPrice", "yearlyUSDPrice", "EntityWiseSubscription", "data", "console", "log", "post", "EntityWiseSubscriptionInvoice", "responseType", "SubscriptionCoupon", "couponCode", "paymentType", "PaymentTypeInfo", "EntitywiseSubscriptionMaster", "masterId", "\u0275\u0275inject", "HttpClient", "factory", "\u0275fac", "providedIn", "_SubscriptionService", "SharedService", "constructor", "subscriptionData", "BehaviorSubject", "subscriptionData$", "asObservable", "updateSubscriptionData", "data", "next", "factory", "\u0275fac", "providedIn", "_SharedService"] }