@leaddreamer/inventorylogic 0.0.3-beta.83 → 0.0.3-beta.84

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.
package/README.md CHANGED
@@ -918,36 +918,26 @@ users
918
918
 
919
919
  * [LineItem](#module_LineItem)
920
920
  * _static_
921
- * [.createLineItem](#module_LineItem.createLineItem) ⇒ <code>Promise.LineItem</code>
922
921
  * [.deleteLineItem(lineItem, product)](#module_LineItem.deleteLineItem) ⇒ <code>Promise.&lt;void&gt;</code>
923
922
  * [.deleteLineItemById(lineItem, product)](#module_LineItem.deleteLineItemById) ⇒ <code>Promise.&lt;void&gt;</code>
923
+ * [.createLineItem(lineItem, product)](#module_LineItem.createLineItem) ⇒ <code>Promise.LineItem</code>
924
924
  * [.knownLineItem(Id, product)](#module_LineItem.knownLineItem) ⇒ <code>Promise.boolean</code>
925
925
  * [.fetchLineItems()](#module_LineItem.fetchLineItems) ⇒ <code>Array.LineItem</code>
926
926
  * [.fetchProductLineItems(product, stage)](#module_LineItem.fetchProductLineItems) ⇒ <code>Array.LineItem</code>
927
927
  * [.paginateProductLineItems(product, stage, limit)](#module_LineItem.paginateProductLineItems) ⇒ <code>PaginatedFetch</code>
928
928
  * [.fetchLineItem(lineItemId, product)](#module_LineItem.fetchLineItem) ⇒ <code>Promise.LineItem</code>
929
929
  * [.fetchLineItemName(lineItemId, product)](#module_LineItem.fetchLineItemName) ⇒ <code>Promise.string</code>
930
+ * [.lineItem_lineSum(lineItem)](#module_LineItem.lineItem_lineSum) ⇒ <code>number</code>
930
931
  * _inner_
931
932
  * [~LineItemDefault](#module_LineItem..LineItemDefault) : <code>LineItem</code>
932
933
  * [~LineItemData](#module_LineItem..LineItemData) : <code>LineItem</code>
933
934
  * [~LineItemDefaultForm](#module_LineItem..LineItemDefaultForm) : <code>LineItem</code>
934
935
  * [~updateLineItem(lineItem, product)](#module_LineItem..updateLineItem) ⇒ <code>promise.LineItem</code>
935
936
  * [~summarizeLineItem(lineItem)](#module_LineItem..summarizeLineItem) ⇒ <code>string</code>
936
- * [~lineItem_lineSum(lineItem)](#module_LineItem..lineItem_lineSum) ⇒ <code>number</code>
937
937
  * [~UpdateChange(prev, value, itemFor, fullChoiceObject)](#module_LineItem..UpdateChange) ⇒ <code>object</code>
938
938
  * [~LineItem](#module_LineItem..LineItem) : <code>object</code>
939
939
  * [~PaginatedFetch](#module_LineItem..PaginatedFetch) : <code>object</code>
940
940
 
941
- <a name="module_LineItem.createLineItem"></a>
942
-
943
- ### LineItem.createLineItem ⇒ <code>Promise.LineItem</code>
944
- **Kind**: static constant of [<code>LineItem</code>](#module_LineItem)
945
-
946
- | Param | Type | Description |
947
- | --- | --- | --- |
948
- | lineItem | <code>LineItem</code> | minimal record of user account |
949
- | product | <code>Product</code> | minimal record of product this lineItem belongs to |
950
-
951
941
  <a name="module_LineItem.deleteLineItem"></a>
952
942
 
953
943
  ### LineItem.deleteLineItem(lineItem, product) ⇒ <code>Promise.&lt;void&gt;</code>
@@ -975,6 +965,16 @@ from database
975
965
  | product | <code>Product</code> | minimal record of product this lineItem belongs to |
976
966
  | product.refPath | <code>string</code> | required as a minimum |
977
967
 
968
+ <a name="module_LineItem.createLineItem"></a>
969
+
970
+ ### LineItem.createLineItem(lineItem, product) ⇒ <code>Promise.LineItem</code>
971
+ **Kind**: static method of [<code>LineItem</code>](#module_LineItem)
972
+
973
+ | Param | Type | Description |
974
+ | --- | --- | --- |
975
+ | lineItem | <code>LineItem</code> | minimal record of user account |
976
+ | product | <code>Product</code> | minimal record of product this lineItem belongs to |
977
+
978
978
  <a name="module_LineItem.knownLineItem"></a>
979
979
 
980
980
  ### LineItem.knownLineItem(Id, product) ⇒ <code>Promise.boolean</code>
@@ -1046,6 +1046,19 @@ Fetches and returns the summarized name from a LineItem record
1046
1046
  | lineItemId | <code>string</code> | |
1047
1047
  | product | <code>Product</code> | minimal record of product this lineItem belongs to |
1048
1048
 
1049
+ <a name="module_LineItem.lineItem_lineSum"></a>
1050
+
1051
+ ### LineItem.lineItem\_lineSum(lineItem) ⇒ <code>number</code>
1052
+ Calculates the lineSum (total) for a lineItem
1053
+
1054
+ **Kind**: static method of [<code>LineItem</code>](#module_LineItem)
1055
+
1056
+ | Param | Type |
1057
+ | --- | --- |
1058
+ | lineItem | <code>object</code> |
1059
+ | lineItem.rate | <code>number</code> |
1060
+ | lineItem.count | <code>number</code> |
1061
+
1049
1062
  <a name="module_LineItem..LineItemDefault"></a>
1050
1063
 
1051
1064
  ### LineItem~LineItemDefault : <code>LineItem</code>
@@ -1095,19 +1108,6 @@ Returns a standardized formatted name string
1095
1108
  | --- | --- |
1096
1109
  | lineItem | <code>LineItem</code> |
1097
1110
 
1098
- <a name="module_LineItem..lineItem_lineSum"></a>
1099
-
1100
- ### LineItem~lineItem\_lineSum(lineItem) ⇒ <code>number</code>
1101
- Calculates the lineSum (total) for a lineItem
1102
-
1103
- **Kind**: inner method of [<code>LineItem</code>](#module_LineItem)
1104
-
1105
- | Param | Type |
1106
- | --- | --- |
1107
- | lineItem | <code>object</code> |
1108
- | lineItem.rate | <code>number</code> |
1109
- | lineItem.count | <code>number</code> |
1110
-
1111
1111
  <a name="module_LineItem..UpdateChange"></a>
1112
1112
 
1113
1113
  ### LineItem~UpdateChange(prev, value, itemFor, fullChoiceObject) ⇒ <code>object</code>
@@ -149,7 +149,7 @@ export async function deleteLineItemById(lineItem, product) {
149
149
  * @param {Product} product minimal record of product this lineItem belongs to
150
150
  * @returns {Promise.LineItem}
151
151
  */
152
- export const createLineItem = (lineItem) => {
152
+ export async function createLineItem(lineItem) {
153
153
  //need a "no duplicate" function - whatever that means in this context
154
154
  return writeRecord(LINEITEM, lineItem, product.refPath);
155
155
  };
@@ -307,7 +307,7 @@ function summarizeLineItem(lineItem) {
307
307
  * @param {?number} lineItem.count
308
308
  * @returns {number}
309
309
  */
310
- function lineItem_lineSum(lineItem) {
310
+ export function lineItem_lineSum(lineItem) {
311
311
  return lineItem?.rate * lineItem?.count;
312
312
  }
313
313
 
@@ -43,6 +43,7 @@ export const UNITS = "units";
43
43
  export const UNIT = UNITS;
44
44
  export const USER = "User";
45
45
  export const USERS = USER;
46
+ export const ACTIVEUSER = "ActiveUser";
46
47
 
47
48
  export const MARKUPS = "markups";
48
49
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "engines": {
4
4
  "node": ">=22"
5
5
  },
6
- "version": "0.0.3-beta.83",
6
+ "version": "0.0.3-beta.84",
7
7
  "description": "Business & Database Logic for Inventory Services",
8
8
  "repository": {
9
9
  "type": "git",