gunsmith-common 2.2.3 → 2.2.5

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.
Files changed (244) hide show
  1. package/esm2020/gunsmith-common.mjs +4 -4
  2. package/esm2020/notification/fade-out.animation.mjs +10 -10
  3. package/esm2020/notification/index.mjs +4 -4
  4. package/esm2020/notification/notification-bar/notification-bar.component.mjs +43 -43
  5. package/esm2020/notification/notification-message.mjs +3 -3
  6. package/esm2020/notification/notification-type.enum.mjs +6 -6
  7. package/esm2020/notification/notification.module.mjs +26 -26
  8. package/esm2020/notification/notification.service.mjs +21 -21
  9. package/esm2020/public_api.mjs +13 -13
  10. package/esm2020/shared/controls/package-selector/package-selector.component.mjs +172 -172
  11. package/esm2020/shared/directives/disable-control.directive.mjs +24 -24
  12. package/esm2020/shared/directives/index.mjs +3 -3
  13. package/esm2020/shared/directives/refinish-details-validators.mjs +45 -45
  14. package/esm2020/shared/pipes/enum.pipe.mjs +16 -16
  15. package/esm2020/shared/pipes/file-name.pipe.mjs +16 -16
  16. package/esm2020/shared/pipes/frame-material.pipe.mjs +24 -24
  17. package/esm2020/shared/pipes/index.mjs +6 -6
  18. package/esm2020/shared/pipes/new-line.pipe.mjs +16 -16
  19. package/esm2020/shared/pipes/phone.pipe.mjs +19 -19
  20. package/esm2020/shared/services/coating.service.mjs +63 -63
  21. package/esm2020/shared/services/configuration.service.mjs +29 -29
  22. package/esm2020/shared/services/customer.service.mjs +47 -47
  23. package/esm2020/shared/services/dealer.service.mjs +45 -45
  24. package/esm2020/shared/services/file-upload.service.mjs +39 -39
  25. package/esm2020/shared/services/firearm-series.service.mjs +45 -45
  26. package/esm2020/shared/services/firearm.service.mjs +48 -48
  27. package/esm2020/shared/services/gun-part.service.mjs +52 -52
  28. package/esm2020/shared/services/index.mjs +27 -27
  29. package/esm2020/shared/services/inventory.service.mjs +38 -38
  30. package/esm2020/shared/services/material.service.mjs +30 -30
  31. package/esm2020/shared/services/milling-type.service.mjs +53 -53
  32. package/esm2020/shared/services/optic.service.mjs +42 -42
  33. package/esm2020/shared/services/package.service.mjs +47 -47
  34. package/esm2020/shared/services/product.service.mjs +29 -29
  35. package/esm2020/shared/services/purchase-order.service.mjs +87 -87
  36. package/esm2020/shared/services/refinish-code.service.mjs +35 -35
  37. package/esm2020/shared/services/state.service.mjs +26 -26
  38. package/esm2020/shared/services/status-history.service.mjs +40 -40
  39. package/esm2020/shared/services/totals.service.mjs +50 -50
  40. package/esm2020/shared/services/user.service.mjs +26 -26
  41. package/esm2020/shared/services/vendor.service.mjs +42 -42
  42. package/esm2020/shared/services/waitlist-customer.service.mjs +38 -38
  43. package/esm2020/shared/services/waitlist-project.service.mjs +38 -38
  44. package/esm2020/shared/services/waitlist.service.mjs +86 -86
  45. package/esm2020/shared/services/work-holiday.service.mjs +32 -32
  46. package/esm2020/shared/services/work-order.service.mjs +195 -187
  47. package/esm2020/shared/shared.module.mjs +67 -67
  48. package/esm2020/shared/types/bundle-item.mjs +6 -6
  49. package/esm2020/shared/types/change-order-status.mjs +9 -9
  50. package/esm2020/shared/types/coating-value.mjs +6 -6
  51. package/esm2020/shared/types/coating.mjs +8 -8
  52. package/esm2020/shared/types/configuration.mjs +3 -3
  53. package/esm2020/shared/types/customer.mjs +6 -6
  54. package/esm2020/shared/types/dealer-contact.mjs +3 -3
  55. package/esm2020/shared/types/dealer-coupon.mjs +3 -3
  56. package/esm2020/shared/types/dealer.mjs +8 -8
  57. package/esm2020/shared/types/filter-options.mjs +9 -9
  58. package/esm2020/shared/types/firearm-series-optic.mjs +9 -9
  59. package/esm2020/shared/types/firearm-series.mjs +10 -10
  60. package/esm2020/shared/types/firearm.mjs +6 -6
  61. package/esm2020/shared/types/frame-material.mjs +8 -8
  62. package/esm2020/shared/types/gun-caliber.mjs +7 -7
  63. package/esm2020/shared/types/gun-part-option.mjs +3 -3
  64. package/esm2020/shared/types/gun-part.mjs +11 -11
  65. package/esm2020/shared/types/index.mjs +68 -67
  66. package/esm2020/shared/types/inventory-item.mjs +6 -6
  67. package/esm2020/shared/types/j-file.mjs +3 -3
  68. package/esm2020/shared/types/material.mjs +6 -6
  69. package/esm2020/shared/types/milling-detail.mjs +7 -7
  70. package/esm2020/shared/types/milling-item.mjs +3 -3
  71. package/esm2020/shared/types/milling-type.mjs +6 -6
  72. package/esm2020/shared/types/mount-type.mjs +9 -9
  73. package/esm2020/shared/types/optic-status.mjs +7 -7
  74. package/esm2020/shared/types/optic.mjs +7 -7
  75. package/esm2020/shared/types/package-item.mjs +3 -3
  76. package/esm2020/shared/types/package-optional-item.mjs +3 -3
  77. package/esm2020/shared/types/package-total.mjs +3 -3
  78. package/esm2020/shared/types/package-variation-option.mjs +3 -3
  79. package/esm2020/shared/types/package-variation.mjs +6 -6
  80. package/esm2020/shared/types/package.mjs +10 -10
  81. package/esm2020/shared/types/product.mjs +3 -3
  82. package/esm2020/shared/types/project-type.mjs +7 -7
  83. package/esm2020/shared/types/purchase-order-refinish-item.mjs +3 -3
  84. package/esm2020/shared/types/purchase-order-status.mjs +8 -8
  85. package/esm2020/shared/types/purchase-order.mjs +9 -9
  86. package/esm2020/shared/types/rear-sight-position.mjs +6 -6
  87. package/esm2020/shared/types/refinish-code.mjs +3 -3
  88. package/esm2020/shared/types/refinish-detail.mjs +3 -3
  89. package/esm2020/shared/types/report-milling-item.mjs +3 -3
  90. package/esm2020/shared/types/report-refinish-item.mjs +3 -3
  91. package/esm2020/shared/types/shield-rms-options.mjs +6 -6
  92. package/esm2020/shared/types/sight-type.mjs +7 -7
  93. package/esm2020/shared/types/state.mjs +3 -3
  94. package/esm2020/shared/types/total-item.mjs +3 -3
  95. package/esm2020/shared/types/total.mjs +3 -3
  96. package/esm2020/shared/types/vendor-contact.mjs +3 -3
  97. package/esm2020/shared/types/vendor.mjs +7 -7
  98. package/esm2020/shared/types/waitlist-action.mjs +9 -9
  99. package/esm2020/shared/types/waitlist-gun-package-detail.mjs +7 -7
  100. package/esm2020/shared/types/waitlist-gun.mjs +12 -12
  101. package/esm2020/shared/types/waitlist-history.mjs +3 -3
  102. package/esm2020/shared/types/waitlist-item.mjs +12 -12
  103. package/esm2020/shared/types/waitlist-status.mjs +15 -15
  104. package/esm2020/shared/types/work-change-order.mjs +3 -3
  105. package/esm2020/shared/types/work-holiday.mjs +3 -3
  106. package/esm2020/shared/types/work-order-action.mjs +7 -7
  107. package/esm2020/shared/types/work-order-history.mjs +3 -3
  108. package/esm2020/shared/types/work-order-inventory-item.mjs +3 -3
  109. package/esm2020/shared/types/work-order-list-item.mjs +3 -0
  110. package/esm2020/shared/types/work-order-package-detail.mjs +7 -7
  111. package/esm2020/shared/types/work-order-refinish-item.mjs +3 -3
  112. package/esm2020/shared/types/work-order-status.mjs +18 -18
  113. package/esm2020/shared/types/work-order-type.mjs +8 -8
  114. package/esm2020/shared/types/work-order.mjs +18 -18
  115. package/esm2020/shared/utils/coating-helpers.mjs +22 -22
  116. package/esm2020/shared/utils/enum-object.mjs +10 -10
  117. package/esm2020/shared/utils/finish-date-calculator.mjs +30 -30
  118. package/esm2020/shared/utils/index.mjs +5 -5
  119. package/esm2020/shared/utils/invalid-form-control-toucher.mjs +7 -7
  120. package/fesm2015/gunsmith-common.mjs +2019 -2008
  121. package/fesm2015/gunsmith-common.mjs.map +1 -1
  122. package/fesm2020/gunsmith-common.mjs +1965 -1954
  123. package/fesm2020/gunsmith-common.mjs.map +1 -1
  124. package/gunsmith-common-2.2.5.tgz +0 -0
  125. package/gunsmith-common.d.ts +5 -5
  126. package/notification/fade-out.animation.d.ts +2 -2
  127. package/notification/index.d.ts +3 -3
  128. package/notification/notification-bar/notification-bar.component.d.ts +18 -18
  129. package/notification/notification-message.d.ts +6 -6
  130. package/notification/notification-type.enum.d.ts +4 -4
  131. package/notification/notification.module.d.ts +8 -8
  132. package/notification/notification.service.d.ts +12 -12
  133. package/package.json +1 -1
  134. package/public_api.d.ts +9 -9
  135. package/shared/controls/package-selector/package-selector.component.d.ts +39 -39
  136. package/shared/directives/disable-control.directive.d.ts +9 -9
  137. package/shared/directives/index.d.ts +2 -2
  138. package/shared/directives/refinish-details-validators.d.ts +4 -4
  139. package/shared/pipes/enum.pipe.d.ts +7 -7
  140. package/shared/pipes/file-name.pipe.d.ts +7 -7
  141. package/shared/pipes/frame-material.pipe.d.ts +11 -11
  142. package/shared/pipes/index.d.ts +5 -5
  143. package/shared/pipes/new-line.pipe.d.ts +7 -7
  144. package/shared/pipes/phone.pipe.d.ts +7 -7
  145. package/shared/services/coating.service.d.ts +22 -22
  146. package/shared/services/configuration.service.d.ts +14 -14
  147. package/shared/services/customer.service.d.ts +17 -17
  148. package/shared/services/dealer.service.d.ts +19 -19
  149. package/shared/services/file-upload.service.d.ts +14 -14
  150. package/shared/services/firearm-series.service.d.ts +18 -18
  151. package/shared/services/firearm.service.d.ts +20 -20
  152. package/shared/services/gun-part.service.d.ts +18 -18
  153. package/shared/services/index.d.ts +26 -26
  154. package/shared/services/inventory.service.d.ts +15 -15
  155. package/shared/services/material.service.d.ts +13 -13
  156. package/shared/services/milling-type.service.d.ts +18 -18
  157. package/shared/services/optic.service.d.ts +17 -17
  158. package/shared/services/package.service.d.ts +16 -16
  159. package/shared/services/product.service.d.ts +15 -15
  160. package/shared/services/purchase-order.service.d.ts +27 -27
  161. package/shared/services/refinish-code.service.d.ts +16 -16
  162. package/shared/services/state.service.d.ts +13 -13
  163. package/shared/services/status-history.service.d.ts +14 -14
  164. package/shared/services/totals.service.d.ts +15 -15
  165. package/shared/services/user.service.d.ts +12 -12
  166. package/shared/services/vendor.service.d.ts +17 -17
  167. package/shared/services/waitlist-customer.service.d.ts +15 -15
  168. package/shared/services/waitlist-project.service.d.ts +17 -17
  169. package/shared/services/waitlist.service.d.ts +25 -25
  170. package/shared/services/work-holiday.service.d.ts +15 -15
  171. package/shared/services/work-order.service.d.ts +53 -51
  172. package/shared/shared.module.d.ts +16 -16
  173. package/shared/types/bundle-item.d.ts +11 -11
  174. package/shared/types/change-order-status.d.ts +7 -7
  175. package/shared/types/coating-value.d.ts +6 -6
  176. package/shared/types/coating.d.ts +11 -11
  177. package/shared/types/configuration.d.ts +11 -11
  178. package/shared/types/customer.d.ts +14 -14
  179. package/shared/types/dealer-contact.d.ts +9 -9
  180. package/shared/types/dealer-coupon.d.ts +5 -5
  181. package/shared/types/dealer.d.ts +24 -24
  182. package/shared/types/filter-options.d.ts +6 -6
  183. package/shared/types/firearm-series-optic.d.ts +12 -12
  184. package/shared/types/firearm-series.d.ts +11 -11
  185. package/shared/types/firearm.d.ts +10 -10
  186. package/shared/types/frame-material.d.ts +6 -6
  187. package/shared/types/gun-caliber.d.ts +5 -5
  188. package/shared/types/gun-part-option.d.ts +9 -9
  189. package/shared/types/gun-part.d.ts +13 -13
  190. package/shared/types/index.d.ts +67 -66
  191. package/shared/types/inventory-item.d.ts +9 -9
  192. package/shared/types/j-file.d.ts +5 -5
  193. package/shared/types/material.d.ts +6 -6
  194. package/shared/types/milling-detail.d.ts +19 -19
  195. package/shared/types/milling-item.d.ts +8 -8
  196. package/shared/types/milling-type.d.ts +10 -10
  197. package/shared/types/mount-type.d.ts +7 -7
  198. package/shared/types/optic-status.d.ts +5 -5
  199. package/shared/types/optic.d.ts +7 -7
  200. package/shared/types/package-item.d.ts +9 -9
  201. package/shared/types/package-optional-item.d.ts +6 -6
  202. package/shared/types/package-total.d.ts +5 -5
  203. package/shared/types/package-variation-option.d.ts +10 -10
  204. package/shared/types/package-variation.d.ts +8 -8
  205. package/shared/types/package.d.ts +14 -14
  206. package/shared/types/product.d.ts +7 -7
  207. package/shared/types/project-type.d.ts +5 -5
  208. package/shared/types/purchase-order-refinish-item.d.ts +18 -18
  209. package/shared/types/purchase-order-status.d.ts +6 -6
  210. package/shared/types/purchase-order.d.ts +11 -11
  211. package/shared/types/rear-sight-position.d.ts +4 -4
  212. package/shared/types/refinish-code.d.ts +8 -8
  213. package/shared/types/refinish-detail.d.ts +13 -13
  214. package/shared/types/report-milling-item.d.ts +16 -16
  215. package/shared/types/report-refinish-item.d.ts +20 -20
  216. package/shared/types/shield-rms-options.d.ts +4 -4
  217. package/shared/types/sight-type.d.ts +5 -5
  218. package/shared/types/state.d.ts +4 -4
  219. package/shared/types/total-item.d.ts +4 -4
  220. package/shared/types/total.d.ts +5 -5
  221. package/shared/types/vendor-contact.d.ts +9 -9
  222. package/shared/types/vendor.d.ts +20 -20
  223. package/shared/types/waitlist-action.d.ts +7 -7
  224. package/shared/types/waitlist-gun-package-detail.d.ts +10 -10
  225. package/shared/types/waitlist-gun.d.ts +24 -24
  226. package/shared/types/waitlist-history.d.ts +8 -8
  227. package/shared/types/waitlist-item.d.ts +25 -25
  228. package/shared/types/waitlist-status.d.ts +13 -13
  229. package/shared/types/work-change-order.d.ts +10 -10
  230. package/shared/types/work-holiday.d.ts +4 -4
  231. package/shared/types/work-order-action.d.ts +5 -5
  232. package/shared/types/work-order-history.d.ts +8 -8
  233. package/shared/types/work-order-inventory-item.d.ts +7 -7
  234. package/shared/types/work-order-list-item.d.ts +15 -0
  235. package/shared/types/work-order-package-detail.d.ts +10 -10
  236. package/shared/types/work-order-refinish-item.d.ts +18 -18
  237. package/shared/types/work-order-status.d.ts +16 -16
  238. package/shared/types/work-order-type.d.ts +6 -6
  239. package/shared/types/work-order.d.ts +33 -33
  240. package/shared/utils/coating-helpers.d.ts +5 -5
  241. package/shared/utils/enum-object.d.ts +5 -5
  242. package/shared/utils/finish-date-calculator.d.ts +2 -2
  243. package/shared/utils/index.d.ts +4 -4
  244. package/shared/utils/invalid-form-control-toucher.d.ts +2 -2
@@ -12,2178 +12,2189 @@ import * as i2$1 from '@angular/common';
12
12
  import { CommonModule } from '@angular/common';
13
13
  import { trigger, transition, style, animate } from '@angular/animations';
14
14
 
