gunsmith-common 2.2.6 → 2.2.7

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.
@@ -466,6 +466,9 @@ class WorkOrderDiscount {
466
466
  constructor() { }
467
467
  }
468
468
 
469
+ class WorkOrderNonInventoryItem {
470
+ }
471
+
469
472
  function adjustHoliday(finishDate, holidays) {
470
473
  while (holidays.map(h => new Date(h.holiday)).findIndex(h => DateTime.fromJSDate(h) === DateTime.fromJSDate(finishDate)) !== -1) {
471
474
  do {
@@ -1684,26 +1687,51 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
1684
1687
  args: ['env']
1685
1688
  }] }]; } });
1686
1689
 
1687
- class WorkOrderShippingItemService {
1688
- constructor(http, env) {
1690
+ class BaseService {
1691
+ constructor(http) {
1689
1692
  this.http = http;
1690
- this.env = env;
1691
- this.url = `${this.env.baseUrl}api/work-orders`;
1692
1693
  }
1693
- getShippingItems(workOrderId) {
1694
- return this.http.get(`${this.url}/${workOrderId}/shipping-items`);
1694
+ getUrl(...params) {
1695
+ let baseUrl = this.urlSegments[0];
1696
+ for (let i = 0; i < params.length; i++) {
1697
+ baseUrl += `/${params[i]}`;
1698
+ if (this.urlSegments.length > i + 1) {
1699
+ baseUrl += `/${this.urlSegments[i + 1]}`;
1700
+ }
1701
+ }
1702
+ return baseUrl;
1703
+ }
1704
+ getAll(...params) {
1705
+ return this.http.get(this.getUrl(...params));
1695
1706
  }
1696
- getShippingItem(workOrderId, shippingItemId) {
1697
- return this.http.get(`${this.url}/${workOrderId}/shipping-items/${shippingItemId}`);
1707
+ get(...params) {
1708
+ return this.http.get(this.getUrl(...params));
1698
1709
  }
1699
- createShippingItem(workOrderId, shippingItem) {
1700
- return this.http.post(`${this.url}/${workOrderId}/shipping-items`, shippingItem);
1710
+ create(item, ...params) {
1711
+ return this.http.post(this.getUrl(...params), item);
1701
1712
  }
1702
- updateShippingItem(workOrderId, shippingItemId, shippingItem) {
1703
- return this.http.put(`${this.url}/${workOrderId}/shipping-items/${shippingItemId}`, shippingItem);
1713
+ update(item, ...params) {
1714
+ return this.http.put(this.getUrl(...params), item);
1704
1715
  }
1705
- deleteShippingItem(workOrderId, shippingItemId) {
1706
- return this.http.delete(`${this.url}/${workOrderId}/shipping-items/${shippingItemId}`);
1716
+ delete(...params) {
1717
+ return this.http.delete(this.getUrl(...params));
1718
+ }
1719
+ }
1720
+ BaseService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: BaseService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1721
+ BaseService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: BaseService, providedIn: 'root' });
1722
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: BaseService, decorators: [{
1723
+ type: Injectable,
1724
+ args: [{
1725
+ providedIn: 'root'
1726
+ }]
1727
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
1728
+
1729
+ class WorkOrderShippingItemService extends BaseService {
1730
+ constructor(http, env) {
1731
+ super(http);
1732
+ this.http = http;
1733
+ this.env = env;
1734
+ this.urlSegments = [`${this.env.baseUrl}api/work-orders`, 'shipping-items'];
1707
1735
  }
1708
1736
  }
1709
1737
  WorkOrderShippingItemService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WorkOrderShippingItemService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
@@ -1718,26 +1746,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
1718
1746
  args: ['env']
1719
1747
  }] }]; } });
1720
1748
 
