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

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 (60) hide show
  1. package/README.md +0 -648
  2. package/business/Product/GoogleMerchantAPI.js +0 -2
  3. package/business/Utilities/index.js +0 -3
  4. package/package.json +5 -16
  5. package/business/Utilities/other.js +0 -404
  6. package/business/Utilities/promise-queue/index.js +0 -264
  7. package/business/Utilities/promise-queue/new.js +0 -231
  8. package/business/Utilities/rate-limited-queue/index.js +0 -127
  9. package/dist/InventoryLogic.0ac93278.js +0 -35
  10. package/dist/InventoryLogic.0ac93278.js.map +0 -1
  11. package/dist/InventoryLogic.31f6d549.js +0 -152
  12. package/dist/InventoryLogic.31f6d549.js.map +0 -1
  13. package/dist/InventoryLogic.35827495.js +0 -285
  14. package/dist/InventoryLogic.35827495.js.map +0 -1
  15. package/dist/InventoryLogic.37dfff3e.js +0 -72
  16. package/dist/InventoryLogic.37dfff3e.js.map +0 -1
  17. package/dist/InventoryLogic.4206cb15.js +0 -213
  18. package/dist/InventoryLogic.4206cb15.js.map +0 -1
  19. package/dist/InventoryLogic.44193a77.js +0 -35
  20. package/dist/InventoryLogic.44193a77.js.map +0 -1
  21. package/dist/InventoryLogic.46ca6768.js +0 -131
  22. package/dist/InventoryLogic.46ca6768.js.map +0 -1
  23. package/dist/InventoryLogic.4d012935.js +0 -151
  24. package/dist/InventoryLogic.4d012935.js.map +0 -1
  25. package/dist/InventoryLogic.57f24f5f.js +0 -155
  26. package/dist/InventoryLogic.57f24f5f.js.map +0 -1
  27. package/dist/InventoryLogic.59be76a4.js +0 -184
  28. package/dist/InventoryLogic.59be76a4.js.map +0 -1
  29. package/dist/InventoryLogic.70925a32.js +0 -375
  30. package/dist/InventoryLogic.70925a32.js.map +0 -1
  31. package/dist/InventoryLogic.72fcf301.js +0 -6
  32. package/dist/InventoryLogic.72fcf301.js.map +0 -1
  33. package/dist/InventoryLogic.7741caec.js +0 -375
  34. package/dist/InventoryLogic.7741caec.js.map +0 -1
  35. package/dist/InventoryLogic.78480e5e.js +0 -152
  36. package/dist/InventoryLogic.78480e5e.js.map +0 -1
  37. package/dist/InventoryLogic.80d0e568.js +0 -135
  38. package/dist/InventoryLogic.80d0e568.js.map +0 -1
  39. package/dist/InventoryLogic.8a273d2e.js +0 -110
  40. package/dist/InventoryLogic.8a273d2e.js.map +0 -1
  41. package/dist/InventoryLogic.8addb055.js +0 -202
  42. package/dist/InventoryLogic.8addb055.js.map +0 -1
  43. package/dist/InventoryLogic.9dee46ea.js +0 -6
  44. package/dist/InventoryLogic.9dee46ea.js.map +0 -1
  45. package/dist/InventoryLogic.b90f66ea.js +0 -124
  46. package/dist/InventoryLogic.b90f66ea.js.map +0 -1
  47. package/dist/InventoryLogic.bb447b4c.js +0 -39
  48. package/dist/InventoryLogic.bb447b4c.js.map +0 -1
  49. package/dist/InventoryLogic.d27e84a7.js +0 -75
  50. package/dist/InventoryLogic.d27e84a7.js.map +0 -1
  51. package/dist/InventoryLogic.d69ad127.js +0 -217
  52. package/dist/InventoryLogic.d69ad127.js.map +0 -1
  53. package/dist/InventoryLogic.e03e6b07.js +0 -245
  54. package/dist/InventoryLogic.e03e6b07.js.map +0 -1
  55. package/dist/InventoryLogic.f276f76c.js +0 -213
  56. package/dist/InventoryLogic.f276f76c.js.map +0 -1
  57. package/dist/InventoryLogic.f4627c8a.js +0 -160
  58. package/dist/InventoryLogic.f4627c8a.js.map +0 -1
  59. package/dist/index.js +0 -23
  60. package/dist/index.js.map +0 -1