15
- function touchControls(formGroup) {
16
- Object.keys(formGroup.controls).forEach(field => {
17
- const control = formGroup.get(field);
18
- control.markAsTouched({ onlySelf: true });
19
- });
20
- }
21
-
22
- function convertEnumToObjectArray(value) {
23
- let enumObject = [];
24
- for (let n in value) {
25
- if (typeof value[n] === 'number') {
26
- enumObject.push({ id: value[n], name: n.replace(/([^A-Z])([A-Z])/g, '$1 $2').trim() });
27
- }
28
- }
29
- return enumObject;
30
- }
31
-
32
- function getCoatings(part, coatings, material) {
33
- if (part && part.id === 1)
34
- return coatings.filter(c => part.coatings.map(pc => pc.id).includes(c.id)
35
- && c.materials.map(m => m.id).includes(material.id));
36
- else if (part)
37
- return coatings.filter(c => part.coatings.map(pc => pc.id).includes(c.id));
38
- else
39
- return [];
40
- }
41
- function getCoatingValues(coating) {
42
- if (coating)
43
- return coating.coatingValues;
44
- else
45
- return [];
46
- }
47
- function hasCoatingValues(coating) {
48
- return coating && coating.coatingValues && coating.coatingValues.length > 0;
49
- }
50
- function hasCoatingDescription(coating) {
51
- return coating && coating.valueLabel && (!coating.coatingValues || !coating.coatingValues.length);
52
- }
53
-
54
- class Configuration {
55
- }
56
-
57
- class Customer {
58
- constructor() {
59
- this.active = true;
60
- }
61
- }
62
-
63
- class Dealer {
64
- constructor() {
65
- this.couponDiscount = 20;
66
- this.active = true;
67
- this.contacts = [];
68
- }
69
- }
70
-
71
- class DealerContact {
72
- }
73
-
74
- class DealerCoupon {
75
- }
76
-
77
- class FilterOptions {
78
- constructor() {
79
- this.workOrderType = true;
80
- this.status = true;
81
- this.warranty = true;
82
- this.specialOrder = true;
83
- }
84
- }
85
-
86
- var GunCaliber;
87
- (function (GunCaliber) {
88
- GunCaliber[GunCaliber["9mm"] = 0] = "9mm";
89
- GunCaliber[GunCaliber["40Caliber"] = 1] = "40Caliber";
90
- GunCaliber[GunCaliber["45Caliber"] = 2] = "45Caliber";
15
+ function touchControls(formGroup) {
16
+ Object.keys(formGroup.controls).forEach(field => {
17
+ const control = formGroup.get(field);
18
+ control.markAsTouched({ onlySelf: true });
19
+ });
20
+ }
21
+
22
+ function convertEnumToObjectArray(value) {
23
+ let enumObject = [];
24
+ for (let n in value) {
25
+ if (typeof value[n] === 'number') {
26
+ enumObject.push({ id: value[n], name: n.replace(/([^A-Z])([A-Z])/g, '$1 $2').trim() });
27
+ }
28
+ }
29
+ return enumObject;
30
+ }
31
+
32
+ function getCoatings(part, coatings, material) {
33
+ if (part && part.id === 1)
34
+ return coatings.filter(c => part.coatings.map(pc => pc.id).includes(c.id)
35
+ && c.materials.map(m => m.id).includes(material.id));
36
+ else if (part)
37
+ return coatings.filter(c => part.coatings.map(pc => pc.id).includes(c.id));
38
+ else
39
+ return [];
40
+ }
41
+ function getCoatingValues(coating) {
42
+ if (coating)
43
+ return coating.coatingValues;
44
+ else
45
+ return [];
46
+ }
47
+ function hasCoatingValues(coating) {
48
+ return coating && coating.coatingValues && coating.coatingValues.length > 0;
49
+ }
50
+ function hasCoatingDescription(coating) {
51
+ return coating && coating.valueLabel && (!coating.coatingValues || !coating.coatingValues.length);
52
+ }
53
+
54
+ class Configuration {
55
+ }
56
+
57
+ class Customer {
58
+ constructor() {
59
+ this.active = true;
60
+ }
61
+ }
62
+
63
+ class Dealer {
64
+ constructor() {
65
+ this.couponDiscount = 20;
66
+ this.active = true;
67
+ this.contacts = [];
68
+ }
69
+ }
70
+
71
+ class DealerContact {
72
+ }
73
+
74
+ class DealerCoupon {
75
+ }
76
+
77
+ class FilterOptions {
78
+ constructor() {
79
+ this.workOrderType = true;
80
+ this.status = true;
81
+ this.warranty = true;
82
+ this.specialOrder = true;
83
+ }
84
+ }
85
+
86
+ var GunCaliber;
87
+ (function (GunCaliber) {
88
+ GunCaliber[GunCaliber["9mm"] = 0] = "9mm";
89
+ GunCaliber[GunCaliber["40Caliber"] = 1] = "40Caliber";
90
+ GunCaliber[GunCaliber["45Caliber"] = 2] = "45Caliber";
91
91
  })(GunCaliber || (GunCaliber = {}));
92
92
 
93
- class Firearm {
94
- constructor() {
95
- this.active = true;
96
- }
93
+ class Firearm {
94
+ constructor() {
95
+ this.active = true;
96
+ }
97
97
  }
98
98
 
99
- class GunPart {
100
- constructor() {
101
- this.coatings = [];
102
- this.options = [];
103
- this.defaultControl = false;
104
- this.customer = false;
105
- this.gunsmith = false;
106
- this.active = true;
107
- }
99
+ class GunPart {
100
+ constructor() {
101
+ this.coatings = [];
102
+ this.options = [];
103
+ this.defaultControl = false;
104
+ this.customer = false;
105
+ this.gunsmith = false;
106
+ this.active = true;
107
+ }
108
108
  }
109
109
 
110
- class Vendor {
111
- constructor() {
112
- this.active = true;
113
- this.contacts = [];
114
- }
110
+ class Vendor {
111
+ constructor() {
112
+ this.active = true;
113
+ this.contacts = [];
114
+ }
115
115
  }
116
116
 
117
- class VendorContact {
117
+ class VendorContact {
118
118
  }
119
119
 
120
- class State {
120
+ class State {
121
121
  }
122
122
 
123
- var WaitlistAction;
124
- (function (WaitlistAction) {
125
- WaitlistAction[WaitlistAction["SendShipmentEmail"] = 0] = "SendShipmentEmail";
126
- WaitlistAction[WaitlistAction["SendShipmentNoResponse"] = 2] = "SendShipmentNoResponse";
127
- WaitlistAction[WaitlistAction["SendWaitingOnShipmentEmail"] = 3] = "SendWaitingOnShipmentEmail";
128
- WaitlistAction[WaitlistAction["SendWaitingOnShipmentNoResponse"] = 5] = "SendWaitingOnShipmentNoResponse";
129
- WaitlistAction[WaitlistAction["SendInShopEmail"] = 6] = "SendInShopEmail";
123
+ var WaitlistAction;
124
+ (function (WaitlistAction) {
125
+ WaitlistAction[WaitlistAction["SendShipmentEmail"] = 0] = "SendShipmentEmail";
126
+ WaitlistAction[WaitlistAction["SendShipmentNoResponse"] = 2] = "SendShipmentNoResponse";
127
+ WaitlistAction[WaitlistAction["SendWaitingOnShipmentEmail"] = 3] = "SendWaitingOnShipmentEmail";
128
+ WaitlistAction[WaitlistAction["SendWaitingOnShipmentNoResponse"] = 5] = "SendWaitingOnShipmentNoResponse";
129
+ WaitlistAction[WaitlistAction["SendInShopEmail"] = 6] = "SendInShopEmail";
130
130
  })(WaitlistAction || (WaitlistAction = {}));
131
131
 
132
- var ProjectType;
133
- (function (ProjectType) {
134
- ProjectType[ProjectType["Firearm"] = 0] = "Firearm";
135
- ProjectType[ProjectType["SlideOnly"] = 1] = "SlideOnly";
136
- ProjectType[ProjectType["PartsOnly"] = 2] = "PartsOnly";
132
+ var ProjectType;
133
+ (function (ProjectType) {
134
+ ProjectType[ProjectType["Firearm"] = 0] = "Firearm";
135
+ ProjectType[ProjectType["SlideOnly"] = 1] = "SlideOnly";
136
+ ProjectType[ProjectType["PartsOnly"] = 2] = "PartsOnly";
137
137
  })(ProjectType || (ProjectType = {}));
138
138
 
139
- class WaitlistGun {
140
- constructor() {
141
- this.projectType = ProjectType.Firearm;
142
- this.logo = false;
143
- this.refinish = false;
144
- this.milling = false;
145
- this.specialOrder = false;
146
- this.refinishDetails = [];
147
- }
148
- }
149
-
150
- class WaitlistHistory {
151
- }
152
-
153
- var WaitlistStatus;
154
- (function (WaitlistStatus) {
155
- WaitlistStatus[WaitlistStatus["NewRequest"] = 0] = "NewRequest";
156
- WaitlistStatus[WaitlistStatus["ShipmentEmailSent"] = 1] = "ShipmentEmailSent";
157
- WaitlistStatus[WaitlistStatus["ShipmentEmailReminderSent"] = 2] = "ShipmentEmailReminderSent";
158
- WaitlistStatus[WaitlistStatus["ShipmentEmailNoResponse"] = 3] = "ShipmentEmailNoResponse";
159
- WaitlistStatus[WaitlistStatus["WaitingOnShipment"] = 4] = "WaitingOnShipment";
160
- WaitlistStatus[WaitlistStatus["WaitingOnShipmentReminderSent"] = 5] = "WaitingOnShipmentReminderSent";
161
- WaitlistStatus[WaitlistStatus["WaitingOnShipmentNoResponse"] = 6] = "WaitingOnShipmentNoResponse";
162
- WaitlistStatus[WaitlistStatus["InShop"] = 7] = "InShop";
163
- WaitlistStatus[WaitlistStatus["Cancelled"] = 8] = "Cancelled";
164
- WaitlistStatus[WaitlistStatus["OnHold"] = 9] = "OnHold";
165
- WaitlistStatus[WaitlistStatus["Voided"] = 10] = "Voided";
139
+ class WaitlistGun {
140
+ constructor() {
141
+ this.projectType = ProjectType.Firearm;
142
+ this.logo = false;
143
+ this.refinish = false;
144
+ this.milling = false;
145
+ this.specialOrder = false;
146
+ this.refinishDetails = [];
147
+ }
148
+ }
149
+
150
+ class WaitlistHistory {
151
+ }
152
+
153
+ var WaitlistStatus;
154
+ (function (WaitlistStatus) {
155
+ WaitlistStatus[WaitlistStatus["NewRequest"] = 0] = "NewRequest";
156
+ WaitlistStatus[WaitlistStatus["ShipmentEmailSent"] = 1] = "ShipmentEmailSent";
157
+ WaitlistStatus[WaitlistStatus["ShipmentEmailReminderSent"] = 2] = "ShipmentEmailReminderSent";
158
+ WaitlistStatus[WaitlistStatus["ShipmentEmailNoResponse"] = 3] = "ShipmentEmailNoResponse";
159
+ WaitlistStatus[WaitlistStatus["WaitingOnShipment"] = 4] = "WaitingOnShipment";
160
+ WaitlistStatus[WaitlistStatus["WaitingOnShipmentReminderSent"] = 5] = "WaitingOnShipmentReminderSent";
161
+ WaitlistStatus[WaitlistStatus["WaitingOnShipmentNoResponse"] = 6] = "WaitingOnShipmentNoResponse";
162
+ WaitlistStatus[WaitlistStatus["InShop"] = 7] = "InShop";
163
+ WaitlistStatus[WaitlistStatus["Cancelled"] = 8] = "Cancelled";
164
+ WaitlistStatus[WaitlistStatus["OnHold"] = 9] = "OnHold";
165
+ WaitlistStatus[WaitlistStatus["Voided"] = 10] = "Voided";
166
166
  })(WaitlistStatus || (WaitlistStatus = {}));
167
167
 
168
- var WorkOrderType;
169
- (function (WorkOrderType) {
170
- WorkOrderType[WorkOrderType["Standard"] = 0] = "Standard";
171
- WorkOrderType[WorkOrderType["NewInBox"] = 1] = "NewInBox";
172
- WorkOrderType[WorkOrderType["Expedited"] = 2] = "Expedited";
173
- WorkOrderType[WorkOrderType["Warranty"] = 5] = "Warranty";
168
+ var WorkOrderType;
169
+ (function (WorkOrderType) {
170
+ WorkOrderType[WorkOrderType["Standard"] = 0] = "Standard";
171
+ WorkOrderType[WorkOrderType["NewInBox"] = 1] = "NewInBox";
172
+ WorkOrderType[WorkOrderType["Expedited"] = 2] = "Expedited";
173
+ WorkOrderType[WorkOrderType["Warranty"] = 5] = "Warranty";
174
174
  })(WorkOrderType || (WorkOrderType = {}));
175
175
 
176
- class WaitlistItem {
177
- constructor() {
178
- this.requestDate = new Date();
179
- this.status = WaitlistStatus.NewRequest;
180
- this.workOrderType = WorkOrderType.Standard;
181
- this.guns = [];
182
- this.histories = [];
183
- }
184
- }
185
-
186
- class WorkChangeOrder {
187
- }
188
-
189
- class WorkHoliday {
190
- }
191
-
192
- var WorkOrderStatus;
193
- (function (WorkOrderStatus) {
194
- WorkOrderStatus[WorkOrderStatus["InShop"] = 0] = "InShop";
195
- WorkOrderStatus[WorkOrderStatus["OnBench"] = 1] = "OnBench";
196
- WorkOrderStatus[WorkOrderStatus["OutOfShop"] = 2] = "OutOfShop";
197
- WorkOrderStatus[WorkOrderStatus["MillingInProgress"] = 13] = "MillingInProgress";
198
- WorkOrderStatus[WorkOrderStatus["WaitingOnCustomer"] = 3] = "WaitingOnCustomer";
199
- WorkOrderStatus[WorkOrderStatus["CustomerNotified"] = 4] = "CustomerNotified";
200
- WorkOrderStatus[WorkOrderStatus["ShippingPostponed"] = 10] = "ShippingPostponed";
201
- WorkOrderStatus[WorkOrderStatus["FflNeeded"] = 11] = "FflNeeded";
202
- WorkOrderStatus[WorkOrderStatus["InspectionNeeded"] = 12] = "InspectionNeeded";
203
- WorkOrderStatus[WorkOrderStatus["ReadyToShip"] = 5] = "ReadyToShip";
204
- WorkOrderStatus[WorkOrderStatus["Completed"] = 6] = "Completed";
205
- WorkOrderStatus[WorkOrderStatus["Cancelled"] = 7] = "Cancelled";
206
- WorkOrderStatus[WorkOrderStatus["Voided"] = 8] = "Voided";
207
- WorkOrderStatus[WorkOrderStatus["OnHold"] = 9] = "OnHold";
176
+ class WaitlistItem {
177
+ constructor() {
178
+ this.requestDate = new Date();
179
+ this.status = WaitlistStatus.NewRequest;
180
+ this.workOrderType = WorkOrderType.Standard;
181
+ this.guns = [];
182
+ this.histories = [];
183
+ }
184
+ }
185
+
186
+ class WorkChangeOrder {
187
+ }
188
+
189
+ class WorkHoliday {
190
+ }
191
+
192
+ var WorkOrderStatus;
193
+ (function (WorkOrderStatus) {
194
+ WorkOrderStatus[WorkOrderStatus["InShop"] = 0] = "InShop";
195
+ WorkOrderStatus[WorkOrderStatus["OnBench"] = 1] = "OnBench";
196
+ WorkOrderStatus[WorkOrderStatus["OutOfShop"] = 2] = "OutOfShop";
197
+ WorkOrderStatus[WorkOrderStatus["MillingInProgress"] = 13] = "MillingInProgress";
198
+ WorkOrderStatus[WorkOrderStatus["WaitingOnCustomer"] = 3] = "WaitingOnCustomer";
199
+ WorkOrderStatus[WorkOrderStatus["CustomerNotified"] = 4] = "CustomerNotified";
200
+ WorkOrderStatus[WorkOrderStatus["ShippingPostponed"] = 10] = "ShippingPostponed";
201
+ WorkOrderStatus[WorkOrderStatus["FflNeeded"] = 11] = "FflNeeded";
202
+ WorkOrderStatus[WorkOrderStatus["InspectionNeeded"] = 12] = "InspectionNeeded";
203
+ WorkOrderStatus[WorkOrderStatus["ReadyToShip"] = 5] = "ReadyToShip";
204
+ WorkOrderStatus[WorkOrderStatus["Completed"] = 6] = "Completed";
205
+ WorkOrderStatus[WorkOrderStatus["Cancelled"] = 7] = "Cancelled";
206
+ WorkOrderStatus[WorkOrderStatus["Voided"] = 8] = "Voided";
207
+ WorkOrderStatus[WorkOrderStatus["OnHold"] = 9] = "OnHold";
208
208
  })(WorkOrderStatus || (WorkOrderStatus = {}));
209
209
 
210
- class WorkOrder {
211
- constructor() {
212
- this.id = 0;
213
- this.receivedDate = new Date();
214
- this.workOrderType = WorkOrderType.Standard;
215
- this.refinish = false;
216
- this.logo = false;
217
- this.milling = false;
218
- this.specialOrder = false;
219
- this.projectType = ProjectType.Firearm;
220
- this.status = WorkOrderStatus.InShop;
221
- this.histories = [];
222
- }
210
+ class WorkOrder {
211
+ constructor() {
212
+ this.id = 0;
213
+ this.receivedDate = new Date();
214
+ this.workOrderType = WorkOrderType.Standard;
215
+ this.refinish = false;
216
+ this.logo = false;
217
+ this.milling = false;
218
+ this.specialOrder = false;
219
+ this.projectType = ProjectType.Firearm;
220
+ this.status = WorkOrderStatus.InShop;
221
+ this.histories = [];
222
+ }
223
223
  }
224
224
 
225
- class WorkOrderHistory {
225
+ class WorkOrderHistory {
226
226
  }
227
227
 
228
- class RefinishDetail {
228
+ class RefinishDetail {
229
229
  }
230
230
 
231
- class Coating {
232
- constructor() {
233
- this.coatingValues = [];
234
- this.materials = [];
235
- this.active = true;
236
- }
231
+ class Coating {
232
+ constructor() {
233
+ this.coatingValues = [];
234
+ this.materials = [];
235
+ this.active = true;
236
+ }
237
237
  }
238
238
 
239
- class CoatingValue {
240
- constructor() {
241
- this.active = true;
242
- }
239
+ class CoatingValue {
240
+ constructor() {
241
+ this.active = true;
242
+ }
243
243
  }
244
244
 
245
- var WorkOrderAction;
246
- (function (WorkOrderAction) {
247
- WorkOrderAction[WorkOrderAction["SendOnBenchEmail"] = 1] = "SendOnBenchEmail";
248
- WorkOrderAction[WorkOrderAction["SendWaitingOnCustomerEmail"] = 3] = "SendWaitingOnCustomerEmail";
249
- WorkOrderAction[WorkOrderAction["SendCustomerNotification"] = 4] = "SendCustomerNotification";
245
+ var WorkOrderAction;
246
+ (function (WorkOrderAction) {
247
+ WorkOrderAction[WorkOrderAction["SendOnBenchEmail"] = 1] = "SendOnBenchEmail";
248
+ WorkOrderAction[WorkOrderAction["SendWaitingOnCustomerEmail"] = 3] = "SendWaitingOnCustomerEmail";
249
+ WorkOrderAction[WorkOrderAction["SendCustomerNotification"] = 4] = "SendCustomerNotification";
250
250
  })(WorkOrderAction || (WorkOrderAction = {}));
251
251
 
252
- class Optic {
253
- constructor() {
254
- this.isAvailable = false;
255
- this.active = true;
256
- }
252
+ class Optic {
253
+ constructor() {
254
+ this.isAvailable = false;
255
+ this.active = true;
256
+ }
257
257
  }
258
258
 
259
- var OpticStatus;
260
- (function (OpticStatus) {
261
- OpticStatus[OpticStatus["Included"] = 0] = "Included";
262
- OpticStatus[OpticStatus["NotIncluded"] = 1] = "NotIncluded";
263
- OpticStatus[OpticStatus["Supply"] = 2] = "Supply";
259
+ var OpticStatus;
260
+ (function (OpticStatus) {
261
+ OpticStatus[OpticStatus["Included"] = 0] = "Included";
262
+ OpticStatus[OpticStatus["NotIncluded"] = 1] = "NotIncluded";
263
+ OpticStatus[OpticStatus["Supply"] = 2] = "Supply";
264
264
  })(OpticStatus || (OpticStatus = {}));
265
265
 
266
- class Product {
266
+ class Product {
267
267
  }
268
268
 
269
- class BundleItem {
270
- constructor() {
271
- this.allowedVariations = [];
272
- }
269
+ class BundleItem {
270
+ constructor() {
271
+ this.allowedVariations = [];
272
+ }
273
273
  }
274
274
 
275
- var ChangeOrderStatus;
276
- (function (ChangeOrderStatus) {
277
- ChangeOrderStatus[ChangeOrderStatus["WaitingOnCustomer"] = 0] = "WaitingOnCustomer";
278
- ChangeOrderStatus[ChangeOrderStatus["Confirmed"] = 1] = "Confirmed";
279
- ChangeOrderStatus[ChangeOrderStatus["Cancelled"] = 2] = "Cancelled";
280
- ChangeOrderStatus[ChangeOrderStatus["NoResponse"] = 3] = "NoResponse";
281
- ChangeOrderStatus[ChangeOrderStatus["Unconfirmed"] = 4] = "Unconfirmed";
275
+ var ChangeOrderStatus;
276
+ (function (ChangeOrderStatus) {
277
+ ChangeOrderStatus[ChangeOrderStatus["WaitingOnCustomer"] = 0] = "WaitingOnCustomer";
278
+ ChangeOrderStatus[ChangeOrderStatus["Confirmed"] = 1] = "Confirmed";
279
+ ChangeOrderStatus[ChangeOrderStatus["Cancelled"] = 2] = "Cancelled";
280
+ ChangeOrderStatus[ChangeOrderStatus["NoResponse"] = 3] = "NoResponse";
281
+ ChangeOrderStatus[ChangeOrderStatus["Unconfirmed"] = 4] = "Unconfirmed";
282
282
  })(ChangeOrderStatus || (ChangeOrderStatus = {}));
283
283
 
284
- var MountType;
285
- (function (MountType) {
286
- MountType[MountType["Standard"] = 0] = "Standard";
287
- MountType[MountType["Plate"] = 1] = "Plate";
288
- MountType[MountType["DeltaPointPro"] = 2] = "DeltaPointPro";
289
- MountType[MountType["ShieldRMS"] = 3] = "ShieldRMS";
290
- MountType[MountType["PlateBUIS"] = 4] = "PlateBUIS";
284
+ var MountType;
285
+ (function (MountType) {
286
+ MountType[MountType["Standard"] = 0] = "Standard";
287
+ MountType[MountType["Plate"] = 1] = "Plate";
288
+ MountType[MountType["DeltaPointPro"] = 2] = "DeltaPointPro";
289
+ MountType[MountType["ShieldRMS"] = 3] = "ShieldRMS";
290
+ MountType[MountType["PlateBUIS"] = 4] = "PlateBUIS";
291
291
  })(MountType || (MountType = {}));
292
292
 
293
- var SightType;
294
- (function (SightType) {
295
- SightType[SightType["Black"] = 0] = "Black";
296
- SightType[SightType["Tritium"] = 1] = "Tritium";
297
- SightType[SightType["FiberOptic"] = 2] = "FiberOptic";
293
+ var SightType;
294
+ (function (SightType) {
295
+ SightType[SightType["Black"] = 0] = "Black";
296
+ SightType[SightType["Tritium"] = 1] = "Tritium";
297
+ SightType[SightType["FiberOptic"] = 2] = "FiberOptic";
298
298
  })(SightType || (SightType = {}));
299
299
 
300
- class MillingDetail {
301
- constructor() {
302
- this.barrelCrown = false;
303
- this.bushingInstallation = false;
304
- }
300
+ class MillingDetail {
301
+ constructor() {
302
+ this.barrelCrown = false;
303
+ this.bushingInstallation = false;
304
+ }
305
305
  }
306
306
 
307
- var RearSightPosition;
308
- (function (RearSightPosition) {
309
- RearSightPosition[RearSightPosition["InFront"] = 0] = "InFront";
310
- RearSightPosition[RearSightPosition["Behind"] = 1] = "Behind";
307
+ var RearSightPosition;
308
+ (function (RearSightPosition) {
309
+ RearSightPosition[RearSightPosition["InFront"] = 0] = "InFront";
310
+ RearSightPosition[RearSightPosition["Behind"] = 1] = "Behind";
311
311
  })(RearSightPosition || (RearSightPosition = {}));
312
312
 
313
- class FirearmSeries {
314
- constructor() {
315
- this.active = true;
316
- this.blackFrontSights = false;
317
- this.tritiumFrontSights = false;
318
- this.fiberOpticFrontSights = false;
319
- this.firearmSeriesOptics = [];
320
- }
321
- }
322
-
323
- class FirearmSeriesOptic {
324
- constructor() {
325
- this.rearFrontSightBlack = false;
326
- this.rearFrontSightTritium = false;
327
- this.rearBehindSightBlack = false;
328
- this.rearBehindSightTritium = false;
329
- }
330
- }
331
-
332
- var FrameMaterial;
333
- (function (FrameMaterial) {
334
- FrameMaterial[FrameMaterial["All"] = 0] = "All";
335
- FrameMaterial[FrameMaterial["Polymer"] = 1] = "Polymer";
336
- FrameMaterial[FrameMaterial["Aluminum"] = 2] = "Aluminum";
337
- FrameMaterial[FrameMaterial["Steel"] = 3] = "Steel";
313
+ class FirearmSeries {
314
+ constructor() {
315
+ this.active = true;
316
+ this.blackFrontSights = false;
317
+ this.tritiumFrontSights = false;
318
+ this.fiberOpticFrontSights = false;
319
+ this.firearmSeriesOptics = [];
320
+ }
321
+ }
322
+
323
+ class FirearmSeriesOptic {
324
+ constructor() {
325
+ this.rearFrontSightBlack = false;
326
+ this.rearFrontSightTritium = false;
327
+ this.rearBehindSightBlack = false;
328
+ this.rearBehindSightTritium = false;
329
+ }
330
+ }
331
+
332
+ var FrameMaterial;
333
+ (function (FrameMaterial) {
334
+ FrameMaterial[FrameMaterial["All"] = 0] = "All";
335
+ FrameMaterial[FrameMaterial["Polymer"] = 1] = "Polymer";
336
+ FrameMaterial[FrameMaterial["Aluminum"] = 2] = "Aluminum";
337
+ FrameMaterial[FrameMaterial["Steel"] = 3] = "Steel";
338
338
  })(FrameMaterial || (FrameMaterial = {}));
339
339
 
340
- class MillingType {
341
- constructor() {
342
- this.active = true;
343
- }
340
+ class MillingType {
341
+ constructor() {
342
+ this.active = true;
343
+ }
344
344
  }
345
345
 
346
- class MillingItem {
346
+ class MillingItem {
347
347
  }
348
348
 
349
- class WorkOrderRefinishItem {
349
+ class WorkOrderRefinishItem {
350
350
  }
351
351
 
352
- class PurchaseOrderRefinishItem {
352
+ class PurchaseOrderRefinishItem {
353
353
  }
354
354
 
355
- class Material {
356
- constructor() {
357
- this.active = true;
358
- }
355
+ class Material {
356
+ constructor() {
357
+ this.active = true;
358
+ }
359
359
  }
360
360
 
361
- var PurchaseOrderStatus;
362
- (function (PurchaseOrderStatus) {
363
- PurchaseOrderStatus[PurchaseOrderStatus["Open"] = 0] = "Open";
364
- PurchaseOrderStatus[PurchaseOrderStatus["Closed"] = 1] = "Closed";
365
- PurchaseOrderStatus[PurchaseOrderStatus["Cancelled"] = 2] = "Cancelled";
366
- PurchaseOrderStatus[PurchaseOrderStatus["Voided"] = 3] = "Voided";
361
+ var PurchaseOrderStatus;
362
+ (function (PurchaseOrderStatus) {
363
+ PurchaseOrderStatus[PurchaseOrderStatus["Open"] = 0] = "Open";
364
+ PurchaseOrderStatus[PurchaseOrderStatus["Closed"] = 1] = "Closed";
365
+ PurchaseOrderStatus[PurchaseOrderStatus["Cancelled"] = 2] = "Cancelled";
366
+ PurchaseOrderStatus[PurchaseOrderStatus["Voided"] = 3] = "Voided";
367
367
  })(PurchaseOrderStatus || (PurchaseOrderStatus = {}));
368
368
 
369
- class PurchaseOrder {
370
- constructor() {
371
- this.date = new Date();
372
- this.status = PurchaseOrderStatus.Open;
373
- this.refinishItems = [];
374
- }
369
+ class PurchaseOrder {
370
+ constructor() {
371
+ this.date = new Date();
372
+ this.status = PurchaseOrderStatus.Open;
373
+ this.refinishItems = [];
374
+ }
375
375
  }
376
376
 
377
- class ReportMillingItem {
377
+ class ReportMillingItem {
378
378
  }
379
379
 
380
- class ReportRefinishItem {
380
+ class ReportRefinishItem {
381
381
  }
382
382
 
383
- class Total {
383
+ class Total {
384
384
  }
385
385
 
386
- class TotalItem {
386
+ class TotalItem {
387
387
  }
388
388
 
389
- class InventoryItem {
390
- constructor() {
391
- this.active = true;
392
- }
389
+ class InventoryItem {
390
+ constructor() {
391
+ this.active = true;
392
+ }
393
393
  }
394
394
 
395
- class JFile {
395
+ class JFile {
396
396
  }
397
397
 
398
- class GunPartOption {
398
+ class GunPartOption {
399
399
  }
400
400
 
401
- var ShieldRMSOptions;
402
- (function (ShieldRMSOptions) {
403
- ShieldRMSOptions[ShieldRMSOptions["KeepBUIS"] = 0] = "KeepBUIS";
404
- ShieldRMSOptions[ShieldRMSOptions["RemoveBUIS"] = 1] = "RemoveBUIS";
401
+ var ShieldRMSOptions;
402
+ (function (ShieldRMSOptions) {
403
+ ShieldRMSOptions[ShieldRMSOptions["KeepBUIS"] = 0] = "KeepBUIS";
404
+ ShieldRMSOptions[ShieldRMSOptions["RemoveBUIS"] = 1] = "RemoveBUIS";
405
405
  })(ShieldRMSOptions || (ShieldRMSOptions = {}));
406
406
 
407
- class PackageItem {
408
- }
409
-
410
- class Package {
411
- constructor() {
412
- this.active = true;
413
- this.firearms = [];
414
- this.items = [];
415
- this.optionalItems = [];
416
- this.variations = [];
417
- }
418
- }
419
-
420
- class PackageOptionalItem {
421
- }
422
-
423
- class PackageVariation {
424
- constructor() {
425
- this.options = [];
426
- }
427
- }
428
-
429
- class PackageVariationOption {
430
- }
431
-
432
- class WaitlistGunPackageDetail {
433
- constructor() {
434
- this.optionalItems = [];
435
- this.variations = [];
436
- }
437
- }
438
-
439
- class WorkOrderPackageDetail {
440
- constructor() {
441
- this.optionalItems = [];
442
- this.variations = [];
443
- }
444
- }
445
-
446
- class PackageTotal {
447
- }
448
-
449
- class WorkOrderInventoryItem {
450
- }
451
-
452
- class RefinishCode {
453
- }
454
-
455
- function adjustHoliday(finishDate, holidays) {
456
- while (holidays.map(h => new Date(h.holiday)).findIndex(h => DateTime.fromJSDate(h) === DateTime.fromJSDate(finishDate)) !== -1) {
457
- do {
458
- finishDate = DateTime.fromJSDate(finishDate).plus({ days: 1 }).toJSDate();
459
- } while (finishDate.getDay() === 0 || finishDate.getDay() === 6);
460
- }
461
- return finishDate;
462
- }
463
- function calculateFinishDate(receivedDate, workOrderType, configs, holidays) {
464
- if (!receivedDate) {
465
- return null;
466
- }
467
- let finishDate = DateTime.fromJSDate(receivedDate).startOf("day");
468
- if (workOrderType === WorkOrderType.Warranty) {
469
- finishDate = finishDate.plus({ weeks: configs.warrantyWeeks });
470
- }
471
- else if (workOrderType === WorkOrderType.Expedited) {
472
- finishDate = finishDate.plus({ weeks: configs.expeditedWeeks });
473
- }
474
- else if (workOrderType === WorkOrderType.NewInBox) {
475
- finishDate = finishDate.plus({ weeks: configs.newInBoxWeeks });
476
- }
477
- else {
478
- finishDate = finishDate.plus({ weeks: configs.standardWeeks });
479
- }
480
- return adjustHoliday(finishDate.toJSDate(), holidays);
481
- }
482
-
483
- class CustomerService {
484
- constructor(http, env) {
485
- this.http = http;
486
- this.env = env;
487
- this.url = this.env.baseUrl + 'api/customers';
488
- }
489
- readCustomers(includeInactive = false, filter = null) {
490
- const params = {};
491
- if (includeInactive) {
492
- params['includeInactive'] = includeInactive.toString();
493
- }
494
- if (filter) {
495
- params['filter'] = filter;
496
- }
497
- return this.http.get(this.url, {
498
- params: params
499
- });
500
- }
501
- readCustomer(id) {
502
- return this.http.get(`${this.url}/${id}`);
503
- }
504
- createCustomer(customer) {
505
- return this.http.post(this.url, customer);
506
- }
507
- updateCustomer(id, customer) {
508
- return this.http.put(`${this.url}/${id}`, customer);
509
- }
510
- deleteCustomer(id) {
511
- return this.http.delete(`${this.url}/${id}`);
512
- }
513
- }
514
- CustomerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CustomerService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
515
- CustomerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CustomerService, providedIn: 'root' });
516
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CustomerService, decorators: [{
517
- type: Injectable,
518
- args: [{
519
- providedIn: 'root'
520
- }]
521
- }], ctorParameters: function () {
522
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
523
- type: Inject,
524
- args: ['env']
525
- }] }];
407
+ class PackageItem {
408
+ }
409
+
410
+ class Package {
411
+ constructor() {
412
+ this.active = true;
413
+ this.firearms = [];
414
+ this.items = [];
415
+ this.optionalItems = [];
416
+ this.variations = [];
417
+ }
418
+ }
419
+
420
+ class PackageOptionalItem {
421
+ }
422
+
423
+ class PackageVariation {
424
+ constructor() {
425
+ this.options = [];
426
+ }
427
+ }
428
+
429
+ class PackageVariationOption {
430
+ }
431
+
432
+ class WaitlistGunPackageDetail {
433
+ constructor() {
434
+ this.optionalItems = [];
435
+ this.variations = [];
436
+ }
437
+ }
438
+
439
+ class WorkOrderPackageDetail {
440
+ constructor() {
441
+ this.optionalItems = [];
442
+ this.variations = [];
443
+ }
444
+ }
445
+
446
+ class PackageTotal {
447
+ }
448
+
449
+ class WorkOrderInventoryItem {
450
+ }
451
+
452
+ class RefinishCode {
453
+ }
454
+
455
+ class WorkOrderListItem {
456
+ }
457
+
458
+ function adjustHoliday(finishDate, holidays) {
459
+ while (holidays.map(h => new Date(h.holiday)).findIndex(h => DateTime.fromJSDate(h) === DateTime.fromJSDate(finishDate)) !== -1) {
460
+ do {
461
+ finishDate = DateTime.fromJSDate(finishDate).plus({ days: 1 }).toJSDate();
462
+ } while (finishDate.getDay() === 0 || finishDate.getDay() === 6);
463
+ }
464
+ return finishDate;
465
+ }
466
+ function calculateFinishDate(receivedDate, workOrderType, configs, holidays) {
467
+ if (!receivedDate) {
468
+ return null;
469
+ }
470
+ let finishDate = DateTime.fromJSDate(receivedDate).startOf("day");
471
+ if (workOrderType === WorkOrderType.Warranty) {
472
+ finishDate = finishDate.plus({ weeks: configs.warrantyWeeks });
473
+ }
474
+ else if (workOrderType === WorkOrderType.Expedited) {
475
+ finishDate = finishDate.plus({ weeks: configs.expeditedWeeks });
476
+ }
477
+ else if (workOrderType === WorkOrderType.NewInBox) {
478
+ finishDate = finishDate.plus({ weeks: configs.newInBoxWeeks });
479
+ }
480
+ else {
481
+ finishDate = finishDate.plus({ weeks: configs.standardWeeks });
482
+ }
483
+ return adjustHoliday(finishDate.toJSDate(), holidays);
484
+ }
485
+
486
+ class CustomerService {
487
+ constructor(http, env) {
488
+ this.http = http;
489
+ this.env = env;
490
+ this.url = this.env.baseUrl + 'api/customers';
491
+ }
492
+ readCustomers(includeInactive = false, filter = null) {
493
+ const params = {};
494
+ if (includeInactive) {
495
+ params['includeInactive'] = includeInactive.toString();
496
+ }
497
+ if (filter) {
498
+ params['filter'] = filter;
499
+ }
500
+ return this.http.get(this.url, {
501
+ params: params
502
+ });
503
+ }
504
+ readCustomer(id) {
505
+ return this.http.get(`${this.url}/${id}`);
506
+ }
507
+ createCustomer(customer) {
508
+ return this.http.post(this.url, customer);
509
+ }
510
+ updateCustomer(id, customer) {
511
+ return this.http.put(`${this.url}/${id}`, customer);
512
+ }
513
+ deleteCustomer(id) {
514
+ return this.http.delete(`${this.url}/${id}`);
515
+ }
516
+ }
517
+ CustomerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CustomerService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
518
+ CustomerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CustomerService, providedIn: 'root' });
519
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CustomerService, decorators: [{
520
+ type: Injectable,
521
+ args: [{
522
+ providedIn: 'root'
523
+ }]
524
+ }], ctorParameters: function () {
525
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
526
+ type: Inject,
527
+ args: ['env']
528
+ }] }];
526
529
  } });
527
530
 
528
- class FirearmService {
529
- constructor(http, env) {
530
- this.http = http;
531
- this.env = env;
532
- this.url = this.env.baseUrl + 'api/firearms';
533
- }
534
- readFirearms(includeInactive = false) {
535
- return this.http.get(this.url, {
536
- params: {
537
- includeInactive: includeInactive.toString()
538
- }
539
- });
540
- }
541
- readFirearm(firearmId) {
542
- return this.http.get(`${this.url}/${firearmId}`);
543
- }
544
- createFirearm(firearm) {
545
- return this.http.post(this.url, firearm);
546
- }
547
- updateFirearm(firearmId, firearm) {
548
- return this.http.put(`${this.url}/${firearmId}`, firearm);
549
- }
550
- deleteFirearm(firearmId) {
551
- return this.http.delete(`${this.url}/${firearmId}`);
552
- }
553
- readFirearmSeries(firearmId) {
554
- return this.http.get(`${this.url}/${firearmId}/series`);
555
- }
556
- readFirearmMaterial(firearmId) {
557
- return this.http.get(`${this.url}/${firearmId}/material`);
558
- }
559
- }
560
- FirearmService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FirearmService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
561
- FirearmService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FirearmService, providedIn: 'root' });
562
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FirearmService, decorators: [{
563
- type: Injectable,
564
- args: [{
565
- providedIn: 'root'
566
- }]
567
- }], ctorParameters: function () {
568
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
569
- type: Inject,
570
- args: ['env']
571
- }] }];
531
+ class FirearmService {
532
+ constructor(http, env) {
533
+ this.http = http;
534
+ this.env = env;
535
+ this.url = this.env.baseUrl + 'api/firearms';
536
+ }
537
+ readFirearms(includeInactive = false) {
538
+ return this.http.get(this.url, {
539
+ params: {
540
+ includeInactive: includeInactive.toString()
541
+ }
542
+ });
543
+ }
544
+ readFirearm(firearmId) {
545
+ return this.http.get(`${this.url}/${firearmId}`);
546
+ }
547
+ createFirearm(firearm) {
548
+ return this.http.post(this.url, firearm);
549
+ }
550
+ updateFirearm(firearmId, firearm) {
551
+ return this.http.put(`${this.url}/${firearmId}`, firearm);
552
+ }
553
+ deleteFirearm(firearmId) {
554
+ return this.http.delete(`${this.url}/${firearmId}`);
555
+ }
556
+ readFirearmSeries(firearmId) {
557
+ return this.http.get(`${this.url}/${firearmId}/series`);
558
+ }
559
+ readFirearmMaterial(firearmId) {
560
+ return this.http.get(`${this.url}/${firearmId}/material`);
561
+ }
562
+ }
563
+ FirearmService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FirearmService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
564
+ FirearmService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FirearmService, providedIn: 'root' });
565
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FirearmService, decorators: [{
566
+ type: Injectable,
567
+ args: [{
568
+ providedIn: 'root'
569
+ }]
570
+ }], ctorParameters: function () {
571
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
572
+ type: Inject,
573
+ args: ['env']
574
+ }] }];
572
575
  } });
573
576
 
574
- class GunPartService {
575
- constructor(http, env) {
576
- this.http = http;
577
- this.env = env;
578
- this.url = this.env.baseUrl + 'api/gun-parts';
579
- }
580
- readGunParts(includeInactive = false, gunsmith = null, customer = null) {
581
- const params = {
582
- includeInactive: includeInactive.toString()
583
- };
584
- if (gunsmith !== null) {
585
- params['gunsmith'] = gunsmith.toString();
586
- }
587
- if (customer !== null) {
588
- params['customer'] = customer.toString();
589
- }
590
- return this.http.get(this.url, {
591
- params: params
592
- });
593
- }
594
- readGunPart(id) {
595
- return this.http.get(`${this.url}/${id}`);
596
- }
597
- createGunPart(gunPart) {
598
- return this.http.post(this.url, gunPart);
599
- }
600
- updateGunPart(id, gunPart) {
601
- return this.http.put(`${this.url}/${id}`, gunPart);
602
- }
603
- deleteGunPart(id) {
604
- return this.http.delete(`${this.url}/${id}`);
605
- }
606
- readPartCoatings(id) {
607
- return this.http.get(`${this.url}/${id}/coatings`);
608
- }
609
- }
610
- GunPartService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GunPartService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
611
- GunPartService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GunPartService, providedIn: 'root' });
612
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GunPartService, decorators: [{
613
- type: Injectable,
614
- args: [{
615
- providedIn: 'root'
616
- }]
617
- }], ctorParameters: function () {
618
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
619
- type: Inject,
620
- args: ['env']
621
- }] }];
577
+ class GunPartService {
578
+ constructor(http, env) {
579
+ this.http = http;
580
+ this.env = env;
581
+ this.url = this.env.baseUrl + 'api/gun-parts';
582
+ }
583
+ readGunParts(includeInactive = false, gunsmith = null, customer = null) {
584
+ const params = {
585
+ includeInactive: includeInactive.toString()
586
+ };
587
+ if (gunsmith !== null) {
588
+ params['gunsmith'] = gunsmith.toString();
589
+ }
590
+ if (customer !== null) {
591
+ params['customer'] = customer.toString();
592
+ }
593
+ return this.http.get(this.url, {
594
+ params: params
595
+ });
596
+ }
597
+ readGunPart(id) {
598
+ return this.http.get(`${this.url}/${id}`);
599
+ }
600
+ createGunPart(gunPart) {
601
+ return this.http.post(this.url, gunPart);
602
+ }
603
+ updateGunPart(id, gunPart) {
604
+ return this.http.put(`${this.url}/${id}`, gunPart);
605
+ }
606
+ deleteGunPart(id) {
607
+ return this.http.delete(`${this.url}/${id}`);
608
+ }
609
+ readPartCoatings(id) {
610
+ return this.http.get(`${this.url}/${id}/coatings`);
611
+ }
612
+ }
613
+ GunPartService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GunPartService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
614
+ GunPartService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GunPartService, providedIn: 'root' });
615
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GunPartService, decorators: [{
616
+ type: Injectable,
617
+ args: [{
618
+ providedIn: 'root'
619
+ }]
620
+ }], ctorParameters: function () {
621
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
622
+ type: Inject,
623
+ args: ['env']
624
+ }] }];
622
625
  } });
623
626
 
624
- class StateService {
625
- constructor(http, env) {
626
- this.http = http;
627
- this.env = env;
628
- this.url = this.env.baseUrl + 'api/states';
629
- }
630
- getStates() {
631
- return this.http.get(this.url);
632
- }
633
- }
634
- StateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: StateService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
635
- StateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: StateService, providedIn: 'root' });
636
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: StateService, decorators: [{
637
- type: Injectable,
638
- args: [{
639
- providedIn: 'root'
640
- }]
641
- }], ctorParameters: function () {
642
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
643
- type: Inject,
644
- args: ['env']
645
- }] }];
627
+ class StateService {
628
+ constructor(http, env) {
629
+ this.http = http;
630
+ this.env = env;
631
+ this.url = this.env.baseUrl + 'api/states';
632
+ }
633
+ getStates() {
634
+ return this.http.get(this.url);
635
+ }
636
+ }
637
+ StateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: StateService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
638
+ StateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: StateService, providedIn: 'root' });
639
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: StateService, decorators: [{
640
+ type: Injectable,
641
+ args: [{
642
+ providedIn: 'root'
643
+ }]
644
+ }], ctorParameters: function () {
645
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
646
+ type: Inject,
647
+ args: ['env']
648
+ }] }];
646
649
  } });
647
650
 
648
- class VendorService {
649
- constructor(http, env) {
650
- this.http = http;
651
- this.env = env;
652
- this.url = this.env.baseUrl + 'api/vendors';
653
- }
654
- readVendors(includeInactive = false) {
655
- return this.http.get(this.url, {
656
- params: {
657
- includeInactive: includeInactive.toString()
658
- }
659
- });
660
- }
661
- readVendor(id) {
662
- return this.http.get(`${this.url}/${id}`);
663
- }
664
- createVendor(Vendor) {
665
- return this.http.post(this.url, Vendor);
666
- }
667
- updateVendor(id, Vendor) {
668
- return this.http.put(`${this.url}/${id}`, Vendor);
669
- }
670
- deleteVendor(id) {
671
- return this.http.delete(`${this.url}/${id}`);
672
- }
673
- }
674
- VendorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: VendorService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
675
- VendorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: VendorService, providedIn: 'root' });
676
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: VendorService, decorators: [{
677
- type: Injectable,
678
- args: [{
679
- providedIn: 'root'
680
- }]
681
- }], ctorParameters: function () {
682
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
683
- type: Inject,
684
- args: ['env']
685
- }] }];
651
+ class VendorService {
652
+ constructor(http, env) {
653
+ this.http = http;
654
+ this.env = env;
655
+ this.url = this.env.baseUrl + 'api/vendors';
656
+ }
657
+ readVendors(includeInactive = false) {
658
+ return this.http.get(this.url, {
659
+ params: {
660
+ includeInactive: includeInactive.toString()
661
+ }
662
+ });
663
+ }
664
+ readVendor(id) {
665
+ return this.http.get(`${this.url}/${id}`);
666
+ }
667
+ createVendor(Vendor) {
668
+ return this.http.post(this.url, Vendor);
669
+ }
670
+ updateVendor(id, Vendor) {
671
+ return this.http.put(`${this.url}/${id}`, Vendor);
672
+ }
673
+ deleteVendor(id) {
674
+ return this.http.delete(`${this.url}/${id}`);
675
+ }
676
+ }
677
+ VendorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: VendorService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
678
+ VendorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: VendorService, providedIn: 'root' });
679
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: VendorService, decorators: [{
680
+ type: Injectable,
681
+ args: [{
682
+ providedIn: 'root'
683
+ }]
684
+ }], ctorParameters: function () {
685
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
686
+ type: Inject,
687
+ args: ['env']
688
+ }] }];
686
689
  } });