1721
- class WorkOrderDiscountService {
1749
+ class WorkOrderDiscountService extends BaseService {
1722
1750
  constructor(http, env) {
1751
+ super(http);
1723
1752
  this.http = http;
1724
1753
  this.env = env;
1725
- this.url = `${this.env.baseUrl}api/work-orders`;
1726
- }
1727
- getDiscounts(workOrderId) {
1728
- return this.http.get(`${this.url}/${workOrderId}/discounts`);
1729
- }
1730
- getDiscount(workOrderId, discountId) {
1731
- return this.http.get(`${this.url}/${workOrderId}/discounts/${discountId}`);
1732
- }
1733
- createDiscount(workOrderId, discount) {
1734
- return this.http.post(`${this.url}/${workOrderId}/discounts`, discount);
1735
- }
1736
- updateDiscount(workOrderId, discountId, discount) {
1737
- return this.http.put(`${this.url}/${workOrderId}/discounts/${discountId}`, discount);
1738
- }
1739
- deleteDiscount(workOrderId, discountId) {
1740
- return this.http.delete(`${this.url}/${workOrderId}/discounts/${discountId}`);
1754
+ this.urlSegments = [`${this.env.baseUrl}api/work-orders`, 'discounts'];
1741
1755
  }
1742
1756
  }
1743
1757
  WorkOrderDiscountService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WorkOrderDiscountService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
@@ -1777,6 +1791,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
1777
1791
  args: ['env']
1778
1792
  }] }]; } });
1779
1793
 
1794
+ class WorkOrderNonInventoryItemService extends BaseService {
1795
+ constructor(http, env) {
1796
+ super(http);
1797
+ this.http = http;
1798
+ this.env = env;
1799
+ this.urlSegments = [`${this.env.baseUrl}api/work-orders`, 'non-inventory-items'];
1800
+ }
1801
+ }
1802
+ WorkOrderNonInventoryItemService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WorkOrderNonInventoryItemService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1803
+ WorkOrderNonInventoryItemService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WorkOrderNonInventoryItemService, providedIn: 'root' });
1804
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WorkOrderNonInventoryItemService, decorators: [{
1805
+ type: Injectable,
1806
+ args: [{
1807
+ providedIn: 'root'
1808
+ }]
1809
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1810
+ type: Inject,
1811
+ args: ['env']
1812
+ }] }]; } });
1813
+
1780
1814
  class PhonePipe {
1781
1815
  transform(value, args) {
1782
1816
  if (value && value.length >= 10) {
@@ -2211,10 +2245,10 @@ class NotificationBarComponent {
2211
2245
  }
2212
2246
  }
2213
2247
  NotificationBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NotificationBarComponent, deps: [{ token: NotificationService }], target: i0.ɵɵFactoryTarget.Component });