@@ -1,135 +0,0 @@
1
- import {BUSINESS_TYPE as $fefa9c41cb73ae0b$export$1bd589465335bb9d, FUNDAMENTALS as $fefa9c41cb73ae0b$export$1a96cd5ee36c0372, MCC as $fefa9c41cb73ae0b$export$af5764009005aa8e, PAYOUTRATES as $fefa9c41cb73ae0b$export$e313271f328bdd7d, RATES as $fefa9c41cb73ae0b$export$6b29f6d6b64b8c84} from "./InventoryLogic.d27e84a7.js";
2
- import {collectRecords as $6z26t$collectRecords} from "@leaddreamer/firebase-wrapper";
3
- import {Forms as $6z26t$Forms} from "@leaddreamer/staticforms";
4
-
5
- /**
6
- * Typedefs, constants, support functions and database operations related to Fundamental
7
- * setting from the Database *
8
- * @module Fundamentals
9
- */
10
-
11
-
12
- //////////////////////////////////////////////////////////////////////
13
- // constants
14
- /**
15
- * @typedef {object} OrganizationFundamentals
16
- * @property {Array.string} Types Allowed organization types
17
- */ /**
18
- * @typedef {object} Rates
19
- * @property {string} Id
20
- * @property {object} service_charge
21
- * @property {number} service_charge.minimum
22
- * @property {number} service_charge.rate - percentage
23
- * @property {number} service_charge.rounding_factor
24
- */ /**
25
- * @constant
26
- * @type {Rates}
27
- * @default
28
- */ const $367d3ba5e1953c5d$var$Rates = {
29
- Id: null,
30
- service_charge: {
31
- minimum: 0,
32
- rate: 0,
33
- rounding_factor: 4
34
- }
35
- };
36
- /**
37
- * @typedef {object} PaymentProcessor
38
- * @property {number} connected_active allowed active connections
39
- * @property {number} processing_concurrency
40
- * @property {number} processing_rate
41
- * @property {number} processing_time_window
42
- * @property {number} per_payout
43
- * @property {number} rate_payout
44
- * @property {number} rate_payout_scale
45
- */ //For Stripe, all below are in "CENTS"
46
- /**
47
- * @constant
48
- * @type {PaymentProcessor}
49
- * @default
50
- */ const $367d3ba5e1953c5d$var$paymentProcessor = {
51
- connected_active: 200,
52
- processing_concurrency: 10,
53
- processing_rate: 25,
54
- processing_time_window: 1000,
55
- per_payout: 25,
56
- rate_payout: 25,
57
- rate_payout_scale: 10000
58
- };
59
- /**
60
- * @typedef {object} MCCType
61
- * @property {string} Id
62
- * @property {string} MCC - Merchant Class Code
63
- * @property {string} name - Merchant Class Code
64
- * @property {string} description - description of Merchant Class Code
65
- * @property {string} long - long description of Merchant Class Code
66
- * @property {string} type - Applicable business model - "Artists", "Venues" or "Brands"
67
- */ /**
68
- * @constant
69
- * @type {MCCType}
70
- * @default
71
- */ const $367d3ba5e1953c5d$var$MCCDefault = {
72
- Id: null,
73
- MCC: null,
74
- name: null,
75
- description: null,
76
- long: null,
77
- type: null
78
- };
79
- /**
80
- * @typedef {object} BusinessType
81
- * @property {string} Id
82
- * @property {string} business_type - allowed business type value
83
- * @property {string} name -business type value
84
- * @property {string} description - description ofbusiness type value
85
- */ /**
86
- * @constant
87
- * @type {BusinessType}
88
- * @default
89
- */ const $367d3ba5e1953c5d$var$BusinessTypeDefault = {
90
- Id: null,
91
- business_type: null,
92
- name: null,
93
- description: null
94
- };
95
- /**
96
- * @typedef {object} Fundamentals
97
- * @property {Rates} Rates
98
- * @property {PaymentProcessor} PaymentProcessor
99
- * @property {object} Defaults
100
- * @property {MCCType} Defaults.MCC
101
- * @property {OrganizationFundamentals} Organizations
102
- * @property {Array.string} Organizations.Types Allowed organization types
103
- */ (0, $6z26t$Forms).Base[0, $fefa9c41cb73ae0b$export$6b29f6d6b64b8c84] = $367d3ba5e1953c5d$var$Rates;
104
- (0, $6z26t$Forms).Base[0, $fefa9c41cb73ae0b$export$e313271f328bdd7d] = $367d3ba5e1953c5d$var$paymentProcessor;
105
- (0, $6z26t$Forms).Base[0, $fefa9c41cb73ae0b$export$af5764009005aa8e] = $367d3ba5e1953c5d$var$MCCDefault;
106
- (0, $6z26t$Forms).Base[0, $fefa9c41cb73ae0b$export$1bd589465335bb9d] = $367d3ba5e1953c5d$var$BusinessTypeDefault;
107
- async function $367d3ba5e1953c5d$export$f235c8eeea8b793b() {
108
- const fundamentals = await (0, $6z26t$collectRecords)((0, $fefa9c41cb73ae0b$export$1a96cd5ee36c0372));
109
- const fundamental_records = fundamentals.reduce((output, record)=>{
110
- const recordName = record.Id;
111
- return record ? {
112
- ...output,
113
- [recordName]: record
114
- } : output;
115
- }, {});
116
- return fundamental_records;
117
- }
118
- async function $367d3ba5e1953c5d$export$1135a00cfd97f348() {
119
- const fundamentals = await $367d3ba5e1953c5d$export$f235c8eeea8b793b();
120
- return fundamentals[0, $fefa9c41cb73ae0b$export$6b29f6d6b64b8c84];
121
- }
122
- async function $367d3ba5e1953c5d$export$e545b306de1ff740() {
123
- const fundamental_records = await $367d3ba5e1953c5d$export$f235c8eeea8b793b();
124
- return fundamental_records[0, $fefa9c41cb73ae0b$export$e313271f328bdd7d];
125
- }
126
- async function $367d3ba5e1953c5d$export$e12c451a9ec5cd7c() {
127
- return (0, $6z26t$collectRecords)((0, $fefa9c41cb73ae0b$export$af5764009005aa8e), `${(0, $fefa9c41cb73ae0b$export$1a96cd5ee36c0372)}/Defaults`);
128
- }
129
- async function $367d3ba5e1953c5d$export$b0ed4f3c6bb2aee1() {
130
- return (0, $6z26t$collectRecords)((0, $fefa9c41cb73ae0b$export$1bd589465335bb9d), `${(0, $fefa9c41cb73ae0b$export$1a96cd5ee36c0372)}/Defaults`);
131
- }
132
-
133
-
134
- export {$367d3ba5e1953c5d$export$f235c8eeea8b793b as fetchFundamentals, $367d3ba5e1953c5d$export$1135a00cfd97f348 as fetchRates, $367d3ba5e1953c5d$export$e545b306de1ff740 as fetchPayoutRates, $367d3ba5e1953c5d$export$e12c451a9ec5cd7c as fetchMCCs, $367d3ba5e1953c5d$export$b0ed4f3c6bb2aee1 as fetchBusinessTypes};
135
- //# sourceMappingURL=InventoryLogic.80d0e568.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;AAAA;;;;CAIC;;;AAWD,sEAAsE;AACtE,YAAY;AAEZ;;;CAGC,GAED;;;;;;;CAOC,GACD;;;;CAIC,GACD,MAAM,8BAAQ;IACZ,IAAI;IACJ,gBAAgB;QACd,SAAS;QACT,MAAM;QACN,iBAAiB;IACnB;AACF;AAEA;;;;;;;;;CASC,GACD,sCAAsC;AACtC;;;;CAIC,GACD,MAAM,yCAAmB;IACvB,kBAAkB;IAClB,wBAAwB;IACxB,iBAAiB;IACjB,wBAAwB;IACxB,YAAY;IACZ,aAAa;IACb,mBAAmB;AACrB;AAEA;;;;;;;;CAQC,GACD;;;;CAIC,GACD,MAAM,mCAAa;IACjB,IAAI;IACJ,KAAK;IACL,MAAM;IACN,aAAa;IACb,MAAM;IACN,MAAM;AACR;AAEA;;;;;;CAMC,GACD;;;;CAIC,GACD,MAAM,4CAAsB;IAC1B,IAAI;IACJ,eAAe;IACf,MAAM;IACN,aAAa;AACf;AAEA;;;;;;;;CAQC,GAED,CAAA,GAAA,YAAI,EAAE,IAAI,CAAC,GAAA,0CAAM,GAAG;AACpB,CAAA,GAAA,YAAI,EAAE,IAAI,CAAC,GAAA,0CAAY,GAAG;AAC1B,CAAA,GAAA,YAAI,EAAE,IAAI,CAAC,GAAA,0CAAI,GAAG;AAClB,CAAA,GAAA,YAAI,EAAE,IAAI,CAAC,GAAA,0CAAc,GAAG;AAUrB,eAAe;IACpB,MAAM,eAAe,MAAM,CAAA,GAAA,qBAAa,EAAE,CAAA,GAAA,yCAAW;IACrD,MAAM,sBAAsB,aAAa,MAAM,CAAC,CAAC,QAAQ;QACvD,MAAM,aAAa,OAAO,EAAE;QAC5B,OAAO,SACH;YACE,GAAG,MAAM;YACT,CAAC,WAAW,EAAE;QAChB,IACA;IACN,GAAG,CAAC;IACJ,OAAO;AACT;AAMO,eAAe;IACpB,MAAM,eAAe,MAAM;IAC3B,OAAO,YAAY,CAAC,GAAA,0CAAM;AAC5B;AAMO,eAAe;IACpB,MAAM,sBAAsB,MAAM;IAElC,OAAO,mBAAmB,CAAC,GAAA,0CAAY;AACzC;AAMO,eAAe;IACpB,OAAO,CAAA,GAAA,qBAAa,EAAE,CAAA,GAAA,yCAAE,GAAG,GAAG,CAAA,GAAA,yCAAW,EAAE,SAAS,CAAC;AACvD;AAMO,eAAe;IACpB,OAAO,CAAA,GAAA,qBAAa,EAAE,CAAA,GAAA,yCAAY,GAAG,GAAG,CAAA,GAAA,yCAAW,EAAE,SAAS,CAAC;AACjE","sources":["business/Fundamentals/index.js"],"sourcesContent":["/**\n * Typedefs, constants, support functions and database operations related to Fundamental\n * setting from the Database *\n * @module Fundamentals\n */\nimport { collectRecords } from \"@leaddreamer/firebase-wrapper\";\nimport { Forms, fillForm } from \"@leaddreamer/staticforms\";\nimport {\n FUNDAMENTALS,\n RATES,\n PAYOUTRATES,\n MCC,\n BUSINESS_TYPE,\n} from \"../boilerplate/index.js\";\n\n//////////////////////////////////////////////////////////////////////\n// constants\n\n/**\n * @typedef {object} OrganizationFundamentals\n * @property {Array.string} Types Allowed organization types\n */\n\n/**\n * @typedef {object} Rates\n * @property {string} Id\n * @property {object} service_charge\n * @property {number} service_charge.minimum\n * @property {number} service_charge.rate - percentage\n * @property {number} service_charge.rounding_factor\n */\n/**\n * @constant\n * @type {Rates}\n * @default\n */\nconst Rates = {\n Id: null,\n service_charge: {\n minimum: 0,\n rate: 0,\n rounding_factor: 4,\n },\n};\n\n/**\n * @typedef {object} PaymentProcessor\n * @property {number} connected_active allowed active connections\n * @property {number} processing_concurrency\n * @property {number} processing_rate\n * @property {number} processing_time_window\n * @property {number} per_payout\n * @property {number} rate_payout\n * @property {number} rate_payout_scale\n */\n//For Stripe, all below are in \"CENTS\"\n/**\n * @constant\n * @type {PaymentProcessor}\n * @default\n */\nconst paymentProcessor = {\n connected_active: 200,\n processing_concurrency: 10,\n processing_rate: 25,\n processing_time_window: 1000,\n per_payout: 25,\n rate_payout: 25,\n rate_payout_scale: 10000,\n};\n\n/**\n * @typedef {object} MCCType\n * @property {string} Id\n * @property {string} MCC - Merchant Class Code\n * @property {string} name - Merchant Class Code\n * @property {string} description - description of Merchant Class Code\n * @property {string} long - long description of Merchant Class Code\n * @property {string} type - Applicable business model - \"Artists\", \"Venues\" or \"Brands\"\n */\n/**\n * @constant\n * @type {MCCType}\n * @default\n */\nconst MCCDefault = {\n Id: null,\n MCC: null,\n name: null,\n description: null,\n long: null,\n type: null,\n};\n\n/**\n * @typedef {object} BusinessType\n * @property {string} Id\n * @property {string} business_type - allowed business type value\n * @property {string} name -business type value\n * @property {string} description - description ofbusiness type value\n */\n/**\n * @constant\n * @type {BusinessType}\n * @default\n */\nconst BusinessTypeDefault = {\n Id: null,\n business_type: null,\n name: null,\n description: null,\n};\n\n/**\n * @typedef {object} Fundamentals\n * @property {Rates} Rates\n * @property {PaymentProcessor} PaymentProcessor\n * @property {object} Defaults\n * @property {MCCType} Defaults.MCC\n * @property {OrganizationFundamentals} Organizations\n * @property {Array.string} Organizations.Types Allowed organization types\n */\n\nForms.Base[RATES] = Rates;\nForms.Base[PAYOUTRATES] = paymentProcessor;\nForms.Base[MCC] = MCCDefault;\nForms.Base[BUSINESS_TYPE] = BusinessTypeDefault;\n\n//////////////////////////////////////////////////////////\n// fetches\n\n/**\n * returns a Promise which resolves with an\n * array of all Fundamentals Objects (or err)\n * @returns {Promise<Fundamentals>}\n */\nexport async function fetchFundamentals() {\n const fundamentals = await collectRecords(FUNDAMENTALS);\n const fundamental_records = fundamentals.reduce((output, record) => {\n const recordName = record.Id;\n return record\n ? {\n ...output,\n [recordName]: record,\n }\n : output;\n }, {});\n return fundamental_records;\n}\n\n/**\n * returns a Promise that resolves with the Rates record from the database\n * @returns {Promise<Rates>}\n */\nexport async function fetchRates() {\n const fundamentals = await fetchFundamentals();\n return fundamentals[RATES];\n}\n\n/**\n * returns a Promise that resolves with the Rates record from the database\n * @returns {Promise<PaymentProcessor>}\n */\nexport async function fetchPayoutRates() {\n const fundamental_records = await fetchFundamentals();\n\n return fundamental_records[PAYOUTRATES];\n}\n\n/**\n * returns an array of all MCC (Merchant Commerce Code) available\n * @returns {Promise<Array.MCCType>}\n */\nexport async function fetchMCCs() {\n return collectRecords(MCC, `${FUNDAMENTALS}/Defaults`);\n}\n\n/**\n * returns an array of all MCC (Merchant Commerce Code) available\n * @returns {Promise<Array.BusinessType>}\n */\nexport async function fetchBusinessTypes() {\n return collectRecords(BUSINESS_TYPE, `${FUNDAMENTALS}/Defaults`);\n}\n"],"names":[],"version":3,"file":"InventoryLogic.80d0e568.js.map"}
@@ -1,110 +0,0 @@
1
- import {ADDRESSES as $fefa9c41cb73ae0b$export$6890d3564b1f252d, PRIVATEDATA as $fefa9c41cb73ae0b$export$398ebe85ebcaa41f, USER as $fefa9c41cb73ae0b$export$ff09b90989b21a8} from "./InventoryLogic.d27e84a7.js";
2
- import {fetchAddresses as $5e875028eacae923$export$c9b8cb1768a98d34} from "./InventoryLogic.37dfff3e.js";
3
- import {fetchRecord as $czehv$fetchRecord, typedWrite as $czehv$typedWrite, writeBack as $czehv$writeBack, deleteRecordByRefPath as $czehv$deleteRecordByRefPath} from "@leaddreamer/firebase-wrapper";
4
- import {Forms as $czehv$Forms, fillForm as $czehv$fillForm} from "@leaddreamer/staticforms";
5
-
6
- /**
7
- * Functions for managing (potentially)private data for a user or organization.
8
- * Unified structure as a sub-record of fan, organization, or CityManager accounts
9
- * @module PrivateData
10
- */
11
-
12
-
13
-
14
- //////////////////////////////////////////////////////////////////////
15
- // definitions
16
- /**
17
- * @external AddressType
18
- */ /**
19
- * @typedef {object} contact
20
- * @property {?string} contact.Id
21
- * @property {!string} contact.first_name
22
- * @property {!string} contact.last_name
23
- * @property {!string} contact.tel
24
- * @property {?string} contact.email - must be filled in to make profile public
25
- */ /**
26
- * @typedef {object} PrivateData
27
- * @property {?string} email - must be filled in to make profile public
28
- * @property {contact} contact
29
- * @property {!string} tel
30
- * @property {AddressType} business_address
31
- * @property {AddressType} mailing_address
32
- * @property {AddressType} billing_address
33
- */ /**
34
- * @constant
35
- * @type {PrivateData}
36
- * @default
37
- */ const $61cd1791d5265689$var$PrivateDefault = {
38
- Id: null,
39
- email: null,
40
- contact: null,
41
- business_address: null,
42
- mailing_address: null,
43
- billing_address: null,
44
- tel: null,
45
- tax_rate: null,
46
- //tax_id: null,
47
- openIssues: false
48
- };
49
- /**
50
- * @constant
51
- * @type {PrivateData}
52
- * @default
53
- */ const $61cd1791d5265689$var$PrivateAccountForm = {
54
- refPath: "hidden:text",
55
- email: "email",
56
- contact: `object:${(0, $fefa9c41cb73ae0b$export$ff09b90989b21a8)}`,
57
- business_address: `lookupLink:${(0, $fefa9c41cb73ae0b$export$6890d3564b1f252d)}`,
58
- mailing_address: `lookupLink:${(0, $fefa9c41cb73ae0b$export$6890d3564b1f252d)}`,
59
- billing_address: `lookupLink:${(0, $fefa9c41cb73ae0b$export$6890d3564b1f252d)}`,
60
- tel: "tel"
61
- };
62
- (0, $czehv$Forms).Base[0, $fefa9c41cb73ae0b$export$398ebe85ebcaa41f] = $61cd1791d5265689$var$PrivateDefault;
63
- (0, $czehv$Forms).BaseForm[0, $fefa9c41cb73ae0b$export$398ebe85ebcaa41f] = $61cd1791d5265689$var$PrivateAccountForm;
64
- (0, $czehv$Forms).AccountForm[0, $fefa9c41cb73ae0b$export$398ebe85ebcaa41f] = $61cd1791d5265689$var$PrivateAccountForm;
65
- async function $61cd1791d5265689$export$c3bebe1b4bbebe25(account) {
66
- let addresses = [];
67
- try {
68
- addresses = await (0, $5e875028eacae923$export$c9b8cb1768a98d34)(account);
69
- } catch (err) {}
70
- const addressMap = new Map();
71
- if (addresses.length) addresses.forEach((address)=>{
72
- addressMap.set(address.Id, address);
73
- });
74
- let privateData = await (0, $czehv$fetchRecord)((0, $fefa9c41cb73ae0b$export$398ebe85ebcaa41f), account.Id, account.refPath);
75
- let addressEntries = {};
76
- [
77
- "business_address",
78
- "billing_address",
79
- "mailing_address"
80
- ].forEach((entry)=>{
81
- const isLink = entry && privateData[entry] && !privateData[entry]?.address_line_1;
82
- if (isLink) addressEntries[entry] = {
83
- ...addressMap.get(privateData[entry])
84
- };
85
- }); //hacky way to repeat same effort
86
- privateData = {
87
- ...privateData,
88
- ...addressEntries
89
- };
90
- return privateData;
91
- }
92
- async function $61cd1791d5265689$export$9cc830020e353c38(account, batch = null) {
93
- return (0, $czehv$typedWrite)({
94
- ...(0, $czehv$Forms).Base[0, $fefa9c41cb73ae0b$export$398ebe85ebcaa41f],
95
- ...(0, $czehv$fillForm)(account, (0, $fefa9c41cb73ae0b$export$398ebe85ebcaa41f))
96
- }, account, (0, $fefa9c41cb73ae0b$export$398ebe85ebcaa41f), batch);
97
- }
98
- async function $61cd1791d5265689$export$fd09f53e2b56e2af(privateData, batch = null) {
99
- return (0, $czehv$writeBack)(privateData, batch);
100
- }
101
- async function $61cd1791d5265689$export$4d99519ebd12d7e2(privateData, batch = null) {
102
- return (0, $czehv$deleteRecordByRefPath)(privateData.refPath, batch);
103
- }
104
- function $61cd1791d5265689$export$9319c406c799955a(account) {
105
- return `${account.refPath}/${0, $fefa9c41cb73ae0b$export$398ebe85ebcaa41f}/${account.Id}`;
106
- }
107
-
108
-
109
- export {$61cd1791d5265689$export$c3bebe1b4bbebe25 as fetchPrivateData, $61cd1791d5265689$export$9cc830020e353c38 as createPrivateData, $61cd1791d5265689$export$fd09f53e2b56e2af as savePrivateData, $61cd1791d5265689$export$4d99519ebd12d7e2 as deletePrivateData, $61cd1791d5265689$export$9319c406c799955a as privateDataPath};
110
- //# sourceMappingURL=InventoryLogic.8a273d2e.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;AAAA;;;;CAIC;;;;AAWD,sEAAsE;AACtE,cAAc;AAEd;;CAEC,GACD;;;;;;;CAOC,GACD;;;;;;;;CAQC,GACD;;;;CAIC,GACD,MAAM,uCAAiB;IACrB,IAAI;IACJ,OAAO;IACP,SAAS;IACT,kBAAkB;IAClB,iBAAiB;IACjB,iBAAiB;IACjB,KAAK;IACL,UAAU;IACV,eAAe;IACf,YAAY;AACd;AAEA;;;;CAIC,GACD,MAAM,2CAAqB;IACzB,SAAS;IACT,OAAO;IACP,SAAS,CAAC,OAAO,EAAE,CAAA,GAAA,wCAAG,GAAG;IACzB,kBAAkB,CAAC,WAAW,EAAE,CAAA,GAAA,yCAAQ,GAAG;IAC3C,iBAAiB,CAAC,WAAW,EAAE,CAAA,GAAA,yCAAQ,GAAG;IAC1C,iBAAiB,CAAC,WAAW,EAAE,CAAA,GAAA,yCAAQ,GAAG;IAC1C,KAAK;AACP;AAEA,CAAA,GAAA,YAAI,EAAE,IAAI,CAAC,GAAA,0CAAY,GAAG;AAC1B,CAAA,GAAA,YAAI,EAAE,QAAQ,CAAC,GAAA,0CAAY,GAAG;AAC9B,CAAA,GAAA,YAAI,EAAE,WAAW,CAAC,GAAA,0CAAY,GAAG;AAU1B,eAAe,0CAAiB,OAAO;IAC5C,IAAI,YAAY,EAAE;IAClB,IAAI;QACF,YAAY,MAAM,CAAA,GAAA,yCAAa,EAAE;IACnC,EAAE,OAAO,KAAK,CAAC;IACf,MAAM,aAAa,IAAI;IACvB,IAAI,UAAU,MAAM,EAClB,UAAU,OAAO,CAAC,CAAC;QACjB,WAAW,GAAG,CAAC,QAAQ,EAAE,EAAE;IAC7B;IAGF,IAAI,cAAc,MAAM,CAAA,GAAA,kBAAU,EAChC,CAAA,GAAA,yCAAU,GACV,QAAQ,EAAE,EACV,QAAQ,OAAO;IAGjB,IAAI,iBAAiB,CAAC;IACtB;QAAC;QAAoB;QAAmB;KAAkB,CAAC,OAAO,CAChE,CAAC;QACC,MAAM,SACJ,SAAS,WAAW,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE;QACtD,IAAI,QACF,cAAc,CAAC,MAAM,GAAG;YACtB,GAAG,WAAW,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC;QACvC;IAEJ,IACC,iCAAiC;IAEpC,cAAc;QACZ,GAAG,WAAW;QACd,GAAG,cAAc;IACnB;IAEA,OAAO;AACT;AAgBO,eAAe,0CAAkB,OAAO,EAAE,QAAQ,IAAI;IAC3D,OAAO,CAAA,GAAA,iBAAS,EACd;QACE,GAAG,CAAA,GAAA,YAAI,EAAE,IAAI,CAAC,GAAA,0CAAY;QAC1B,GAAG,CAAA,GAAA,eAAO,EAAE,SAAS,CAAA,GAAA,yCAAU,EAAE;IACnC,GACA,SACA,CAAA,GAAA,yCAAU,GACV;AAEJ;AAOO,eAAe,0CAAgB,WAAW,EAAE,QAAQ,IAAI;IAC7D,OAAO,CAAA,GAAA,gBAAQ,EAAE,aAAa;AAChC;AAQO,eAAe,0CAAkB,WAAW,EAAE,QAAQ,IAAI;IAC/D,OAAO,CAAA,GAAA,4BAAoB,EAAE,YAAY,OAAO,EAAE;AACpD;AAQO,SAAS,0CAAgB,OAAO;IACrC,OAAO,GAAG,QAAQ,OAAO,CAAC,CAAC,EAAE,GAAA,0CAAY,CAAC,EAAE,QAAQ,EAAE,EAAE;AAC1D","sources":["business/PrivateData/index.js"],"sourcesContent":["/**\n * Functions for managing (potentially)private data for a user or organization.\n * Unified structure as a sub-record of fan, organization, or CityManager accounts\n * @module PrivateData\n */\nimport {\n fetchRecord,\n typedWrite,\n writeBack,\n deleteRecordByRefPath,\n} from \"@leaddreamer/firebase-wrapper\";\nimport { Forms, fillForm } from \"@leaddreamer/staticforms\";\nimport { PRIVATEDATA, ADDRESSES, USER, MCC } from \"../boilerplate/index.js\";\nimport { fetchAddresses } from \"../Addresses/index.js\";\n\n//////////////////////////////////////////////////////////////////////\n// definitions\n\n/**\n * @external AddressType\n */\n/**\n * @typedef {object} contact\n * @property {?string} contact.Id\n * @property {!string} contact.first_name\n * @property {!string} contact.last_name\n * @property {!string} contact.tel\n * @property {?string} contact.email - must be filled in to make profile public\n */\n/**\n * @typedef {object} PrivateData\n * @property {?string} email - must be filled in to make profile public\n * @property {contact} contact\n * @property {!string} tel\n * @property {AddressType} business_address\n * @property {AddressType} mailing_address\n * @property {AddressType} billing_address\n */\n/**\n * @constant\n * @type {PrivateData}\n * @default\n */\nconst PrivateDefault = {\n Id: null,\n email: null,\n contact: null,\n business_address: null,\n mailing_address: null,\n billing_address: null,\n tel: null,\n tax_rate: null,\n //tax_id: null,\n openIssues: false,\n};\n\n/**\n * @constant\n * @type {PrivateData}\n * @default\n */\nconst PrivateAccountForm = {\n refPath: \"hidden:text\",\n email: \"email\",\n contact: `object:${USER}`,\n business_address: `lookupLink:${ADDRESSES}`,\n mailing_address: `lookupLink:${ADDRESSES}`,\n billing_address: `lookupLink:${ADDRESSES}`,\n tel: \"tel\",\n};\n\nForms.Base[PRIVATEDATA] = PrivateDefault;\nForms.BaseForm[PRIVATEDATA] = PrivateAccountForm;\nForms.AccountForm[PRIVATEDATA] = PrivateAccountForm;\n\n//////////////////////////////////////////////////////////////////////\n// Utilities\n\n/**\n * Fecthes the PrivateData (email, tel, addresses, etc) for a Fan account\n * @param {AccountType} account\n * @returns {Promise.PrivateData}\n */\nexport async function fetchPrivateData(account) {\n let addresses = [];\n try {\n addresses = await fetchAddresses(account);\n } catch (err) {}\n const addressMap = new Map();\n if (addresses.length) {\n addresses.forEach((address) => {\n addressMap.set(address.Id, address);\n });\n }\n\n let privateData = await fetchRecord(\n PRIVATEDATA,\n account.Id,\n account.refPath,\n );\n\n let addressEntries = {};\n [\"business_address\", \"billing_address\", \"mailing_address\"].forEach(\n (entry) => {\n const isLink =\n entry && privateData[entry] && !privateData[entry]?.address_line_1;\n if (isLink) {\n addressEntries[entry] = {\n ...addressMap.get(privateData[entry]),\n };\n }\n },\n ); //hacky way to repeat same effort\n\n privateData = {\n ...privateData,\n ...addressEntries\n };\n \n return privateData;\n}\n\n/**\n * @external WriteBatch\n * @typedef {WriteBatch|Transaction|void} ChainType\n */\n\n/**\n * @async\n * @function\n * @static\n * Creates the Business information document\n * @param {AccountType} account\n * @param {?ChainType} batch - batching object. Transaction will be added to the batch\n * @returns {Promise<ChainType>} WriteBatch, Transaction or Void\n */\nexport async function createPrivateData(account, batch = null) {\n return typedWrite(\n {\n ...Forms.Base[PRIVATEDATA],\n ...fillForm(account, PRIVATEDATA), //sanitize\n }, //data\n account, //parent\n PRIVATEDATA, //type\n batch,\n );\n}\n\n/**\n * Writes the \"private\" data to the database\n * @param {PrivateData} privateData\n * @returns {Promise<PrivateData>}\n */\nexport async function savePrivateData(privateData, batch = null) {\n return writeBack(privateData, batch);\n}\n\n/**\n * Deletes a PrivateData record (rarely used if ever)\n * @param {PrivateData} privateData\n * @param {!string} privateData.refPath\n * @returns {Promise<void>}\n */\nexport async function deletePrivateData(privateData, batch = null) {\n return deleteRecordByRefPath(privateData.refPath, batch);\n}\n\n/**\n * creates the \"base path\" (refPath) to store addresses based on an account (refPath)\n * @param {Record} account\n * @param {!string} account.refPath\n * @returns {string}\n */\nexport function privateDataPath(account) {\n return `${account.refPath}/${PRIVATEDATA}/${account.Id}`;\n}\n"],"names":[],"version":3,"file":"InventoryLogic.8a273d2e.js.map"}
@@ -1,202 +0,0 @@
1
- import {COMMODITY as $fefa9c41cb73ae0b$export$eb747620ce9c5e16, COMPONENT_COUNT_RANGE as $fefa9c41cb73ae0b$export$d141374f02dd06d9, COMPONENT_RANGE as $fefa9c41cb73ae0b$export$72581e25313abf48, LINEITEM as $fefa9c41cb73ae0b$export$4843f9d856059ffd, MATERIAL as $fefa9c41cb73ae0b$export$ca8f11448d1a1116, STAGE as $fefa9c41cb73ae0b$export$f9865a0a7f208c15, UNITS as $fefa9c41cb73ae0b$export$a037d132965e1c9f} from "./InventoryLogic.d27e84a7.js";
2
- import {deleteRecord as $c3ITo$deleteRecord, writeRecord as $c3ITo$writeRecord, updateRecord as $c3ITo$updateRecord, collectRecordsByFilter as $c3ITo$collectRecordsByFilter, PaginateFetch as $c3ITo$PaginateFetch, fetchRecord as $c3ITo$fetchRecord} from "@leaddreamer/firebase-wrapper";
3
- import {Forms as $c3ITo$Forms, fillForm as $c3ITo$fillForm} from "@leaddreamer/staticforms";
4
-
5
- /**
6
- * Typedefs, constants, support functions and database operations related to LineItem Matrials
7
- * users
8
- * @module LineItem
9
- */
10
-
11
-
12
- //import {StageLevels, MaterialLevels} from "../Markups/index.js";
13
- //////////////////////////////////////////////////////////////////////
14
- // Constants
15
- /**
16
- * a record
17
- * @typedef {object} LineItem
18
- * @property {string} Id Id of document (redundant for convenience)
19
- * @property {string} refPath if from database, full path to document
20
- * @property {StageLevels} STAGE "fabrication", "wholesale", "retail" or other to be defined
21
- * @property {MaterialLevels} MATERIAL "base", "highValue", "service" or other value to be defined
22
- * @property {null|string} commodity Id of a commodity item/material (optional)
23
- * @property {string|null} description description, e.g. "Wire, Silver, Sterling, 20ga"
24
- * //can be overwritten by commodity
25
- * @property {string|null} unit usage/measurement unit (for unit conversion)
26
- * //can be overwritten by commodity
27
- * @property {number} rate the per unit cost of this lineItem
28
- * //can be overwritten by commodity
29
- * @property {number} amount amount of material/item useed
30
- * @property {datetime} timestamp initial time of creation for sorting
31
- * @property {url|null} image a reference image for the lineItem
32
- */ /**
33
- * Default/Blank Form for LineItem data records
34
- * @readonly
35
- * @constant
36
- * @type {LineItem}
37
- * @default
38
- */ const $618035149cc2f269$var$LineItemDefault = {
39
- Id: null,
40
- refPath: null,
41
- [(0, $fefa9c41cb73ae0b$export$f9865a0a7f208c15)]: null,
42
- [(0, $fefa9c41cb73ae0b$export$ca8f11448d1a1116)]: null,
43
- commodity: null,
44
- description: null,
45
- unit: null,
46
- rate: 0,
47
- count: 0,
48
- image: null
49
- };
50
- /**
51
- * Form for generating placeholder LineItem data.
52
- * @readonly
53
- * @constant
54
- * @type {LineItem}
55
- * @default
56
- */ const $618035149cc2f269$var$LineItemData = {
57
- Id: `string.uuid`,
58
- refPath: null,
59
- [(0, $fefa9c41cb73ae0b$export$f9865a0a7f208c15)]: `lookupChoices:${(0, $fefa9c41cb73ae0b$export$f9865a0a7f208c15)}`,
60
- [(0, $fefa9c41cb73ae0b$export$ca8f11448d1a1116)]: `lookupChoices:${(0, $fefa9c41cb73ae0b$export$ca8f11448d1a1116)}`,
61
- commodity: `lookupLevels:${(0, $fefa9c41cb73ae0b$export$eb747620ce9c5e16)}`,
62
- description: `commerce.productDescription`,
63
- count: `number.int:${(0, $fefa9c41cb73ae0b$export$d141374f02dd06d9)}`,
64
- unit: `lookupLink:units`,
65
- rate: `commerce.price:${(0, $fefa9c41cb73ae0b$export$72581e25313abf48)}`,
66
- line_total: `commerce.price:${(0, $fefa9c41cb73ae0b$export$72581e25313abf48)}`,
67
- image: null
68
- };
69
- /**
70
- * Form for driving an Editor form for LineItem Data
71
- * @readonly
72
- * @constant
73
- * @type {LineItem}
74
- * @default
75
- */ const $618035149cc2f269$var$LineItemDefaultForm = {
76
- [(0, $fefa9c41cb73ae0b$export$f9865a0a7f208c15)]: `lookupChoices:${(0, $fefa9c41cb73ae0b$export$f9865a0a7f208c15)}`,
77
- [(0, $fefa9c41cb73ae0b$export$ca8f11448d1a1116)]: `lookupChoices:${(0, $fefa9c41cb73ae0b$export$ca8f11448d1a1116)}`,
78
- commodity: `lookupLevels:${(0, $fefa9c41cb73ae0b$export$eb747620ce9c5e16)}`,
79
- description: `text`,
80
- count: `number`,
81
- unit: `lookupLink:${(0, $fefa9c41cb73ae0b$export$a037d132965e1c9f)}`,
82
- rate: `number`,
83
- line_total: `lineSum`,
84
- image: `url`
85
- };
86
- (0, $c3ITo$Forms).Base[0, $fefa9c41cb73ae0b$export$4843f9d856059ffd] = $618035149cc2f269$var$LineItemDefault;
87
- (0, $c3ITo$Forms).BaseForm[0, $fefa9c41cb73ae0b$export$4843f9d856059ffd] = $618035149cc2f269$var$LineItemDefaultForm;
88
- (0, $c3ITo$Forms).CreateForm[0, $fefa9c41cb73ae0b$export$4843f9d856059ffd] = $618035149cc2f269$var$LineItemDefaultForm;
89
- (0, $c3ITo$Forms).Data[0, $fefa9c41cb73ae0b$export$4843f9d856059ffd] = $618035149cc2f269$var$LineItemData;
90
- (0, $c3ITo$Forms).Summarize[0, $fefa9c41cb73ae0b$export$4843f9d856059ffd] = $618035149cc2f269$var$summarizeLineItem;
91
- (0, $c3ITo$Forms).Save[0, $fefa9c41cb73ae0b$export$4843f9d856059ffd] = $618035149cc2f269$var$updateLineItem;
92
- (0, $c3ITo$Forms).SearchBy[0, $fefa9c41cb73ae0b$export$4843f9d856059ffd] = "description";
93
- (0, $c3ITo$Forms).LineSum[0, $fefa9c41cb73ae0b$export$4843f9d856059ffd] = $618035149cc2f269$var$lineItem_lineSum; //FUNCTION
94
- (0, $c3ITo$Forms).UpdateChange[0, $fefa9c41cb73ae0b$export$4843f9d856059ffd] = $618035149cc2f269$var$UpdateChange;
95
- async function $618035149cc2f269$export$42fb5c11b332038a(lineItem, product1 = null) {
96
- return (0, $c3ITo$deleteRecord)(lineItem, (0, $fefa9c41cb73ae0b$export$4843f9d856059ffd), product1?.refPath);
97
- }
98
- async function $618035149cc2f269$export$9311bf4c650d8c56(lineItem, product1) {
99
- if (!lineItem?.Id) return;
100
- return (0, $c3ITo$deleteRecord)(lineItem, (0, $fefa9c41cb73ae0b$export$4843f9d856059ffd), product1?.refPath);
101
- }
102
- const $618035149cc2f269$export$9160586647000ce = (lineItem)=>{
103
- //need a "no duplicate" function - whatever that means in this context
104
- return (0, $c3ITo$writeRecord)((0, $fefa9c41cb73ae0b$export$4843f9d856059ffd), lineItem, product.refPath);
105
- };
106
- /**
107
- * writes record back to database. Assumes only Id is valid
108
- * @param {LineItem} lineItem a partially-populated lineItem record for updates
109
- * @param {Product} product minimal record of product this lineItem belongs to
110
- * @returns {promise.LineItem} a copy of the data written
111
- */ async function $618035149cc2f269$var$updateLineItem(lineItem, product1 = null) {
112
- if (!(lineItem?.refPath || product1?.refPath)) {
113
- console.log("no product specified to save LineItem");
114
- //no root lineItems
115
- return null;
116
- }
117
- return (0, $c3ITo$updateRecord)((0, $c3ITo$fillForm)(lineItem, (0, $fefa9c41cb73ae0b$export$4843f9d856059ffd)), product1, (0, $fefa9c41cb73ae0b$export$4843f9d856059ffd));
118
- }
119
- async function $618035149cc2f269$export$682c51c4d54f1588(Id, product1) {
120
- let exists = true;
121
- try {
122
- await $618035149cc2f269$export$7c918f386d58a9a2(Id, product1);
123
- } catch (err) {
124
- exists = false;
125
- }
126
- return exists;
127
- }
128
- async function $618035149cc2f269$export$93ad1b66295660db() {
129
- return collectRecordsInGroup((0, $fefa9c41cb73ae0b$export$4843f9d856059ffd));
130
- }
131
- async function $618035149cc2f269$export$d2c186a25126fe28(product1, stage = null) {
132
- const filterArray = stage ? [
133
- {
134
- fieldRef: "stage",
135
- opStr: "==",
136
- value: stage.name
137
- }
138
- ] : null;
139
- return (0, $c3ITo$collectRecordsByFilter)((0, $fefa9c41cb73ae0b$export$4843f9d856059ffd), product1.refPath, filterArray, null);
140
- }
141
- async function $618035149cc2f269$export$e6123a92ff8533fc(product1, stage = null, limit = null) {
142
- const filterArray = stage ? [
143
- {
144
- fieldRef: "stage",
145
- opStr: "==",
146
- value: stage.name
147
- }
148
- ] : null;
149
- return new (0, $c3ITo$PaginateFetch)((0, $fefa9c41cb73ae0b$export$4843f9d856059ffd), filterArray, [
150
- {
151
- fieldRef: "timestamp",
152
- dirStr: "asc"
153
- }
154
- ], product1.refPath, limit);
155
- }
156
- async function $618035149cc2f269$export$7c918f386d58a9a2(lineItemId, product1) {
157
- return (0, $c3ITo$fetchRecord)((0, $fefa9c41cb73ae0b$export$4843f9d856059ffd), lineItemId, product1.refPath);
158
- }
159
- async function $618035149cc2f269$export$218cbdd54a707ec7(lineItemId, product1) {
160
- const lineItem = await $618035149cc2f269$export$7c918f386d58a9a2(lineItemId, product1);
161
- return $618035149cc2f269$var$summarizeLineItem(lineItem);
162
- }
163
- //////////////////////////////////////////////////////////////////////
164
- // utilities
165
- /**
166
- * Returns a standardized formatted name string
167
- * @param {LineItem}
168
- * @returns {string} formatted name string
169
- */ function $618035149cc2f269$var$summarizeLineItem(lineItem) {
170
- return `${lineItem?.description}`;
171
- }
172
- /**
173
- * calculates line-sums for display in reactdatagrid tables
174
- * @param {CustomRenderProps} customRenderProps
175
- * @returns {number | string} for display
176
- */ /**
177
- * Calculates the lineSum (total) for a lineItem
178
- * @param {object} lineItem
179
- * @param {?number} lineItem.rate
180
- * @param {?number} lineItem.count
181
- * @returns {number}
182
- */ function $618035149cc2f269$var$lineItem_lineSum(lineItem) {
183
- return lineItem?.rate * lineItem?.count;
184
- }
185
- /**
186
- * checks for cross-dependencies - in this case, adjusting the "count" if the UNIT changes
187
- * @param {object} prev
188
- * @param {object} value
189
- * @param {string} itemFor
190
- * @param {object} fullChoiceObject
191
- * @returns {object}
192
- */ function $618035149cc2f269$var$UpdateChange(prevItem, newValue, itemFor, fullChoiceObject) {
193
- console.log("LineItem UpdateChange", prevItem, newValue, itemFor, fullChoiceObject);
194
- return {
195
- ...prevItem,
196
- [itemFor]: value
197
- };
198
- }
199
-
200
-
201
- export {$618035149cc2f269$export$42fb5c11b332038a as deleteLineItem, $618035149cc2f269$export$9311bf4c650d8c56 as deleteLineItemById, $618035149cc2f269$export$9160586647000ce as createLineItem, $618035149cc2f269$export$682c51c4d54f1588 as knownLineItem, $618035149cc2f269$export$7c918f386d58a9a2 as fetchLineItem, $618035149cc2f269$export$93ad1b66295660db as fetchLineItems, $618035149cc2f269$export$d2c186a25126fe28 as fetchProductLineItems, $618035149cc2f269$export$e6123a92ff8533fc as paginateProductLineItems, $618035149cc2f269$export$218cbdd54a707ec7 as fetchLineItemName};
202
- //# sourceMappingURL=InventoryLogic.8addb055.js.map
@@ -1 +0,0 @@
1
- {"mappings":"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","sources":["business/LineItem/index.js"],"sourcesContent":["/**\n * Typedefs, constants, support functions and database operations related to LineItem Matrials\n * users\n * @module LineItem\n */\nimport {\n writeRecord,\n updateRecord,\n fetchRecord,\n collectRecordsByFilter,\n deleteRecord,\n PaginateFetch,\n} from \"@leaddreamer/firebase-wrapper\";\nimport { Forms, fillForm } from \"@leaddreamer/staticforms\";\n\nimport {\n COMMODITY,\n LINEITEM,\n STAGE,\n MATERIAL,\n UNITS,\n COMPONENT_RANGE,\n COMPONENT_COUNT_RANGE,\n} from \"../boilerplate/index.js\";\n//import {StageLevels, MaterialLevels} from \"../Markups/index.js\";\n\n//////////////////////////////////////////////////////////////////////\n// Constants\n\n/**\n * a record\n * @typedef {object} LineItem\n * @property {string} Id Id of document (redundant for convenience)\n * @property {string} refPath if from database, full path to document\n * @property {StageLevels} STAGE \"fabrication\", \"wholesale\", \"retail\" or other to be defined\n * @property {MaterialLevels} MATERIAL \"base\", \"highValue\", \"service\" or other value to be defined\n * @property {null|string} commodity Id of a commodity item/material (optional)\n * @property {string|null} description description, e.g. \"Wire, Silver, Sterling, 20ga\"\n * //can be overwritten by commodity\n * @property {string|null} unit usage/measurement unit (for unit conversion)\n * //can be overwritten by commodity\n * @property {number} rate the per unit cost of this lineItem\n * //can be overwritten by commodity\n * @property {number} amount amount of material/item useed\n * @property {datetime} timestamp initial time of creation for sorting\n * @property {url|null} image a reference image for the lineItem\n */\n/**\n * Default/Blank Form for LineItem data records\n * @readonly\n * @constant\n * @type {LineItem}\n * @default\n */\nconst LineItemDefault = {\n Id: null,\n refPath: null,\n [STAGE]: null,\n [MATERIAL]: null,\n commodity: null,\n description: null,\n unit: null,\n rate: 0,\n count: 0,\n image: null,\n};\n\n/**\n * Form for generating placeholder LineItem data.\n * @readonly\n * @constant\n * @type {LineItem}\n * @default\n */\nconst LineItemData = {\n Id: `string.uuid`,\n refPath: null,\n [STAGE]: `lookupChoices:${STAGE}`,\n [MATERIAL]: `lookupChoices:${MATERIAL}`,\n commodity: `lookupLevels:${COMMODITY}`,\n description: `commerce.productDescription`,\n count: `number.int:${COMPONENT_COUNT_RANGE}`,\n unit: `lookupLink:units`,\n rate: `commerce.price:${COMPONENT_RANGE}`,\n line_total: `commerce.price:${COMPONENT_RANGE}`,\n image: null,\n};\n\n/**\n * Form for driving an Editor form for LineItem Data\n * @readonly\n * @constant\n * @type {LineItem}\n * @default\n */\nconst LineItemDefaultForm = {\n [STAGE]: `lookupChoices:${STAGE}`,\n [MATERIAL]: `lookupChoices:${MATERIAL}`,\n commodity: `lookupLevels:${COMMODITY}`,\n description: `text`,\n count: `number`,\n unit: `lookupLink:${UNITS}`,\n rate: `number`,\n line_total: `lineSum`,\n image: `url`,\n};\n\nForms.Base[LINEITEM] = LineItemDefault;\nForms.BaseForm[LINEITEM] = LineItemDefaultForm;\nForms.CreateForm[LINEITEM] = LineItemDefaultForm;\nForms.Data[LINEITEM] = LineItemData;\nForms.Summarize[LINEITEM] = summarizeLineItem;\nForms.Save[LINEITEM] = updateLineItem;\nForms.SearchBy[LINEITEM] = \"description\";\nForms.LineSum[LINEITEM] = lineItem_lineSum; //FUNCTION\nForms.UpdateChange[LINEITEM] = UpdateChange;\n\n\n//////////////////////////////////////////////////////////////////////\n// record operations\n/**\n * deletes a lineItem. Product required if lineItem is missing refPath\n * from database\n * @param {LineItemDefault} lineItem lineItem record\n * @param {!string} lineItem.Id at least Id is required to identify record\n * @param {string|null} lineItem.refPath refpath will be used if present\n * @param {Product|null} product\n * @returns {Promise<void>}\n */\nexport async function deleteLineItem(lineItem, product = null) {\n return deleteRecord(lineItem, LINEITEM, product?.refPath);\n}\n\n/**\n * @param {LineItemDefault} lineItem minimal record of lineItem in question\n * @param {!string} lineItem.Id record Id of account\n * @param {Product} product minimal record of product this lineItem belongs to\n * @param {!string} product.refPath required as a minimum\n * @returns {Promise<void>}\n */\nexport async function deleteLineItemById(lineItem, product) {\n if (!lineItem?.Id) return;\n\n return deleteRecord(lineItem, LINEITEM, product?.refPath);\n}\n\n/**\n * @param {LineItem} lineItem minimal record of user account\n * @param {Product} product minimal record of product this lineItem belongs to\n * @returns {Promise.LineItem}\n */\nexport const createLineItem = (lineItem) => {\n //need a \"no duplicate\" function - whatever that means in this context\n return writeRecord(LINEITEM, lineItem, product.refPath);\n};\n\n/**\n * writes record back to database. Assumes only Id is valid\n * @param {LineItem} lineItem a partially-populated lineItem record for updates\n * @param {Product} product minimal record of product this lineItem belongs to\n * @returns {promise.LineItem} a copy of the data written\n */\nasync function updateLineItem(lineItem, product = null) {\n if (!(lineItem?.refPath || product?.refPath)) {\n console.log(\"no product specified to save LineItem\");\n //no root lineItems\n return null;\n };\n\n\n return updateRecord(\n fillForm(lineItem, LINEITEM), //saves only APPROPRIATE fields -does NOT populate missing fields\n product,\n LINEITEM\n );\n}\n\n//////////////////////////////////////////////////////////////////////\n// fetches\n\n/**\n * Checks if this is a known LineItem Id\n * @param {!string} Id Id value to check\n * @param {Product} product minimal record of product this lineItem belongs to\n * @returns {Promise.boolean} true is this Id is in database\n */\nexport async function knownLineItem(Id, product) {\n let exists = true;\n try {\n await fetchLineItem(Id, product);\n } catch (err) {\n exists = false;\n }\n return exists;\n}\n\n//////////////////////////////////////////////////////////////////////\n// fetches\n\n/**\n * Fetches ALL LineItem records. Not very useful\n * @returns {Array.LineItem}\n */\nexport async function fetchLineItems() {\n return collectRecordsInGroup(LINEITEM);\n}\n\n/**\n * Fetches ALL LineItem records for a specific product. Not very useful\n * @param {Product} product minimal record of product this lineItem belongs to\n * @param {?Stage} stage optional stage selection, to get a subset of the line items\n * @returns {Array.LineItem}\n */\nexport async function fetchProductLineItems(product, stage = null) {\n const filterArray = stage\n ? [{ fieldRef: \"stage\", opStr: \"==\", value: stage.name }]\n : null;\n return collectRecordsByFilter(\n LINEITEM, //table\n product.refPath, //refPath\n filterArray, //filterArray\n null, //sort\n );\n}\n\n/**\n * An object to allow for paginating a table read from Firestore. REQUIRES a sorting choice\n * @typedef {object} PaginatedFetch\n * @property {Query} Query that forms basis for the table read\n * @property {number} limit page size\n * @property {QuerySnapshot} snapshot last successful snapshot/page fetched\n * @property {enum} status status of pagination object\n * @property {method} PageForward pages the fetch forward\n * @property {method} PageBack pages the fetch backward\n \n */\n\n/**\n * Fetchs an object to fetch pages of lineItem data, ascending by name, \"limit\" at a time\n * NOT a \"listener\"\n * @param {Product} product\n * @param {?Stage} stage optional stage selection, to get a subset of the line items\n * @param {number} limit\n * @returns {PaginatedFetch} object with pagination methods\n */\n\nexport async function paginateProductLineItems(\n product,\n stage = null,\n limit = null,\n) {\n const filterArray = stage\n ? [{ fieldRef: \"stage\", opStr: \"==\", value: stage.name }]\n : null;\n\n return new PaginateFetch(\n LINEITEM,\n filterArray, //filter\n [{ fieldRef: \"timestamp\", dirStr: \"asc\" }], //sort\n product.refPath, //ref\n limit,\n );\n}\n\n/**\n * Fetches a single LineItem record by Id\n * @param {!string} lineItemId\n * @param {Product} product minimal record of product this lineItem belongs to\n * @returns {Promise.LineItem}\n */\nexport async function fetchLineItem(lineItemId, product) {\n return fetchRecord(LINEITEM, lineItemId, product.refPath);\n}\n\n/**\n * Fetches and returns the summarized name from a LineItem record\n * @param {!string} lineItemId\n * @param {Product} product minimal record of product this lineItem belongs to\n * @returns {Promise.string} the summarized name from the record\n */\nexport async function fetchLineItemName(lineItemId, product) {\n const lineItem = await fetchLineItem(lineItemId, product);\n return summarizeLineItem(lineItem);\n}\n\n//////////////////////////////////////////////////////////////////////\n// utilities\n/**\n * Returns a standardized formatted name string\n * @param {LineItem}\n * @returns {string} formatted name string\n */\nfunction summarizeLineItem(lineItem) {\n return `${lineItem?.description}`;\n}\n\n/**\n * calculates line-sums for display in reactdatagrid tables\n * @param {CustomRenderProps} customRenderProps\n * @returns {number | string} for display\n */\n\n/**\n * Calculates the lineSum (total) for a lineItem\n * @param {object} lineItem \n * @param {?number} lineItem.rate\n * @param {?number} lineItem.count\n * @returns {number}\n */\nfunction lineItem_lineSum(lineItem) {\n return lineItem?.rate * lineItem?.count;\n}\n\n/**\n * checks for cross-dependencies - in this case, adjusting the \"count\" if the UNIT changes\n * @param {object} prev\n * @param {object} value\n * @param {string} itemFor\n * @param {object} fullChoiceObject\n * @returns {object}\n */\nfunction UpdateChange(prevItem, newValue, itemFor, fullChoiceObject) {\n console.log(\"LineItem UpdateChange\", prevItem, newValue, itemFor, fullChoiceObject);\n return {\n ...prevItem,\n [itemFor]: value\n }\n}\n"],"names":[],"version":3,"file":"InventoryLogic.8addb055.js.map"}
@@ -1,6 +0,0 @@
1
- var $d1c5ef8e0a54257b$exports = {};
2
- $d1c5ef8e0a54257b$exports = JSON.parse("\" {\\r\\n \\\"id\\\": \\\"69fa54e8f691fe20c13bc732\\\",\\r\\n \\\"type\\\": \\\"PHYSICAL\\\",\\r\\n \\\"name\\\": \\\"Stack : : short gemstone earrings\\\",\\r\\n \\\"description\\\": \\\"<p style=\\\\\\\"white-space:pre-wrap;\\\\\\\" data-rte-preserve-empty=\\\\\\\"true\\\\\\\">About an inch long, my Stack earrings are quick grabs of a bit of neutral with a pop of color when you want earrings for a casual day look. Choose your favorite palette or ping me with your own color combinations and ideas!</p><p style=\\\\\\\"white-space:pre-wrap;\\\\\\\" data-rte-preserve-empty=\\\\\\\"true\\\\\\\"><span>:: great gift!<br />:: 1.25 inches<br />:: limited edition<br />:: ships 4-7 days from purchase<br />:: handcrafted in tucson, arizona</span></p>\\\",\\r\\n \\\"storePageId\\\": \\\"694b2289b16b8d02d4bdaaba\\\",\\r\\n \\\"url\\\": \\\"https://sirlinhalljewelry.com/shop/p/stack-earrings-26050500\\\",\\r\\n \\\"urlSlug\\\": \\\"p/stack-earrings-26050500\\\",\\r\\n \\\"images\\\": [\\r\\n {\\r\\n \\\"id\\\": \\\"69fa5769cfa3e81e12d7c224\\\",\\r\\n \\\"altText\\\": \\\"PXL_20260505_201834132.jpg\\\",\\r\\n \\\"orderIndex\\\": 0,\\r\\n \\\"url\\\": \\\"https://images.squarespace-cdn.com/content/v1/694b2288b16b8d02d4bdaa0c/2bf39ac2-a49b-4820-a211-961d6a0722ef/PXL_20260505_201834132.jpg\\\",\\r\\n \\\"originalSize\\\": {\\r\\n \\\"width\\\": 480,\\r\\n \\\"height\\\": 480\\r\\n },\\r\\n \\\"availableFormats\\\": []\\r\\n },\\r\\n {\\r\\n \\\"id\\\": \\\"69fa5769f691fe20c13bc9f8\\\",\\r\\n \\\"altText\\\": \\\"PXL_20260505_201739701.jpg\\\",\\r\\n \\\"orderIndex\\\": 1,\\r\\n \\\"url\\\": \\\"https://images.squarespace-cdn.com/content/v1/694b2288b16b8d02d4bdaa0c/8d5186e3-e5a1-43bb-9714-77a939b8bc40/PXL_20260505_201739701.jpg\\\",\\r\\n \\\"originalSize\\\": {\\r\\n \\\"width\\\": 480,\\r\\n \\\"height\\\": 480\\r\\n },\\r\\n \\\"availableFormats\\\": []\\r\\n },\\r\\n {\\r\\n \\\"id\\\": \\\"69fa5769cfa3e81e12d7c225\\\",\\r\\n \\\"altText\\\": \\\"PXL_20260505_201915047.jpg\\\",\\r\\n \\\"orderIndex\\\": 2,\\r\\n \\\"url\\\": \\\"https://images.squarespace-cdn.com/content/v1/694b2288b16b8d02d4bdaa0c/ff61c7e8-a03b-442e-81b2-db67241d85ec/PXL_20260505_201915047.jpg\\\",\\r\\n \\\"originalSize\\\": {\\r\\n \\\"width\\\": 480,\\r\\n \\\"height\\\": 480\\r\\n },\\r\\n \\\"availableFormats\\\": []\\r\\n },\\r\\n {\\r\\n \\\"id\\\": \\\"69fa5769f691fe20c13bc9f9\\\",\\r\\n \\\"altText\\\": \\\"PXL_20260505_202122912.jpg\\\",\\r\\n \\\"orderIndex\\\": 3,\\r\\n \\\"url\\\": \\\"https://images.squarespace-cdn.com/content/v1/694b2288b16b8d02d4bdaa0c/357dfd2f-1bce-4687-b57b-1ff53209d970/PXL_20260505_202122912.jpg\\\",\\r\\n \\\"originalSize\\\": {\\r\\n \\\"width\\\": 480,\\r\\n \\\"height\\\": 480\\r\\n },\\r\\n \\\"availableFormats\\\": []\\r\\n },\\r\\n {\\r\\n \\\"id\\\": \\\"69fa5769a3780355a2edfbb0\\\",\\r\\n \\\"altText\\\": \\\"PXL_20260505_202100350.jpg\\\",\\r\\n \\\"orderIndex\\\": 4,\\r\\n \\\"url\\\": \\\"https://images.squarespace-cdn.com/content/v1/694b2288b16b8d02d4bdaa0c/4fcf4192-dbe3-477a-90e7-be0c553f4c5b/PXL_20260505_202100350.jpg\\\",\\r\\n \\\"originalSize\\\": {\\r\\n \\\"width\\\": 480,\\r\\n \\\"height\\\": 480\\r\\n },\\r\\n \\\"availableFormats\\\": []\\r\\n },\\r\\n {\\r\\n \\\"id\\\": \\\"69fa5769cfa3e81e12d7c226\\\",\\r\\n \\\"altText\\\": \\\"PXL_20260505_201947380.jpg\\\",\\r\\n \\\"orderIndex\\\": 5,\\r\\n \\\"url\\\": \\\"https://images.squarespace-cdn.com/content/v1/694b2288b16b8d02d4bdaa0c/fba1dcf8-8526-47ab-ab7f-be2ab37a1dbd/PXL_20260505_201947380.jpg\\\",\\r\\n \\\"originalSize\\\": {\\r\\n \\\"width\\\": 480,\\r\\n \\\"height\\\": 480\\r\\n },\\r\\n \\\"availableFormats\\\": []\\r\\n }\\r\\n ],\\r\\n \\\"tags\\\": [],\\r\\n \\\"seoOptions\\\": {\\r\\n \\\"title\\\": \\\"Stack short gemstone and pearl earrings\\\",\\r\\n \\\"description\\\": \\\"Tucson designer Lisa Sirlin-Hall's Stack earrings are quick grabs of a bit of neutral with a pop of color when you want earrings for a casual day look.\\\"\\r\\n },\\r\\n \\\"createdOn\\\": \\\"2026-05-05T20:36:56.235Z\\\",\\r\\n \\\"modifiedOn\\\": \\\"2026-08-31T20:06:56.852Z\\\",\\r\\n \\\"variants\\\": [\\r\\n {\\r\\n \\\"id\\\": \\\"fdb09e8d-467c-412e-a355-f6a40a24af24\\\",\\r\\n \\\"sku\\\": \\\"26050101\\\",\\r\\n \\\"image\\\": null,\\r\\n \\\"pricing\\\": {\\r\\n \\\"basePrice\\\": {\\r\\n \\\"currency\\\": \\\"USD\\\",\\r\\n \\\"value\\\": \\\"68.00\\\"\\r\\n },\\r\\n \\\"salePrice\\\": {\\r\\n \\\"currency\\\": \\\"USD\\\",\\r\\n \\\"value\\\": \\\"0.00\\\"\\r\\n },\\r\\n \\\"onSale\\\": false\\r\\n },\\r\\n \\\"stock\\\": {\\r\\n \\\"quantity\\\": 1,\\r\\n \\\"unlimited\\\": false\\r\\n },\\r\\n \\\"attributes\\\": {\\r\\n \\\"Color\\\": \\\"Blue with Labradorite\\\"\\r\\n },\\r\\n \\\"shippingMeasurements\\\": {\\r\\n \\\"weight\\\": {\\r\\n \\\"unit\\\": \\\"POUND\\\",\\r\\n \\\"value\\\": 0.0625\\r\\n },\\r\\n \\\"dimensions\\\": {\\r\\n \\\"unit\\\": \\\"INCH\\\",\\r\\n \\\"length\\\": 9.0,\\r\\n \\\"width\\\": 6.0,\\r\\n \\\"height\\\": 0.5\\r\\n }\\r\\n },\\r\\n \\\"gtin\\\": null,\\r\\n \\\"mpn\\\": null\\r\\n },\\r\\n {\\r\\n \\\"id\\\": \\\"61c47a68-5acb-4d74-b18b-83ac27e49aeb\\\",\\r\\n \\\"sku\\\": \\\"26050102\\\",\\r\\n \\\"image\\\": null,\\r\\n \\\"pricing\\\": {\\r\\n \\\"basePrice\\\": {\\r\\n \\\"currency\\\": \\\"USD\\\",\\r\\n \\\"value\\\": \\\"68.00\\\"\\r\\n },\\r\\n \\\"salePrice\\\": {\\r\\n \\\"currency\\\": \\\"USD\\\",\\r\\n \\\"value\\\": \\\"0.00\\\"\\r\\n },\\r\\n \\\"onSale\\\": false\\r\\n },\\r\\n \\\"stock\\\": {\\r\\n \\\"quantity\\\": 1,\\r\\n \\\"unlimited\\\": false\\r\\n },\\r\\n \\\"attributes\\\": {\\r\\n \\\"Color\\\": \\\"Silver with Black Onyx\\\"\\r\\n },\\r\\n \\\"shippingMeasurements\\\": {\\r\\n \\\"weight\\\": {\\r\\n \\\"unit\\\": \\\"POUND\\\",\\r\\n \\\"value\\\": 0.0625\\r\\n },\\r\\n \\\"dimensions\\\": {\\r\\n \\\"unit\\\": \\\"INCH\\\",\\r\\n \\\"length\\\": 9.0,\\r\\n \\\"width\\\": 6.0,\\r\\n \\\"height\\\": 0.5\\r\\n }\\r\\n },\\r\\n \\\"gtin\\\": null,\\r\\n \\\"mpn\\\": null\\r\\n },\\r\\n {\\r\\n \\\"id\\\": \\\"4b1ca060-8d0e-4e20-9863-cb37324da85d\\\",\\r\\n \\\"sku\\\": \\\"26050103\\\",\\r\\n \\\"image\\\": null,\\r\\n \\\"pricing\\\": {\\r\\n \\\"basePrice\\\": {\\r\\n \\\"currency\\\": \\\"USD\\\",\\r\\n \\\"value\\\": \\\"68.00\\\"\\r\\n },\\r\\n \\\"salePrice\\\": {\\r\\n \\\"currency\\\": \\\"USD\\\",\\r\\n \\\"value\\\": \\\"0.00\\\"\\r\\n },\\r\\n \\\"onSale\\\": false\\r\\n },\\r\\n \\\"stock\\\": {\\r\\n \\\"quantity\\\": 1,\\r\\n \\\"unlimited\\\": false\\r\\n },\\r\\n \\\"attributes\\\": {\\r\\n \\\"Color\\\": \\\"Champagne yellow and Pearl\\\"\\r\\n },\\r\\n \\\"shippingMeasurements\\\": {\\r\\n \\\"weight\\\": {\\r\\n \\\"unit\\\": \\\"POUND\\\",\\r\\n \\\"value\\\": 0.0625\\r\\n },\\r\\n \\\"dimensions\\\": {\\r\\n \\\"unit\\\": \\\"INCH\\\",\\r\\n \\\"length\\\": 9.0,\\r\\n \\\"width\\\": 6.0,\\r\\n \\\"height\\\": 0.5\\r\\n }\\r\\n },\\r\\n \\\"gtin\\\": null,\\r\\n \\\"mpn\\\": null\\r\\n }\\r\\n ],\\r\\n \\\"variantAttributes\\\": [\\r\\n \\\"Color\\\"\\r\\n ],\\r\\n \\\"isVisible\\\": true\\r\\n }\\r\\n\"");
3
-
4
-
5
- export {$d1c5ef8e0a54257b$exports as default};
6
- //# sourceMappingURL=InventoryLogic.9dee46ea.js.map
@@ -1 +0,0 @@
1
- {"mappings":";AAAA,4BAAiB,KAAK,KAAK,CAAC","sources":["business/Product/SampleJSON.json"],"sourcesContent":["\" {\\r\\n \\\"id\\\": \\\"69fa54e8f691fe20c13bc732\\\",\\r\\n \\\"type\\\": \\\"PHYSICAL\\\",\\r\\n \\\"name\\\": \\\"Stack : : short gemstone earrings\\\",\\r\\n \\\"description\\\": \\\"<p style=\\\\\\\"white-space:pre-wrap;\\\\\\\" data-rte-preserve-empty=\\\\\\\"true\\\\\\\">About an inch long, my Stack earrings are quick grabs of a bit of neutral with a pop of color when you want earrings for a casual day look. Choose your favorite palette or ping me with your own color combinations and ideas!</p><p style=\\\\\\\"white-space:pre-wrap;\\\\\\\" data-rte-preserve-empty=\\\\\\\"true\\\\\\\"><span>:: great gift!<br />:: 1.25 inches<br />:: limited edition<br />:: ships 4-7 days from purchase<br />:: handcrafted in tucson, arizona</span></p>\\\",\\r\\n \\\"storePageId\\\": \\\"694b2289b16b8d02d4bdaaba\\\",\\r\\n \\\"url\\\": \\\"https://sirlinhalljewelry.com/shop/p/stack-earrings-26050500\\\",\\r\\n \\\"urlSlug\\\": \\\"p/stack-earrings-26050500\\\",\\r\\n \\\"images\\\": [\\r\\n {\\r\\n \\\"id\\\": \\\"69fa5769cfa3e81e12d7c224\\\",\\r\\n \\\"altText\\\": \\\"PXL_20260505_201834132.jpg\\\",\\r\\n \\\"orderIndex\\\": 0,\\r\\n \\\"url\\\": \\\"https://images.squarespace-cdn.com/content/v1/694b2288b16b8d02d4bdaa0c/2bf39ac2-a49b-4820-a211-961d6a0722ef/PXL_20260505_201834132.jpg\\\",\\r\\n \\\"originalSize\\\": {\\r\\n \\\"width\\\": 480,\\r\\n \\\"height\\\": 480\\r\\n },\\r\\n \\\"availableFormats\\\": []\\r\\n },\\r\\n {\\r\\n \\\"id\\\": \\\"69fa5769f691fe20c13bc9f8\\\",\\r\\n \\\"altText\\\": \\\"PXL_20260505_201739701.jpg\\\",\\r\\n \\\"orderIndex\\\": 1,\\r\\n \\\"url\\\": \\\"https://images.squarespace-cdn.com/content/v1/694b2288b16b8d02d4bdaa0c/8d5186e3-e5a1-43bb-9714-77a939b8bc40/PXL_20260505_201739701.jpg\\\",\\r\\n \\\"originalSize\\\": {\\r\\n \\\"width\\\": 480,\\r\\n \\\"height\\\": 480\\r\\n },\\r\\n \\\"availableFormats\\\": []\\r\\n },\\r\\n {\\r\\n \\\"id\\\": \\\"69fa5769cfa3e81e12d7c225\\\",\\r\\n \\\"altText\\\": \\\"PXL_20260505_201915047.jpg\\\",\\r\\n \\\"orderIndex\\\": 2,\\r\\n \\\"url\\\": \\\"https://images.squarespace-cdn.com/content/v1/694b2288b16b8d02d4bdaa0c/ff61c7e8-a03b-442e-81b2-db67241d85ec/PXL_20260505_201915047.jpg\\\",\\r\\n \\\"originalSize\\\": {\\r\\n \\\"width\\\": 480,\\r\\n \\\"height\\\": 480\\r\\n },\\r\\n \\\"availableFormats\\\": []\\r\\n },\\r\\n {\\r\\n \\\"id\\\": \\\"69fa5769f691fe20c13bc9f9\\\",\\r\\n \\\"altText\\\": \\\"PXL_20260505_202122912.jpg\\\",\\r\\n \\\"orderIndex\\\": 3,\\r\\n \\\"url\\\": \\\"https://images.squarespace-cdn.com/content/v1/694b2288b16b8d02d4bdaa0c/357dfd2f-1bce-4687-b57b-1ff53209d970/PXL_20260505_202122912.jpg\\\",\\r\\n \\\"originalSize\\\": {\\r\\n \\\"width\\\": 480,\\r\\n \\\"height\\\": 480\\r\\n },\\r\\n \\\"availableFormats\\\": []\\r\\n },\\r\\n {\\r\\n \\\"id\\\": \\\"69fa5769a3780355a2edfbb0\\\",\\r\\n \\\"altText\\\": \\\"PXL_20260505_202100350.jpg\\\",\\r\\n \\\"orderIndex\\\": 4,\\r\\n \\\"url\\\": \\\"https://images.squarespace-cdn.com/content/v1/694b2288b16b8d02d4bdaa0c/4fcf4192-dbe3-477a-90e7-be0c553f4c5b/PXL_20260505_202100350.jpg\\\",\\r\\n \\\"originalSize\\\": {\\r\\n \\\"width\\\": 480,\\r\\n \\\"height\\\": 480\\r\\n },\\r\\n \\\"availableFormats\\\": []\\r\\n },\\r\\n {\\r\\n \\\"id\\\": \\\"69fa5769cfa3e81e12d7c226\\\",\\r\\n \\\"altText\\\": \\\"PXL_20260505_201947380.jpg\\\",\\r\\n \\\"orderIndex\\\": 5,\\r\\n \\\"url\\\": \\\"https://images.squarespace-cdn.com/content/v1/694b2288b16b8d02d4bdaa0c/fba1dcf8-8526-47ab-ab7f-be2ab37a1dbd/PXL_20260505_201947380.jpg\\\",\\r\\n \\\"originalSize\\\": {\\r\\n \\\"width\\\": 480,\\r\\n \\\"height\\\": 480\\r\\n },\\r\\n \\\"availableFormats\\\": []\\r\\n }\\r\\n ],\\r\\n \\\"tags\\\": [],\\r\\n \\\"seoOptions\\\": {\\r\\n \\\"title\\\": \\\"Stack short gemstone and pearl earrings\\\",\\r\\n \\\"description\\\": \\\"Tucson designer Lisa Sirlin-Hall's Stack earrings are quick grabs of a bit of neutral with a pop of color when you want earrings for a casual day look.\\\"\\r\\n },\\r\\n \\\"createdOn\\\": \\\"2026-05-05T20:36:56.235Z\\\",\\r\\n \\\"modifiedOn\\\": \\\"2026-08-31T20:06:56.852Z\\\",\\r\\n \\\"variants\\\": [\\r\\n {\\r\\n \\\"id\\\": \\\"fdb09e8d-467c-412e-a355-f6a40a24af24\\\",\\r\\n \\\"sku\\\": \\\"26050101\\\",\\r\\n \\\"image\\\": null,\\r\\n \\\"pricing\\\": {\\r\\n \\\"basePrice\\\": {\\r\\n \\\"currency\\\": \\\"USD\\\",\\r\\n \\\"value\\\": \\\"68.00\\\"\\r\\n },\\r\\n \\\"salePrice\\\": {\\r\\n \\\"currency\\\": \\\"USD\\\",\\r\\n \\\"value\\\": \\\"0.00\\\"\\r\\n },\\r\\n \\\"onSale\\\": false\\r\\n },\\r\\n \\\"stock\\\": {\\r\\n \\\"quantity\\\": 1,\\r\\n \\\"unlimited\\\": false\\r\\n },\\r\\n \\\"attributes\\\": {\\r\\n \\\"Color\\\": \\\"Blue with Labradorite\\\"\\r\\n },\\r\\n \\\"shippingMeasurements\\\": {\\r\\n \\\"weight\\\": {\\r\\n \\\"unit\\\": \\\"POUND\\\",\\r\\n \\\"value\\\": 0.0625\\r\\n },\\r\\n \\\"dimensions\\\": {\\r\\n \\\"unit\\\": \\\"INCH\\\",\\r\\n \\\"length\\\": 9.0,\\r\\n \\\"width\\\": 6.0,\\r\\n \\\"height\\\": 0.5\\r\\n }\\r\\n },\\r\\n \\\"gtin\\\": null,\\r\\n \\\"mpn\\\": null\\r\\n },\\r\\n {\\r\\n \\\"id\\\": \\\"61c47a68-5acb-4d74-b18b-83ac27e49aeb\\\",\\r\\n \\\"sku\\\": \\\"26050102\\\",\\r\\n \\\"image\\\": null,\\r\\n \\\"pricing\\\": {\\r\\n \\\"basePrice\\\": {\\r\\n \\\"currency\\\": \\\"USD\\\",\\r\\n \\\"value\\\": \\\"68.00\\\"\\r\\n },\\r\\n \\\"salePrice\\\": {\\r\\n \\\"currency\\\": \\\"USD\\\",\\r\\n \\\"value\\\": \\\"0.00\\\"\\r\\n },\\r\\n \\\"onSale\\\": false\\r\\n },\\r\\n \\\"stock\\\": {\\r\\n \\\"quantity\\\": 1,\\r\\n \\\"unlimited\\\": false\\r\\n },\\r\\n \\\"attributes\\\": {\\r\\n \\\"Color\\\": \\\"Silver with Black Onyx\\\"\\r\\n },\\r\\n \\\"shippingMeasurements\\\": {\\r\\n \\\"weight\\\": {\\r\\n \\\"unit\\\": \\\"POUND\\\",\\r\\n \\\"value\\\": 0.0625\\r\\n },\\r\\n \\\"dimensions\\\": {\\r\\n \\\"unit\\\": \\\"INCH\\\",\\r\\n \\\"length\\\": 9.0,\\r\\n \\\"width\\\": 6.0,\\r\\n \\\"height\\\": 0.5\\r\\n }\\r\\n },\\r\\n \\\"gtin\\\": null,\\r\\n \\\"mpn\\\": null\\r\\n },\\r\\n {\\r\\n \\\"id\\\": \\\"4b1ca060-8d0e-4e20-9863-cb37324da85d\\\",\\r\\n \\\"sku\\\": \\\"26050103\\\",\\r\\n \\\"image\\\": null,\\r\\n \\\"pricing\\\": {\\r\\n \\\"basePrice\\\": {\\r\\n \\\"currency\\\": \\\"USD\\\",\\r\\n \\\"value\\\": \\\"68.00\\\"\\r\\n },\\r\\n \\\"salePrice\\\": {\\r\\n \\\"currency\\\": \\\"USD\\\",\\r\\n \\\"value\\\": \\\"0.00\\\"\\r\\n },\\r\\n \\\"onSale\\\": false\\r\\n },\\r\\n \\\"stock\\\": {\\r\\n \\\"quantity\\\": 1,\\r\\n \\\"unlimited\\\": false\\r\\n },\\r\\n \\\"attributes\\\": {\\r\\n \\\"Color\\\": \\\"Champagne yellow and Pearl\\\"\\r\\n },\\r\\n \\\"shippingMeasurements\\\": {\\r\\n \\\"weight\\\": {\\r\\n \\\"unit\\\": \\\"POUND\\\",\\r\\n \\\"value\\\": 0.0625\\r\\n },\\r\\n \\\"dimensions\\\": {\\r\\n \\\"unit\\\": \\\"INCH\\\",\\r\\n \\\"length\\\": 9.0,\\r\\n \\\"width\\\": 6.0,\\r\\n \\\"height\\\": 0.5\\r\\n }\\r\\n },\\r\\n \\\"gtin\\\": null,\\r\\n \\\"mpn\\\": null\\r\\n }\\r\\n ],\\r\\n \\\"variantAttributes\\\": [\\r\\n \\\"Color\\\"\\r\\n ],\\r\\n \\\"isVisible\\\": true\\r\\n }\\r\\n\"\n"],"names":[],"version":3,"file":"InventoryLogic.9dee46ea.js.map"}