687
690
 
688
- class TotalsService {
689
- constructor(http, env) {
690
- this.http = http;
691
- this.env = env;
692
- this.url = this.env.baseUrl + 'api/';
693
- }
694
- readTotals(startDate, endDate, groupBy) {
695
- return this.http.get(this.url + 'work-orders/totals', {
696
- params: {
697
- startDate: startDate.toUTCString(),
698
- endDate: endDate.toUTCString(),
699
- groupBy: groupBy.toString()
700
- }
701
- });
702
- }
703
- readMillingTotals(startDate, endDate, groupBy) {
704
- return this.http.get(this.url + 'milling-totals', {
705
- params: {
706
- startDate: startDate.toUTCString(),
707
- endDate: endDate.toUTCString(),
708
- groupBy: groupBy.toString()
709
- }
710
- });
711
- }
712
- readRefinishTotals(startDate, endDate, groupBy) {
713
- return this.http.get(this.url + 'refinish-totals', {
714
- params: {
715
- startDate: startDate.toUTCString(),
716
- endDate: endDate.toUTCString(),
717
- groupBy: groupBy.toString()
718
- }
719
- });
720
- }
721
- }
722
- TotalsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TotalsService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
723
- TotalsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TotalsService, providedIn: 'root' });
724
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TotalsService, decorators: [{
725
- type: Injectable,
726
- args: [{
727
- providedIn: 'root'
728
- }]
729
- }], ctorParameters: function () {
730
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
731
- type: Inject,
732
- args: ['env']
733
- }] }];
691
+ class TotalsService {
692
+ constructor(http, env) {
693
+ this.http = http;
694
+ this.env = env;
695
+ this.url = this.env.baseUrl + 'api/';
696
+ }
697
+ readTotals(startDate, endDate, groupBy) {
698
+ return this.http.get(this.url + 'work-orders/totals', {
699
+ params: {
700
+ startDate: startDate.toUTCString(),
701
+ endDate: endDate.toUTCString(),
702
+ groupBy: groupBy.toString()
703
+ }
704
+ });
705
+ }
706
+ readMillingTotals(startDate, endDate, groupBy) {
707
+ return this.http.get(this.url + 'milling-totals', {
708
+ params: {
709
+ startDate: startDate.toUTCString(),
710
+ endDate: endDate.toUTCString(),
711
+ groupBy: groupBy.toString()
712
+ }
713
+ });
714
+ }
715
+ readRefinishTotals(startDate, endDate, groupBy) {
716
+ return this.http.get(this.url + 'refinish-totals', {
717
+ params: {
718
+ startDate: startDate.toUTCString(),
719
+ endDate: endDate.toUTCString(),
720
+ groupBy: groupBy.toString()
721
+ }
722
+ });
723
+ }
724
+ }
725
+ TotalsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TotalsService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
726
+ TotalsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TotalsService, providedIn: 'root' });
727
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TotalsService, decorators: [{
728
+ type: Injectable,
729
+ args: [{
730
+ providedIn: 'root'
731
+ }]
732
+ }], ctorParameters: function () {
733
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
734
+ type: Inject,
735
+ args: ['env']
736
+ }] }];
734
737
  } });
735
738
 
736
- class WorkHolidayService {
737
- constructor(http, env) {
738
- this.http = http;
739
- this.env = env;
740
- this.url = this.env.baseUrl + 'api/holidays';
741
- }
742
- readHolidays() {
743
- return this.http.get(this.url);
744
- }
745
- createHoliday(holiday) {
746
- return this.http.post(this.url, holiday);
747
- }
748
- deleteHoliday(id) {
749
- return this.http.delete(`${this.url}/${id}`);
750
- }
751
- }
752
- WorkHolidayService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WorkHolidayService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
753
- WorkHolidayService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WorkHolidayService, providedIn: 'root' });
754
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WorkHolidayService, decorators: [{
755
- type: Injectable,
756
- args: [{
757
- providedIn: 'root'
758
- }]
759
- }], ctorParameters: function () {
760
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
761
- type: Inject,
762
- args: ['env']
763
- }] }];
739
+ class WorkHolidayService {
740
+ constructor(http, env) {
741
+ this.http = http;
742
+ this.env = env;
743
+ this.url = this.env.baseUrl + 'api/holidays';
744
+ }
745
+ readHolidays() {
746
+ return this.http.get(this.url);
747
+ }
748
+ createHoliday(holiday) {
749
+ return this.http.post(this.url, holiday);
750
+ }
751
+ deleteHoliday(id) {
752
+ return this.http.delete(`${this.url}/${id}`);
753
+ }
754
+ }
755
+ WorkHolidayService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WorkHolidayService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
756
+ WorkHolidayService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WorkHolidayService, providedIn: 'root' });
757
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WorkHolidayService, decorators: [{
758
+ type: Injectable,
759
+ args: [{
760
+ providedIn: 'root'
761
+ }]
762
+ }], ctorParameters: function () {
763
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
764
+ type: Inject,
765
+ args: ['env']
766
+ }] }];
764
767
  } });
765
768
 