2214
- NotificationBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: NotificationBarComponent, selector: "app-notification-bar", ngImport: i0, template: "<div class=\"notification-bar\" *ngIf=\"messages.length\">\n <div *ngFor=\"let message of viewMessages\" class=\"notification-pill\" [class.error]=\"message.type == 1\" [@fadeOutAnimation]=\"shouldFade()\">\n <i class=\"fa\" [ngClass]=\"getIconClass(message)\"></i> <span class=\"ms-1\">{{message.message}}</span>\n </div>\n <div *ngIf=\"messages.length > 3\" class=\"notification-pill\">{{messages.length - 2}} more...</div>\n</div>\n", styles: [".notification-bar{position:fixed;top:0;left:0;right:0;z-index:10001;pointer-events:none}.notification-bar .notification-pill{max-width:300px;margin:10px auto;border-radius:4px;color:#000;background:rgba(16,16,16,.4);padding:8px;text-align:center}.notification-bar .error{color:#711e16!important;background:rgba(248,216,212,.6)!important}\n"], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], animations: [fadeOutAnimation] });
2248
+ NotificationBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: NotificationBarComponent, selector: "app-notification-bar", ngImport: i0, template: "<div class=\"notification-bar\" *ngIf=\"messages.length\">\n <div *ngFor=\"let message of viewMessages\" class=\"notification-pill\" [class.error]=\"message.type == 1\" [@fadeOutAnimation]=\"shouldFade()\">\n <i class=\"fa\" [ngClass]=\"getIconClass(message)\"></i> <span class=\"ms-1\">{{message.message}}</span>\n </div>\n <div *ngIf=\"messages.length > 3\" class=\"notification-pill\">{{messages.length - 2}} more...</div>\n</div>\n", styles: [".notification-bar{position:fixed;top:0;left:0;right:0;z-index:10001;pointer-events:none}.notification-bar .notification-pill{max-width:300px;margin:10px auto;border-radius:4px;color:#000;background:#181818;padding:8px;text-align:center;color:#fff}.notification-bar .error{color:#711e16!important;background:#f8d8d4!important}\n"], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], animations: [fadeOutAnimation] });
2215
2249
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NotificationBarComponent, decorators: [{
2216
2250
  type: Component,
2217
- args: [{ selector: 'app-notification-bar', animations: [fadeOutAnimation], template: "<div class=\"notification-bar\" *ngIf=\"messages.length\">\n <div *ngFor=\"let message of viewMessages\" class=\"notification-pill\" [class.error]=\"message.type == 1\" [@fadeOutAnimation]=\"shouldFade()\">\n <i class=\"fa\" [ngClass]=\"getIconClass(message)\"></i> <span class=\"ms-1\">{{message.message}}</span>\n </div>\n <div *ngIf=\"messages.length > 3\" class=\"notification-pill\">{{messages.length - 2}} more...</div>\n</div>\n", styles: [".notification-bar{position:fixed;top:0;left:0;right:0;z-index:10001;pointer-events:none}.notification-bar .notification-pill{max-width:300px;margin:10px auto;border-radius:4px;color:#000;background:rgba(16,16,16,.4);padding:8px;text-align:center}.notification-bar .error{color:#711e16!important;background:rgba(248,216,212,.6)!important}\n"] }]
2251
+ args: [{ selector: 'app-notification-bar', animations: [fadeOutAnimation], template: "<div class=\"notification-bar\" *ngIf=\"messages.length\">\n <div *ngFor=\"let message of viewMessages\" class=\"notification-pill\" [class.error]=\"message.type == 1\" [@fadeOutAnimation]=\"shouldFade()\">\n <i class=\"fa\" [ngClass]=\"getIconClass(message)\"></i> <span class=\"ms-1\">{{message.message}}</span>\n </div>\n <div *ngIf=\"messages.length > 3\" class=\"notification-pill\">{{messages.length - 2}} more...</div>\n</div>\n", styles: [".notification-bar{position:fixed;top:0;left:0;right:0;z-index:10001;pointer-events:none}.notification-bar .notification-pill{max-width:300px;margin:10px auto;border-radius:4px;color:#000;background:#181818;padding:8px;text-align:center;color:#fff}.notification-bar .error{color:#711e16!important;background:#f8d8d4!important}\n"] }]
2218
2252
  }], ctorParameters: function () { return [{ type: NotificationService }]; } });
2219
2253
 
