@leaddreamer/inventorylogic 0.0.3-beta.1 → 0.0.3-beta.11
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 +219 -9
- package/business/Commodities/index.js +1 -1
- package/business/LineItem/index.js +2 -2
- package/business/Markups/index.js +1 -1
- package/business/Payment/index.js +1 -1
- package/business/Product/index.js +160 -17
- package/business/User/index.js +2 -2
- package/business/Utilities/index.js +1 -1
- package/business/index.js +9 -9
- package/business/units/index.js +1 -1
- package/index.js +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1152,6 +1152,20 @@ Typedefs, constants, support functions and database operations related to Produc
|
|
|
1152
1152
|
* [~ProductDefaultForm](#module_Product..ProductDefaultForm) : <code>Product</code>
|
|
1153
1153
|
* [~updateProduct(product, user)](#module_Product..updateProduct) ⇒ <code>promise.LineItem</code>
|
|
1154
1154
|
* [~summarizeProduct(product)](#module_Product..summarizeProduct) ⇒ <code>string</code>
|
|
1155
|
+
* [~Recipe_Data](#module_Product..Recipe_Data) : <code>object</code>
|
|
1156
|
+
* [~AttributeList](#module_Product..AttributeList) : <code>Array.String</code>
|
|
1157
|
+
* [~AttributeValue](#module_Product..AttributeValue) : <code>object</code>
|
|
1158
|
+
* [~ProductImage](#module_Product..ProductImage) : <code>object</code>
|
|
1159
|
+
* [~CurrencyDescription](#module_Product..CurrencyDescription) : <code>object</code>
|
|
1160
|
+
* [~MonetaryValue](#module_Product..MonetaryValue) : <code>object</code>
|
|
1161
|
+
* [~FullProductPricing](#module_Product..FullProductPricing) : <code>object</code>
|
|
1162
|
+
* [~ProductDimensions](#module_Product..ProductDimensions) : <code>object</code>
|
|
1163
|
+
* [~PriceObject](#module_Product..PriceObject) : <code>object</code>
|
|
1164
|
+
* [~ProductWeight](#module_Product..ProductWeight) : <code>object</code>
|
|
1165
|
+
* [~ProductMeasurements](#module_Product..ProductMeasurements) : <code>object</code>
|
|
1166
|
+
* [~ProductStock](#module_Product..ProductStock) : <code>object</code>
|
|
1167
|
+
* [~PhysicalProductVariant](#module_Product..PhysicalProductVariant) : <code>object</code>
|
|
1168
|
+
* [~MetaData](#module_Product..MetaData) : <code>object</code>
|
|
1155
1169
|
* [~Product](#module_Product..Product) : <code>object</code>
|
|
1156
1170
|
|
|
1157
1171
|
<a name="module_Product.createProduct"></a>
|
|
@@ -1178,7 +1192,7 @@ Creates a new Blank Product
|
|
|
1178
1192
|
|
|
1179
1193
|
### Product~ProductDefault : <code>Product</code>
|
|
1180
1194
|
**Kind**: inner constant of [<code>Product</code>](#module_Product)
|
|
1181
|
-
**Default**: <code>{"
|
|
1195
|
+
**Default**: <code>{"name":"","description":null,"recipe":"","image_links":"","type":"","google_product_type":"","shipping_time":0,"condition":"","adultQ":false,"age_group":"adult","color":"","material":"","gender":"unisex","attributes_gemstones":"","pattern":"","size":"","weight":0,"shippingMeasurements":""}</code>
|
|
1182
1196
|
**Read only**: true
|
|
1183
1197
|
<a name="module_Product..ProductDataForm"></a>
|
|
1184
1198
|
|
|
@@ -1217,26 +1231,222 @@ Returns a standardized formatted name string
|
|
|
1217
1231
|
| --- | --- |
|
|
1218
1232
|
| product | <code>Unit</code> |
|
|
1219
1233
|
|
|
1220
|
-
<a name="module_Product..
|
|
1234
|
+
<a name="module_Product..Recipe_Data"></a>
|
|
1221
1235
|
|
|
1222
|
-
### Product~
|
|
1223
|
-
|
|
1236
|
+
### Product~Recipe\_Data : <code>object</code>
|
|
1237
|
+
"recipe" related values - build-stage markups, product/project Flag, created/modified dates
|
|
1224
1238
|
|
|
1225
1239
|
**Kind**: inner typedef of [<code>Product</code>](#module_Product)
|
|
1226
1240
|
**Properties**
|
|
1227
1241
|
|
|
1228
1242
|
| Name | Type | Description |
|
|
1229
1243
|
| --- | --- | --- |
|
|
1230
|
-
| Id | <code>string</code> | Id of document (redundant for convenience) |
|
|
1231
|
-
| refPath | <code>string</code> | if from database, full path to document |
|
|
1232
|
-
| name | <code>string</code> | name for the Product |
|
|
1233
|
-
| description | <code>string</code> | |
|
|
1234
|
-
| sku | <code>string</code> | |
|
|
1235
1244
|
| markups | <code>module:Markups~Stage</code> | |
|
|
1236
1245
|
| projectQ | <code>boolean</code> | flag for product/project |
|
|
1237
1246
|
| created | <code>dateTime</code> | |
|
|
1238
1247
|
| modified | <code>dateTime</code> | |
|
|
1239
1248
|
|
|
1249
|
+
<a name="module_Product..AttributeList"></a>
|
|
1250
|
+
|
|
1251
|
+
### Product~AttributeList : <code>Array.String</code>
|
|
1252
|
+
A list of attributes for a product
|
|
1253
|
+
|
|
1254
|
+
**Kind**: inner typedef of [<code>Product</code>](#module_Product)
|
|
1255
|
+
<a name="module_Product..AttributeValue"></a>
|
|
1256
|
+
|
|
1257
|
+
### Product~AttributeValue : <code>object</code>
|
|
1258
|
+
Array of attribute name/value pairs
|
|
1259
|
+
|
|
1260
|
+
**Kind**: inner typedef of [<code>Product</code>](#module_Product)
|
|
1261
|
+
**Properties**
|
|
1262
|
+
|
|
1263
|
+
| Name | Type | Description |
|
|
1264
|
+
| --- | --- | --- |
|
|
1265
|
+
| attibuteName | <code>string</code> | attribute name from attribute list |
|
|
1266
|
+
| value | <code>string</code> | value for the particular attribute |
|
|
1267
|
+
|
|
1268
|
+
<a name="module_Product..ProductImage"></a>
|
|
1269
|
+
|
|
1270
|
+
### Product~ProductImage : <code>object</code>
|
|
1271
|
+
Image Descriptor
|
|
1272
|
+
|
|
1273
|
+
**Kind**: inner typedef of [<code>Product</code>](#module_Product)
|
|
1274
|
+
**Properties**
|
|
1275
|
+
|
|
1276
|
+
| Name | Type | Description |
|
|
1277
|
+
| --- | --- | --- |
|
|
1278
|
+
| altText | <code>string</code> | alt text for the image - SEO etc |
|
|
1279
|
+
| availableFormats | <code>Array.string</code> | Available image sizes. |
|
|
1280
|
+
| id | <code>string</code> | unique id for this productImage |
|
|
1281
|
+
| orderIndex | <code>integer</code> | Position of the image in the product's image list. |
|
|
1282
|
+
| originalSize | <code>object</code> | Image size when first uploaded. |
|
|
1283
|
+
| seoOptions | <code>MetaData</code> | |
|
|
1284
|
+
| URL | <code>string</code> | Absolute URL of the hosted image. |
|
|
1285
|
+
|
|
1286
|
+
<a name="module_Product..CurrencyDescription"></a>
|
|
1287
|
+
|
|
1288
|
+
### Product~CurrencyDescription : <code>object</code>
|
|
1289
|
+
Currency Description ISO 4217 currency code
|
|
1290
|
+
|
|
1291
|
+
**Kind**: inner typedef of [<code>Product</code>](#module_Product)
|
|
1292
|
+
**Properties**
|
|
1293
|
+
|
|
1294
|
+
| Name | Type |
|
|
1295
|
+
| --- | --- |
|
|
1296
|
+
| currencyCode | <code>string</code> |
|
|
1297
|
+
| defaultFractionDigits | <code>integer</code> |
|
|
1298
|
+
| displayName | <code>string</code> |
|
|
1299
|
+
| numericCodeAsString | <code>string</code> |
|
|
1300
|
+
| symbol | <code>string</code> |
|
|
1301
|
+
|
|
1302
|
+
<a name="module_Product..MonetaryValue"></a>
|
|
1303
|
+
|
|
1304
|
+
### Product~MonetaryValue : <code>object</code>
|
|
1305
|
+
Monetary Value Specification
|
|
1306
|
+
|
|
1307
|
+
**Kind**: inner typedef of [<code>Product</code>](#module_Product)
|
|
1308
|
+
**Properties**
|
|
1309
|
+
|
|
1310
|
+
| Name | Type | Description |
|
|
1311
|
+
| --- | --- | --- |
|
|
1312
|
+
| | <code>CurrencyDescription</code> | |
|
|
1313
|
+
| value | <code>decimal</code> | Decimal monetary value |
|
|
1314
|
+
|
|
1315
|
+
<a name="module_Product..FullProductPricing"></a>
|
|
1316
|
+
|
|
1317
|
+
### Product~FullProductPricing : <code>object</code>
|
|
1318
|
+
Pricing Object
|
|
1319
|
+
|
|
1320
|
+
**Kind**: inner typedef of [<code>Product</code>](#module_Product)
|
|
1321
|
+
**Properties**
|
|
1322
|
+
|
|
1323
|
+
| Name | Type |
|
|
1324
|
+
| --- | --- |
|
|
1325
|
+
| basePrice | <code>MonetaryValue</code> |
|
|
1326
|
+
| onSale | <code>boolean</code> |
|
|
1327
|
+
| salePrice | <code>MonetaryValue</code> |
|
|
1328
|
+
|
|
1329
|
+
<a name="module_Product..ProductDimensions"></a>
|
|
1330
|
+
|
|
1331
|
+
### Product~ProductDimensions : <code>object</code>
|
|
1332
|
+
Dimensions Object
|
|
1333
|
+
|
|
1334
|
+
**Kind**: inner typedef of [<code>Product</code>](#module_Product)
|
|
1335
|
+
**Properties**
|
|
1336
|
+
|
|
1337
|
+
| Name | Type | Description |
|
|
1338
|
+
| --- | --- | --- |
|
|
1339
|
+
| height | <code>float</code> | |
|
|
1340
|
+
| width | <code>float</code> | |
|
|
1341
|
+
| length | <code>float</code> | |
|
|
1342
|
+
| unit | <code>text</code> | //ProductDimensionsUnit |
|
|
1343
|
+
|
|
1344
|
+
<a name="module_Product..PriceObject"></a>
|
|
1345
|
+
|
|
1346
|
+
### Product~PriceObject : <code>object</code>
|
|
1347
|
+
Price Object
|
|
1348
|
+
|
|
1349
|
+
**Kind**: inner typedef of [<code>Product</code>](#module_Product)
|
|
1350
|
+
<a name="module_Product..ProductWeight"></a>
|
|
1351
|
+
|
|
1352
|
+
### Product~ProductWeight : <code>object</code>
|
|
1353
|
+
Weight Object
|
|
1354
|
+
|
|
1355
|
+
**Kind**: inner typedef of [<code>Product</code>](#module_Product)
|
|
1356
|
+
**Properties**
|
|
1357
|
+
|
|
1358
|
+
| Name | Type | Description |
|
|
1359
|
+
| --- | --- | --- |
|
|
1360
|
+
| unit | <code>text</code> | //ProductWeightUnitEnum |
|
|
1361
|
+
| value | <code>float</code> | |
|
|
1362
|
+
|
|
1363
|
+
<a name="module_Product..ProductMeasurements"></a>
|
|
1364
|
+
|
|
1365
|
+
### Product~ProductMeasurements : <code>object</code>
|
|
1366
|
+
Measurements of the variant when it's shipped. Present for PHYSICAL products only.
|
|
1367
|
+
|
|
1368
|
+
**Kind**: inner typedef of [<code>Product</code>](#module_Product)
|
|
1369
|
+
**Properties**
|
|
1370
|
+
|
|
1371
|
+
| Name | Type |
|
|
1372
|
+
| --- | --- |
|
|
1373
|
+
| dimensions | <code>ProductDimensions</code> |
|
|
1374
|
+
| weight | <code>ProductWeight</code> |
|
|
1375
|
+
|
|
1376
|
+
<a name="module_Product..ProductStock"></a>
|
|
1377
|
+
|
|
1378
|
+
### Product~ProductStock : <code>object</code>
|
|
1379
|
+
Available stock for the variant. Present for PHYSICAL products only.
|
|
1380
|
+
|
|
1381
|
+
**Kind**: inner typedef of [<code>Product</code>](#module_Product)
|
|
1382
|
+
**Properties**
|
|
1383
|
+
|
|
1384
|
+
| Name | Type |
|
|
1385
|
+
| --- | --- |
|
|
1386
|
+
| quantity | <code>integer</code> |
|
|
1387
|
+
| unlimited | <code>boolean</code> |
|
|
1388
|
+
|
|
1389
|
+
<a name="module_Product..PhysicalProductVariant"></a>
|
|
1390
|
+
|
|
1391
|
+
### Product~PhysicalProductVariant : <code>object</code>
|
|
1392
|
+
variant record (including inventory and pricing)
|
|
1393
|
+
|
|
1394
|
+
**Kind**: inner typedef of [<code>Product</code>](#module_Product)
|
|
1395
|
+
**Properties**
|
|
1396
|
+
|
|
1397
|
+
| Name | Type | Description |
|
|
1398
|
+
| --- | --- | --- |
|
|
1399
|
+
| attributes | <code>Array.AttributeValue</code> | array of attribute/value pairs for a variant |
|
|
1400
|
+
| sku | <code>string</code> | |
|
|
1401
|
+
| mpn | <code>string</code> | manufacturer part number |
|
|
1402
|
+
| gtin | <code>string</code> | Global Trade Item Number |
|
|
1403
|
+
| id | <code>string</code> | unique ID for product variant |
|
|
1404
|
+
| image | <code>ProductImage</code> | Image associated with this variant |
|
|
1405
|
+
| shippingMeasurements | <code>ProductMeasurements</code> | |
|
|
1406
|
+
| stock | <code>ProductStock</code> | |
|
|
1407
|
+
|
|
1408
|
+
<a name="module_Product..MetaData"></a>
|
|
1409
|
+
|
|
1410
|
+
### Product~MetaData : <code>object</code>
|
|
1411
|
+
Meta Information for SEO
|
|
1412
|
+
|
|
1413
|
+
**Kind**: inner typedef of [<code>Product</code>](#module_Product)
|
|
1414
|
+
**Properties**
|
|
1415
|
+
|
|
1416
|
+
| Name | Type |
|
|
1417
|
+
| --- | --- |
|
|
1418
|
+
| title | <code>string</code> |
|
|
1419
|
+
| description | <code>string</code> |
|
|
1420
|
+
|
|
1421
|
+
<a name="module_Product..Product"></a>
|
|
1422
|
+
|
|
1423
|
+
### Product~Product : <code>object</code>
|
|
1424
|
+
a product record
|
|
1425
|
+
|
|
1426
|
+
**Kind**: inner typedef of [<code>Product</code>](#module_Product)
|
|
1427
|
+
**Properties**
|
|
1428
|
+
|
|
1429
|
+
| Name | Type | Description |
|
|
1430
|
+
| --- | --- | --- |
|
|
1431
|
+
| Id | <code>string</code> | Database Id of document (redundant for convenience) |
|
|
1432
|
+
| refPath | <code>string</code> | if from database, full path to document |
|
|
1433
|
+
| name | <code>string</code> | name for the Product |
|
|
1434
|
+
| description | <code>string</code> | Basic description of the product |
|
|
1435
|
+
| recipe | <code>Recipe\_Data</code> | pricing and fabrication data |
|
|
1436
|
+
| image_links | <code>Array:ImageLinks</code> | |
|
|
1437
|
+
| type | <code>text</code> | //ProductTypeV2Enum |
|
|
1438
|
+
| isVisible | <code>boolean</code> | |
|
|
1439
|
+
| seoOptions | <code>MetaData</code> | |
|
|
1440
|
+
| name | <code>string</code> | name for the Product |
|
|
1441
|
+
| seoOptions | <code>MetaData</code> | |
|
|
1442
|
+
| tags | <code>Array.string</code> | |
|
|
1443
|
+
| materials | <code>Array.string</code> | |
|
|
1444
|
+
| patterns | <code>Array.string</code> | |
|
|
1445
|
+
| URL | <code>string</code> | |
|
|
1446
|
+
| urlSlug | <code>string</code> | |
|
|
1447
|
+
| variantAttributes | <code>Array.string</code> | |
|
|
1448
|
+
| variants | <code>Array.PhysicalProductVariant</code> | |
|
|
1449
|
+
|
|
1240
1450
|
<a name="module_User"></a>
|
|
1241
1451
|
|
|
1242
1452
|
## User
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "@leaddreamer/firebase-wrapper";
|
|
15
15
|
import { Forms, fillForm } from "@leaddreamer/staticforms";
|
|
16
16
|
|
|
17
|
-
import { UNITS, MATERIAL, COMMODITIES, COMMODITY, COMPONENT_RANGE } from "../boilerplate";
|
|
17
|
+
import { UNITS, MATERIAL, COMMODITIES, COMMODITY, COMPONENT_RANGE } from "../boilerplate/index.js";
|
|
18
18
|
|
|
19
19
|
//////////////////////////////////////////////////////////////////////
|
|
20
20
|
// Constants
|
|
@@ -21,8 +21,8 @@ import {
|
|
|
21
21
|
UNITS,
|
|
22
22
|
COMPONENT_RANGE,
|
|
23
23
|
COMPONENT_COUNT_RANGE,
|
|
24
|
-
} from "../boilerplate";
|
|
25
|
-
import {StageLevels, MaterialLevels} from "../Markups";
|
|
24
|
+
} from "../boilerplate/index.js";
|
|
25
|
+
import {StageLevels, MaterialLevels} from "../Markups/index.js";
|
|
26
26
|
|
|
27
27
|
//////////////////////////////////////////////////////////////////////
|
|
28
28
|
// Constants
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { updateRecord } from "@leaddreamer/firebase-wrapper";
|
|
7
7
|
import { Forms, fillForm } from "@leaddreamer/staticforms";
|
|
8
8
|
|
|
9
|
-
import { MARKUPS, STAGE, FABRICATION, WHOLESALE, RETAIL, BASE, HIGHVALUE, SERVICE, MATERIAL } from "../boilerplate";
|
|
9
|
+
import { MARKUPS, STAGE, FABRICATION, WHOLESALE, RETAIL, BASE, HIGHVALUE, SERVICE, MATERIAL } from "../boilerplate/index.js";
|
|
10
10
|
|
|
11
11
|
//////////////////////////////////////////////////////////////////////
|
|
12
12
|
// Constants
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "@leaddreamer/firebase-wrapper";
|
|
18
18
|
|
|
19
19
|
import { Forms, cleanType } from "@leaddreamer/staticforms";
|
|
20
|
-
import { PAYMENT, RECEIPTS, CARDS } from "../boilerplate";
|
|
20
|
+
import { PAYMENT, RECEIPTS, CARDS } from "../boilerplate/index.js";
|
|
21
21
|
|
|
22
22
|
//////////////////////////////////////////////////////////////////////
|
|
23
23
|
// definitions
|
|
@@ -5,23 +5,148 @@
|
|
|
5
5
|
import { updateRecord} from "@leaddreamer/firebase-wrapper";
|
|
6
6
|
import { Forms, fillForm } from "@leaddreamer/staticforms";
|
|
7
7
|
|
|
8
|
-
import { PRODUCT, MARKUPS, ISBN_LENGTH } from "../boilerplate";
|
|
9
|
-
import { typedRecordFromChild } from "../Utilities"
|
|
8
|
+
import { PRODUCT, MARKUPS, ISBN_LENGTH } from "../boilerplate/index.js";
|
|
9
|
+
import { typedRecordFromChild } from "../Utilities/index.js"
|
|
10
10
|
|
|
11
11
|
//////////////////////////////////////////////////////////////////////
|
|
12
12
|
// Constants
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* "recipe" related values - build-stage markups, product/project Flag, created/modified dates
|
|
16
|
+
* @typedef {object} Recipe_Data
|
|
17
|
+
* @property {module:Markups~Stage} markups
|
|
18
|
+
* @property {boolean} projectQ flag for product/project
|
|
19
|
+
* @property {dateTime} created
|
|
20
|
+
* @property {dateTime} modified
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* A list of attributes for a product
|
|
25
|
+
* @typedef {Array.String} AttributeList
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Array of attribute name/value pairs
|
|
30
|
+
* @typedef {object} AttributeValue
|
|
31
|
+
* @property {string} attibuteName attribute name from attribute list
|
|
32
|
+
* @property {string} value value for the particular attribute
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Image Descriptor
|
|
37
|
+
* @typedef {object} ProductImage
|
|
38
|
+
* @property {string} altText alt text for the image - SEO etc
|
|
39
|
+
* @property {Array.string} availableFormats Available image sizes.
|
|
40
|
+
* @property {string} id unique id for this productImage
|
|
41
|
+
* @property {integer} orderIndex Position of the image in the product's image list.
|
|
42
|
+
* @property {object} originalSize Image size when first uploaded.
|
|
43
|
+
* @property {MetaData} seoOptions
|
|
44
|
+
* @property {string} URL Absolute URL of the hosted image.
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Currency Description ISO 4217 currency code
|
|
49
|
+
* @typedef {object} CurrencyDescription
|
|
50
|
+
* @property {string} currencyCode
|
|
51
|
+
* @property {integer} defaultFractionDigits
|
|
52
|
+
* @property {string} displayName
|
|
53
|
+
* @property {string} numericCodeAsString
|
|
54
|
+
* @property {string} symbol
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Monetary Value Specification
|
|
59
|
+
* @typedef {object} MonetaryValue
|
|
60
|
+
* @property {CurrencyDescription}
|
|
61
|
+
* @property {decimal} value Decimal monetary value
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Pricing Object
|
|
66
|
+
* @typedef {object} FullProductPricing
|
|
67
|
+
* @property {MonetaryValue} basePrice
|
|
68
|
+
* @property {boolean} onSale
|
|
69
|
+
* @property {MonetaryValue} salePrice
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Dimensions Object
|
|
74
|
+
* @typedef {object} ProductDimensions
|
|
75
|
+
* @property {float} height
|
|
76
|
+
* @property {float} width
|
|
77
|
+
* @property {float} length
|
|
78
|
+
* @property {text} unit //ProductDimensionsUnit
|
|
79
|
+
*/
|
|
80
|
+
|
|
13
81
|
/**
|
|
14
|
-
*
|
|
82
|
+
* Price Object
|
|
83
|
+
* @typedef {object} PriceObject
|
|
84
|
+
*
|
|
85
|
+
*/
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Weight Object
|
|
89
|
+
* @typedef {object} ProductWeight
|
|
90
|
+
* @property {text} unit //ProductWeightUnitEnum
|
|
91
|
+
* @property {float} value
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Measurements of the variant when it's shipped. Present for PHYSICAL products only.
|
|
96
|
+
* @typedef {object} ProductMeasurements
|
|
97
|
+
* @property {ProductDimensions} dimensions
|
|
98
|
+
* @property {ProductWeight} weight
|
|
99
|
+
*/
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Available stock for the variant. Present for PHYSICAL products only.
|
|
103
|
+
* @typedef {object} ProductStock
|
|
104
|
+
* @property {integer} quantity
|
|
105
|
+
* @property {boolean} unlimited
|
|
106
|
+
*/
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* variant record (including inventory and pricing)
|
|
111
|
+
* @typedef {object} PhysicalProductVariant
|
|
112
|
+
* @property {Array.AttributeValue} attributes array of attribute/value pairs for a variant
|
|
113
|
+
* @property {string} sku
|
|
114
|
+
* @property {string} mpn manufacturer part number
|
|
115
|
+
* @property {string} gtin Global Trade Item Number
|
|
116
|
+
* @property {string} id unique ID for product variant
|
|
117
|
+
* @property {ProductImage} image Image associated with this variant
|
|
118
|
+
* @property {ProductMeasurements} shippingMeasurements
|
|
119
|
+
* @property {ProductStock} stock
|
|
120
|
+
*/
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Meta Information for SEO
|
|
124
|
+
* @typedef {object} MetaData
|
|
125
|
+
* @property {string} title
|
|
126
|
+
* @property {string} description
|
|
127
|
+
*/
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* a product record
|
|
15
131
|
* @typedef {object} Product
|
|
16
|
-
* @property {?string} Id Id of document (redundant for convenience)
|
|
132
|
+
* @property {?string} Id Database Id of document (redundant for convenience)
|
|
17
133
|
* @property {?string} refPath if from database, full path to document
|
|
18
134
|
* @property {string} name name for the Product
|
|
19
|
-
* @property {string} description
|
|
20
|
-
* @property {
|
|
21
|
-
* @property {
|
|
22
|
-
* @property {
|
|
23
|
-
* @property {
|
|
24
|
-
* @property {
|
|
135
|
+
* @property {string} description Basic description of the product
|
|
136
|
+
* @property {Recipe_Data} recipe pricing and fabrication data
|
|
137
|
+
* @property {Array:ImageLinks} image_links
|
|
138
|
+
* @property {text} type //ProductTypeV2Enum
|
|
139
|
+
* @property {boolean} isVisible
|
|
140
|
+
* @property {MetaData} seoOptions
|
|
141
|
+
* @property {string} name name for the Product
|
|
142
|
+
* @property {MetaData} seoOptions
|
|
143
|
+
* @property {Array.string} tags
|
|
144
|
+
* @property {Array.string} materials
|
|
145
|
+
* @property {Array.string} patterns
|
|
146
|
+
* @property {string} URL
|
|
147
|
+
* @property {string} urlSlug
|
|
148
|
+
* @property {Array.string} variantAttributes
|
|
149
|
+
* @property {Array.PhysicalProductVariant} variants
|
|
25
150
|
*/
|
|
26
151
|
|
|
27
152
|
/**
|
|
@@ -31,15 +156,33 @@ import { typedRecordFromChild } from "../Utilities"
|
|
|
31
156
|
* @default
|
|
32
157
|
*/
|
|
33
158
|
const ProductDefault = {
|
|
34
|
-
Id: null,
|
|
35
|
-
refPath: null,
|
|
36
159
|
name: `A Product`,
|
|
37
160
|
description: null,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
161
|
+
recipe: {
|
|
162
|
+
markups: null,
|
|
163
|
+
projectQ: false,
|
|
164
|
+
created: null,
|
|
165
|
+
modified: null,
|
|
166
|
+
},
|
|
167
|
+
image_links: [],
|
|
168
|
+
type: "",
|
|
169
|
+
google_product_type: "",
|
|
170
|
+
shipping_time: 0,
|
|
171
|
+
condition: "",
|
|
172
|
+
adultQ: false,
|
|
173
|
+
age_group: "adult",
|
|
174
|
+
color: [""],
|
|
175
|
+
material: [""],
|
|
176
|
+
gender: "unisex",
|
|
177
|
+
attributes_gemstones: [""],
|
|
178
|
+
pattern: "",
|
|
179
|
+
size: "",
|
|
180
|
+
weight: 0,
|
|
181
|
+
shippingMeasurements: {
|
|
182
|
+
shipping_length: 0,
|
|
183
|
+
shippin_width: 0,
|
|
184
|
+
shipping_height: 0
|
|
185
|
+
}
|
|
43
186
|
};
|
|
44
187
|
|
|
45
188
|
/**
|
package/business/User/index.js
CHANGED
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
} from "@leaddreamer/firebase-wrapper";
|
|
18
18
|
import { Forms } from "@leaddreamer/staticforms";
|
|
19
19
|
|
|
20
|
-
import { USER, USERS } from "../boilerplate";
|
|
21
|
-
import { typedRecordFromChild } from "../Utilities"
|
|
20
|
+
import { USER, USERS } from "../boilerplate/index.js";
|
|
21
|
+
import { typedRecordFromChild } from "../Utilities/index.js"
|
|
22
22
|
|
|
23
23
|
//////////////////////////////////////////////////////////////////////
|
|
24
24
|
// Constants
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
writeRecord,
|
|
14
14
|
} from "@leaddreamer/firebase-wrapper";
|
|
15
15
|
import { Forms } from "@leaddreamer/staticforms";
|
|
16
|
-
import { ADDRESSES } from "../boilerplate";
|
|
16
|
+
import { ADDRESSES } from "../boilerplate/index.js";
|
|
17
17
|
|
|
18
18
|
//////////////////////////////////////////////////////////////////////
|
|
19
19
|
|
package/business/index.js
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* frontEnd and NodeJS BackEnd
|
|
4
4
|
* @module InventoryLogic
|
|
5
5
|
*/
|
|
6
|
-
export * from "./boilerplate";
|
|
7
|
-
export * from "./Commodities";
|
|
8
|
-
export * from "./LineItem";
|
|
9
|
-
export * from "./Payment";
|
|
10
|
-
export * from "./User";
|
|
11
|
-
export * from "./Product";
|
|
12
|
-
export * from "./Markups";
|
|
13
|
-
export * from "./units";
|
|
14
|
-
export * from "./Utilities";
|
|
6
|
+
export * from "./boilerplate/index.js/index.js";
|
|
7
|
+
export * from "./Commodities/index.js";
|
|
8
|
+
export * from "./LineItem/index.js/index.js";
|
|
9
|
+
export * from "./Payment/index.js/index.js";
|
|
10
|
+
export * from "./User/index.js/index.js";
|
|
11
|
+
export * from "./Product/index.js/index.js";
|
|
12
|
+
export * from "./Markups/index.js";
|
|
13
|
+
export * from "./units/index.js";
|
|
14
|
+
export * from "./Utilities/index.js";
|
package/business/units/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { writeRecord, writeBack } from "@leaddreamer/firebase-wrapper";
|
|
7
7
|
import { Forms } from "@leaddreamer/staticforms";
|
|
8
8
|
|
|
9
|
-
import { UNITS } from "../boilerplate";
|
|
9
|
+
import { UNITS } from "../boilerplate/index.js";
|
|
10
10
|
|
|
11
11
|
//////////////////////////////////////////////////////////////////////
|
|
12
12
|
// Constants
|
package/index.js
CHANGED
|
@@ -54,7 +54,7 @@ export function databaseStart(firebase, config, thisLogger = null) {
|
|
|
54
54
|
return FirebaseWrapper(firebase, config, thisLogger);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
export * from "./business";
|
|
57
|
+
export * from "./business/index.js";
|
|
58
58
|
export * from "@leaddreamer/firebase-wrapper";
|
|
59
59
|
export * from "@leaddreamer/genericutilities";
|
|
60
60
|
export * from "@leaddreamer/staticforms";
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"engines": {
|
|
4
4
|
"node": ">=22"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.0.3-beta.
|
|
6
|
+
"version": "0.0.3-beta.11",
|
|
7
7
|
"description": "Business & Database Logic for Inventory Services",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
"module": "index.js",
|
|
30
30
|
"scripts": {
|
|
31
31
|
"reinstall": "rm -rf node_modules && npm install",
|
|
32
|
-
"mybuild": "parcel build",
|
|
33
|
-
"rebuild": "$npm_execpath version patch --git-tag-version && $npm_execpath run docs",
|
|
34
|
-
"beta:rebuild": "$npm_execpath version prerelease --git-tag-version --preid=beta && $npm_execpath run docs",
|
|
32
|
+
"mybuild": "parcel build --dist-dir './dist'",
|
|
35
33
|
"release:rebuild": "$npm_execpath version minor --git-tag-version && $npm_execpath run docs",
|
|
36
34
|
"myprepublishOnly": "$npm_execpath run build",
|
|
37
35
|
"make_docs": "jsdoc2md -c jsdoc.conf.json --template README.hbs --files *.js ./business/*.js ./business/*/*.js > README.md",
|
|
38
36
|
"docs": "$npm_execpath run make_docs",
|
|
37
|
+
"beta:rebuild": "$npm_execpath version prerelease --git-tag-version --preid=beta && $npm_execpath run docs",
|
|
39
38
|
"beta:publish": "$npm_execpath publish --tag=beta --access=restricted",
|
|
39
|
+
"package:rebuild": "$npm_execpath version patch --git-tag-version && $npm_execpath run docs",
|
|
40
40
|
"package:publish": "$npm_execpath publish --access=restricted",
|
|
41
41
|
"dry:publish": "$npm_execpath publish --dry-run"
|
|
42
42
|
},
|