766
- class WorkOrderService {
767
- constructor(http, env) {
768
- this.http = http;
769
- this.env = env;
770
- this.url = this.env.baseUrl + 'api/work-orders';
771
- }
772
- doWorkOrderAction(id, actionId) {
773
- return this.http.get(`${this.url}/${id}/actions/${actionId}`);
774
- }
775
- readWorkOrders(statuses = null, id = null, customerName = null, customerEmail = null, serialNumber = null, orderTypes = null, projectTypes = null, users = null, specialOrder = null) {
776
- const params = {};
777
- if (statuses) {
778
- params['statuses'] = statuses.map(status => status.toString());
779
- }
780
- if (id) {
781
- params['id'] = id.toString();
782
- }
783
- if (customerName) {
784
- params['customerName'] = customerName;
785
- }
786
- if (customerEmail) {
787
- params['customerEmail'] = customerEmail;
788
- }
789
- if (serialNumber) {
790
- params['serialNumber'] = serialNumber;
791
- }
792
- if (orderTypes !== null) {
793
- params['orderTypes'] = orderTypes.map(type => type.toString());
794
- }
795
- if (projectTypes) {
796
- params['projectTypes'] = projectTypes.map(t => t.toString());
797
- }
798
- if (users) {
799
- params['users'] = users;
800
- }
801
- if (specialOrder) {
802
- params['specialOrder'] = specialOrder.toString();
803
- }
804
- return this.http.get(this.url, {
805
- params: params
806
- });
807
- }
808
- readWorkOrder(workOrderId) {
809
- return this.http.get(`${this.url}/${workOrderId}`);
810
- }
811
- createWorkOrder(workOrder) {
812
- return this.http.post(this.url, workOrder);
813
- }
814
- updateWorkOrder(workOrderId, workOrder) {
815
- return this.http.put(`${this.url}/${workOrderId}`, workOrder);
816
- }
817
- deleteWorkOrder(workOrderId) {
818
- return this.http.delete(`${this.url}/${workOrderId}`);
819
- }
820
- recalcWorkDates() {
821
- return this.http.get(`${this.url}/recalc-dates`);
822
- }
823
- // Change Orders
824
- readChangeOrders(workOrderId) {
825
- return this.http.get(`${this.url}/${workOrderId}/change-orders`);
826
- }
827
- readChangeOrder(workOrderId, changeOrderId) {
828
- return this.http.get(`${this.url}/${workOrderId}/change-orders/${changeOrderId}`);
829
- }
830
- createChangeOrder(workOrderId, changeOrder) {
831
- return this.http.post(`${this.url}/${workOrderId}/change-orders`, changeOrder);
832
- }
833
- updateChangeOrder(workOrderId, changeOrderId, changeOrder) {
834
- return this.http.put(`${this.url}/${workOrderId}/change-orders/${changeOrderId}`, changeOrder);
835
- }
836
- deleteChangeOrder(workOrderId, changeOrderId) {
837
- return this.http.delete(`${this.url}/${workOrderId}/change-orders/${changeOrderId}`);
838
- }
839
- confirmChangeOrder(token) {
840
- return this.http.get(`${this.env.baseUrl}api/change-orders/customer`, {
841
- params: {
842
- token: token
843
- }
844
- });
845
- }
846
- cancelChangeOrder(token) {
847
- return this.http.delete(`${this.env.baseUrl}api/change-orders/customer`, {
848
- params: {
849
- token: token
850
- }
851
- });
852
- }
853
- // Checklist
854
- createChecklists(workOrderId, refinishItemIds) {
855
- return this.http.get(`${this.url}/${workOrderId}/refinish-items/` + refinishItemIds.join(',') + '/pdfs', { responseType: "blob" });
856
- }
857
- createShopChecklist(workOrderId) {
858
- return this.http.get(`${this.url}/${workOrderId}/pdf`, { responseType: "blob" });
859
- }
860
- // Refinish Items
861
- readRefinishItems(workOrderId) {
862
- return this.http.get(`${this.url}/${workOrderId}/refinish-items`);
863
- }
864
- readRefinishItemCollection(workOrderId, itemIds) {
865
- return this.http.get(`${this.url}/${workOrderId}/refinish-items/collection/${itemIds.join(',')}`);
866
- }
867
- readRefinishItem(workOrderId, refinishItemId) {
868
- return this.http.get(`${this.url}/${workOrderId}/refinish-items/${refinishItemId}`);
869
- }
870
- createRefinishItems(workOrderId, refinishItems) {
871
- return this.http.post(`${this.url}/${workOrderId}/refinish-items/collection`, refinishItems);
872
- }
873
- updateRefinishItem(workOrderId, refinishItemId, refinishItem) {
874
- return this.http.put(`${this.url}/${workOrderId}/refinish-items/${refinishItemId}`, refinishItem);
875
- }
876
- deleteRefinishItem(workOrderId, refinishItemId) {
877
- return this.http.delete(`${this.url}/${workOrderId}/refinish-items/${refinishItemId}`);
878
- }
879
- // Milling Items
880
- readMillingItems(workOrderId) {
881
- return this.http.get(`${this.url}/${workOrderId}/milling-items`);
882
- }
883
- readMillingItem(workOrderId, millingItemId) {
884
- return this.http.get(`${this.url}/${workOrderId}/milling-items/${millingItemId}`);
885
- }
886
- createMillingItem(workOrderId, millingItem) {
887
- return this.http.post(`${this.url}/${workOrderId}/milling-items`, millingItem);
888
- }
889
- updateMillingItem(workOrderId, millingItemId, millingItem) {
890
- return this.http.put(`${this.url}/${workOrderId}/milling-items/${millingItemId}`, millingItem);
891
- }
892
- updateMillingItemCollection(workOrderId, itemIds, millingItems) {
893
- return this.http.put(`${this.url}/${workOrderId}/milling-items/collection/${itemIds.join(',')}`, millingItems);
894
- }
895
- deleteMillingItem(workOrderId, millingItemId) {
896
- return this.http.delete(`${this.url}/${workOrderId}/milling-items/${millingItemId}`);
897
- }
898
- // Report Items
899
- readReportMillingItems() {
900
- return this.http.get(`${this.env.baseUrl}api/report-milling-items`);
901
- }
902
- readReportRefinishItems() {
903
- return this.http.get(`${this.env.baseUrl}api/report-refinish-items`);
904
- }
905
- readPackageDetailTotals(startDate, endDate, statuses) {
906
- return this.http.get(`${this.url}/package-details/totals`, {
907
- params: {
908
- startDate: startDate.toUTCString(),
909
- endDate: endDate.toUTCString(),
910
- statuses: statuses.map(status => status.toString())
911
- }
912
- });
913
- }
914
- // Inventory Items
915
- readInventoryItems(workOrderId) {
916
- return this.http.get(`${this.url}/${workOrderId}/inventory-items`);
917
- }
918
- readInventoryItem(workOrderId, inventoryItemId) {
919
- return this.http.get(`${this.url}/${workOrderId}/inventory-items/${inventoryItemId}`);
920
- }
921
- createInventoryItem(workOrderId, inventoryItem) {
922
- return this.http.post(`${this.url}/${workOrderId}/inventory-items`, inventoryItem);
923
- }
924
- updateInventoryItem(workOrderId, inventoryItemId, inventoryItem) {
925
- return this.http.put(`${this.url}/${workOrderId}/inventory-items/${inventoryItemId}`, inventoryItem);
926
- }
927
- deleteInventoryItem(workOrderId, inventoryItemId) {
928
- return this.http.delete(`${this.url}/${workOrderId}/inventory-items/${inventoryItemId}`);
929
- }
930
- readInventoryItemCollection(workOrderId, itemIds) {
931
- return this.http.get(`${this.url}/${workOrderId}/inventory-items/collection/${itemIds.join(',')}`);
932
- }
933
- createInventoryItems(workOrderId, inventoryItems) {
934
- return this.http.post(`${this.url}/${workOrderId}/inventory-items/collection`, inventoryItems);
935
- }
936
- }
937
- WorkOrderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WorkOrderService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
938
- WorkOrderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WorkOrderService, providedIn: 'root' });
939
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WorkOrderService, decorators: [{
940
- type: Injectable,
941
- args: [{
942
- providedIn: 'root'
943
- }]
944
- }], ctorParameters: function () {
945
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
946
- type: Inject,
947
- args: ['env']
948
- }] }];
769
+ class WorkOrderService {
770
+ constructor(http, env) {
771
+ this.http = http;
772
+ this.env = env;
773
+ this.url = this.env.baseUrl + 'api/work-orders';
774
+ }
775
+ doWorkOrderAction(id, actionId) {
776
+ return this.http.get(`${this.url}/${id}/actions/${actionId}`);
777
+ }
778
+ readWorkOrders(statuses = null, id = null, customerName = null, customerEmail = null, serialNumber = null, orderTypes = null, projectTypes = null, users = null, specialOrder = null) {
779
+ return this.http.get(this.url, {
780
+ params: this.createWorkOrderParams(statuses, id, customerName, customerEmail, serialNumber, orderTypes, projectTypes, users, specialOrder)
781
+ });
782
+ }
783
+ readExportWorkOrders(statuses = null, id = null, customerName = null, customerEmail = null, serialNumber = null, orderTypes = null, projectTypes = null, users = null, specialOrder = null) {
784
+ return this.http.get(`${this.url}/export`, {
785
+ params: this.createWorkOrderParams(statuses, id, customerName, customerEmail, serialNumber, orderTypes, projectTypes, users, specialOrder)
786
+ });
787
+ }
788
+ createWorkOrderParams(statuses = null, id = null, customerName = null, customerEmail = null, serialNumber = null, orderTypes = null, projectTypes = null, users = null, specialOrder = null) {
789
+ const params = {};
790
+ if (statuses) {
791
+ params['statuses'] = statuses.map(status => status.toString());
792
+ }
793
+ if (id) {
794
+ params['id'] = id.toString();
795
+ }
796
+ if (customerName) {
797
+ params['customerName'] = customerName;
798
+ }
799
+ if (customerEmail) {
800
+ params['customerEmail'] = customerEmail;
801
+ }
802
+ if (serialNumber) {
803
+ params['serialNumber'] = serialNumber;
804
+ }
805
+ if (orderTypes !== null) {
806
+ params['orderTypes'] = orderTypes.map(type => type.toString());
807
+ }
808
+ if (projectTypes) {
809
+ params['projectTypes'] = projectTypes.map(t => t.toString());
810
+ }
811
+ if (users) {
812
+ params['users'] = users;
813
+ }
814
+ if (specialOrder) {
815
+ params['specialOrder'] = specialOrder.toString();
816
+ }
817
+ return params;
818
+ }
819
+ readWorkOrder(workOrderId) {
820
+ return this.http.get(`${this.url}/${workOrderId}`);
821
+ }
822
+ createWorkOrder(workOrder) {
823
+ return this.http.post(this.url, workOrder);
824
+ }
825
+ updateWorkOrder(workOrderId, workOrder) {
826
+ return this.http.put(`${this.url}/${workOrderId}`, workOrder);
827
+ }
828
+ deleteWorkOrder(workOrderId) {
829
+ return this.http.delete(`${this.url}/${workOrderId}`);
830
+ }
831
+ recalcWorkDates() {
832
+ return this.http.get(`${this.url}/recalc-dates`);
833
+ }
834
+ // Change Orders
835
+ readChangeOrders(workOrderId) {
836
+ return this.http.get(`${this.url}/${workOrderId}/change-orders`);
837
+ }
838
+ readChangeOrder(workOrderId, changeOrderId) {
839
+ return this.http.get(`${this.url}/${workOrderId}/change-orders/${changeOrderId}`);
840
+ }
841
+ createChangeOrder(workOrderId, changeOrder) {
842
+ return this.http.post(`${this.url}/${workOrderId}/change-orders`, changeOrder);
843
+ }
844
+ updateChangeOrder(workOrderId, changeOrderId, changeOrder) {
845
+ return this.http.put(`${this.url}/${workOrderId}/change-orders/${changeOrderId}`, changeOrder);
846
+ }
847
+ deleteChangeOrder(workOrderId, changeOrderId) {
848
+ return this.http.delete(`${this.url}/${workOrderId}/change-orders/${changeOrderId}`);
849
+ }
850
+ confirmChangeOrder(token) {
851
+ return this.http.get(`${this.env.baseUrl}api/change-orders/customer`, {
852
+ params: {
853
+ token: token
854
+ }
855
+ });
856
+ }
857
+ cancelChangeOrder(token) {
858
+ return this.http.delete(`${this.env.baseUrl}api/change-orders/customer`, {
859
+ params: {
860
+ token: token
861
+ }
862
+ });
863
+ }
864
+ // Checklist
865
+ createChecklists(workOrderId, refinishItemIds) {
866
+ return this.http.get(`${this.url}/${workOrderId}/refinish-items/` + refinishItemIds.join(',') + '/pdfs', { responseType: "blob" });
867
+ }
868
+ createShopChecklist(workOrderId) {
869
+ return this.http.get(`${this.url}/${workOrderId}/pdf`, { responseType: "blob" });
870
+ }
871
+ // Refinish Items
872
+ readRefinishItems(workOrderId) {
873
+ return this.http.get(`${this.url}/${workOrderId}/refinish-items`);
874
+ }
875
+ readRefinishItemCollection(workOrderId, itemIds) {
876
+ return this.http.get(`${this.url}/${workOrderId}/refinish-items/collection/${itemIds.join(',')}`);
877
+ }
878
+ readRefinishItem(workOrderId, refinishItemId) {
879
+ return this.http.get(`${this.url}/${workOrderId}/refinish-items/${refinishItemId}`);
880
+ }
881
+ createRefinishItems(workOrderId, refinishItems) {
882
+ return this.http.post(`${this.url}/${workOrderId}/refinish-items/collection`, refinishItems);
883
+ }
884
+ updateRefinishItem(workOrderId, refinishItemId, refinishItem) {
885
+ return this.http.put(`${this.url}/${workOrderId}/refinish-items/${refinishItemId}`, refinishItem);
886
+ }
887
+ deleteRefinishItem(workOrderId, refinishItemId) {
888
+ return this.http.delete(`${this.url}/${workOrderId}/refinish-items/${refinishItemId}`);
889
+ }
890
+ // Milling Items
891
+ readMillingItems(workOrderId) {
892
+ return this.http.get(`${this.url}/${workOrderId}/milling-items`);
893
+ }
894
+ readMillingItem(workOrderId, millingItemId) {
895
+ return this.http.get(`${this.url}/${workOrderId}/milling-items/${millingItemId}`);
896
+ }
897
+ createMillingItem(workOrderId, millingItem) {
898
+ return this.http.post(`${this.url}/${workOrderId}/milling-items`, millingItem);
899
+ }
900
+ updateMillingItem(workOrderId, millingItemId, millingItem) {
901
+ return this.http.put(`${this.url}/${workOrderId}/milling-items/${millingItemId}`, millingItem);
902
+ }
903
+ updateMillingItemCollection(workOrderId, itemIds, millingItems) {
904
+ return this.http.put(`${this.url}/${workOrderId}/milling-items/collection/${itemIds.join(',')}`, millingItems);
905
+ }
906
+ deleteMillingItem(workOrderId, millingItemId) {
907
+ return this.http.delete(`${this.url}/${workOrderId}/milling-items/${millingItemId}`);
908
+ }
909
+ // Report Items
910
+ readReportMillingItems() {
911
+ return this.http.get(`${this.env.baseUrl}api/report-milling-items`);
912
+ }
913
+ readReportRefinishItems() {
914
+ return this.http.get(`${this.env.baseUrl}api/report-refinish-items`);
915
+ }
916
+ readPackageDetailTotals(startDate, endDate, statuses) {
917
+ return this.http.get(`${this.url}/package-details/totals`, {
918
+ params: {
919
+ startDate: startDate.toUTCString(),
920
+ endDate: endDate.toUTCString(),
921
+ statuses: statuses.map(status => status.toString())
922
+ }
923
+ });
924
+ }
925
+ // Inventory Items
926
+ readInventoryItems(workOrderId) {
927
+ return this.http.get(`${this.url}/${workOrderId}/inventory-items`);
928
+ }
929
+ readInventoryItem(workOrderId, inventoryItemId) {
930
+ return this.http.get(`${this.url}/${workOrderId}/inventory-items/${inventoryItemId}`);
931
+ }
932
+ createInventoryItem(workOrderId, inventoryItem) {
933
+ return this.http.post(`${this.url}/${workOrderId}/inventory-items`, inventoryItem);
934
+ }
935
+ updateInventoryItem(workOrderId, inventoryItemId, inventoryItem) {
936
+ return this.http.put(`${this.url}/${workOrderId}/inventory-items/${inventoryItemId}`, inventoryItem);
937
+ }
938
+ deleteInventoryItem(workOrderId, inventoryItemId) {
939
+ return this.http.delete(`${this.url}/${workOrderId}/inventory-items/${inventoryItemId}`);
940
+ }
941
+ readInventoryItemCollection(workOrderId, itemIds) {
942
+ return this.http.get(`${this.url}/${workOrderId}/inventory-items/collection/${itemIds.join(',')}`);
943
+ }
944
+ createInventoryItems(workOrderId, inventoryItems) {
945
+ return this.http.post(`${this.url}/${workOrderId}/inventory-items/collection`, inventoryItems);
946
+ }
947
+ }
948
+ WorkOrderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WorkOrderService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
949
+ WorkOrderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WorkOrderService, providedIn: 'root' });
950
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WorkOrderService, decorators: [{
951
+ type: Injectable,
952
+ args: [{
953
+ providedIn: 'root'
954
+ }]
955
+ }], ctorParameters: function () {
956
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
957
+ type: Inject,
958
+ args: ['env']
959
+ }] }];
949
960
  } });
950
961
 
951
- class DealerService {
952
- constructor(http, env) {
953
- this.http = http;
954
- this.env = env;
955
- this.url = this.env.baseUrl + 'api/dealers';
956
- }
957
- readDealers(includeInactive = false) {
958
- return this.http.get(this.url, {
959
- params: {
960
- includeInactive: includeInactive.toString()
961
- }
962
- });
963
- }
964
- readDealer(id) {
965
- return this.http.get(`${this.url}/${id}`);
966
- }
967
- createDealer(dealer) {
968
- return this.http.post(this.url, dealer);
969
- }
970
- updateDealer(id, dealer) {
971
- return this.http.put(`${this.url}/${id}`, dealer);
972
- }
973
- deleteDealer(id) {
974
- return this.http.delete(`${this.url}/${id}`);
975
- }
976
- updateDealerCoupon(dealerId, couponId, dealerCoupon) {
977
- return this.http.put(`${this.url}/${dealerId}/coupons/${couponId}`, dealerCoupon);
978
- }
979
- }
980
- DealerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DealerService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
981
- DealerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DealerService, providedIn: 'root' });
982
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DealerService, decorators: [{
983
- type: Injectable,
984
- args: [{
985
- providedIn: 'root'
986
- }]
987
- }], ctorParameters: function () {
988
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
989
- type: Inject,
990
- args: ['env']
991
- }] }];
962
+ class DealerService {
963
+ constructor(http, env) {
964
+ this.http = http;
965
+ this.env = env;
966
+ this.url = this.env.baseUrl + 'api/dealers';
967
+ }
968
+ readDealers(includeInactive = false) {
969
+ return this.http.get(this.url, {
970
+ params: {
971
+ includeInactive: includeInactive.toString()
972
+ }
973
+ });
974
+ }
975
+ readDealer(id) {
976
+ return this.http.get(`${this.url}/${id}`);
977
+ }
978
+ createDealer(dealer) {
979
+ return this.http.post(this.url, dealer);
980
+ }
981
+ updateDealer(id, dealer) {
982
+ return this.http.put(`${this.url}/${id}`, dealer);
983
+ }
984
+ deleteDealer(id) {
985
+ return this.http.delete(`${this.url}/${id}`);
986
+ }
987
+ updateDealerCoupon(dealerId, couponId, dealerCoupon) {
988
+ return this.http.put(`${this.url}/${dealerId}/coupons/${couponId}`, dealerCoupon);
989
+ }
990
+ }
991
+ DealerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DealerService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
992
+ DealerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DealerService, providedIn: 'root' });
993
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DealerService, decorators: [{
994
+ type: Injectable,
995
+ args: [{
996
+ providedIn: 'root'
997
+ }]
998
+ }], ctorParameters: function () {
999
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1000
+ type: Inject,
1001
+ args: ['env']
1002
+ }] }];
992
1003
  } });
993
1004
 
994
- class FileUploadService {
995
- constructor(http, env) {
996
- this.http = http;
997
- this.env = env;
998
- this.url = this.env.baseUrl + 'api/uploads';
999
- }
1000
- deleteFile(fileName) {
1001
- return this.http.delete(`${this.url}/${fileName}`);
1002
- }
1003
- saveFile(file) {
1004
- const formData = new FormData();
1005
- formData.append('fileKey', file, file.name);
1006
- return this.http.post(this.url, formData, { responseType: "text" });
1007
- }
1008
- retrieveFile(fileName) {
1009
- return this.http.get(`${this.url}/${fileName}`, { responseType: 'blob' })
1010
- .pipe(switchMap((response) => {
1011
- return of(new File([response], fileName, { type: response.type }));
1012
- }));
1013
- }
1014
- }
1015
- FileUploadService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileUploadService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1016
- FileUploadService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileUploadService, providedIn: 'root' });
1017
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileUploadService, decorators: [{
1018
- type: Injectable,
1019
- args: [{
1020
- providedIn: 'root'
1021
- }]
1022
- }], ctorParameters: function () {
1023
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1024
- type: Inject,
1025
- args: ['env']
1026
- }] }];
1005
+ class FileUploadService {
1006
+ constructor(http, env) {
1007
+ this.http = http;
1008
+ this.env = env;
1009
+ this.url = this.env.baseUrl + 'api/uploads';
1010
+ }
1011
+ deleteFile(fileName) {
1012
+ return this.http.delete(`${this.url}/${fileName}`);
1013
+ }
1014
+ saveFile(file) {
1015
+ const formData = new FormData();
1016
+ formData.append('fileKey', file, file.name);
1017
+ return this.http.post(this.url, formData, { responseType: "text" });
1018
+ }
1019
+ retrieveFile(fileName) {
1020
+ return this.http.get(`${this.url}/${fileName}`, { responseType: 'blob' })
1021
+ .pipe(switchMap((response) => {
1022
+ return of(new File([response], fileName, { type: response.type }));
1023
+ }));
1024
+ }
1025
+ }
1026
+ FileUploadService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileUploadService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1027
+ FileUploadService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileUploadService, providedIn: 'root' });
1028
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileUploadService, decorators: [{
1029
+ type: Injectable,
1030
+ args: [{
1031
+ providedIn: 'root'
1032
+ }]
1033
+ }], ctorParameters: function () {
1034
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1035
+ type: Inject,
1036
+ args: ['env']
1037
+ }] }];
1027
1038
  } });
1028
1039
 
