{"version":3,"sources":["./node_modules/uuid/lib/bytesToUuid.js","./node_modules/uuid/lib/rng-browser.js","./node_modules/uuid/v4.js","./src/app/shared/libraries/carts-orders-calculator.ts","./src/app/shared/models/cart-item.model.ts","./src/app/shared/models/invoice/google-payment.model.ts","./src/app/shared/models/invoice/orders.model.ts","./src/app/shared/services/googlepayment.service.ts","./src/app/shared/services/tax.service.ts"],"names":[],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;ACzBA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,iCAAiC;;AAEjC;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAsB,QAAQ;AAC9B;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;ACjCA,UAAU,mBAAO,CAAC,qBAAW;AAC7B,kBAAkB,mBAAO,CAAC,6BAAmB;;AAE7C;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,SAAS;AAC7B;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;;;;;;;;ACtBwC;AACa;;AAU9C;UAAM,qBAAsB,SAAQ,8DAAiB;QAE1D;YACE,KAAK,EAAE,CAAC;YACR,IAAI,CAAC,IAAI,GAAG,IAAI,8DAAiB,EAAE,CAAC;QACtC,CAAC;QAEM,gBAAgB,CAAC,SAAqB;YAC3C,IAAI,WAAW,GAAG,IAAI,gEAAM,EAAE,CAAC;YAC/B,IAAI,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;YAC9D,IAAI,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;YAClD,IAAI,aAAa,GAAG,aAAa,G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AAU,CAAC,IAAI,CACzB,GAAG,6EAAmB,gCAAgC,EACtD,OAAO,CACR,CAAC;QACJ,CAAC;QAED,gBAAgB,CAAC,OAAY;YAC3B,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CACzB,GAAG,6EAAmB,mCAAmC,EACzD,OAAO,CACR,CAAC;QACJ,CAAC;QAED,eAAe;YACb,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CACxB,GAAG,qFAA2B,eAAe,CAC9C,CAAC;QACJ,CAAC;QAED,aAAa,CAAC,OAAY;YACxB,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CACzB,GAAG,6EAAmB,kCAAkC,EACxD,OAAO,CACR,CAAC;QACJ,CAAC;QAED,YAAY,CAAI,UAAkB;YAChC,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CACxB,GAAG,IAAI,CAAC,SAAS,gCAAgC,UAAU,EAAE,CAC9D,CAAC;QACJ,CAAC;QAED,oBAAoB;YAClB,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CACxB,GAAG,IAAI,CAAC,SAAS,4BAA4B,CAC9C,CAAC;QACJ,CAAC;;wEA7FU,UAAU;+GAAV,UAAU,WAAV,UAAU,mBAFT,MAAM","file":"default-node_modules_uuid_v4_js-src_app_shared_libraries_carts-orders-calculator_ts-src_app_s-a1ad65.89970c84151871553618.js","sourcesContent":["/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","import { Injectable } from '@angular/core';\r\nimport {\r\n Orders,\r\n OrderAdjustments,\r\n OrderItems,\r\n ItemAdjustments,\r\n} from '../models/invoice/orders.model';\r\nimport { AuthorizationBase } from './authorize-base';\r\nimport {\r\n CartItem,\r\n OptionCalc,\r\n OptionsCalcTotals,\r\n} from '../models/cart-item.model';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class CartsOrdersCalculator extends AuthorizationBase {\r\n auth: AuthorizationBase;\r\n constructor() {\r\n super();\r\n this.auth = new AuthorizationBase();\r\n }\r\n\r\n public CartDataToOrders(cartItems: CartItem[]): Orders {\r\n let ordersModel = new Orders();\r\n let itemsOptionSubTotal = this.ItemsOptionSubTotal(cartItems);\r\n let itemsSubTotal = this.ItemsSubTotal(cartItems);\r\n let orderSubTotal = itemsSubTotal + itemsOptionSubTotal;\r\n let orderAdjustmentsSubTotal = this.GeneralAdjustMentSubTotal(\r\n cartItems,\r\n orderSubTotal\r\n );\r\n\r\n let loginuser = null;\r\n ordersModel.orderSubTotal = orderSubTotal;\r\n ordersModel.orderTotal = orderSubTotal - orderAdjustmentsSubTotal;\r\n ordersModel.terminalId = loginuser ? loginuser.TermId : 1;\r\n ordersModel.isEditable = true;\r\n ordersModel.orderItems = this.ProcessCartItems(cartItems);\r\n ordersModel.orderAdjustments = this.ProcessOrderAdjustments(\r\n cartItems,\r\n orderSubTotal\r\n );\r\n return ordersModel;\r\n }\r\n\r\n private ProcessCartItems(items: CartItem[]): OrderItems[] {\r\n let orderItems = items\r\n .filter((x) => x.Item.ProductName != 'GeneralAdjustment')\r\n .map((cartItem: CartItem) => {\r\n return {\r\n orderId: '',\r\n lineId: cartItem.Item.Id,\r\n itemName: cartItem.Item.ItemName,\r\n unitPrice: cartItem.Item.RecentPrice,\r\n quantity: cartItem.Qty,\r\n itemId: cartItem.Item.ItemId,\r\n itemVariationId: cartItem.ItemVariationId,\r\n itemVariationName: cartItem.Item.ItemVariantName,\r\n barcode: cartItem.Item.Barcode,\r\n lineTotal: cartItem.Price + cartItem.Item.ItemOptionsSubTotal,\r\n itemAdjustments: this.ProcessCartItemsAdjustments(cartItem),\r\n };\r\n });\r\n return orderItems;\r\n }\r\n\r\n public ProcessOrderAdjustments(items, tempSubtotal): OrderAdjustments[] {\r\n let orderAdjustments = items\r\n .filter((x) => x.Item.ProductName == 'GeneralAdjustment')\r\n .map((cartItem: CartItem) => {\r\n return {\r\n orderId: '',\r\n id: cartItem.Item.Id,\r\n adjustmentType: 'discount',\r\n adjustmentName: cartItem.Item.ItemName,\r\n amount: this.ProcessInlineDiscount(cartItem, tempSubtotal),\r\n };\r\n });\r\n return orderAdjustments;\r\n }\r\n\r\n private ProcessInlineDiscount(item: CartItem, subtotal: number) {\r\n let amount = 0;\r\n if (item.Item.DiscountPercent != null) {\r\n amount = (item.Item.DiscountPercent / 100) * subtotal;\r\n } else if (item.Item.DiscountAmount != null) {\r\n amount = item.Item.DiscountAmount;\r\n }\r\n return amount;\r\n }\r\n\r\n private ProcessCartItemsAdjustments(cartItem: CartItem): ItemAdjustments[] {\r\n if (!cartItem.Item.ItemOptionsCalc) {\r\n return [];\r\n }\r\n\r\n if (cartItem.Item.ProductName == 'GeneralAdjustment') {\r\n return [];\r\n }\r\n\r\n let itemAdjustments = cartItem.Item.ItemOptionsCalc.map((opt) => {\r\n return {\r\n orderId: '',\r\n lineId: cartItem.Item.Id,\r\n adjustmentType: opt.type,\r\n adjustmentName: opt.name,\r\n amount: this.adjustmentActualValue(opt, cartItem.Item.RecentPrice),\r\n };\r\n });\r\n return itemAdjustments;\r\n }\r\n\r\n private adjustmentActualValue(option: OptionCalc, itemPrice: number): number {\r\n let actualValue = option.isPercent\r\n ? itemPrice * (Number(option.value.replace('%', '')) / 100)\r\n : Number(option.value);\r\n return actualValue;\r\n }\r\n\r\n public ProcessOptionCalculation(\r\n cartItemOptions: OptionCalc[],\r\n price: number\r\n ) {\r\n let subTotal = 0;\r\n let optionsTotals: OptionsCalcTotals[] = [];\r\n\r\n if (cartItemOptions) {\r\n cartItemOptions.forEach((option) => {\r\n let actualValue = this.adjustmentActualValue(option, price);\r\n if (option.operation === 'minus') {\r\n subTotal -= actualValue;\r\n optionsTotals.push({\r\n type: option.type,\r\n totalValue: actualValue * -1,\r\n });\r\n } else {\r\n subTotal += actualValue;\r\n optionsTotals.push({ type: option.type, totalValue: actualValue });\r\n }\r\n });\r\n }\r\n\r\n return { subTotal: subTotal, optionsSummarized: optionsTotals };\r\n }\r\n\r\n public ProcessOptionsAggregation(cartItems: CartItem[]): any[] {\r\n let cartItemsOptionCalTotals = cartItems.map((c) => {\r\n return c.Item.ItemOptionsSummarized ? c.Item.ItemOptionsSummarized : [];\r\n });\r\n let listOfOptionsValues = [].concat(...cartItemsOptionCalTotals); // convert 2d array to 1d\r\n\r\n if (cartItemsOptionCalTotals.length === 0) {\r\n return [];\r\n }\r\n\r\n const result = Object.values(\r\n listOfOptionsValues.reduce(\r\n (r, o) => (\r\n r[o.type]\r\n ? (r[o.type].totalValue += o.totalValue)\r\n : (r[o.type] = { ...o }),\r\n r\r\n ),\r\n {}\r\n )\r\n );\r\n return result;\r\n }\r\n\r\n public ItemsSubTotal(cartItems: CartItem[]) {\r\n return cartItems\r\n .filter((x) => x.Item.ProductName != 'GeneralAdjustment')\r\n .map((c) => c.Price)\r\n .reduce((a, b) => a + b, 0);\r\n }\r\n\r\n public ItemsOptionSubTotal(cartItems: CartItem[]) {\r\n return cartItems\r\n .filter((x) => x.Item.ProductName != 'GeneralAdjustment')\r\n .map((c) => c.Item.ItemOptionsSubTotal)\r\n .reduce((a, b) => a + b, 0);\r\n }\r\n\r\n public GeneralAdjustMentSubTotal(\r\n cartItems: CartItem[],\r\n cartSubTotal: number\r\n ) {\r\n return cartItems\r\n .filter((x) => x.Item.ProductName == 'GeneralAdjustment')\r\n .map((c) => this.ProcessInlineDiscount(c, cartSubTotal))\r\n .reduce((a, b) => a + b, 0);\r\n }\r\n}\r\n","\r\nexport class CartSummary {\r\n public CartItems: CartItem[];\r\n public CartOptions: any[]; //tax, upcharge and etc\r\n public CartItemsSubTotal: number = 0; //don't include in saving to db\r\n public GrandTotal: number = 0; //don't include in saving to db\r\n\r\n //options // don't include in saving to db\r\n public TotalTaxes: number = 0;\r\n public TotalxMofiers: number = 0;\r\n public TotalDiscounts: number = 0;\r\n public AggregatedOptions: OptionsCalcTotals[];\r\n public GeneralAdjustMents: any[];\r\n}\r\n\r\nexport class ItemOptions {\r\n public ItemTaxes: any[];\r\n public ItemDiscounts: any[];\r\n public ItemUpcharges: any[];\r\n public ItemModifierSetOptions: any[];\r\n}\r\n//@TODO : Transfer the lineItemId or Id in this level and not on the Item\r\nexport class CartItem {\r\n public Item: Item = new Item();\r\n public ItemVariationId: number = 0;\r\n public Qty: number;\r\n public Notes: string = '';\r\n public Price: number = 0; //SubTotal of Item\r\n}\r\n\r\nexport class ServiceItem {\r\n public ServiceId: number;\r\n public ServiceName: string;\r\n public Price: number;\r\n public CategoryName: string;\r\n public ServiceDescription: string;\r\n}\r\n\r\nexport class Item {\r\n public Id: string;\r\n public ItemId: number = 0;\r\n public VariationId: number = 0;\r\n\r\n public ItemName: string;\r\n public ItemVariantName: string;\r\n public ProductName: string;\r\n public Barcode: string;\r\n public Photo: string;\r\n public Thumbnail: string;\r\n public CurrentQty: number = 0;\r\n public RecentPrice: number = 0;\r\n //calculation / processed based\r\n public ItemOptions: ItemOptions; // display only, don't use on aggregation or calculation\r\n public ItemOptionsCalc: OptionCalc[];\r\n public ItemOptionsSummarized: OptionsCalcTotals[];\r\n public ItemOptionsSubTotal: number = 0;\r\n\r\n //general discounts calculation\r\n public DiscountPercent: number = 0;\r\n public DiscountAmount: number = 0;\r\n}\r\n\r\nexport class OptionCalc {\r\n public name: string;\r\n public type: string;\r\n public operation: string;\r\n public isPercent: boolean;\r\n public value: any;\r\n}\r\n\r\nexport class OptionsCalcTotals {\r\n public type: string;\r\n public totalValue: number;\r\n}\r\n","export class GooglePayment {\r\n amount: number;\r\n email: string;\r\n paymentMethodData: GooglePaymentMethodData;\r\n}\r\n\r\nexport class GooglePaymentMethodData {\r\n description: string;\r\n tokenizationData: {\r\n type: string;\r\n token: string;\r\n };\r\n type: string;\r\n info: GooglePaymentInfo;\r\n}\r\n\r\nexport class GooglePaymentInfo {\r\n cardNetwork: string;\r\n cardDetails: string;\r\n locationId: number;\r\n secretApiKey: string;\r\n serviceUrl: string;\r\n developerId: string;\r\n versionNumber: string;\r\n mid: string;\r\n deviceId: string;\r\n transactionKey: string;\r\n cardDataSource: string;\r\n level: string;\r\n invoiceNumber: string;\r\n transactionSource: string;\r\n orderId: string;\r\n terminalId: string;\r\n sourceComponent: string;\r\n transactionId: string;\r\n isPartialPayment: boolean;\r\n customerId: number;\r\n currency: string;\r\n cvn: string;\r\n billingAddress: GooglePayCustomerAddress;\r\n}\r\n\r\nexport class GooglePayCustomerAddress {\r\n streetAddress1: string;\r\n streetAddress2: string;\r\n streetAddress3: string;\r\n city: string;\r\n province: string;\r\n state: string;\r\n postalCode: string;\r\n country: string;\r\n countryCode: string;\r\n name: string;\r\n}\r\n","export class Orders {\r\n public orderId: string = '';\r\n public orderDate: Date;\r\n public orderStatus: string = 'Preparing';\r\n public invoiceNumber: string;\r\n public orderTotal: number = 0;\r\n public orderSubTotal: number = 0;\r\n public terminalId: string;\r\n public isEditable: boolean = false;\r\n public comments: string;\r\n public terms: string;\r\n public source: string;\r\n public customerId: number = 0;\r\n public createdBy : number = 0;\r\n public createdDate : string;\r\n public updatedBy : number = 0;\r\n public updatedDate : string;\r\n\r\n public orderAdjustments : OrderAdjustments[];\r\n public orderItems : OrderItems[];\r\n\r\n //processed property\r\n public allAdjustments: AllAdjustments[];\r\n}\r\n\r\nexport class OrderItems {\r\n public lineId: string;\r\n public itemName: string;\r\n public unitPrice: number = 0;\r\n public quantity: number = 0;\r\n public itemId: number = 0;\r\n public itemVariationId: number = 0;\r\n public itemVariationName :string;\r\n public barcode: string;\r\n public orderId: string;\r\n public lineTotal: number;\r\n public itemAdjustments: ItemAdjustments[];\r\n}\r\n\r\nexport class OrderAdjustments {\r\n public id: number;\r\n public orderId: string;\r\n public adjustmentType: string;\r\n public adjustmentName: string;\r\n public amount: number = 0;\r\n public percentValue: number = 0;\r\n}\r\n\r\nexport class ItemAdjustments {\r\n public orderId: string;\r\n public lineId: string;\r\n public adjustmentType: string;\r\n public adjustmentName: string;\r\n public amount: number = 0;\r\n}\r\n\r\n//for displaying purpose\r\n//sum of all item adjustments and the order adjustments\r\nexport class AllAdjustments {\r\n public orderId: string;\r\n public adjustmentType: string;\r\n public adjustmentName: string;\r\n public amount: number = 0;\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { HttpClient, HttpHeaders } from '@angular/common/http';\r\nimport { Observable } from 'rxjs';\r\nimport { environment } from 'src/environments/environment';\r\nimport { TransactionSource } from '../models/invoice/payment.model';\r\nimport { GooglePayment } from 'src/app/shared/models/invoice/google-payment.model';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class GooglePaymentService {\r\n private baseRoute: string;\r\n\r\n constructor(private httpClient: HttpClient) {\r\n this.baseRoute = environment.paymentAPIRoot;\r\n }\r\n\r\n charge(payload: GooglePayment): Observable {\r\n return this.httpClient.post(\r\n `${this.baseRoute}/api/googlepay/charge?userId=1&locationId=${payload.paymentMethodData.info.locationId}`,\r\n payload\r\n );\r\n }\r\n\r\n chargeOnly(payload: GooglePayment): Observable {\r\n console.log(payload);\r\n payload.paymentMethodData.info.mid =\r\n payload.paymentMethodData.info.mid.substring(3);\r\n return this.httpClient.post(\r\n `${this.baseRoute}/api/googlepay/chargeonly?userId=1&locationId=${payload.paymentMethodData.info.locationId}`,\r\n payload\r\n );\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { HttpClient, HttpHeaders } from '@angular/common/http';\r\nimport { Observable } from 'rxjs';\r\nimport { environment } from 'src/environments/environment';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class TaxService {\r\n private baseRoute: string;\r\n private accountBaseRoute: string;\r\n\r\n constructor(private httpClient: HttpClient) {\r\n this.baseRoute = environment.accountAPIRoot;\r\n this.accountBaseRoute = environment.accountAPIRoot;\r\n }\r\n\r\n getAllTaxCategory(): Observable {\r\n return this.httpClient.get(`${this.baseRoute}/taxcategory/getall`);\r\n }\r\n\r\n getTaxSettings(): Observable {\r\n return this.httpClient.get(`${this.baseRoute}/taxsettings/get`);\r\n }\r\n\r\n updateTaxSettings(payload: any) {\r\n return this.httpClient.post(\r\n `${this.baseRoute}/taxsettings/update`,\r\n payload\r\n );\r\n }\r\n\r\n getAllManualTax() {\r\n return this.httpClient.get(\r\n `${environment.apiRoot}api/account/tax/getall`\r\n );\r\n }\r\n\r\n getAllManualTaxById(id: any) {\r\n return this.httpClient.get(\r\n `${environment.apiRoot}api/account/tax/get/${id}`\r\n );\r\n }\r\n\r\n updateManualTax(payload: any) {\r\n return this.httpClient.post(\r\n `${environment.apiRoot}api/account/tax/update`,\r\n payload\r\n );\r\n }\r\n\r\n addManualTax(payload: any) {\r\n return this.httpClient.post(\r\n `${environment.apiRoot}api/account/tax/add`,\r\n payload\r\n );\r\n }\r\n\r\n getTaxSummary() {\r\n return this.httpClient.get(\r\n `${environment.apiRoot}api/account/taxsummaryrate/getall`\r\n );\r\n }\r\n\r\n addTaxSummary(payload: any) {\r\n return this.httpClient.post(\r\n `${environment.apiRoot}api/account/taxsummaryrate/add`,\r\n payload\r\n );\r\n }\r\n\r\n updateTaxSummary(payload: any) {\r\n return this.httpClient.post(\r\n `${environment.apiRoot}api/account/taxsummaryrate/update`,\r\n payload\r\n );\r\n }\r\n\r\n getAllCountries(): Observable {\r\n return this.httpClient.get(\r\n `${environment.locationAPIRoot}/getCountries`\r\n );\r\n }\r\n\r\n getTaxJarRate(payload: any) {\r\n return this.httpClient.post(\r\n `${environment.apiRoot}api/account/taxjar/tax/order/get`,\r\n payload\r\n );\r\n }\r\n\r\n getManualTax(locationId: number): Observable {\r\n return this.httpClient.get(\r\n `${this.baseRoute}/tax/location/get?locationId=${locationId}`\r\n );\r\n }\r\n\r\n getAllTaxjarCategory(): Observable {\r\n return this.httpClient.get(\r\n `${this.baseRoute}/taxcategory/taxjar/getall`\r\n );\r\n }\r\n}\r\n"],"sourceRoot":"webpack:///"}