@pmcretail/mapper-library 0.0.15 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6332,6 +6332,310 @@ if (false) {
6332
6332
  RJMapperBuilderClass.prototype.rjObject;
6333
6333
  }
6334
6334
 
6335
+ /**
6336
+ * @fileoverview added by tsickle
6337
+ * Generated from: lib/WebReturn-mapper.class.ts
6338
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6339
+ */
6340
+ var WebReturnMapperBuilderClass = /** @class */ (function () {
6341
+ function WebReturnMapperBuilderClass(document) {
6342
+ this.webReturnObject = {
6343
+ id: '',
6344
+ orgCode: "",
6345
+ storeId: "",
6346
+ storeNodeId: "",
6347
+ storeNodeStructure: "",
6348
+ deviceId: "",
6349
+ terminalId: "",
6350
+ initiatingModule: "",
6351
+ export: false,
6352
+ basket: {},
6353
+ basketSummary: {},
6354
+ baseCurrency: "",
6355
+ customer: {
6356
+ firstName: '',
6357
+ lastName: '',
6358
+ email: '',
6359
+ postCode: '',
6360
+ id: '',
6361
+ billingAddress: {},
6362
+ shippingAddress: {},
6363
+ }
6364
+ };
6365
+ if (document) {
6366
+ this.document = document;
6367
+ }
6368
+ }
6369
+ /**
6370
+ * @template THIS
6371
+ * @this {THIS}
6372
+ * @return {THIS}
6373
+ */
6374
+ WebReturnMapperBuilderClass.prototype.WebReturnMapper = /**
6375
+ * @template THIS
6376
+ * @this {THIS}
6377
+ * @return {THIS}
6378
+ */
6379
+ function () {
6380
+ (/** @type {?} */ (this)).webReturnObject['type'] = 'WEB_RETURNS';
6381
+ (/** @type {?} */ (this)).webReturnObject['datetime'] = (/** @type {?} */ (this)).getUTCDateTime((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.updated_at));
6382
+ (/** @type {?} */ (this)).webReturnObject.baseCurrency = (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.base_currency_code);
6383
+ (/** @type {?} */ (this)).webReturnObject.storeId = (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.store_id);
6384
+ (/** @type {?} */ (this)).webReturnObject.subsidiaryId = '1';
6385
+ (/** @type {?} */ (this)).webReturnObject.initiatingModule = 'MAGENTO';
6386
+ (/** @type {?} */ (this)).webReturnObject.createdAt = (/** @type {?} */ (this)).getUTCDateTime((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.created_at));
6387
+ (/** @type {?} */ (this)).webReturnObject.updatedAt = (/** @type {?} */ (this)).getUTCDateTime((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.updated_at));
6388
+ (/** @type {?} */ (this)).webReturnObject.export = true;
6389
+ (/** @type {?} */ (this)).webReturnObject.transCompletedAt = (/** @type {?} */ (this)).getUTCDateTime((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.updated_at));
6390
+ (/** @type {?} */ (this)).webReturnObject['externalTransactionId'] = (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.order_id);
6391
+ // customer
6392
+ (/** @type {?} */ (this)).webReturnObject['customer']['firstName'] = (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.customer_firstname) || '';
6393
+ (/** @type {?} */ (this)).webReturnObject['customer']['lastName'] = (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.customer_lastname) || '';
6394
+ (/** @type {?} */ (this)).webReturnObject['customer']['email'] = (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.customer_email) || '';
6395
+ (/** @type {?} */ (this)).webReturnObject['customer']['postCode'] = '';
6396
+ // Billing address
6397
+ (/** @type {?} */ (this)).webReturnObject['customer']['billingAddress']['address1'] = ((/** @type {?} */ (this)).document.billing_address && (/** @type {?} */ (this)).document.billing_address.street) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.billing_address.street) : '';
6398
+ (/** @type {?} */ (this)).webReturnObject['customer']['billingAddress']['city'] = ((/** @type {?} */ (this)).document.billing_address && (/** @type {?} */ (this)).document.billing_address.city) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.billing_address.city) : '';
6399
+ (/** @type {?} */ (this)).webReturnObject['customer']['billingAddress']['county'] = ((/** @type {?} */ (this)).document.billing_address && (/** @type {?} */ (this)).document.billing_address.region) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.billing_address.region) : '';
6400
+ (/** @type {?} */ (this)).webReturnObject['customer']['billingAddress']['postCode'] = ((/** @type {?} */ (this)).document.billing_address && (/** @type {?} */ (this)).document.billing_address.postcode) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.billing_address.postcode) : '';
6401
+ (/** @type {?} */ (this)).webReturnObject['customer']['billingAddress']['country'] = ((/** @type {?} */ (this)).document.billing_address && (/** @type {?} */ (this)).document.billing_address.country) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.billing_address.country) : '';
6402
+ // Shipping address
6403
+ (/** @type {?} */ (this)).webReturnObject['customer']['shippingAddress']['address1'] = ((/** @type {?} */ (this)).document.shipping_address && (/** @type {?} */ (this)).document.shipping_address.street) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.shipping_address.street) : '';
6404
+ (/** @type {?} */ (this)).webReturnObject['customer']['shippingAddress']['city'] = ((/** @type {?} */ (this)).document.shipping_address && (/** @type {?} */ (this)).document.shipping_address.city) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.shipping_address.city) : '';
6405
+ (/** @type {?} */ (this)).webReturnObject['customer']['shippingAddress']['county'] = ((/** @type {?} */ (this)).document.shipping_address && (/** @type {?} */ (this)).document.shipping_address.region) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.shipping_address.region) : '';
6406
+ (/** @type {?} */ (this)).webReturnObject['customer']['shippingAddress']['postCode'] = ((/** @type {?} */ (this)).document.shipping_address && (/** @type {?} */ (this)).document.shipping_address.postcode) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.shipping_address.postcode) : '';
6407
+ (/** @type {?} */ (this)).webReturnObject['customer']['shippingAddress']['country'] = ((/** @type {?} */ (this)).document.shipping_address && (/** @type {?} */ (this)).document.shipping_address.country) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.shipping_address.country) : '';
6408
+ // basketSummary
6409
+ (/** @type {?} */ (this)).webReturnObject.basketSummary['discountTotal'] = Number((/** @type {?} */ (this)).document.discount_amount ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.discount_amount) : 0);
6410
+ (/** @type {?} */ (this)).webReturnObject.basketSummary['VATTotal'] = Number((/** @type {?} */ (this)).document.base_total_paid ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.base_total_paid) : 0);
6411
+ (/** @type {?} */ (this)).webReturnObject.basketSummary['saleTotal'] = Number((/** @type {?} */ (this)).document.base_total_invoiced ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.base_total_invoiced) : 0);
6412
+ (/** @type {?} */ (this)).webReturnObject.basketSummary['basketTotal'] = Number((/** @type {?} */ (this)).document.base_total_paid ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.base_total_paid) : 0);
6413
+ (/** @type {?} */ (this)).webReturnObject.basketSummary['totalItems'] = Number((/** @type {?} */ (this)).document.total_qty_ordered ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.total_qty_ordered) : 0);
6414
+ (/** @type {?} */ (this)).webReturnObject.basketSummary['refundTotal'] = Number((/** @type {?} */ (this)).document.base_total_refunded ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.base_total_refunded) : 0);
6415
+ // basket line discount
6416
+ (/** @type {?} */ (this)).webReturnObject.basket['lineDiscount'] = [];
6417
+ /** @type {?} */
6418
+ var lineDiscount = {
6419
+ itemLineId: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.item_id) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.item_id) : 0,
6420
+ discountAmount: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.discount_amount) ? Number((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.discount_amount)) : 0
6421
+ };
6422
+ (/** @type {?} */ (this)).webReturnObject.basket['lineDiscount'].push(lineDiscount);
6423
+ // basket transaction discount
6424
+ (/** @type {?} */ (this)).webReturnObject.basket['transactionDiscount'] = [];
6425
+ /** @type {?} */
6426
+ var transactionDiscount = {
6427
+ discountAmount: ((/** @type {?} */ (this)).document && (/** @type {?} */ (this)).document.discount_amount) ? Number((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.discount_amount)) : 0
6428
+ };
6429
+ (/** @type {?} */ (this)).webReturnObject.basket['transactionDiscount'].push(transactionDiscount);
6430
+ // basket products
6431
+ (/** @type {?} */ (this)).webReturnObject.basket['products'] = [];
6432
+ /** @type {?} */
6433
+ var product = {
6434
+ description: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.name) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.name) : '',
6435
+ SKU: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.sku) ? (/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.sku) : '',
6436
+ quantity: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.qty_ordered) ? Number((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.qty_ordered)) : 0,
6437
+ refundedQuantity: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.qty_refunded) ? Number((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.qty_refunded)) : 0,
6438
+ price: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.original_price) ? Number((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.original_price)) : 0,
6439
+ itemLineId: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.item_id) ? Number((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.item_id)) : 0,
6440
+ totalLinePrice: ((/** @type {?} */ (this)).document.items && (/** @type {?} */ (this)).document.items.item && (/** @type {?} */ (this)).document.items.item.row_invoiced) ? Number((/** @type {?} */ (this)).getText((/** @type {?} */ (this)).document.items.item.row_invoiced)) : 0,
6441
+ };
6442
+ (/** @type {?} */ (this)).webReturnObject.basket['products'].push(product);
6443
+ return (/** @type {?} */ (this));
6444
+ };
6445
+ /**
6446
+ * @template THIS
6447
+ * @this {THIS}
6448
+ * @param {?} deviceId
6449
+ * @return {THIS}
6450
+ */
6451
+ WebReturnMapperBuilderClass.prototype.deviceId = /**
6452
+ * @template THIS
6453
+ * @this {THIS}
6454
+ * @param {?} deviceId
6455
+ * @return {THIS}
6456
+ */
6457
+ function (deviceId) {
6458
+ (/** @type {?} */ (this)).webReturnObject.deviceId = deviceId;
6459
+ return (/** @type {?} */ (this));
6460
+ };
6461
+ /**
6462
+ * @template THIS
6463
+ * @this {THIS}
6464
+ * @param {?} terminalId
6465
+ * @return {THIS}
6466
+ */
6467
+ WebReturnMapperBuilderClass.prototype.terminalId = /**
6468
+ * @template THIS
6469
+ * @this {THIS}
6470
+ * @param {?} terminalId
6471
+ * @return {THIS}
6472
+ */
6473
+ function (terminalId) {
6474
+ (/** @type {?} */ (this)).webReturnObject.terminalId = terminalId;
6475
+ return (/** @type {?} */ (this));
6476
+ };
6477
+ /**
6478
+ * @template THIS
6479
+ * @this {THIS}
6480
+ * @param {?} orgCode
6481
+ * @return {THIS}
6482
+ */
6483
+ WebReturnMapperBuilderClass.prototype.orgCode = /**
6484
+ * @template THIS
6485
+ * @this {THIS}
6486
+ * @param {?} orgCode
6487
+ * @return {THIS}
6488
+ */
6489
+ function (orgCode) {
6490
+ (/** @type {?} */ (this)).webReturnObject.orgCode = orgCode;
6491
+ return (/** @type {?} */ (this));
6492
+ };
6493
+ /**
6494
+ * @template THIS
6495
+ * @this {THIS}
6496
+ * @param {?} storeId
6497
+ * @return {THIS}
6498
+ */
6499
+ WebReturnMapperBuilderClass.prototype.storeId = /**
6500
+ * @template THIS
6501
+ * @this {THIS}
6502
+ * @param {?} storeId
6503
+ * @return {THIS}
6504
+ */
6505
+ function (storeId) {
6506
+ (/** @type {?} */ (this)).webReturnObject.storeId = storeId;
6507
+ return (/** @type {?} */ (this));
6508
+ };
6509
+ /**
6510
+ * @template THIS
6511
+ * @this {THIS}
6512
+ * @param {?} storeNodeId
6513
+ * @return {THIS}
6514
+ */
6515
+ WebReturnMapperBuilderClass.prototype.storeNodeId = /**
6516
+ * @template THIS
6517
+ * @this {THIS}
6518
+ * @param {?} storeNodeId
6519
+ * @return {THIS}
6520
+ */
6521
+ function (storeNodeId) {
6522
+ (/** @type {?} */ (this)).webReturnObject.storeNodeId = storeNodeId;
6523
+ return (/** @type {?} */ (this));
6524
+ };
6525
+ /**
6526
+ * @template THIS
6527
+ * @this {THIS}
6528
+ * @param {?} storeNodeStructure
6529
+ * @return {THIS}
6530
+ */
6531
+ WebReturnMapperBuilderClass.prototype.storeNodeStructure = /**
6532
+ * @template THIS
6533
+ * @this {THIS}
6534
+ * @param {?} storeNodeStructure
6535
+ * @return {THIS}
6536
+ */
6537
+ function (storeNodeStructure) {
6538
+ (/** @type {?} */ (this)).webReturnObject.storeNodeStructure = storeNodeStructure;
6539
+ return (/** @type {?} */ (this));
6540
+ };
6541
+ /**
6542
+ * @template THIS
6543
+ * @this {THIS}
6544
+ * @param {?} docId
6545
+ * @return {THIS}
6546
+ */
6547
+ WebReturnMapperBuilderClass.prototype.docId = /**
6548
+ * @template THIS
6549
+ * @this {THIS}
6550
+ * @param {?} docId
6551
+ * @return {THIS}
6552
+ */
6553
+ function (docId) {
6554
+ (/** @type {?} */ (this)).webReturnObject.id = docId;
6555
+ return (/** @type {?} */ (this));
6556
+ };
6557
+ /**
6558
+ * @template THIS
6559
+ * @this {THIS}
6560
+ * @param {?} userID
6561
+ * @return {THIS}
6562
+ */
6563
+ WebReturnMapperBuilderClass.prototype.updateUserID = /**
6564
+ * @template THIS
6565
+ * @this {THIS}
6566
+ * @param {?} userID
6567
+ * @return {THIS}
6568
+ */
6569
+ function (userID) {
6570
+ (/** @type {?} */ (this)).webReturnObject.userId = userID;
6571
+ return (/** @type {?} */ (this));
6572
+ };
6573
+ /**
6574
+ * @template THIS
6575
+ * @this {THIS}
6576
+ * @param {?} name
6577
+ * @return {THIS}
6578
+ */
6579
+ WebReturnMapperBuilderClass.prototype.updateUserName = /**
6580
+ * @template THIS
6581
+ * @this {THIS}
6582
+ * @param {?} name
6583
+ * @return {THIS}
6584
+ */
6585
+ function (name) {
6586
+ (/** @type {?} */ (this)).webReturnObject.userName = name;
6587
+ return (/** @type {?} */ (this));
6588
+ };
6589
+ /**
6590
+ * @return {?}
6591
+ */
6592
+ WebReturnMapperBuilderClass.prototype.build = /**
6593
+ * @return {?}
6594
+ */
6595
+ function () {
6596
+ return this.webReturnObject;
6597
+ };
6598
+ /**
6599
+ * @param {?} obj
6600
+ * @return {?}
6601
+ */
6602
+ WebReturnMapperBuilderClass.prototype.getText = /**
6603
+ * @param {?} obj
6604
+ * @return {?}
6605
+ */
6606
+ function (obj) {
6607
+ if (obj) {
6608
+ return obj.text;
6609
+ }
6610
+ };
6611
+ /**
6612
+ * @param {?} date
6613
+ * @return {?}
6614
+ */
6615
+ WebReturnMapperBuilderClass.prototype.getUTCDateTime = /**
6616
+ * @param {?} date
6617
+ * @return {?}
6618
+ */
6619
+ function (date) {
6620
+ if (date) {
6621
+ return new Date(date).toISOString();
6622
+ }
6623
+ };
6624
+ return WebReturnMapperBuilderClass;
6625
+ }());
6626
+ if (false) {
6627
+ /**
6628
+ * @type {?}
6629
+ * @private
6630
+ */
6631
+ WebReturnMapperBuilderClass.prototype.document;
6632
+ /**
6633
+ * @type {?}
6634
+ * @private
6635
+ */
6636
+ WebReturnMapperBuilderClass.prototype.webReturnObject;
6637
+ }
6638
+
6335
6639
  /**
6336
6640
  * @fileoverview added by tsickle
6337
6641
  * Generated from: public-api.ts
@@ -6344,5 +6648,5 @@ if (false) {
6344
6648
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6345
6649
  */
6346
6650
 
6347
- export { MapperLibraryComponent, MapperLibraryModule, RJMapperBuilderClass };
6651
+ export { MapperLibraryComponent, MapperLibraryModule, RJMapperBuilderClass, WebReturnMapperBuilderClass };
6348
6652
  //# sourceMappingURL=pmcretail-mapper-library.js.map