1029
- class WaitlistService {
1030
- constructor(http, env) {
1031
- this.http = http;
1032
- this.env = env;
1033
- this.url = this.env.baseUrl + 'api/waitlist-items';
1034
- }
1035
- retrieveWaitlistItems(statuses = null, id = null, customerName = null, customerEmail = null, serialNumber = null, workOrderTypes = null, projectTypes = null) {
1036
- const params = {};
1037
- if (statuses) {
1038
- params['statuses'] = statuses.map(status => status.toString());
1039
- }
1040
- if (id) {
1041
- params['id'] = id.toString();
1042
- }
1043
- if (customerName) {
1044
- params['customerName'] = customerName;
1045
- }
1046
- if (customerEmail) {
1047
- params['customerEmail'] = customerEmail;
1048
- }
1049
- if (serialNumber) {
1050
- params['serialNumber'] = serialNumber;
1051
- }
1052
- if (workOrderTypes) {
1053
- params['workOrderTypes'] = workOrderTypes.map(t => t.toString());
1054
- }
1055
- if (projectTypes) {
1056
- params['projectTypes'] = projectTypes.map(t => t.toString());
1057
- }
1058
- return this.http.get(this.url, {
1059
- params: params
1060
- });
1061
- }
1062
- retrieveWaitlistItem(id) {
1063
- return this.http.get(`${this.url}/${id}`);
1064
- }
1065
- createWaitlistItem(waitlistItem) {
1066
- return this.http.post(this.url, waitlistItem);
1067
- }
1068
- updateWaitlistItem(id, waitlistItem) {
1069
- return this.http.put(`${this.url}/${id}`, waitlistItem);
1070
- }
1071
- deleteWaitlistItem(id) {
1072
- return this.http.delete(`${this.url}/${id}`);
1073
- }
1074
- doWaitlistAction(id, actionId) {
1075
- return this.http.get(`${this.url}/${id}/actions/${actionId}`);
1076
- }
1077
- retrieveProjectPdf(id, projectId) {
1078
- return this.http.get(`${this.url}/${id}/projects/${projectId}/pdf`, { responseType: "blob" });
1079
- }
1080
- retrieveProjects(waitlistId) {
1081
- return this.http.get(`${this.url}/${waitlistId}/projects`);
1082
- }
1083
- retrieveProject(waitlistId, projectId) {
1084
- return this.http.get(`${this.url}/${waitlistId}/projects/${projectId}`);
1085
- }
1086
- createProject(waitlistId, project) {
1087
- return this.http.post(`${this.url}/${waitlistId}/projects`, project);
1088
- }
1089
- updateProject(waitlistId, projectId, project) {
1090
- return this.http.put(`${this.url}/${waitlistId}/projects/${projectId}`, project);
1091
- }
1092
- deleteProject(waitlistId, projectId) {
1093
- return this.http.delete(`${this.url}/${waitlistId}/projects/${projectId}`);
1094
- }
1095
- readPackageDetailTotals() {
1096
- return this.http.get(`${this.url}/package-details/totals`);
1097
- }
1098
- }
1099
- WaitlistService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WaitlistService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1100
- WaitlistService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WaitlistService, providedIn: 'root' });
1101
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WaitlistService, decorators: [{
1102
- type: Injectable,
1103
- args: [{
1104
- providedIn: 'root'
1105
- }]
1106
- }], ctorParameters: function () {
1107
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1108
- type: Inject,
1109
- args: ['env']
1110
- }] }];
1040
+ class WaitlistService {
1041
+ constructor(http, env) {
1042
+ this.http = http;
1043
+ this.env = env;
1044
+ this.url = this.env.baseUrl + 'api/waitlist-items';
1045
+ }
1046
+ retrieveWaitlistItems(statuses = null, id = null, customerName = null, customerEmail = null, serialNumber = null, workOrderTypes = null, projectTypes = null) {
1047
+ const params = {};
1048
+ if (statuses) {
1049
+ params['statuses'] = statuses.map(status => status.toString());
1050
+ }
1051
+ if (id) {
1052
+ params['id'] = id.toString();
1053
+ }
1054
+ if (customerName) {
1055
+ params['customerName'] = customerName;
1056
+ }
1057
+ if (customerEmail) {
1058
+ params['customerEmail'] = customerEmail;
1059
+ }
1060
+ if (serialNumber) {
1061
+ params['serialNumber'] = serialNumber;
1062
+ }
1063
+ if (workOrderTypes) {
1064
+ params['workOrderTypes'] = workOrderTypes.map(t => t.toString());
1065
+ }
1066
+ if (projectTypes) {
1067
+ params['projectTypes'] = projectTypes.map(t => t.toString());
1068
+ }
1069
+ return this.http.get(this.url, {
1070
+ params: params
1071
+ });
1072
+ }
1073
+ retrieveWaitlistItem(id) {
1074
+ return this.http.get(`${this.url}/${id}`);
1075
+ }
1076
+ createWaitlistItem(waitlistItem) {
1077
+ return this.http.post(this.url, waitlistItem);
1078
+ }
1079
+ updateWaitlistItem(id, waitlistItem) {
1080
+ return this.http.put(`${this.url}/${id}`, waitlistItem);
1081
+ }
1082
+ deleteWaitlistItem(id) {
1083
+ return this.http.delete(`${this.url}/${id}`);
1084
+ }
1085
+ doWaitlistAction(id, actionId) {
1086
+ return this.http.get(`${this.url}/${id}/actions/${actionId}`);
1087
+ }
1088
+ retrieveProjectPdf(id, projectId) {
1089
+ return this.http.get(`${this.url}/${id}/projects/${projectId}/pdf`, { responseType: "blob" });
1090
+ }
1091
+ retrieveProjects(waitlistId) {
1092
+ return this.http.get(`${this.url}/${waitlistId}/projects`);
1093
+ }
1094
+ retrieveProject(waitlistId, projectId) {
1095
+ return this.http.get(`${this.url}/${waitlistId}/projects/${projectId}`);
1096
+ }
1097
+ createProject(waitlistId, project) {
1098
+ return this.http.post(`${this.url}/${waitlistId}/projects`, project);
1099
+ }
1100
+ updateProject(waitlistId, projectId, project) {
1101
+ return this.http.put(`${this.url}/${waitlistId}/projects/${projectId}`, project);
1102
+ }
1103
+ deleteProject(waitlistId, projectId) {
1104
+ return this.http.delete(`${this.url}/${waitlistId}/projects/${projectId}`);
1105
+ }
1106
+ readPackageDetailTotals() {
1107
+ return this.http.get(`${this.url}/package-details/totals`);
1108
+ }
1109
+ }
1110
+ WaitlistService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WaitlistService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1111
+ WaitlistService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WaitlistService, providedIn: 'root' });
1112
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WaitlistService, decorators: [{
1113
+ type: Injectable,
1114
+ args: [{
1115
+ providedIn: 'root'
1116
+ }]
1117
+ }], ctorParameters: function () {
1118
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1119
+ type: Inject,
1120
+ args: ['env']
1121
+ }] }];
1111
1122
  } });
1112
1123
 
1113
- class ConfigurationService {
1114
- constructor(http, env) {
1115
- this.http = http;
1116
- this.env = env;
1117
- this.url = this.env.baseUrl + 'api/configs';
1118
- }
1119
- readConfigs() {
1120
- return this.http.get(this.url);
1121
- }
1122
- updateConfigs(configuration) {
1123
- return this.http.put(`${this.url}/1`, configuration);
1124
- }
1125
- }
1126
- ConfigurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ConfigurationService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1127
- ConfigurationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ConfigurationService, providedIn: 'root' });
1128
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ConfigurationService, decorators: [{
1129
- type: Injectable,
1130
- args: [{
1131
- providedIn: 'root'
1132
- }]
1133
- }], ctorParameters: function () {
1134
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1135
- type: Inject,
1136
- args: ['env']
1137
- }] }];
1124
+ class ConfigurationService {
1125
+ constructor(http, env) {
1126
+ this.http = http;
1127
+ this.env = env;
1128
+ this.url = this.env.baseUrl + 'api/configs';
1129
+ }
1130
+ readConfigs() {
1131
+ return this.http.get(this.url);
1132
+ }
1133
+ updateConfigs(configuration) {
1134
+ return this.http.put(`${this.url}/1`, configuration);
1135
+ }
1136
+ }
1137
+ ConfigurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ConfigurationService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1138
+ ConfigurationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ConfigurationService, providedIn: 'root' });
1139
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ConfigurationService, decorators: [{
1140
+ type: Injectable,
1141
+ args: [{
1142
+ providedIn: 'root'
1143
+ }]
1144
+ }], ctorParameters: function () {
1145
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1146
+ type: Inject,
1147
+ args: ['env']
1148
+ }] }];
1138
1149
  } });
1139
1150
 
1140
- class WaitlistCustomerService {
1141
- constructor(http, env) {
1142
- this.http = http;
1143
- this.env = env;
1144
- this.url = this.env.baseUrl + 'api/waitlist-items/customer';
1145
- }
1146
- readWaitlistItem(token) {
1147
- return this.http.get(this.url, {
1148
- params: { token: token }
1149
- });
1150
- }
1151
- updateWaitlistItem(token, waitlistItem) {
1152
- return this.http.put(`${this.url}/${waitlistItem.id}`, waitlistItem, {
1153
- params: { token: token }
1154
- });
1155
- }
1156
- cancelWaitlistItem(token) {
1157
- return this.http.delete(`${this.url}`, {
1158
- params: { token: token }
1159
- });
1160
- }
1161
- }
1162
- WaitlistCustomerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WaitlistCustomerService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1163
- WaitlistCustomerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WaitlistCustomerService, providedIn: 'root' });
1164
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WaitlistCustomerService, decorators: [{
1165
- type: Injectable,
1166
- args: [{
1167
- providedIn: 'root'
1168
- }]
1169
- }], ctorParameters: function () {
1170
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1171
- type: Inject,
1172
- args: ['env']
1173
- }] }];
1151
+ class WaitlistCustomerService {
1152
+ constructor(http, env) {
1153
+ this.http = http;
1154
+ this.env = env;
1155
+ this.url = this.env.baseUrl + 'api/waitlist-items/customer';
1156
+ }
1157
+ readWaitlistItem(token) {
1158
+ return this.http.get(this.url, {
1159
+ params: { token: token }
1160
+ });
1161
+ }
1162
+ updateWaitlistItem(token, waitlistItem) {
1163
+ return this.http.put(`${this.url}/${waitlistItem.id}`, waitlistItem, {
1164
+ params: { token: token }
1165
+ });
1166
+ }
1167
+ cancelWaitlistItem(token) {
1168
+ return this.http.delete(`${this.url}`, {
1169
+ params: { token: token }
1170
+ });
1171
+ }
1172
+ }
1173
+ WaitlistCustomerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WaitlistCustomerService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1174
+ WaitlistCustomerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WaitlistCustomerService, providedIn: 'root' });
1175
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WaitlistCustomerService, decorators: [{
1176
+ type: Injectable,
1177
+ args: [{
1178
+ providedIn: 'root'
1179
+ }]
1180
+ }], ctorParameters: function () {
1181
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1182
+ type: Inject,
1183
+ args: ['env']
1184
+ }] }];
1174
1185
  } });
1175
1186
 
1176
- class OpticService {
1177
- constructor(http, env) {
1178
- this.http = http;
1179
- this.env = env;
1180
- this.url = this.env.baseUrl + 'api/optics';
1181
- }
1182
- readOptics(includeInactive = false) {
1183
- return this.http.get(this.url, {
1184
- params: {
1185
- includeInactive: includeInactive.toString()
1186
- }
1187
- });
1188
- }
1189
- readOptic(opticId) {
1190
- return this.http.get(`${this.url}/${opticId}`);
1191
- }
1192
- createOptic(optic) {
1193
- return this.http.post(this.url, optic);
1194
- }
1195
- updateOptic(opticId, optic) {
1196
- return this.http.put(`${this.url}/${opticId}`, optic);
1197
- }
1198
- deleteOptic(opticId) {
1199
- return this.http.delete(`${this.url}/${opticId}`);
1200
- }
1201
- }
1202
- OpticService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: OpticService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1203
- OpticService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: OpticService, providedIn: 'root' });
1204
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: OpticService, decorators: [{
1205
- type: Injectable,
1206
- args: [{
1207
- providedIn: 'root'
1208
- }]
1209
- }], ctorParameters: function () {
1210
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1211
- type: Inject,
1212
- args: ['env']
1213
- }] }];
1187
+ class OpticService {
1188
+ constructor(http, env) {
1189
+ this.http = http;
1190
+ this.env = env;
1191
+ this.url = this.env.baseUrl + 'api/optics';
1192
+ }
1193
+ readOptics(includeInactive = false) {
1194
+ return this.http.get(this.url, {
1195
+ params: {
1196
+ includeInactive: includeInactive.toString()
1197
+ }
1198
+ });
1199
+ }
1200
+ readOptic(opticId) {
1201
+ return this.http.get(`${this.url}/${opticId}`);
1202
+ }
1203
+ createOptic(optic) {
1204
+ return this.http.post(this.url, optic);
1205
+ }
1206
+ updateOptic(opticId, optic) {
1207
+ return this.http.put(`${this.url}/${opticId}`, optic);
1208
+ }
1209
+ deleteOptic(opticId) {
1210
+ return this.http.delete(`${this.url}/${opticId}`);
1211
+ }
1212
+ }
1213
+ OpticService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: OpticService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1214
+ OpticService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: OpticService, providedIn: 'root' });
1215
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: OpticService, decorators: [{
1216
+ type: Injectable,
1217
+ args: [{
1218
+ providedIn: 'root'
1219
+ }]
1220
+ }], ctorParameters: function () {
1221
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1222
+ type: Inject,
1223
+ args: ['env']
1224
+ }] }];
1214
1225
  } });
1215
1226
 
1216
- class ProductService {
1217
- constructor(http, env) {
1218
- this.http = http;
1219
- this.env = env;
1220
- this.url = this.env.baseUrl + 'api/products';
1221
- }
1222
- readProducts(sku) {
1223
- return this.http.get(this.url, { params: { sku: sku } });
1224
- }
1225
- readProductBundleItems(id) {
1226
- return this.http.get(`${this.url}/${id}/bundle-items`);
1227
- }
1228
- }
1229
- ProductService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ProductService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1230
- ProductService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ProductService, providedIn: 'root' });
1231
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ProductService, decorators: [{
1232
- type: Injectable,
1233
- args: [{
1234
- providedIn: 'root'
1235
- }]
1236
- }], ctorParameters: function () {
1237
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1238
- type: Inject,
1239
- args: ['env']
1240
- }] }];
1227
+ class ProductService {
1228
+ constructor(http, env) {
1229
+ this.http = http;
1230
+ this.env = env;
1231
+ this.url = this.env.baseUrl + 'api/products';
1232
+ }
1233
+ readProducts(sku) {
1234
+ return this.http.get(this.url, { params: { sku: sku } });
1235
+ }
1236
+ readProductBundleItems(id) {
1237
+ return this.http.get(`${this.url}/${id}/bundle-items`);
1238
+ }
1239
+ }
1240
+ ProductService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ProductService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1241
+ ProductService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ProductService, providedIn: 'root' });
1242
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ProductService, decorators: [{
1243
+ type: Injectable,
1244
+ args: [{
1245
+ providedIn: 'root'
1246
+ }]
1247
+ }], ctorParameters: function () {
1248
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1249
+ type: Inject,
1250
+ args: ['env']
1251
+ }] }];
1241
1252
  } });
1242
1253
 
1243
- class FirearmSeriesService {
1244
- constructor(http, env) {
1245
- this.http = http;
1246
- this.env = env;
1247
- this.url = this.env.baseUrl + 'api/firearm-serieses';
1248
- }
1249
- readSerieses(includeInactive = false) {
1250
- return this.http.get(this.url, {
1251
- params: {
1252
- includeInactive: includeInactive.toString()
1253
- }
1254
- });
1255
- }
1256
- readSeries(firearmSeriesId) {
1257
- return this.http.get(`${this.url}/${firearmSeriesId}`);
1258
- }
1259
- createSeries(firearmSeries) {
1260
- return this.http.post(this.url, firearmSeries);
1261
- }
1262
- updateSeries(firearmSeriesId, firearmSeries) {
1263
- return this.http.put(`${this.url}/${firearmSeriesId}`, firearmSeries);
1264
- }
1265
- deleteSeries(firearmSeriesId) {
1266
- return this.http.delete(`${this.url}/${firearmSeriesId}`);
1267
- }
1268
- readSeriesOptics(firearmSeriesId) {
1269
- return this.http.get(`${this.url}/${firearmSeriesId}/optics`);
1270
- }
1271
- }
1272
- FirearmSeriesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FirearmSeriesService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1273
- FirearmSeriesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FirearmSeriesService, providedIn: 'root' });
1274
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FirearmSeriesService, decorators: [{
1275
- type: Injectable,
1276
- args: [{
1277
- providedIn: 'root'
1278
- }]
1279
- }], ctorParameters: function () {
1280
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1281
- type: Inject,
1282
- args: ['env']
1283
- }] }];
1254
+ class FirearmSeriesService {
1255
+ constructor(http, env) {
1256
+ this.http = http;
1257
+ this.env = env;
1258
+ this.url = this.env.baseUrl + 'api/firearm-serieses';
1259
+ }
1260
+ readSerieses(includeInactive = false) {
1261
+ return this.http.get(this.url, {
1262
+ params: {
1263
+ includeInactive: includeInactive.toString()
1264
+ }
1265
+ });
1266
+ }
1267
+ readSeries(firearmSeriesId) {
1268
+ return this.http.get(`${this.url}/${firearmSeriesId}`);
1269
+ }
1270
+ createSeries(firearmSeries) {
1271
+ return this.http.post(this.url, firearmSeries);
1272
+ }
1273
+ updateSeries(firearmSeriesId, firearmSeries) {
1274
+ return this.http.put(`${this.url}/${firearmSeriesId}`, firearmSeries);
1275
+ }
1276
+ deleteSeries(firearmSeriesId) {
1277
+ return this.http.delete(`${this.url}/${firearmSeriesId}`);
1278
+ }
1279
+ readSeriesOptics(firearmSeriesId) {
1280
+ return this.http.get(`${this.url}/${firearmSeriesId}/optics`);
1281
+ }
1282
+ }
1283
+ FirearmSeriesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FirearmSeriesService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1284
+ FirearmSeriesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FirearmSeriesService, providedIn: 'root' });
1285
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FirearmSeriesService, decorators: [{
1286
+ type: Injectable,
1287
+ args: [{
1288
+ providedIn: 'root'
1289
+ }]
1290
+ }], ctorParameters: function () {
1291
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1292
+ type: Inject,
1293
+ args: ['env']
1294
+ }] }];
1284
1295
  } });
1285
1296
 
1286
- class MillingTypeService {
1287
- constructor(http, env) {
1288
- this.http = http;
1289
- this.env = env;
1290
- this.url = this.env.baseUrl + 'api/milling-types';
1291
- }
1292
- readMillingTypes(includeInactive = false) {
1293
- const params = {};
1294
- if (includeInactive) {
1295
- params['includeInactive'] = includeInactive.toString();
1296
- }
1297
- return this.http.get(this.url, {
1298
- params: params
1299
- });
1300
- }
1301
- readCosmeticMillings(includeInactive = false) {
1302
- const params = {};
1303
- if (includeInactive) {
1304
- params['includeInactive'] = includeInactive.toString();
1305
- }
1306
- return this.http.get(`${this.url}/cosmetics`, {
1307
- params: params
1308
- });
1309
- }
1310
- readMillingType(id) {
1311
- return this.http.get(`${this.url}/${id}`);
1312
- }
1313
- createMillingType(millingType) {
1314
- return this.http.post(this.url, millingType);
1315
- }
1316
- updateMillingType(id, millingType) {
1317
- return this.http.put(`${this.url}/${id}`, millingType);
1318
- }
1319
- deleteMillingType(id) {
1320
- return this.http.delete(`${this.url}/${id}`);
1321
- }
1322
- }
1323
- MillingTypeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MillingTypeService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1324
- MillingTypeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MillingTypeService, providedIn: 'root' });
1325
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MillingTypeService, decorators: [{
1326
- type: Injectable,
1327
- args: [{
1328
- providedIn: 'root'
1329
- }]
1330
- }], ctorParameters: function () {
1331
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1332
- type: Inject,
1333
- args: ['env']
1334
- }] }];
1297
+ class MillingTypeService {
1298
+ constructor(http, env) {
1299
+ this.http = http;
1300
+ this.env = env;
1301
+ this.url = this.env.baseUrl + 'api/milling-types';
1302
+ }
1303
+ readMillingTypes(includeInactive = false) {
1304
+ const params = {};
1305
+ if (includeInactive) {
1306
+ params['includeInactive'] = includeInactive.toString();
1307
+ }
1308
+ return this.http.get(this.url, {
1309
+ params: params
1310
+ });
1311
+ }
1312
+ readCosmeticMillings(includeInactive = false) {
1313
+ const params = {};
1314
+ if (includeInactive) {
1315
+ params['includeInactive'] = includeInactive.toString();
1316
+ }
1317
+ return this.http.get(`${this.url}/cosmetics`, {
1318
+ params: params
1319
+ });
1320
+ }
1321
+ readMillingType(id) {
1322
+ return this.http.get(`${this.url}/${id}`);
1323
+ }
1324
+ createMillingType(millingType) {
1325
+ return this.http.post(this.url, millingType);
1326
+ }
1327
+ updateMillingType(id, millingType) {
1328
+ return this.http.put(`${this.url}/${id}`, millingType);
1329
+ }
1330
+ deleteMillingType(id) {
1331
+ return this.http.delete(`${this.url}/${id}`);
1332
+ }
1333
+ }
1334
+ MillingTypeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MillingTypeService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1335
+ MillingTypeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MillingTypeService, providedIn: 'root' });
1336
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MillingTypeService, decorators: [{
1337
+ type: Injectable,
1338
+ args: [{
1339
+ providedIn: 'root'
1340
+ }]
1341
+ }], ctorParameters: function () {
1342
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1343
+ type: Inject,
1344
+ args: ['env']
1345
+ }] }];
1335
1346
  } });
1336
1347
 
1337
- class CoatingService {
1338
- constructor(http, env) {
1339
- this.http = http;
1340
- this.env = env;
1341
- this.url = this.env.baseUrl + 'api/coatings';
1342
- }
1343
- readCoatings(includeInactive = false) {
1344
- const params = {
1345
- includeInactive: includeInactive.toString()
1346
- };
1347
- return this.http.get(this.url, {
1348
- params: params
1349
- });
1350
- }
1351
- readCoating(id) {
1352
- return this.http.get(`${this.url}/${id}`);
1353
- }
1354
- createCoating(coating) {
1355
- return this.http.post(this.url, coating);
1356
- }
1357
- updateCoating(id, coating) {
1358
- return this.http.put(`${this.url}/${id}`, coating);
1359
- }
1360
- deleteCoating(id) {
1361
- return this.http.delete(`${this.url}/${id}`);
1362
- }
1363
- // Coating Values
1364
- readCoatingValues(coatingId, includeInactive = false) {
1365
- return this.http.get(`${this.url}/${coatingId}/coating-values`, {
1366
- params: {
1367
- includeInactive: includeInactive.toString()
1368
- }
1369
- });
1370
- }
1371
- readCoatingValue(coatingId, coatingValueId) {
1372
- return this.http.get(`${this.url}/${coatingId}/coating-values/${coatingValueId}`);
1373
- }
1374
- createCoatingValue(coatingId, coatingValue) {
1375
- return this.http.post(`${this.url}/${coatingId}/coating-values`, coatingValue);
1376
- }
1377
- updateCoatingValue(coatingId, coatingValueId, coatingValue) {
1378
- return this.http.put(`${this.url}/${coatingId}/coating-values/${coatingValueId}`, coatingValue);
1379
- }
1380
- deleteCoatingValue(coatingId, coatingValueId) {
1381
- return this.http.delete(`${this.url}/${coatingId}/coating-values/${coatingValueId}`);
1382
- }
1383
- }
1384
- CoatingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CoatingService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1385
- CoatingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CoatingService, providedIn: 'root' });
1386
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CoatingService, decorators: [{
1387
- type: Injectable,
1388
- args: [{
1389
- providedIn: 'root'
1390
- }]
1391
- }], ctorParameters: function () {
1392
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1393
- type: Inject,
1394
- args: ['env']
1395
- }] }];
1348
+ class CoatingService {
1349
+ constructor(http, env) {
1350
+ this.http = http;
1351
+ this.env = env;
1352
+ this.url = this.env.baseUrl + 'api/coatings';
1353
+ }
1354
+ readCoatings(includeInactive = false) {
1355
+ const params = {
1356
+ includeInactive: includeInactive.toString()
1357
+ };
1358
+ return this.http.get(this.url, {
1359
+ params: params
1360
+ });
1361
+ }
1362
+ readCoating(id) {
1363
+ return this.http.get(`${this.url}/${id}`);
1364
+ }
1365
+ createCoating(coating) {
1366
+ return this.http.post(this.url, coating);
1367
+ }
1368
+ updateCoating(id, coating) {
1369
+ return this.http.put(`${this.url}/${id}`, coating);
1370
+ }
1371
+ deleteCoating(id) {
1372
+ return this.http.delete(`${this.url}/${id}`);
1373
+ }
1374
+ // Coating Values
1375
+ readCoatingValues(coatingId, includeInactive = false) {
1376
+ return this.http.get(`${this.url}/${coatingId}/coating-values`, {
1377
+ params: {
1378
+ includeInactive: includeInactive.toString()
1379
+ }
1380
+ });
1381
+ }
1382
+ readCoatingValue(coatingId, coatingValueId) {
1383
+ return this.http.get(`${this.url}/${coatingId}/coating-values/${coatingValueId}`);
1384
+ }
1385
+ createCoatingValue(coatingId, coatingValue) {
1386
+ return this.http.post(`${this.url}/${coatingId}/coating-values`, coatingValue);
1387
+ }
1388
+ updateCoatingValue(coatingId, coatingValueId, coatingValue) {
1389
+ return this.http.put(`${this.url}/${coatingId}/coating-values/${coatingValueId}`, coatingValue);
1390
+ }
1391
+ deleteCoatingValue(coatingId, coatingValueId) {
1392
+ return this.http.delete(`${this.url}/${coatingId}/coating-values/${coatingValueId}`);
1393
+ }
1394
+ }
1395
+ CoatingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CoatingService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1396
+ CoatingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CoatingService, providedIn: 'root' });
1397
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CoatingService, decorators: [{
1398
+ type: Injectable,
1399
+ args: [{
1400
+ providedIn: 'root'
1401
+ }]
1402
+ }], ctorParameters: function () {
1403
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1404
+ type: Inject,
1405
+ args: ['env']
1406
+ }] }];
1396
1407
  } });