2220
2254
  class NotificationModule {
@@ -2253,5 +2287,5 @@ var NotificationType;
2253
2287
  * Generated bundle index. Do not edit.
2254
2288
  */
2255
2289
 
2256
- export { BundleItem, ChangeOrderStatus, Coating, CoatingService, CoatingValue, Configuration, ConfigurationService, Customer, CustomerService, Dealer, DealerContact, DealerCoupon, DealerService, DisableControlDirective, EnumPipe, FileNamePipe, FileUploadService, FilterOptions, Firearm, FirearmSeries, FirearmSeriesOptic, FirearmSeriesService, FirearmService, FrameMaterial, FrameMaterialPipe, GunCaliber, GunPart, GunPartOption, GunPartService, InventoryItem, InventoryService, JFile, Material, MaterialService, MillingDetail, MillingItem, MillingType, MillingTypeService, MountType, NewLinePipe, NotificationBarComponent, NotificationModule, NotificationService, NotificationType, Optic, OpticService, OpticStatus, Package, PackageItem, PackageOptionalItem, PackageSelectorComponent, PackageService, PackageTotal, PackageVariation, PackageVariationOption, PhonePipe, Product, ProductService, ProjectType, PurchaseOrder, PurchaseOrderRefinishItem, PurchaseOrderService, PurchaseOrderStatus, QuickbooksService, RearSightPosition, RefinishCode, RefinishCodeService, RefinishDetail, ReportMillingItem, ReportRefinishItem, SharedModule, ShieldRMSOptions, SightType, State, StateService, StatusHistoryService, Total, TotalItem, TotalsService, UserService, Vendor, VendorContact, VendorService, WaitlistAction, WaitlistCustomerService, WaitlistGun, WaitlistGunPackageDetail, WaitlistHistory, WaitlistItem, WaitlistProjectService, WaitlistService, WaitlistStatus, WorkChangeOrder, WorkHoliday, WorkHolidayService, WorkOrder, WorkOrderAction, WorkOrderDiscount, WorkOrderDiscountService, WorkOrderHistory, WorkOrderInventoryItem, WorkOrderListItem, WorkOrderPackageDetail, WorkOrderRefinishItem, WorkOrderService, WorkOrderShippingItem, WorkOrderShippingItemService, WorkOrderStatus, WorkOrderType, calculateFinishDate, coatingDescriptionValidator, coatingValueValidator, convertEnumToObjectArray, getCoatingValues, getCoatings, hasCoatingDescription, hasCoatingValues, refinishDetailsValidator, touchControls };
2290
+ export { BaseService, BundleItem, ChangeOrderStatus, Coating, CoatingService, CoatingValue, Configuration, ConfigurationService, Customer, CustomerService, Dealer, DealerContact, DealerCoupon, DealerService, DisableControlDirective, EnumPipe, FileNamePipe, FileUploadService, FilterOptions, Firearm, FirearmSeries, FirearmSeriesOptic, FirearmSeriesService, FirearmService, FrameMaterial, FrameMaterialPipe, GunCaliber, GunPart, GunPartOption, GunPartService, InventoryItem, InventoryService, JFile, Material, MaterialService, MillingDetail, MillingItem, MillingType, MillingTypeService, MountType, NewLinePipe, NotificationBarComponent, NotificationModule, NotificationService, NotificationType, Optic, OpticService, OpticStatus, Package, PackageItem, PackageOptionalItem, PackageSelectorComponent, PackageService, PackageTotal, PackageVariation, PackageVariationOption, PhonePipe, Product, ProductService, ProjectType, PurchaseOrder, PurchaseOrderRefinishItem, PurchaseOrderService, PurchaseOrderStatus, QuickbooksService, RearSightPosition, RefinishCode, RefinishCodeService, RefinishDetail, ReportMillingItem, ReportRefinishItem, SharedModule, ShieldRMSOptions, SightType, State, StateService, StatusHistoryService, Total, TotalItem, TotalsService, UserService, Vendor, VendorContact, VendorService, WaitlistAction, WaitlistCustomerService, WaitlistGun, WaitlistGunPackageDetail, WaitlistHistory, WaitlistItem, WaitlistProjectService, WaitlistService, WaitlistStatus, WorkChangeOrder, WorkHoliday, WorkHolidayService, WorkOrder, WorkOrderAction, WorkOrderDiscount, WorkOrderDiscountService, WorkOrderHistory, WorkOrderInventoryItem, WorkOrderListItem, WorkOrderNonInventoryItem, WorkOrderNonInventoryItemService, WorkOrderPackageDetail, WorkOrderRefinishItem, WorkOrderService, WorkOrderShippingItem, WorkOrderShippingItemService, WorkOrderStatus, WorkOrderType, calculateFinishDate, coatingDescriptionValidator, coatingValueValidator, convertEnumToObjectArray, getCoatingValues, getCoatings, hasCoatingDescription, hasCoatingValues, refinishDetailsValidator, touchControls };
2257
2291
  //# sourceMappingURL=gunsmith-common.mjs.map