1397
1408
 
1398
- class MaterialService {
1399
- constructor(http, env) {
1400
- this.http = http;
1401
- this.env = env;
1402
- this.url = this.env.baseUrl + 'api/materials';
1403
- }
1404
- readMaterials(includeInactive = false) {
1405
- return this.http.get(this.url, {
1406
- params: {
1407
- includeInactive: includeInactive.toString()
1408
- }
1409
- });
1410
- }
1411
- }
1412
- MaterialService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MaterialService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1413
- MaterialService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MaterialService, providedIn: 'root' });
1414
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MaterialService, decorators: [{
1415
- type: Injectable,
1416
- args: [{
1417
- providedIn: 'root'
1418
- }]
1419
- }], ctorParameters: function () {
1420
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1421
- type: Inject,
1422
- args: ['env']
1423
- }] }];
1409
+ class MaterialService {
1410
+ constructor(http, env) {
1411
+ this.http = http;
1412
+ this.env = env;
1413
+ this.url = this.env.baseUrl + 'api/materials';
1414
+ }
1415
+ readMaterials(includeInactive = false) {
1416
+ return this.http.get(this.url, {
1417
+ params: {
1418
+ includeInactive: includeInactive.toString()
1419
+ }
1420
+ });
1421
+ }
1422
+ }
1423
+ MaterialService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MaterialService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1424
+ MaterialService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MaterialService, providedIn: 'root' });
1425
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MaterialService, decorators: [{
1426
+ type: Injectable,
1427
+ args: [{
1428
+ providedIn: 'root'
1429
+ }]
1430
+ }], ctorParameters: function () {
1431
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1432
+ type: Inject,
1433
+ args: ['env']
1434
+ }] }];
1424
1435
  } });
1425
1436
 
1426
- class PurchaseOrderService {
1427
- constructor(http, env) {
1428
- this.http = http;
1429
- this.env = env;
1430
- this.url = this.env.baseUrl + 'api/purchase-orders';
1431
- }
1432
- readPurchaseOrders(statuses = null, id = null, date = null, vendorId = null, serialNumber = null) {
1433
- const params = {};
1434
- if (statuses) {
1435
- params['statuses'] = statuses.map(s => s.toString());
1436
- }
1437
- if (id) {
1438
- params['id'] = id;
1439
- }
1440
- if (date) {
1441
- params['date'] = date.toUTCString();
1442
- }
1443
- if (vendorId) {
1444
- params['vendorId'] = vendorId;
1445
- }
1446
- if (serialNumber) {
1447
- params['serialNumber'] = serialNumber;
1448
- }
1449
- return this.http.get(this.url, {
1450
- params: params
1451
- });
1452
- }
1453
- readPurchaseOrder(id) {
1454
- return this.http.get(`${this.url}/${id}`);
1455
- }
1456
- createPurchaseOrder(purchaseOrder) {
1457
- return this.http.post(this.url, purchaseOrder);
1458
- }
1459
- updatePurchaseOrder(id, purchaseOrder) {
1460
- return this.http.put(`${this.url}/${id}`, purchaseOrder);
1461
- }
1462
- deletePurchaseOrder(id) {
1463
- return this.http.delete(`${this.url}/${id}`);
1464
- }
1465
- getRefinishItems() {
1466
- return this.http.get(`${this.env.baseUrl}api/purchase-order-refinish-items`);
1467
- }
1468
- // Refinish Items
1469
- readRefinishItemCollection(purchaseOrderId, itemIds) {
1470
- return this.http.get(`${this.url}/${purchaseOrderId}/refinish-items/collection/${itemIds.join(',')}`);
1471
- }
1472
- readRefinishItem(purchaseOrderId, refinishItemId) {
1473
- return this.http.get(`${this.url}/${purchaseOrderId}/refinish-items/${refinishItemId}`);
1474
- }
1475
- createRefinishItem(purchaseOrderId, refinishItem) {
1476
- return this.http.post(`${this.url}/${purchaseOrderId}/refinish-items`, refinishItem);
1477
- }
1478
- createRefinishItemCollection(purchaseOrderId, refinishItems) {
1479
- return this.http.post(`${this.url}/${purchaseOrderId}/refinish-items/collection`, refinishItems);
1480
- }
1481
- updateRefinishItem(purchaseOrderId, refinishItemId, refinishItem) {
1482
- return this.http.put(`${this.url}/${purchaseOrderId}/refinish-items/${refinishItemId}`, refinishItem);
1483
- }
1484
- updateRefinishItemCollection(purchaseOrderId, itemIds, refinishItems) {
1485
- return this.http.put(`${this.url}/${purchaseOrderId}/refinish-items/collection/${itemIds.join(',')}`, refinishItems);
1486
- }
1487
- deleteRefinishItem(purchaseOrderId, refinishItemId) {
1488
- return this.http.delete(`${this.url}/${purchaseOrderId}/refinish-items/${refinishItemId}`);
1489
- }
1490
- getPdf(purchaseOrderId) {
1491
- return this.http.get(`${this.url}/${purchaseOrderId}/pdf`, { responseType: "blob" });
1492
- }
1493
- getBatf(purchaseOrderId) {
1494
- return this.http.get(`${this.url}/${purchaseOrderId}/batf`, { responseType: "blob" });
1495
- }
1496
- }
1497
- PurchaseOrderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PurchaseOrderService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1498
- PurchaseOrderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PurchaseOrderService, providedIn: 'root' });
1499
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PurchaseOrderService, decorators: [{
1500
- type: Injectable,
1501
- args: [{
1502
- providedIn: 'root'
1503
- }]
1504
- }], ctorParameters: function () {
1505
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1506
- type: Inject,
1507
- args: ['env']
1508
- }] }];
1437
+ class PurchaseOrderService {
1438
+ constructor(http, env) {
1439
+ this.http = http;
1440
+ this.env = env;
1441
+ this.url = this.env.baseUrl + 'api/purchase-orders';
1442
+ }
1443
+ readPurchaseOrders(statuses = null, id = null, date = null, vendorId = null, serialNumber = null) {
1444
+ const params = {};
1445
+ if (statuses) {
1446
+ params['statuses'] = statuses.map(s => s.toString());
1447
+ }
1448
+ if (id) {
1449
+ params['id'] = id;
1450
+ }
1451
+ if (date) {
1452
+ params['date'] = date.toUTCString();
1453
+ }
1454
+ if (vendorId) {
1455
+ params['vendorId'] = vendorId;
1456
+ }
1457
+ if (serialNumber) {
1458
+ params['serialNumber'] = serialNumber;
1459
+ }
1460
+ return this.http.get(this.url, {
1461
+ params: params
1462
+ });
1463
+ }
1464
+ readPurchaseOrder(id) {
1465
+ return this.http.get(`${this.url}/${id}`);
1466
+ }
1467
+ createPurchaseOrder(purchaseOrder) {
1468
+ return this.http.post(this.url, purchaseOrder);
1469
+ }
1470
+ updatePurchaseOrder(id, purchaseOrder) {
1471
+ return this.http.put(`${this.url}/${id}`, purchaseOrder);
1472
+ }
1473
+ deletePurchaseOrder(id) {
1474
+ return this.http.delete(`${this.url}/${id}`);
1475
+ }
1476
+ getRefinishItems() {
1477
+ return this.http.get(`${this.env.baseUrl}api/purchase-order-refinish-items`);
1478
+ }
1479
+ // Refinish Items
1480
+ readRefinishItemCollection(purchaseOrderId, itemIds) {
1481
+ return this.http.get(`${this.url}/${purchaseOrderId}/refinish-items/collection/${itemIds.join(',')}`);
1482
+ }
1483
+ readRefinishItem(purchaseOrderId, refinishItemId) {
1484
+ return this.http.get(`${this.url}/${purchaseOrderId}/refinish-items/${refinishItemId}`);
1485
+ }
1486
+ createRefinishItem(purchaseOrderId, refinishItem) {
1487
+ return this.http.post(`${this.url}/${purchaseOrderId}/refinish-items`, refinishItem);
1488
+ }
1489
+ createRefinishItemCollection(purchaseOrderId, refinishItems) {
1490
+ return this.http.post(`${this.url}/${purchaseOrderId}/refinish-items/collection`, refinishItems);
1491
+ }
1492
+ updateRefinishItem(purchaseOrderId, refinishItemId, refinishItem) {
1493
+ return this.http.put(`${this.url}/${purchaseOrderId}/refinish-items/${refinishItemId}`, refinishItem);
1494
+ }
1495
+ updateRefinishItemCollection(purchaseOrderId, itemIds, refinishItems) {
1496
+ return this.http.put(`${this.url}/${purchaseOrderId}/refinish-items/collection/${itemIds.join(',')}`, refinishItems);
1497
+ }
1498
+ deleteRefinishItem(purchaseOrderId, refinishItemId) {
1499
+ return this.http.delete(`${this.url}/${purchaseOrderId}/refinish-items/${refinishItemId}`);
1500
+ }
1501
+ getPdf(purchaseOrderId) {
1502
+ return this.http.get(`${this.url}/${purchaseOrderId}/pdf`, { responseType: "blob" });
1503
+ }
1504
+ getBatf(purchaseOrderId) {
1505
+ return this.http.get(`${this.url}/${purchaseOrderId}/batf`, { responseType: "blob" });
1506
+ }
1507
+ }
1508
+ PurchaseOrderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PurchaseOrderService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1509
+ PurchaseOrderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PurchaseOrderService, providedIn: 'root' });
1510
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PurchaseOrderService, decorators: [{
1511
+ type: Injectable,
1512
+ args: [{
1513
+ providedIn: 'root'
1514
+ }]
1515
+ }], ctorParameters: function () {
1516
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1517
+ type: Inject,
1518
+ args: ['env']
1519
+ }] }];
1509
1520
  } });
1510
1521
 
1511
- class UserService {
1512
- constructor(http, env) {
1513
- this.http = http;
1514
- this.env = env;
1515
- this.url = this.env.baseUrl + 'api/users';
1516
- }
1517
- readUsers() {
1518
- return this.http.get(this.url);
1519
- }
1520
- }
1521
- UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: UserService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1522
- UserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: UserService, providedIn: 'root' });
1523
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: UserService, decorators: [{
1524
- type: Injectable,
1525
- args: [{
1526
- providedIn: 'root'
1527
- }]
1528
- }], ctorParameters: function () {
1529
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1530
- type: Inject,
1531
- args: ['env']
1532
- }] }];
1522
+ class UserService {
1523
+ constructor(http, env) {
1524
+ this.http = http;
1525
+ this.env = env;
1526
+ this.url = this.env.baseUrl + 'api/users';
1527
+ }
1528
+ readUsers() {
1529
+ return this.http.get(this.url);
1530
+ }
1531
+ }
1532
+ UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: UserService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1533
+ UserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: UserService, providedIn: 'root' });
1534
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: UserService, decorators: [{
1535
+ type: Injectable,
1536
+ args: [{
1537
+ providedIn: 'root'
1538
+ }]
1539
+ }], ctorParameters: function () {
1540
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1541
+ type: Inject,
1542
+ args: ['env']
1543
+ }] }];
1533
1544
  } });
1534
1545
 
1535
- class WaitlistProjectService {
1536
- constructor(http, env) {
1537
- this.http = http;
1538
- this.env = env;
1539
- this.url = this.env.baseUrl + 'api/waitlist-projects';
1540
- }
1541
- readRefinishDetails(projectId) {
1542
- return this.http.get(`${this.url}/${projectId}/refinish-details`);
1543
- }
1544
- updateRefinishDetails(projectId, details) {
1545
- return this.http.put(`${this.url}/${projectId}/refinish-details`, details);
1546
- }
1547
- readMillingDetail(projectId) {
1548
- return this.http.get(`${this.url}/${projectId}/milling-details`);
1549
- }
1550
- createMillingDetail(projectId, detail) {
1551
- return this.http.post(`${this.url}/${projectId}/milling-details`, detail);
1552
- }
1553
- updateMillingDetail(projectId, detailId, detail) {
1554
- return this.http.put(`${this.url}/${projectId}/milling-details/${detailId}`, detail);
1555
- }
1556
- }
1557
- WaitlistProjectService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WaitlistProjectService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1558
- WaitlistProjectService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WaitlistProjectService, providedIn: 'root' });
1559
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WaitlistProjectService, decorators: [{
1560
- type: Injectable,
1561
- args: [{
1562
- providedIn: 'root'
1563
- }]
1564
- }], ctorParameters: function () {
1565
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1566
- type: Inject,
1567
- args: ['env']
1568
- }] }];
1546
+ class WaitlistProjectService {
1547
+ constructor(http, env) {
1548
+ this.http = http;
1549
+ this.env = env;
1550
+ this.url = this.env.baseUrl + 'api/waitlist-projects';
1551
+ }
1552
+ readRefinishDetails(projectId) {
1553
+ return this.http.get(`${this.url}/${projectId}/refinish-details`);
1554
+ }
1555
+ updateRefinishDetails(projectId, details) {
1556
+ return this.http.put(`${this.url}/${projectId}/refinish-details`, details);
1557
+ }
1558
+ readMillingDetail(projectId) {
1559
+ return this.http.get(`${this.url}/${projectId}/milling-details`);
1560
+ }
1561
+ createMillingDetail(projectId, detail) {
1562
+ return this.http.post(`${this.url}/${projectId}/milling-details`, detail);
1563
+ }
1564
+ updateMillingDetail(projectId, detailId, detail) {
1565
+ return this.http.put(`${this.url}/${projectId}/milling-details/${detailId}`, detail);
1566
+ }
1567
+ }
1568
+ WaitlistProjectService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WaitlistProjectService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1569
+ WaitlistProjectService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WaitlistProjectService, providedIn: 'root' });
1570
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WaitlistProjectService, decorators: [{
1571
+ type: Injectable,
1572
+ args: [{
1573
+ providedIn: 'root'
1574
+ }]
1575
+ }], ctorParameters: function () {
1576
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1577
+ type: Inject,
1578
+ args: ['env']
1579
+ }] }];
1569
1580
  } });
1570
1581
 
1571
- class InventoryService {
1572
- constructor(http, env) {
1573
- this.http = http;
1574
- this.env = env;
1575
- this.url = this.env.baseUrl + 'api/inventory-items';
1576
- }
1577
- readInventoryItems(includeInactive = false, search = null) {
1578
- const params = {
1579
- includeInactive: includeInactive.toString()
1580
- };
1581
- if (search !== null) {
1582
- params['search'] = search;
1583
- }
1584
- return this.http.get(this.url, { params: params });
1585
- }
1586
- updateInventoryItem(id, item) {
1587
- return this.http.put(`${this.url}/${id}`, item);
1588
- }
1589
- createInventoryItem(item) {
1590
- return this.http.post(this.url, item);
1591
- }
1592
- }
1593
- InventoryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: InventoryService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1594
- InventoryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: InventoryService, providedIn: 'root' });
1595
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: InventoryService, decorators: [{
1596
- type: Injectable,
1597
- args: [{
1598
- providedIn: 'root'
1599
- }]
1600
- }], ctorParameters: function () {
1601
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1602
- type: Inject,
1603
- args: ['env']
1604
- }] }];
1582
+ class InventoryService {
1583
+ constructor(http, env) {
1584
+ this.http = http;
1585
+ this.env = env;
1586
+ this.url = this.env.baseUrl + 'api/inventory-items';
1587
+ }
1588
+ readInventoryItems(includeInactive = false, search = null) {
1589
+ const params = {
1590
+ includeInactive: includeInactive.toString()
1591
+ };
1592
+ if (search !== null) {
1593
+ params['search'] = search;
1594
+ }
1595
+ return this.http.get(this.url, { params: params });
1596
+ }
1597
+ updateInventoryItem(id, item) {
1598
+ return this.http.put(`${this.url}/${id}`, item);
1599
+ }
1600
+ createInventoryItem(item) {
1601
+ return this.http.post(this.url, item);
1602
+ }
1603
+ }
1604
+ InventoryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: InventoryService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1605
+ InventoryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: InventoryService, providedIn: 'root' });
1606
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: InventoryService, decorators: [{
1607
+ type: Injectable,
1608
+ args: [{
1609
+ providedIn: 'root'
1610
+ }]
1611
+ }], ctorParameters: function () {
1612
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1613
+ type: Inject,
1614
+ args: ['env']
1615
+ }] }];
1605
1616
  } });
1606
1617
 
1607
- class StatusHistoryService {
1608
- constructor(http, env) {
1609
- this.http = http;
1610
- this.env = env;
1611
- this.url = this.env.baseUrl + 'api/status-histories';
1612
- }
1613
- readStatusByUser(user, startDate, endDate) {
1614
- return this.http.get(`${this.url}/by-user`, {
1615
- params: {
1616
- user: user,
1617
- startDate: startDate.toUTCString(),
1618
- endDate: endDate.toUTCString()
1619
- }
1620
- });
1621
- }
1622
- readStatusByDate(date) {
1623
- return this.http.get(`${this.url}/by-date`, {
1624
- params: {
1625
- date: date.toUTCString()
1626
- }
1627
- });
1628
- }
1629
- }
1630
- StatusHistoryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: StatusHistoryService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1631
- StatusHistoryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: StatusHistoryService, providedIn: 'root' });
1632
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: StatusHistoryService, decorators: [{
1633
- type: Injectable,
1634
- args: [{
1635
- providedIn: 'root'
1636
- }]
1637
- }], ctorParameters: function () {
1638
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1639
- type: Inject,
1640
- args: ['env']
1641
- }] }];
1618
+ class StatusHistoryService {
1619
+ constructor(http, env) {
1620
+ this.http = http;
1621
+ this.env = env;
1622
+ this.url = this.env.baseUrl + 'api/status-histories';
1623
+ }
1624
+ readStatusByUser(user, startDate, endDate) {
1625
+ return this.http.get(`${this.url}/by-user`, {
1626
+ params: {
1627
+ user: user,
1628
+ startDate: startDate.toUTCString(),
1629
+ endDate: endDate.toUTCString()
1630
+ }
1631
+ });
1632
+ }
1633
+ readStatusByDate(date) {
1634
+ return this.http.get(`${this.url}/by-date`, {
1635
+ params: {
1636
+ date: date.toUTCString()
1637
+ }
1638
+ });
1639
+ }
1640
+ }
1641
+ StatusHistoryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: StatusHistoryService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1642
+ StatusHistoryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: StatusHistoryService, providedIn: 'root' });
1643
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: StatusHistoryService, decorators: [{
1644
+ type: Injectable,
1645
+ args: [{
1646
+ providedIn: 'root'
1647
+ }]
1648
+ }], ctorParameters: function () {
1649
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1650
+ type: Inject,
1651
+ args: ['env']
1652
+ }] }];
1642
1653
  } });
1643
1654
 
1644
- class PackageService {
1645
- constructor(http, env) {
1646
- this.http = http;
1647
- this.env = env;
1648
- this.url = this.env.baseUrl + 'api/packages';
1649
- }
1650
- readPackages(includeInactive = false, sku = null, name = null) {
1651
- const params = {
1652
- includeInactive
1653
- };
1654
- if (sku) {
1655
- params['sku'] = sku;
1656
- }
1657
- if (name) {
1658
- params['name'] = name;
1659
- }
1660
- return this.http.get(this.url, { params: params });
1661
- }
1662
- readPackage(id) {
1663
- return this.http.get(`${this.url}/${id}`);
1664
- }
1665
- readPackagesByFirearm(firearmId) {
1666
- return this.http.get(`${this.env.baseUrl}api/firearms/${firearmId}/packages`);
1667
- }
1668
- savePackage(packagez) {
1669
- if (packagez.id) {
1670
- return this.http.put(`${this.url}/${packagez.id}`, packagez);
1671
- }
1672
- return this.http.post(this.url, packagez);
1673
- }
1674
- }
1675
- PackageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PackageService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1676
- PackageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PackageService, providedIn: 'root' });
1677
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PackageService, decorators: [{
1678
- type: Injectable,
1679
- args: [{
1680
- providedIn: 'root'
1681
- }]
1682
- }], ctorParameters: function () {
1683
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1684
- type: Inject,
1685
- args: ['env']
1686
- }] }];
1655
+ class PackageService {
1656
+ constructor(http, env) {
1657
+ this.http = http;
1658
+ this.env = env;
1659
+ this.url = this.env.baseUrl + 'api/packages';
1660
+ }
1661
+ readPackages(includeInactive = false, sku = null, name = null) {
1662
+ const params = {
1663
+ includeInactive
1664
+ };
1665
+ if (sku) {
1666
+ params['sku'] = sku;
1667
+ }
1668
+ if (name) {
1669
+ params['name'] = name;
1670
+ }
1671
+ return this.http.get(this.url, { params: params });
1672
+ }
1673
+ readPackage(id) {
1674
+ return this.http.get(`${this.url}/${id}`);
1675
+ }
1676
+ readPackagesByFirearm(firearmId) {
1677
+ return this.http.get(`${this.env.baseUrl}api/firearms/${firearmId}/packages`);
1678
+ }
1679
+ savePackage(packagez) {
1680
+ if (packagez.id) {
1681
+ return this.http.put(`${this.url}/${packagez.id}`, packagez);
1682
+ }
1683
+ return this.http.post(this.url, packagez);
1684
+ }
1685
+ }
1686
+ PackageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PackageService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1687
+ PackageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PackageService, providedIn: 'root' });
1688
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PackageService, decorators: [{
1689
+ type: Injectable,
1690
+ args: [{
1691
+ providedIn: 'root'
1692
+ }]
1693
+ }], ctorParameters: function () {
1694
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1695
+ type: Inject,
1696
+ args: ['env']
1697
+ }] }];
1687
1698
  } });
1688
1699
 
1689
- class RefinishCodeService {
1690
- constructor(http, env) {
1691
- this.http = http;
1692
- this.env = env;
1693
- this.url = this.env.baseUrl + 'api/refinish-codes';
1694
- }
1695
- readRefinishCodes() {
1696
- return this.http.get(this.url);
1697
- }
1698
- createRefinishCodes(refinishCodes) {
1699
- return this.http.post(this.url, refinishCodes);
1700
- }
1701
- updateRefinishCodes(ids, refinishCodes) {
1702
- return this.http.put(`${this.url}/` + ids.join(','), refinishCodes);
1703
- }
1704
- deleteRefinishCodes(ids) {
1705
- return this.http.delete(this.url + '/' + ids.join(','));
1706
- }
1707
- }
1708
- RefinishCodeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: RefinishCodeService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1709
- RefinishCodeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: RefinishCodeService, providedIn: 'root' });
1710
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: RefinishCodeService, decorators: [{
1711
- type: Injectable,
1712
- args: [{
1713
- providedIn: 'root'
1714
- }]
1715
- }], ctorParameters: function () {
1716
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1717
- type: Inject,
1718
- args: ['env']
1719
- }] }];
1700
+ class RefinishCodeService {
1701
+ constructor(http, env) {
1702
+ this.http = http;
1703
+ this.env = env;
1704
+ this.url = this.env.baseUrl + 'api/refinish-codes';
1705
+ }
1706
+ readRefinishCodes() {
1707
+ return this.http.get(this.url);
1708
+ }
1709
+ createRefinishCodes(refinishCodes) {
1710
+ return this.http.post(this.url, refinishCodes);
1711
+ }
1712
+ updateRefinishCodes(ids, refinishCodes) {
1713
+ return this.http.put(`${this.url}/` + ids.join(','), refinishCodes);
1714
+ }
1715
+ deleteRefinishCodes(ids) {
1716
+ return this.http.delete(this.url + '/' + ids.join(','));
1717
+ }
1718
+ }
1719
+ RefinishCodeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: RefinishCodeService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1720
+ RefinishCodeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: RefinishCodeService, providedIn: 'root' });
1721
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: RefinishCodeService, decorators: [{
1722
+ type: Injectable,
1723
+ args: [{
1724
+ providedIn: 'root'
1725
+ }]
1726
+ }], ctorParameters: function () {
1727
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1728
+ type: Inject,
1729
+ args: ['env']
1730
+ }] }];
1720
1731
  } });
1721
1732
 
1722
- class PhonePipe {
1723
- transform(value, args) {
1724
- if (value && value.length >= 10) {
1725
- return `(${value.slice(0, 3)}) ${value.slice(3, 6)}-${value.slice(6)}`;
1726
- }
1727
- return '';
1728
- }
1729
- }
1730
- PhonePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PhonePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1731
- PhonePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PhonePipe, name: "phone" });
1732
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PhonePipe, decorators: [{
1733
- type: Pipe,
1734
- args: [{
1735
- name: 'phone'
1736
- }]
1733
+ class PhonePipe {
1734
+ transform(value, args) {
1735
+ if (value && value.length >= 10) {
1736
+ return `(${value.slice(0, 3)}) ${value.slice(3, 6)}-${value.slice(6)}`;
1737
+ }
1738
+ return '';
1739
+ }
1740
+ }
1741
+ PhonePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PhonePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1742
+ PhonePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PhonePipe, name: "phone" });
1743
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PhonePipe, decorators: [{
1744
+ type: Pipe,
1745
+ args: [{
1746
+ name: 'phone'
1747
+ }]
1737
1748
  }] });
1738
1749
 
1739
- class FileNamePipe {
1740
- transform(value, args) {
1741
- return value.replace(/(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}-/, '');
1742
- }
1743
- }
1744
- FileNamePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileNamePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1745
- FileNamePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileNamePipe, name: "fileName" });
1746
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileNamePipe, decorators: [{
1747
- type: Pipe,
1748
- args: [{
1749
- name: 'fileName'
1750
- }]
1750
+ class FileNamePipe {
1751
+ transform(value, args) {
1752
+ return value.replace(/(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}-/, '');
1753
+ }
1754
+ }
1755
+ FileNamePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileNamePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1756
+ FileNamePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileNamePipe, name: "fileName" });
1757
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileNamePipe, decorators: [{
1758
+ type: Pipe,
1759
+ args: [{
1760
+ name: 'fileName'
1761
+ }]
1751
1762
  }] });
1752
1763
 
1753
- class EnumPipe {
1754
- transform(value, args) {
1755
- return value.replace(/([^A-Z])([A-Z])/g, '$1 $2').trim();
1756
- }
1757
- }
1758
- EnumPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EnumPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1759
- EnumPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EnumPipe, name: "enum" });
1760
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EnumPipe, decorators: [{
1761
- type: Pipe,
1762
- args: [{
1763
- name: 'enum'
1764
- }]
1764
+ class EnumPipe {
1765
+ transform(value, args) {
1766
+ return value.replace(/([^A-Z])([A-Z])/g, '$1 $2').trim();
1767
+ }
1768
+ }
1769
+ EnumPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EnumPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1770
+ EnumPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EnumPipe, name: "enum" });
1771
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EnumPipe, decorators: [{
1772
+ type: Pipe,
1773
+ args: [{
1774
+ name: 'enum'
1775
+ }]
1765
1776
  }] });
1766
1777
 
1767
- class NewLinePipe {
1768
- transform(value, args) {
1769
- return value ? value.replace(/(?:\r\n|\r|\n)/g, '<br>') : '';
1770
- }
1771
- }
1772
- NewLinePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NewLinePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1773
- NewLinePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NewLinePipe, name: "newLine" });
1774
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NewLinePipe, decorators: [{
1775
- type: Pipe,
1776
- args: [{
1777
- name: 'newLine'
1778
- }]
1778
+ class NewLinePipe {
1779
+ transform(value, args) {
1780
+ return value ? value.replace(/(?:\r\n|\r|\n)/g, '<br>') : '';
1781
+ }
1782
+ }
1783
+ NewLinePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NewLinePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1784
+ NewLinePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NewLinePipe, name: "newLine" });
1785
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NewLinePipe, decorators: [{
1786
+ type: Pipe,
1787
+ args: [{
1788
+ name: 'newLine'
1789
+ }]
1779
1790
  }] });
1780
1791
 
1781
- class FrameMaterialPipe {
1782
- constructor() {
1783
- this.frameMaterial = [
1784
- { id: 0, name: 'All' },
1785
- { id: 1, name: 'Polymer' },
1786
- { id: 2, name: 'Aluminum' },
1787
- { id: 3, name: 'Steel' },
1788
- ];
1789
- }
1790
- transform(value, args) {
1791
- return this.frameMaterial.find(fm => fm.id == value).name;
1792
- }
1793
- }
1794
- FrameMaterialPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FrameMaterialPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1795
- FrameMaterialPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FrameMaterialPipe, name: "frameMaterial" });
1796
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FrameMaterialPipe, decorators: [{
1797
- type: Pipe,
1798
- args: [{
1799
- name: 'frameMaterial'
1800
- }]
1792
+ class FrameMaterialPipe {
1793
+ constructor() {
1794
+ this.frameMaterial = [
1795
+ { id: 0, name: 'All' },
1796
+ { id: 1, name: 'Polymer' },
1797
+ { id: 2, name: 'Aluminum' },
1798
+ { id: 3, name: 'Steel' },
1799
+ ];
1800
+ }
1801
+ transform(value, args) {
1802
+ return this.frameMaterial.find(fm => fm.id == value).name;
1803
+ }
1804
+ }
1805
+ FrameMaterialPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FrameMaterialPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1806
+ FrameMaterialPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FrameMaterialPipe, name: "frameMaterial" });
1807
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FrameMaterialPipe, decorators: [{
1808
+ type: Pipe,
1809
+ args: [{
1810
+ name: 'frameMaterial'
1811
+ }]
1801
1812
  }] });
1802
1813
 
1803
- class DisableControlDirective {
1804
- constructor(ngControl) {
1805
- this.ngControl = ngControl;
1806
- }
1807
- set disableControl(condition) {
1808
- const action = condition ? 'disable' : 'enable';
1809
- this.ngControl.control[action]();
1810
- }
1811
- }
1812
- DisableControlDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DisableControlDirective, deps: [{ token: i2.NgControl }], target: i0.ɵɵFactoryTarget.Directive });
1813
- DisableControlDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: DisableControlDirective, selector: "[disableControl]", inputs: { disableControl: "disableControl" }, ngImport: i0 });
1814
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DisableControlDirective, decorators: [{
1815
- type: Directive,
1816
- args: [{
1817
- selector: '[disableControl]'
1818
- }]
1819
- }], ctorParameters: function () { return [{ type: i2.NgControl }]; }, propDecorators: { disableControl: [{
1820
- type: Input
1814
+ class DisableControlDirective {
1815
+ constructor(ngControl) {
1816
+ this.ngControl = ngControl;
1817
+ }
1818
+ set disableControl(condition) {
1819
+ const action = condition ? 'disable' : 'enable';
1820
+ this.ngControl.control[action]();
1821
+ }
1822
+ }
1823
+ DisableControlDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DisableControlDirective, deps: [{ token: i2.NgControl }], target: i0.ɵɵFactoryTarget.Directive });
1824
+ DisableControlDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: DisableControlDirective, selector: "[disableControl]", inputs: { disableControl: "disableControl" }, ngImport: i0 });
1825
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DisableControlDirective, decorators: [{
1826
+ type: Directive,
1827
+ args: [{
1828
+ selector: '[disableControl]'
1829
+ }]
1830
+ }], ctorParameters: function () { return [{ type: i2.NgControl }]; }, propDecorators: { disableControl: [{
1831
+ type: Input
1821
1832
  }] } });
1822
1833
 
1823
- function coatingValueValidator() {
1824
- return (control) => {
1825
- if (!control.parent) {
1826
- return null;
1827
- }
1828
- const coatingControl = control.parent.get('coating');
1829
- if (!coatingControl) {
1830
- return null;
1831
- }
1832
- const coating = coatingControl.value;
1833
- return coating && coating.valueLabel && coating.coatingValues && coating.coatingValues.length &&
1834
- !control.value ? { value: control.value } : null;
1835
- };
1836
- }
1837
- function coatingDescriptionValidator() {
1838
- return (control) => {
1839
- if (!control.parent) {
1840
- return null;
1841
- }
1842
- const coatingControl = control.parent.get('coating');
1843
- if (!coatingControl) {
1844
- return null;
1845
- }
1846
- const coating = coatingControl.value;
1847
- return coating && coating.valueLabel && (!coating.coatingValues || !coating.coatingValues.length) &&
1848
- !control.value ? { value: control.value } : null;
1849
- };
1850
- }
1851
- function refinishDetailsValidator() {
1852
- return (control) => {
1853
- const formArray = control;
1854
- let isValid = false;
1855
- if (!formArray.controls.length) {
1856
- isValid = true;
1857
- }
1858
- for (let i = 0; i < formArray.controls.length; i++) {
1859
- const controlValue = formArray.controls[i].value;
1860
- if (controlValue.coating && controlValue.coating.id) {
1861
- isValid = true;
1862
- }
1863
- }
1864
- return !isValid ? { 'allNone': { value: true } } : null;
1865
- };
1866
- }
1867
-
1868
- class PackageSelectorComponent {
1869
- constructor(packageService, fb, inj) {
1870
- this.packageService = packageService;
1871
- this.fb = fb;
1872
- this.inj = inj;
1873
- this.packages = [];
1874
- this.packageVariations = [];
1875
- this.packageOptionalItems = [];
1876
- this.onChangeSubs = [];
1877
- this.onTouched = () => { };
1878
- this.touched = false;
1879
- this.disabled = false;
1880
- this.createForm();
1881
- }
1882
- ngOnChanges(changes) {
1883
- var _a, _b;
1884
- if ((((_a = changes.firearmId) === null || _a === void 0 ? void 0 : _a.currentValue) && this.projectType === ProjectType.Firearm) ||
1885
- (((_b = changes.projectType) === null || _b === void 0 ? void 0 : _b.currentValue) === ProjectType.Firearm && this.firearmId)) {
1886
- this.getPackages();
1887
- this.packageForm.reset();
1888
- }
1889
- else {
1890
- this.packages = [];
1891
- this.packageForm.reset();
1892
- }
1893
- }
1894
- ngAfterViewInit() {
1895
- const outerControl = this.inj.get(NgControl).control;
1896
- const prevMarkAsTouched = outerControl.markAsTouched;
1897
- outerControl.markAsTouched = (...args) => {
1898
- this.packageForm.markAllAsTouched();
1899
- prevMarkAsTouched.bind(outerControl)(...args);
1900
- };
1901
- }
1902
- ngOnDestroy() {
1903
- for (let sub of this.onChangeSubs) {
1904
- sub.unsubscribe();
1905
- }
1906
- }
1907
- getPackages() {
1908
- this.packageService.readPackagesByFirearm(this.firearmId)
1909
- .subscribe(packages => {
1910
- this.packages = packages;
1911
- if (this.packageForm.controls.package.value) {
1912
- let packagez = this.packages.find(p => p.id === this.packageForm.controls.package.value.id);
1913
- this.setPackageOptions(packagez);
1914
- }
1915
- });
1916
- }
1917
- createForm() {
1918
- this.packageForm = this.fb.group({
1919
- package: null,
1920
- optionalItems: this.fb.control([]),
1921
- variations: this.fb.array([])
1922
- });
1923
- this.packageForm.controls.package.valueChanges
1924
- .subscribe(value => {
1925
- this.packageForm.controls.optionalItems.reset();
1926
- this.packageOptionalItems = [];
1927
- this.variations.clear({ emitEvent: false });
1928
- this.packageVariations = [];
1929
- if (value === null || value === void 0 ? void 0 : value.id) {
1930
- this.setPackageOptions(value);
1931
- }
1932
- else {
1933
- if (this.packageDetail) {
1934
- this.packageDetail.variations = null;
1935
- this.packageDetail.optionalItems = null;
1936
- }
1937
- }
1938
- });
1939
- }
1940
- get variations() { return this.packageForm.controls.variations; }
1941
- setPackageOptions(packagez) {
1942
- var _a, _b;
1943
- this.packageOptionalItems = packagez.optionalItems;
1944
- this.packageVariations = packagez.variations;
1945
- this.variations.clear({ emitEvent: false });
1946
- for (let v of this.packageVariations) {
1947
- let selectedVariation = (_b = (_a = this.packageDetail) === null || _a === void 0 ? void 0 : _a.variations) === null || _b === void 0 ? void 0 : _b.find(pv => pv.packageVariationId === v.id);
1948
- this.variations.push(this.fb.control(selectedVariation, Validators.required), { emitEvent: false });
1949
- }
1950
- }
1951
- setValue(packageDetail) {
1952
- this.packageForm.reset(packageDetail);
1953
- }
1954
- validate(control) {
1955
- if (this.packageForm.valid) {
1956
- return null;
1957
- }
1958
- let errors = {};
1959
- for (let v of this.variations.controls) {
1960
- if (v.invalid) {
1961
- return v.errors;
1962
- }
1963
- }
1964
- return errors;
1965
- }
1966
- addControlErrors(allErrors, controlName) {
1967
- const errors = Object.assign({}, allErrors);
1968
- const controlErrors = this.packageForm.controls[controlName].errors;
1969
- if (controlErrors) {
1970
- errors[controlName] = controlErrors;
1971
- }
1972
- return errors;
1973
- }
1974
- writeValue(packageDetail) {
1975
- if (packageDetail) {
1976
- this.packageDetail = Object.assign({}, packageDetail);
1977
- this.setValue(packageDetail);
1978
- }
1979
- else {
1980
- this.packageForm.reset();
1981
- }
1982
- }
1983
- registerOnChange(onChange) {
1984
- const sub = this.packageForm.valueChanges.subscribe(onChange);
1985
- this.onChangeSubs.push(sub);
1986
- }
1987
- registerOnTouched(onTouched) {
1988
- this.onTouched = onTouched;
1989
- }
1990
- setDisabledState(isDisabled) {
1991
- this.disabled = isDisabled;
1992
- if (isDisabled) {
1993
- this.packageForm.disable();
1994
- }
1995
- else {
1996
- this.packageForm.enable();
1997
- }
1998
- }
1999
- }
2000
- PackageSelectorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PackageSelectorComponent, deps: [{ token: PackageService }, { token: i2.FormBuilder }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
2001
- PackageSelectorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: PackageSelectorComponent, selector: "cgw-package-selector", inputs: { firearmId: "firearmId", projectType: "projectType" }, providers: [
2002
- {
2003
- provide: NG_VALUE_ACCESSOR,
2004
- multi: true,
2005
- useExisting: PackageSelectorComponent
2006
- },
2007
- {
2008
- provide: NG_VALIDATORS,
2009
- multi: true,
2010
- useExisting: PackageSelectorComponent
2011
- }
2012
- ], usesOnChanges: true, ngImport: i0, template: "<div [formGroup]=\"packageForm\">\r\n <div class=\"row mb-2\">\r\n <div class=\"col\">\r\n <label for=\"waitlist-gun-package\">Package - <span class=\"fst-italic fs-7\">Select a model to list available packages</span></label>\r\n <kendo-dropdownlist [data]=\"packages\"\r\n [defaultItem]=\"{name: 'No Package', id: null}\"\r\n id=\"waitlist-gun-package\"\r\n formControlName=\"package\"\r\n textField=\"name\"\r\n valueField=\"id\"\r\n size=\"small\"></kendo-dropdownlist>\r\n </div>\r\n </div>\r\n <div formArrayName=\"variations\" *ngFor=\"let variationControl of variations.controls; let i = index\">\r\n <div class=\"row mb-2\">\r\n <div class=\"col\">\r\n <label [for]=\"'waitlist-gun-package-variation-' + i\">{{packageVariations[i]?.name}}</label>\r\n <kendo-dropdownlist [data]=\"packageVariations[i]?.options\"\r\n [id]=\"'waitlist-gun-package-variation-' + i\"\r\n textField=\"optionName\"\r\n [formControl]=\"variationControl\"\r\n valueField=\"id\"\r\n size=\"small\"></kendo-dropdownlist>\r\n </div>\r\n </div>\r\n <div *ngIf=\"variationControl.invalid && (variationControl.dirty || variationControl.touched)\" class=\"error-container text-danger\">\r\n <div *ngIf=\"variationControl.errors.required\">\r\n {{packageVariations[i]?.name}} is required.\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mb-2\" *ngIf=\"packageOptionalItems?.length\">\r\n <div class=\"col\">\r\n <label for=\"waitlist-gun-package-addons\">Add-ons (Additional charges will apply)</label>\r\n <kendo-multiselect id=\"waitlist-gun-package-addons\"\r\n [data]=\"packageOptionalItems\"\r\n formControlName=\"optionalItems\"\r\n textField=\"name\"\r\n valueField=\"inventoryItemId\"\r\n size=\"small\"></kendo-multiselect>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [""], components: [{ type: i3.DropDownListComponent, selector: "kendo-dropdownlist", inputs: ["iconClass", "loading", "data", "value", "textField", "valueField", "popupSettings", "listHeight", "defaultItem", "disabled", "itemDisabled", "readonly", "filterable", "virtual", "ignoreCase", "delay", "valuePrimitive", "tabindex", "tabIndex", "size", "rounded", "fillMode", "id"], outputs: ["valueChange", "filterChange", "selectionChange", "open", "opened", "close", "closed", "focus", "blur"], exportAs: ["kendoDropDownList"] }, { type: i3.MultiSelectComponent, selector: "kendo-multiselect", inputs: ["focusableId", "autoClose", "loading", "data", "value", "valueField", "textField", "tabindex", "tabIndex", "size", "rounded", "fillMode", "placeholder", "disabled", "itemDisabled", "checkboxes", "readonly", "filterable", "virtual", "popupSettings", "listHeight", "valuePrimitive", "clearButton", "tagMapper", "allowCustom", "valueNormalizer"], outputs: ["filterChange", "valueChange", "open", "opened", "close", "closed", "focus", "blur", "removeTag"], exportAs: ["kendoMultiSelect"] }], directives: [{ type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
2013
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PackageSelectorComponent, decorators: [{
2014
- type: Component,
2015
- args: [{ selector: 'cgw-package-selector', providers: [
2016
- {
2017
- provide: NG_VALUE_ACCESSOR,
2018
- multi: true,
2019
- useExisting: PackageSelectorComponent
2020
- },
2021
- {
2022
- provide: NG_VALIDATORS,
2023
- multi: true,
2024
- useExisting: PackageSelectorComponent
2025
- }
2026
- ], template: "<div [formGroup]=\"packageForm\">\r\n <div class=\"row mb-2\">\r\n <div class=\"col\">\r\n <label for=\"waitlist-gun-package\">Package - <span class=\"fst-italic fs-7\">Select a model to list available packages</span></label>\r\n <kendo-dropdownlist [data]=\"packages\"\r\n [defaultItem]=\"{name: 'No Package', id: null}\"\r\n id=\"waitlist-gun-package\"\r\n formControlName=\"package\"\r\n textField=\"name\"\r\n valueField=\"id\"\r\n size=\"small\"></kendo-dropdownlist>\r\n </div>\r\n </div>\r\n <div formArrayName=\"variations\" *ngFor=\"let variationControl of variations.controls; let i = index\">\r\n <div class=\"row mb-2\">\r\n <div class=\"col\">\r\n <label [for]=\"'waitlist-gun-package-variation-' + i\">{{packageVariations[i]?.name}}</label>\r\n <kendo-dropdownlist [data]=\"packageVariations[i]?.options\"\r\n [id]=\"'waitlist-gun-package-variation-' + i\"\r\n textField=\"optionName\"\r\n [formControl]=\"variationControl\"\r\n valueField=\"id\"\r\n size=\"small\"></kendo-dropdownlist>\r\n </div>\r\n </div>\r\n <div *ngIf=\"variationControl.invalid && (variationControl.dirty || variationControl.touched)\" class=\"error-container text-danger\">\r\n <div *ngIf=\"variationControl.errors.required\">\r\n {{packageVariations[i]?.name}} is required.\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mb-2\" *ngIf=\"packageOptionalItems?.length\">\r\n <div class=\"col\">\r\n <label for=\"waitlist-gun-package-addons\">Add-ons (Additional charges will apply)</label>\r\n <kendo-multiselect id=\"waitlist-gun-package-addons\"\r\n [data]=\"packageOptionalItems\"\r\n formControlName=\"optionalItems\"\r\n textField=\"name\"\r\n valueField=\"inventoryItemId\"\r\n size=\"small\"></kendo-multiselect>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [""] }]
2027
- }], ctorParameters: function () { return [{ type: PackageService }, { type: i2.FormBuilder }, { type: i0.Injector }]; }, propDecorators: { firearmId: [{
2028
- type: Input
2029
- }], projectType: [{
2030
- type: Input
1834
+ function coatingValueValidator() {
1835
+ return (control) => {
1836
+ if (!control.parent) {
1837
+ return null;
1838
+ }
1839
+ const coatingControl = control.parent.get('coating');
1840
+ if (!coatingControl) {
1841
+ return null;
1842
+ }
1843
+ const coating = coatingControl.value;
1844
+ return coating && coating.valueLabel && coating.coatingValues && coating.coatingValues.length &&
1845
+ !control.value ? { value: control.value } : null;
1846
+ };
1847
+ }
1848
+ function coatingDescriptionValidator() {
1849
+ return (control) => {
1850
+ if (!control.parent) {
1851
+ return null;
1852
+ }
1853
+ const coatingControl = control.parent.get('coating');
1854
+ if (!coatingControl) {
1855
+ return null;
1856
+ }
1857
+ const coating = coatingControl.value;
1858
+ return coating && coating.valueLabel && (!coating.coatingValues || !coating.coatingValues.length) &&
1859
+ !control.value ? { value: control.value } : null;
1860
+ };
1861
+ }
1862
+ function refinishDetailsValidator() {
1863
+ return (control) => {
1864
+ const formArray = control;
1865
+ let isValid = false;
1866
+ if (!formArray.controls.length) {
1867
+ isValid = true;
1868
+ }
1869
+ for (let i = 0; i < formArray.controls.length; i++) {
1870
+ const controlValue = formArray.controls[i].value;
1871
+ if (controlValue.coating && controlValue.coating.id) {
1872
+ isValid = true;
1873
+ }
1874
+ }
1875
+ return !isValid ? { 'allNone': { value: true } } : null;
1876
+ };
1877
+ }
1878
+
1879
+ class PackageSelectorComponent {
1880
+ constructor(packageService, fb, inj) {
1881
+ this.packageService = packageService;
1882
+ this.fb = fb;
1883
+ this.inj = inj;
1884
+ this.packages = [];
1885
+ this.packageVariations = [];
1886
+ this.packageOptionalItems = [];
1887
+ this.onChangeSubs = [];
1888
+ this.onTouched = () => { };
1889
+ this.touched = false;
1890
+ this.disabled = false;
1891
+ this.createForm();
1892
+ }
1893
+ ngOnChanges(changes) {
1894
+ var _a, _b;
1895
+ if ((((_a = changes.firearmId) === null || _a === void 0 ? void 0 : _a.currentValue) && this.projectType === ProjectType.Firearm) ||
1896
+ (((_b = changes.projectType) === null || _b === void 0 ? void 0 : _b.currentValue) === ProjectType.Firearm && this.firearmId)) {
1897
+ this.getPackages();
1898
+ this.packageForm.reset();
1899
+ }
1900
+ else {
1901
+ this.packages = [];
1902
+ this.packageForm.reset();
1903
+ }
1904
+ }
1905
+ ngAfterViewInit() {
1906
+ const outerControl = this.inj.get(NgControl).control;
1907
+ const prevMarkAsTouched = outerControl.markAsTouched;
1908
+ outerControl.markAsTouched = (...args) => {
1909
+ this.packageForm.markAllAsTouched();
1910
+ prevMarkAsTouched.bind(outerControl)(...args);
1911
+ };
1912
+ }
1913
+ ngOnDestroy() {
1914
+ for (let sub of this.onChangeSubs) {
1915
+ sub.unsubscribe();
1916
+ }
1917
+ }
1918
+ getPackages() {
1919
+ this.packageService.readPackagesByFirearm(this.firearmId)
1920
+ .subscribe(packages => {
1921
+ this.packages = packages;
1922
+ if (this.packageForm.controls.package.value) {
1923
+ let packagez = this.packages.find(p => p.id === this.packageForm.controls.package.value.id);
1924
+ this.setPackageOptions(packagez);
1925
+ }
1926
+ });
1927
+ }
1928
+ createForm() {
1929
+ this.packageForm = this.fb.group({
1930
+ package: null,
1931
+ optionalItems: this.fb.control([]),
1932
+ variations: this.fb.array([])
1933
+ });
1934
+ this.packageForm.controls.package.valueChanges
1935
+ .subscribe(value => {
1936
+ this.packageForm.controls.optionalItems.reset();
1937
+ this.packageOptionalItems = [];
1938
+ this.variations.clear({ emitEvent: false });
1939
+ this.packageVariations = [];
1940
+ if (value === null || value === void 0 ? void 0 : value.id) {
1941
+ this.setPackageOptions(value);
1942
+ }
1943
+ else {
1944
+ if (this.packageDetail) {
1945
+ this.packageDetail.variations = null;
1946
+ this.packageDetail.optionalItems = null;
1947
+ }
1948
+ }
1949
+ });
1950
+ }
1951
+ get variations() { return this.packageForm.controls.variations; }
1952
+ setPackageOptions(packagez) {
1953
+ var _a, _b;
1954
+ this.packageOptionalItems = packagez.optionalItems;
1955
+ this.packageVariations = packagez.variations;
1956
+ this.variations.clear({ emitEvent: false });
1957
+ for (let v of this.packageVariations) {
1958
+ let selectedVariation = (_b = (_a = this.packageDetail) === null || _a === void 0 ? void 0 : _a.variations) === null || _b === void 0 ? void 0 : _b.find(pv => pv.packageVariationId === v.id);
1959
+ this.variations.push(this.fb.control(selectedVariation, Validators.required), { emitEvent: false });
1960
+ }
1961
+ }
1962
+ setValue(packageDetail) {
1963
+ this.packageForm.reset(packageDetail);
1964
+ }
1965
+ validate(control) {
1966
+ if (this.packageForm.valid) {
1967
+ return null;
1968
+ }
1969
+ let errors = {};
1970
+ for (let v of this.variations.controls) {
1971
+ if (v.invalid) {
1972
+ return v.errors;
1973
+ }
1974
+ }
1975
+ return errors;
1976
+ }
1977
+ addControlErrors(allErrors, controlName) {
1978
+ const errors = Object.assign({}, allErrors);
1979
+ const controlErrors = this.packageForm.controls[controlName].errors;
1980
+ if (controlErrors) {
1981
+ errors[controlName] = controlErrors;
1982
+ }
1983
+ return errors;
1984
+ }
1985
+ writeValue(packageDetail) {
1986
+ if (packageDetail) {
1987
+ this.packageDetail = Object.assign({}, packageDetail);
1988
+ this.setValue(packageDetail);
1989
+ }
1990
+ else {
1991
+ this.packageForm.reset();
1992
+ }
1993
+ }
1994
+ registerOnChange(onChange) {
1995
+ const sub = this.packageForm.valueChanges.subscribe(onChange);
1996
+ this.onChangeSubs.push(sub);
1997
+ }
1998
+ registerOnTouched(onTouched) {
1999
+ this.onTouched = onTouched;
2000
+ }
2001
+ setDisabledState(isDisabled) {
2002
+ this.disabled = isDisabled;
2003
+ if (isDisabled) {
2004
+ this.packageForm.disable();
2005
+ }
2006
+ else {
2007
+ this.packageForm.enable();
2008
+ }
2009
+ }
2010
+ }
2011
+ PackageSelectorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PackageSelectorComponent, deps: [{ token: PackageService }, { token: i2.FormBuilder }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
2012
+ PackageSelectorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: PackageSelectorComponent, selector: "cgw-package-selector", inputs: { firearmId: "firearmId", projectType: "projectType" }, providers: [
2013
+ {
2014
+ provide: NG_VALUE_ACCESSOR,
2015
+ multi: true,
2016
+ useExisting: PackageSelectorComponent
2017
+ },
2018
+ {
2019
+ provide: NG_VALIDATORS,
2020
+ multi: true,
2021
+ useExisting: PackageSelectorComponent
2022
+ }
2023
+ ], usesOnChanges: true, ngImport: i0, template: "<div [formGroup]=\"packageForm\">\n <div class=\"row mb-2\">\n <div class=\"col\">\n <label for=\"waitlist-gun-package\">Package - <span class=\"fst-italic fs-7\">Select a model to list available packages</span></label>\n <kendo-dropdownlist [data]=\"packages\"\n [defaultItem]=\"{name: 'No Package', id: null}\"\n id=\"waitlist-gun-package\"\n formControlName=\"package\"\n textField=\"name\"\n valueField=\"id\"\n size=\"small\"></kendo-dropdownlist>\n </div>\n </div>\n <div formArrayName=\"variations\" *ngFor=\"let variationControl of variations.controls; let i = index\">\n <div class=\"row mb-2\">\n <div class=\"col\">\n <label [for]=\"'waitlist-gun-package-variation-' + i\">{{packageVariations[i]?.name}}</label>\n <kendo-dropdownlist [data]=\"packageVariations[i]?.options\"\n [id]=\"'waitlist-gun-package-variation-' + i\"\n textField=\"optionName\"\n [formControl]=\"variationControl\"\n valueField=\"id\"\n size=\"small\"></kendo-dropdownlist>\n </div>\n </div>\n <div *ngIf=\"variationControl.invalid && (variationControl.dirty || variationControl.touched)\" class=\"error-container text-danger\">\n <div *ngIf=\"variationControl.errors.required\">\n {{packageVariations[i]?.name}} is required.\n </div>\n </div>\n </div>\n <div class=\"row mb-2\" *ngIf=\"packageOptionalItems?.length\">\n <div class=\"col\">\n <label for=\"waitlist-gun-package-addons\">Add-ons (Additional charges will apply)</label>\n <kendo-multiselect id=\"waitlist-gun-package-addons\"\n [data]=\"packageOptionalItems\"\n formControlName=\"optionalItems\"\n textField=\"name\"\n valueField=\"inventoryItemId\"\n size=\"small\"></kendo-multiselect>\n </div>\n </div>\n</div>\n", styles: [""], components: [{ type: i3.DropDownListComponent, selector: "kendo-dropdownlist", inputs: ["iconClass", "loading", "data", "value", "textField", "valueField", "popupSettings", "listHeight", "defaultItem", "disabled", "itemDisabled", "readonly", "filterable", "virtual", "ignoreCase", "delay", "valuePrimitive", "tabindex", "tabIndex", "size", "rounded", "fillMode", "id"], outputs: ["valueChange", "filterChange", "selectionChange", "open", "opened", "close", "closed", "focus", "blur"], exportAs: ["kendoDropDownList"] }, { type: i3.MultiSelectComponent, selector: "kendo-multiselect", inputs: ["focusableId", "autoClose", "loading", "data", "value", "valueField", "textField", "tabindex", "tabIndex", "size", "rounded", "fillMode", "placeholder", "disabled", "itemDisabled", "checkboxes", "readonly", "filterable", "virtual", "popupSettings", "listHeight", "valuePrimitive", "clearButton", "tagMapper", "allowCustom", "valueNormalizer"], outputs: ["filterChange", "valueChange", "open", "opened", "close", "closed", "focus", "blur", "removeTag"], exportAs: ["kendoMultiSelect"] }], directives: [{ type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
2024
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PackageSelectorComponent, decorators: [{
2025
+ type: Component,
2026
+ args: [{ selector: 'cgw-package-selector', providers: [
2027
+ {
2028
+ provide: NG_VALUE_ACCESSOR,
2029
+ multi: true,
2030
+ useExisting: PackageSelectorComponent
2031
+ },
2032
+ {
2033
+ provide: NG_VALIDATORS,
2034
+ multi: true,
2035
+ useExisting: PackageSelectorComponent
2036
+ }
2037
+ ], template: "<div [formGroup]=\"packageForm\">\n <div class=\"row mb-2\">\n <div class=\"col\">\n <label for=\"waitlist-gun-package\">Package - <span class=\"fst-italic fs-7\">Select a model to list available packages</span></label>\n <kendo-dropdownlist [data]=\"packages\"\n [defaultItem]=\"{name: 'No Package', id: null}\"\n id=\"waitlist-gun-package\"\n formControlName=\"package\"\n textField=\"name\"\n valueField=\"id\"\n size=\"small\"></kendo-dropdownlist>\n </div>\n </div>\n <div formArrayName=\"variations\" *ngFor=\"let variationControl of variations.controls; let i = index\">\n <div class=\"row mb-2\">\n <div class=\"col\">\n <label [for]=\"'waitlist-gun-package-variation-' + i\">{{packageVariations[i]?.name}}</label>\n <kendo-dropdownlist [data]=\"packageVariations[i]?.options\"\n [id]=\"'waitlist-gun-package-variation-' + i\"\n textField=\"optionName\"\n [formControl]=\"variationControl\"\n valueField=\"id\"\n size=\"small\"></kendo-dropdownlist>\n </div>\n </div>\n <div *ngIf=\"variationControl.invalid && (variationControl.dirty || variationControl.touched)\" class=\"error-container text-danger\">\n <div *ngIf=\"variationControl.errors.required\">\n {{packageVariations[i]?.name}} is required.\n </div>\n </div>\n </div>\n <div class=\"row mb-2\" *ngIf=\"packageOptionalItems?.length\">\n <div class=\"col\">\n <label for=\"waitlist-gun-package-addons\">Add-ons (Additional charges will apply)</label>\n <kendo-multiselect id=\"waitlist-gun-package-addons\"\n [data]=\"packageOptionalItems\"\n formControlName=\"optionalItems\"\n textField=\"name\"\n valueField=\"inventoryItemId\"\n size=\"small\"></kendo-multiselect>\n </div>\n </div>\n</div>\n", styles: [""] }]
2038
+ }], ctorParameters: function () { return [{ type: PackageService }, { type: i2.FormBuilder }, { type: i0.Injector }]; }, propDecorators: { firearmId: [{
2039
+ type: Input
2040
+ }], projectType: [{
2041
+ type: Input
2031
2042
  }] } });
2032
2043
 
2033
- class SharedModule {
2034
- }
2035
- SharedModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2036
- SharedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SharedModule, declarations: [PhonePipe,
2037
- FileNamePipe,
2038
- EnumPipe,
2039
- DisableControlDirective,
2040
- NewLinePipe,
2041
- FrameMaterialPipe,
2042
- PackageSelectorComponent], imports: [CommonModule,
2043
- DropDownsModule,
2044
- FormsModule,
2045
- ReactiveFormsModule], exports: [PhonePipe,
2046
- FileNamePipe,
2047
- EnumPipe,
2048
- NewLinePipe,
2049
- DisableControlDirective,
2050
- FrameMaterialPipe,
2051
- PackageSelectorComponent] });
2052
- SharedModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SharedModule, imports: [[
2053
- CommonModule,
2054
- DropDownsModule,
2055
- FormsModule,
2056
- ReactiveFormsModule
2057
- ]] });
2058
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SharedModule, decorators: [{
2059
- type: NgModule,
2060
- args: [{
2061
- declarations: [
2062
- PhonePipe,
2063
- FileNamePipe,
2064
- EnumPipe,
2065
- DisableControlDirective,
2066
- NewLinePipe,
2067
- FrameMaterialPipe,
2068
- PackageSelectorComponent
2069
- ],
2070
- imports: [
2071
- CommonModule,
2072
- DropDownsModule,
2073
- FormsModule,
2074
- ReactiveFormsModule
2075
- ],
2076
- exports: [
2077
- PhonePipe,
2078
- FileNamePipe,
2079
- EnumPipe,
2080
- NewLinePipe,
2081
- DisableControlDirective,
2082
- FrameMaterialPipe,
2083
- PackageSelectorComponent
2084
- ]
2085
- }]
2044
+ class SharedModule {
2045
+ }
2046
+ SharedModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2047
+ SharedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SharedModule, declarations: [PhonePipe,
2048
+ FileNamePipe,
2049
+ EnumPipe,
2050
+ DisableControlDirective,
2051
+ NewLinePipe,
2052
+ FrameMaterialPipe,
2053
+ PackageSelectorComponent], imports: [CommonModule,
2054
+ DropDownsModule,
2055
+ FormsModule,
2056
+ ReactiveFormsModule], exports: [PhonePipe,
2057
+ FileNamePipe,
2058
+ EnumPipe,
2059
+ NewLinePipe,
2060
+ DisableControlDirective,
2061
+ FrameMaterialPipe,
2062
+ PackageSelectorComponent] });
2063
+ SharedModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SharedModule, imports: [[
2064
+ CommonModule,
2065
+ DropDownsModule,
2066
+ FormsModule,
2067
+ ReactiveFormsModule
2068
+ ]] });
2069
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SharedModule, decorators: [{
2070
+ type: NgModule,
2071
+ args: [{
2072
+ declarations: [
2073
+ PhonePipe,
2074
+ FileNamePipe,
2075
+ EnumPipe,
2076
+ DisableControlDirective,
2077
+ NewLinePipe,
2078
+ FrameMaterialPipe,
2079
+ PackageSelectorComponent
2080
+ ],
2081
+ imports: [
2082
+ CommonModule,
2083
+ DropDownsModule,
2084
+ FormsModule,
2085
+ ReactiveFormsModule
2086
+ ],
2087
+ exports: [
2088
+ PhonePipe,
2089
+ FileNamePipe,
2090
+ EnumPipe,
2091
+ NewLinePipe,
2092
+ DisableControlDirective,
2093
+ FrameMaterialPipe,
2094
+ PackageSelectorComponent
2095
+ ]
2096
+ }]
2086
2097
  }] });
2087
2098
 
2088
- const fadeOutAnimation = trigger('fadeOutAnimation', [
2089
- transition('true => void', [
2090
- style({
2091
- opacity: 1
2092
- }),
2093
- animate('0.2s', style({ opacity: 0 })),
2094
- ])
2099
+ const fadeOutAnimation = trigger('fadeOutAnimation', [
2100
+ transition('true => void', [
2101
+ style({
2102
+ opacity: 1
2103
+ }),
2104
+ animate('0.2s', style({ opacity: 0 })),
2105
+ ])
2095
2106
  ]);
2096
2107
 
2097
- class NotificationService {
2098
- constructor() {
2099
- this.messageUpdatedSource = new Subject();
2100
- this.messageUpdated = this.messageUpdatedSource.asObservable();
2101
- }
2102
- addMessage(type, message) {
2103
- this.messageUpdatedSource.next({ index: 0, type: type, message: message });
2104
- }
2105
- }
2106
- NotificationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2107
- NotificationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NotificationService, providedIn: 'root' });
2108
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NotificationService, decorators: [{
2109
- type: Injectable,
2110
- args: [{
2111
- providedIn: 'root'
2112
- }]
2108
+ class NotificationService {
2109
+ constructor() {
2110
+ this.messageUpdatedSource = new Subject();
2111
+ this.messageUpdated = this.messageUpdatedSource.asObservable();
2112
+ }
2113
+ addMessage(type, message) {
2114
+ this.messageUpdatedSource.next({ index: 0, type: type, message: message });
2115
+ }
2116
+ }
2117
+ NotificationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2118
+ NotificationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NotificationService, providedIn: 'root' });
2119
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NotificationService, decorators: [{
2120
+ type: Injectable,
2121
+ args: [{
2122
+ providedIn: 'root'
2123
+ }]
2113
2124
  }], ctorParameters: function () { return []; } });
2114
2125
 
2115
- class NotificationBarComponent {
2116
- constructor(notificationService) {
2117
- this.notificationService = notificationService;
2118
- this.messages = [];
2119
- }
2120
- get viewMessages() {
2121
- if (this.messages.length > 3) {
2122
- return this.messages.slice(0).reverse().slice(0, 2);
2123
- }
2124
- return this.messages.slice(0).reverse();
2125
- }
2126
- ;
2127
- ngOnInit() {
2128
- this.notificationService.messageUpdated.subscribe(message => {
2129
- this.messages.push(message);
2130
- setTimeout(() => {
2131
- this.messages.shift();
2132
- }, 4000);
2133
- });
2134
- }
2135
- getIconClass(message) {
2136
- return {
2137
- 'fa-exclamation-triangle': message.type == 1,
2138
- 'fa-info-circle': message.type == 0,
2139
- };
2140
- }
2141
- shouldFade() {
2142
- return this.messages.length < 3;
2143
- }
2144
- }
2145
- NotificationBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NotificationBarComponent, deps: [{ token: NotificationService }], target: i0.ɵɵFactoryTarget.Component });
2146
- 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\">\r\n <div *ngFor=\"let message of viewMessages\" class=\"notification-pill\" [class.error]=\"message.type == 1\" [@fadeOutAnimation]=\"shouldFade()\">\r\n <i class=\"fa\" [ngClass]=\"getIconClass(message)\"></i> <span class=\"ms-1\">{{message.message}}</span>\r\n </div>\r\n <div *ngIf=\"messages.length > 3\" class=\"notification-pill\">{{messages.length - 2}} more...</div>\r\n</div>\r\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] });
2147
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NotificationBarComponent, decorators: [{
2148
- type: Component,
2149
- args: [{ selector: 'app-notification-bar', animations: [fadeOutAnimation], template: "<div class=\"notification-bar\" *ngIf=\"messages.length\">\r\n <div *ngFor=\"let message of viewMessages\" class=\"notification-pill\" [class.error]=\"message.type == 1\" [@fadeOutAnimation]=\"shouldFade()\">\r\n <i class=\"fa\" [ngClass]=\"getIconClass(message)\"></i> <span class=\"ms-1\">{{message.message}}</span>\r\n </div>\r\n <div *ngIf=\"messages.length > 3\" class=\"notification-pill\">{{messages.length - 2}} more...</div>\r\n</div>\r\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"] }]
2126
+ class NotificationBarComponent {
2127
+ constructor(notificationService) {
2128
+ this.notificationService = notificationService;
2129
+ this.messages = [];
2130
+ }
2131
+ get viewMessages() {
2132
+ if (this.messages.length > 3) {
2133
+ return this.messages.slice(0).reverse().slice(0, 2);
2134
+ }
2135
+ return this.messages.slice(0).reverse();
2136
+ }
2137
+ ;
2138
+ ngOnInit() {
2139
+ this.notificationService.messageUpdated.subscribe(message => {
2140
+ this.messages.push(message);
2141
+ setTimeout(() => {
2142
+ this.messages.shift();
2143
+ }, 4000);
2144
+ });
2145
+ }
2146
+ getIconClass(message) {
2147
+ return {
2148
+ 'fa-exclamation-triangle': message.type == 1,
2149
+ 'fa-info-circle': message.type == 0,
2150
+ };
2151
+ }
2152
+ shouldFade() {
2153
+ return this.messages.length < 3;
2154
+ }
2155
+ }
2156
+ NotificationBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NotificationBarComponent, deps: [{ token: NotificationService }], target: i0.ɵɵFactoryTarget.Component });
2157
+ 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] });
2158
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NotificationBarComponent, decorators: [{
2159
+ type: Component,
2160
+ 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"] }]
2150
2161
  }], ctorParameters: function () { return [{ type: NotificationService }]; } });
2151
2162
 
2152
- class NotificationModule {
2153
- }
2154
- NotificationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NotificationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2155
- NotificationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NotificationModule, declarations: [NotificationBarComponent], imports: [CommonModule], exports: [NotificationBarComponent] });
2156
- NotificationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NotificationModule, imports: [[
2157
- CommonModule
2158
- ]] });
2159
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NotificationModule, decorators: [{
2160
- type: NgModule,
2161
- args: [{
2162
- imports: [
2163
- CommonModule
2164
- ],
2165
- exports: [
2166
- NotificationBarComponent
2167
- ],
2168
- declarations: [
2169
- NotificationBarComponent
2170
- ]
2171
- }]
2163
+ class NotificationModule {
2164
+ }
2165
+ NotificationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NotificationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2166
+ NotificationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NotificationModule, declarations: [NotificationBarComponent], imports: [CommonModule], exports: [NotificationBarComponent] });
2167
+ NotificationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NotificationModule, imports: [[
2168
+ CommonModule
2169
+ ]] });
2170
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NotificationModule, decorators: [{
2171
+ type: NgModule,
2172
+ args: [{
2173
+ imports: [
2174
+ CommonModule
2175
+ ],
2176
+ exports: [
2177
+ NotificationBarComponent
2178
+ ],
2179
+ declarations: [
2180
+ NotificationBarComponent
2181
+ ]
2182
+ }]
2172
2183
  }] });
2173
2184
 
2174
- var NotificationType;
2175
- (function (NotificationType) {
2176
- NotificationType[NotificationType["Info"] = 0] = "Info";
2177
- NotificationType[NotificationType["Error"] = 1] = "Error";
2185
+ var NotificationType;
2186
+ (function (NotificationType) {
2187
+ NotificationType[NotificationType["Info"] = 0] = "Info";
2188
+ NotificationType[NotificationType["Error"] = 1] = "Error";
2178
2189
  })(NotificationType || (NotificationType = {}));
2179
2190
 
2180
- /*
2181
- * Public API Surface of gunsmith-common
2191
+ /*
2192
+ * Public API Surface of gunsmith-common
2182
2193
  */
2183
2194
 
2184
- /**
2185
- * Generated bundle index. Do not edit.
2195
+ /**
2196
+ * Generated bundle index. Do not edit.
2186
2197
  */
2187
2198
 
2188
- 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, 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, WorkOrderHistory, WorkOrderInventoryItem, WorkOrderPackageDetail, WorkOrderRefinishItem, WorkOrderService, WorkOrderStatus, WorkOrderType, calculateFinishDate, coatingDescriptionValidator, coatingValueValidator, convertEnumToObjectArray, getCoatingValues, getCoatings, hasCoatingDescription, hasCoatingValues, refinishDetailsValidator, touchControls };
2199
+ 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, 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, WorkOrderHistory, WorkOrderInventoryItem, WorkOrderListItem, WorkOrderPackageDetail, WorkOrderRefinishItem, WorkOrderService, WorkOrderStatus, WorkOrderType, calculateFinishDate, coatingDescriptionValidator, coatingValueValidator, convertEnumToObjectArray, getCoatingValues, getCoatings, hasCoatingDescription, hasCoatingValues, refinishDetailsValidator, touchControls };
2189
2200
  //# sourceMappingURL=gunsmith-common.mjs.map