diff --git a/__tests__/record/Record.js b/__tests__/record/Record.js index a33e15c..a3391d3 100644 --- a/__tests__/record/Record.js +++ b/__tests__/record/Record.js @@ -19,11 +19,23 @@ beforeEach(() => { test: 1, test2: { value: 2, text: "test2" }, testdate: new Date("2023-01-01"), + testsubrecord: new record.Record({ + id: 2, + fields: { + test: 1, + }, + }), + }, + { + test: 2, + test2: { value: 3, text: "test2" }, + testdate: new Date("2023-01-02"), }, ], }, subrecords: { test: new record.Record({ + id: 3, fields: { test: 1, }, @@ -53,9 +65,12 @@ describe("record.Record", () => { Record.cancelLine("test"); expect(Record.sublists.test.currentline.test).toBe(undefined); }); + it("should return record", () => { + expect(Record.cancelLine("test")).toBe(Record); + }); }); - describe("commitline", () => { + describe("commitLine", () => { beforeEach(() => { Record.selectLine("test", 0); Record.setCurrentSublistValue("test", "test", 2); @@ -74,14 +89,80 @@ describe("record.Record", () => { Record.selectNewLine("test"); Record.setCurrentSublistValue("test", "test", 2); Record.commitLine("test"); - expect(Record.sublists.test.lines.length).toBe(2); + expect(Record.sublists.test.lines.length).toBe(3); expect(Record.sublists.test.lines[0].test).toEqual(1); - expect(Record.sublists.test.lines[1].test).toEqual({ value: 2 }); + expect(Record.sublists.test.lines[2].test).toEqual({ value: 2 }); }); it("should select a new line", () => { Record.commitLine("test"); expect(Record.sublists.test.currentline.test).toBe(undefined); }); + it("should return record", () => { + expect(Record.commitLine("test")).toBe(Record); + }); + }); + + describe("findSublistLineWithValue", () => { + it("should return -1 if sublist doesn't exist", () => { + expect(Record.findSublistLineWithValue("doesntexist", "test", 1)).toBe(-1); + }); + it("should return -1 if sublist doesn't contain value", () => { + expect(Record.findSublistLineWithValue("test", "test", "doesntexist")).toBe(-1); + }); + it("should return index of first line with value", () => { + expect(Record.findSublistLineWithValue("test", "test", 1)).toBe(0); + }); + }); + + describe("getCurrentSublistField", () => { + beforeEach(() => { + Record.selectLine("test", 0); + }); + it("should error if sublist doesn't exist", () => { + expect(() => { + Record.getCurrentSublistField("doesntexist", "test"); + }).toThrow(); + }); + it("should return Field if field exists", () => { + expect(Record.getCurrentSublistField("test", "test")).toBeInstanceOf(record.Field); + }); + it("should return null if field doesn't exist", () => { + expect(Record.getCurrentSublistField("test", "doesntexist")).toBe(null); + }); + }); + + describe("getCurrentSublistIndex", () => { + it("should return -1 if sublist doesn't exist", () => { + expect(Record.getCurrentSublistIndex("banana")).toBe(-1); + }); + it("should return index of current selected line", () => { + Record.selectLine("test", 0); + expect(Record.getCurrentSublistIndex("test")).toBe(0); + }); + it("should return length of lines if its a new line", () => { + expect(Record.getCurrentSublistIndex("test")).toBe(2); + }); + }); + + describe("getCurrentSublistSubrecord", () => { + beforeEach(() => { + Record.selectLine("test", 0); + }); + it("should error if sublist doesn't exist", () => { + expect(() => { + Record.getCurrentSublistSubrecord("doesntexist", "testsubrecord"); + }).toThrow(); + }); + it("should error if field isn't a subrecord", () => { + expect(() => { + Record.getCurrentSublistSubrecord("test", "test"); + }).toThrow(); + }); + it("should return subrecord", () => { + expect(Record.getCurrentSublistSubrecord("test", "testsubrecord")).toBe( + Record.sublists.test.lines[0].testsubrecord, + ); + }); }); describe("getCurrentSublistText", () => { @@ -129,15 +210,83 @@ describe("record.Record", () => { }); }); + describe("getField", () => { + it("should return Field if field exists", () => { + expect(Record.getField("test")).toBeInstanceOf(record.Field); + }); + it("should return null if field doesn't exist", () => { + expect(Record.getField("doesntexist")).toBe(null); + }); + }); + + describe("getFields", () => { + it("should return list of field ids", () => { + expect(Record.getFields()).toEqual(["test", "test2", "testdate"]); + }); + }); + describe("getLineCount", () => { it("should return length of sublist if it exists", () => { - expect(Record.getLineCount("test")).toBe(1); + expect(Record.getLineCount("test")).toBe(2); }); it("should return -1 if sublist doesn't exist", () => { expect(Record.getLineCount("doesntexist")).toBe(-1); }); }); + describe("getSublist", () => { + it("should return null if sublist doesn't exist", () => { + expect(Record.getSublist("doesntexist")).toBe(null); + }); + it("should return Sublist if sublist exists", () => { + expect(Record.getSublist("test")).toBeInstanceOf(record.Sublist); + }); + }); + + describe("getSublists", () => { + it("should return list of sublist ids", () => { + expect(Record.getSublists()).toEqual(["test"]); + }); + }); + + describe("getSublistField", () => { + it("should error if sublist doesn't exist", () => { + expect(() => { + Record.getSublistField("doesntexist", "test", 0); + }).toThrow(); + }); + it("should return Field if field exists", () => { + expect(Record.getSublistField("test", "test", 0)).toBeInstanceOf(record.Field); + }); + it("should return null if field doesn't exist", () => { + expect(Record.getSublistField("test", "doesntexist", 0)).toBe(null); + }); + }); + + describe("getSublistFields", () => { + it("should return list of field ids", () => { + expect(Record.getSublistFields("test")).toEqual(["test", "test2", "testdate", "testsubrecord"]); + }); + }); + + describe("getSublistSubrecord", () => { + it("should error if sublist doesn't exist", () => { + expect(() => { + Record.getSublistSubrecord("doesntexist", "testsubrecord", 0); + }).toThrow(); + }); + it("should error if field isn't a subrecord", () => { + expect(() => { + Record.getSublistSubrecord("test", "test", 0); + }).toThrow(); + }); + it("should return subrecord", () => { + expect(Record.getSublistSubrecord("test", "testsubrecord", 0)).toBe( + Record.sublists.test.lines[0].testsubrecord, + ); + }); + }); + describe("getSublistText", () => { it("should return text if it exists", () => { expect(Record.getSublistText("test", "test2", 0)).toBe("test2"); @@ -249,10 +398,104 @@ describe("record.Record", () => { }); }); + describe("hasCurrentSublistSubrecord", () => { + beforeEach(() => { + Record.selectLine("test", 0); + }); + it("should error if sublist doesn't exist", () => { + expect(() => { + Record.hasCurrentSublistSubrecord("doesntexist", "testsubrecord"); + }).toThrow(); + }); + it("should error if field isn't a subrecord", () => { + expect(() => { + Record.hasCurrentSublistSubrecord("test", "test"); + }).toThrow(); + }); + it("should return true if subrecord exists", () => { + expect(Record.hasCurrentSublistSubrecord("test", "testsubrecord")).toBe(true); + }); + }); + + describe("hasSublistSubrecord", () => { + it("should error if sublist doesn't exist", () => { + expect(() => { + Record.hasSublistSubrecord("doesntexist", "testsubrecord", 0); + }).toThrow(); + }); + it("should error if field isn't a subrecord", () => { + expect(() => { + Record.hasSublistSubrecord("test", "test", 0); + }).toThrow(); + }); + it("should return true if subrecord exists", () => { + expect(Record.hasSublistSubrecord("test", "testsubrecord", 0)).toBe(true); + }); + }); + + describe("hasSubrecord", () => { + it("should error if field isn't a subrecord", () => { + expect(() => { + Record.hasSubrecord("doesntexist"); + }).toThrow(); + }); + it("should return true if subrecord exists", () => { + expect(Record.hasSubrecord("test")).toBe(true); + }); + }); + + describe("insertLine", () => { + it("should error if sublist doesn't exist", () => { + expect(() => { + Record.insertLine("doesntexist", 0); + }).toThrow(); + }); + it("should error if line is outside valid range", () => { + expect(() => { + Record.insertLine("doesntexist", 999); + }).toThrow(); + }); + it("should insert line", () => { + Record.insertLine("test", 1); + expect(Record.sublists.test.lines).toHaveLength(3); + expect(Record.sublists.test.lines[1]._id).toBe(undefined); + }); + it("should select line if in dynamic mode", () => { + Record.insertLine("test", 1); + expect(Record.sublists.test.currentline).toEqual({}); + }); + it("should return record", () => { + expect(Record.insertLine("test", 1)).toBe(Record); + }); + }); + + describe("removeCurrentSublistSubrecord", () => { + beforeEach(() => { + Record.selectLine("test", 0); + }); + it("should error if sublist doesn't exist", () => { + expect(() => { + Record.removeCurrentSublistSubrecord("doesntexist", "testsubrecord"); + }).toThrow(); + }); + it("should error if field isn't a subrecord", () => { + expect(() => { + Record.removeCurrentSublistSubrecord("test", "test"); + }).toThrow(); + }); + it("should remove subrecord", () => { + Record.removeCurrentSublistSubrecord("test", "testsubrecord"); + expect(Record.sublists.test.currentline.testsubrecord).toBe(null); + }); + it("should return record", () => { + expect(Record.removeCurrentSublistSubrecord("test", "testsubrecord")).toBe(Record); + }); + }); + describe("removeLine", () => { it("should remove line if it exists", () => { Record.removeLine("test", 0); - expect(Record.sublists.test.lines.length).toBe(0); + expect(Record.sublists.test.lines.length).toBe(1); }); it("should error if sublist doesn't exist", () => { expect(() => { @@ -264,6 +507,51 @@ describe("record.Record", () => { Record.removeLine("test", -1); }).toThrow(); }); + it("should select first line if in dynamic mode", () => { + Record.removeLine("test", 0); + expect(Record.sublists.test.currentLine); + }); + it("should return record", () => { + expect(Record.removeLine("test", 0)).toBe(Record); + }); + }); + + describe("removeSublistSubrecord", () => { + beforeEach(() => { + Record.isDynamic = false; + }); + it("should error if sublist doesn't exist", () => { + expect(() => { + Record.removeSublistSubrecord("doesntexist", "testsubrecord", 0); + }).toThrow(); + }); + it("should error if field isn't a subrecord", () => { + expect(() => { + Record.removeSublistSubrecord("test", "test", 0); + }).toThrow(); + }); + it("should remove subrecord", () => { + Record.removeSublistSubrecord("test", "testsubrecord", 0); + expect(Record.sublists.test.lines[0].testsubrecord).toBe(null); + }); + it("should return record", () => { + expect(Record.removeSublistSubrecord("test", "testsubrecord", 0)).toBe(Record); + }); + }); + + describe("removeSubrecord", () => { + it("should error if field isn't a subrecord", () => { + expect(() => { + Record.removeSubrecord("doesntexist"); + }).toThrow(); + }); + it("should remove subrecord", () => { + Record.removeSubrecord("test"); + expect(Record.subrecords.test).toBe(null); + }); + it("should return record", () => { + expect(Record.removeSubrecord("test")).toBe(Record); + }); }); describe("save", () => { @@ -364,6 +652,16 @@ describe("record.Record", () => { Record.selectLine("test", 0); expect(Record.sublists.test.currentline).toEqual(Record.sublists.test.lines[0]); }); + it("should remove any uncommitted lines created by insertLine", () => { + Record.insertLine("test", 1); + expect(Record.sublists.test.lines).toHaveLength(3); + Record.selectLine("test", 2); + expect(Record.sublists.test.lines).toHaveLength(2); + expect(Record.getCurrentSublistIndex("test")).toBe(1); + }); + it("should return record", () => { + expect(Record.selectLine("test", 0)).toBe(Record); + }); }); describe("selectNewLine", () => { @@ -383,95 +681,120 @@ describe("record.Record", () => { expect(Record.sublists.test.currentline).not.toEqual(Record.sublists.test.lines[0]); expect(Record.sublists.test.currentline).not.toEqual(Record.sublists.test.lines[1]); }); + it("should return record", () => { + expect(Record.selectNewLine("test")).toBe(Record); + }); }); - describe("setCurrentSublistValue", () => { + describe("setCurrentSublistText", () => { beforeEach(() => { Record.selectLine("test", 0); }); it("should throw error if record isn't in dynamic mode", () => { Record.isDynamic = false; expect(() => { - Record.setCurrentSublistValue("test", "test", 0); + Record.setCurrentSublistText("test", "test", "test2"); }).toThrow(); }); it("should throw error if sublist doesn't exist", () => { expect(() => { - Record.setCurrentSublistValue("doesntexist", "test", 0); + Record.setCurrentSublistText("doesntexist", "test", "test2"); }).toThrow(); }); - it("should throw error if fieldId isn't supplied", () => { + it("should set value on current sublist line", () => { + Record.setCurrentSublistText("test", "test", "test2"); + expect(Record.sublists.test.currentline.test).toEqual({ value: "test2", text: "test2" }); + }); + it("should return record", () => { + expect(Record.setCurrentSublistText("test", "test", "test2")).toBe(Record); + }); + }); + + describe("setCurrentSublistValue", () => { + beforeEach(() => { + Record.selectLine("test", 0); + }); + it("should throw error if record isn't in dynamic mode", () => { + Record.isDynamic = false; expect(() => { - Record.setCurrentSublistValue("test"); + Record.setCurrentSublistValue("test", "test", 0); }).toThrow(); }); - it("should throw error if value isn't supplied", () => { + it("should throw error if sublist doesn't exist", () => { expect(() => { - Record.setCurrentSublistValue("test", "test"); + Record.setCurrentSublistValue("doesntexist", "test", 0); }).toThrow(); }); it("should set value on current sublist line", () => { Record.setCurrentSublistValue("test", "test", 2); expect(Record.sublists.test.currentline.test).toEqual({ value: 2 }); }); + it("should return record", () => { + expect(Record.setCurrentSublistValue("test", "test", 2)).toBe(Record); + }); }); - describe("setSublistValue", () => { + describe("setSublistText", () => { beforeEach(() => { Record.isDynamic = false; }); it("should throw error if record isn't in standard mode", () => { Record.isDynamic = true; expect(() => { - Record.setSublistValue("test", "test", 0, 0); + Record.setSublistText("test", "test", 0, "test2"); }).toThrow(); }); it("should throw error if sublist doesn't exist", () => { expect(() => { - Record.setSublistValue("doesntexist", "test", 0, 0); + Record.setSublistText("doesntexist", "test", 0, "test2"); }).toThrow(); }); - it("should throw error if line doesn't exist", () => { - expect(() => { - Record.setSublistValue("test", "test", 999, 0); - }).toThrow(); + it("should set value on current sublist line", () => { + Record.setSublistText("test", "test", 0, "test2"); + expect(Record.sublists.test.lines[0].test).toEqual({ value: "test2", text: "test2" }); }); - it("should throw error if fieldId isn't supplied", () => { + it("should return record", () => { + expect(Record.setSublistText("test", "test", 0, "test2")).toBe(Record); + }); + }); + + describe("setSublistValue", () => { + beforeEach(() => { + Record.isDynamic = false; + }); + it("should throw error if record isn't in standard mode", () => { + Record.isDynamic = true; expect(() => { - Record.setSublistValue("test"); + Record.setSublistValue("test", "test", 0, 0); }).toThrow(); }); - it("should throw error if line isn't supplied", () => { + it("should throw error if sublist doesn't exist", () => { expect(() => { - Record.setSublistValue("test", "test"); + Record.setSublistValue("doesntexist", "test", 0, 0); }).toThrow(); }); - it("should throw error if value isn't supplied", () => { + it("should throw error if line doesn't exist", () => { expect(() => { - Record.setSublistValue("test", "test", 0); + Record.setSublistValue("test", "test", 999, 0); }).toThrow(); }); it("should set value on sublist line", () => { Record.setSublistValue("test", "test", 0, 2); expect(Record.sublists.test.lines[0].test).toEqual({ value: 2 }); }); + it("should return record", () => { + expect(Record.setSublistValue("test", "test", 0, 2)).toBe(Record); + }); }); describe("setText", () => { - it("should error if fieldId isn't supplied", () => { - expect(() => { - Record.setText(); - }).toThrow(); - }); - it("should error if text isn't supplied", () => { - expect(() => { - Record.setText("test"); - }).toThrow(); - }); it("should set text", () => { Record.setText("test", "test2"); expect(Record.fields.test).toEqual({ value: "test2", text: "test2" }); }); + it("should return record", () => { + expect(Record.setText("test", "test2")).toBe(Record); + }); }); describe("setValue", () => { @@ -479,5 +802,8 @@ describe("record.Record", () => { Record.setValue("test", 2); expect(Record.fields.test).toEqual({ value: 2 }); }); + it("should return record", () => { + expect(Record.setValue("test", 2)).toBe(Record); + }); }); }); diff --git a/__tests__/record/index.js b/__tests__/record/index.js index 35e3ceb..eaa0380 100644 --- a/__tests__/record/index.js +++ b/__tests__/record/index.js @@ -136,7 +136,7 @@ describe("record", () => { test: "test2", }, }); - expect(Record.fields.test).toBe("test2"); + expect(SuiteScriptMocks.records[0].fields.test).toBe("test2"); }); it("should throw error if record doesn't exist", () => { expect(() => { @@ -149,6 +149,16 @@ describe("record", () => { }); }).toThrow(); }); + it("should save fields on copy of record", () => { + record.submitFields({ + id: 1, + type: record.Type.SALES_ORDER, + values: { + test: "test2", + }, + }); + expect(Record.fields.test).toBe(1); + }); }); describe("transform", () => { diff --git a/lib/mocks/record/Field.cjs b/lib/mocks/record/Field.cjs new file mode 100644 index 0000000..eb2f0ce --- /dev/null +++ b/lib/mocks/record/Field.cjs @@ -0,0 +1,30 @@ +var _initClass, _dec, _dec2, _init_getSelectOptions; +function applyDecs2203RFactory() { function createAddInitializerMethod(e, t) { return function (r) { !function (e, t) { if (e.v) throw new Error("attempted to call " + t + " after decoration was finished"); }(t, "addInitializer"), assertCallable(r, "An initializer"), e.push(r); }; } function memberDec(e, t, r, n, a, i, s, o) { var c; switch (a) { case 1: c = "accessor"; break; case 2: c = "method"; break; case 3: c = "getter"; break; case 4: c = "setter"; break; default: c = "field"; } var l, u, f = { kind: c, name: s ? "#" + t : t, static: i, private: s }, p = { v: !1 }; 0 !== a && (f.addInitializer = createAddInitializerMethod(n, p)), 0 === a ? s ? (l = r.get, u = r.set) : (l = function () { return this[t]; }, u = function (e) { this[t] = e; }) : 2 === a ? l = function () { return r.value; } : (1 !== a && 3 !== a || (l = function () { return r.get.call(this); }), 1 !== a && 4 !== a || (u = function (e) { r.set.call(this, e); })), f.access = l && u ? { get: l, set: u } : l ? { get: l } : { set: u }; try { return e(o, f); } finally { p.v = !0; } } function assertCallable(e, t) { if ("function" != typeof e) throw new TypeError(t + " must be a function"); } function assertValidReturnValue(e, t) { var r = typeof t; if (1 === e) { if ("object" !== r || null === t) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); void 0 !== t.get && assertCallable(t.get, "accessor.get"), void 0 !== t.set && assertCallable(t.set, "accessor.set"), void 0 !== t.init && assertCallable(t.init, "accessor.init"); } else if ("function" !== r) { var n; throw n = 0 === e ? "field" : 10 === e ? "class" : "method", new TypeError(n + " decorators must return a function or void 0"); } } function applyMemberDec(e, t, r, n, a, i, s, o) { var c, l, u, f, p, d, h = r[0]; if (s ? c = 0 === a || 1 === a ? { get: r[3], set: r[4] } : 3 === a ? { get: r[3] } : 4 === a ? { set: r[3] } : { value: r[3] } : 0 !== a && (c = Object.getOwnPropertyDescriptor(t, n)), 1 === a ? u = { get: c.get, set: c.set } : 2 === a ? u = c.value : 3 === a ? u = c.get : 4 === a && (u = c.set), "function" == typeof h) void 0 !== (f = memberDec(h, n, c, o, a, i, s, u)) && (assertValidReturnValue(a, f), 0 === a ? l = f : 1 === a ? (l = f.init, p = f.get || u.get, d = f.set || u.set, u = { get: p, set: d }) : u = f);else for (var v = h.length - 1; v >= 0; v--) { var g; if (void 0 !== (f = memberDec(h[v], n, c, o, a, i, s, u))) assertValidReturnValue(a, f), 0 === a ? g = f : 1 === a ? (g = f.init, p = f.get || u.get, d = f.set || u.set, u = { get: p, set: d }) : u = f, void 0 !== g && (void 0 === l ? l = g : "function" == typeof l ? l = [l, g] : l.push(g)); } if (0 === a || 1 === a) { if (void 0 === l) l = function (e, t) { return t; };else if ("function" != typeof l) { var y = l; l = function (e, t) { for (var r = t, n = 0; n < y.length; n++) r = y[n].call(e, r); return r; }; } else { var m = l; l = function (e, t) { return m.call(e, t); }; } e.push(l); } 0 !== a && (1 === a ? (c.get = u.get, c.set = u.set) : 2 === a ? c.value = u : 3 === a ? c.get = u : 4 === a && (c.set = u), s ? 1 === a ? (e.push(function (e, t) { return u.get.call(e, t); }), e.push(function (e, t) { return u.set.call(e, t); })) : 2 === a ? e.push(u) : e.push(function (e, t) { return u.call(e, t); }) : Object.defineProperty(t, n, c)); } function applyMemberDecs(e, t) { for (var r, n, a = [], i = new Map(), s = new Map(), o = 0; o < t.length; o++) { var c = t[o]; if (Array.isArray(c)) { var l, u, f = c[1], p = c[2], d = c.length > 3, h = f >= 5; if (h ? (l = e, 0 !== (f -= 5) && (u = n = n || [])) : (l = e.prototype, 0 !== f && (u = r = r || [])), 0 !== f && !d) { var v = h ? s : i, g = v.get(p) || 0; if (!0 === g || 3 === g && 4 !== f || 4 === g && 3 !== f) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + p); !g && f > 2 ? v.set(p, f) : v.set(p, !0); } applyMemberDec(a, l, c, p, f, h, d, u); } } return pushInitializers(a, r), pushInitializers(a, n), a; } function pushInitializers(e, t) { t && e.push(function (e) { for (var r = 0; r < t.length; r++) t[r].call(e); return e; }); } return function (e, t, r) { return { e: applyMemberDecs(e, t), get c() { return function (e, t) { if (t.length > 0) { for (var r = [], n = e, a = e.name, i = t.length - 1; i >= 0; i--) { var s = { v: !1 }; try { var o = t[i](n, { kind: "class", name: a, addInitializer: createAddInitializerMethod(r, s) }); } finally { s.v = !0; } void 0 !== o && (assertValidReturnValue(10, o), n = o); } return [n, function () { for (var e = 0; e < r.length; e++) r[e].call(n); }]; } }(e, r); } }; }; } +function _applyDecs2203R(e, t, r) { return (_applyDecs2203R = applyDecs2203RFactory())(e, t, r); } +const { + assignConstructor, + required +} = require("../../helpers.cjs"); +let _Field; +_dec = assignConstructor(); +_dec2 = required("filter", "operator"); +class Field { + static { + ({ + e: [_init_getSelectOptions], + c: [_Field, _initClass] + } = _applyDecs2203R(this, [[_dec2, 0, "getSelectOptions"]], [_dec])); + } + label; + id; + type; + isMandatory; + sublistId; + isDisplay; + getSelectOptions = _init_getSelectOptions(this, options => {}); + static { + _initClass(); + } +} +module.exports = _Field; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJhc3NpZ25Db25zdHJ1Y3RvciIsInJlcXVpcmVkIiwicmVxdWlyZSIsIl9GaWVsZCIsIl9kZWMiLCJfZGVjMiIsIkZpZWxkIiwiZSIsIl9pbml0X2dldFNlbGVjdE9wdGlvbnMiLCJjIiwiX2luaXRDbGFzcyIsIl9hcHBseURlY3MyMjAzUiIsImxhYmVsIiwiaWQiLCJ0eXBlIiwiaX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RTtFQUNGQyxJQUFJO0VBQ0pDLFdBQVc7RUFDWEMsU0FBUztFQUNUQyxTQUFTO0VBR1RDLGdCQUFnQixHQUFBVixzQkFBQSxPQUFJVyxPQUFPLElBQUssQ0FBQyxDQUFDO0VBQUM7SUFBQVQsVUFBQTtFQUFBO0FBQ3BDO0FBRUFVLE1BQU0sQ0FBQ0MsT0FBTyxHQUFHZixNQUFLIn0= \ No newline at end of file diff --git a/lib/mocks/record/Record.cjs b/lib/mocks/record/Record.cjs index c564a1f..f2f2279 100644 --- a/lib/mocks/record/Record.cjs +++ b/lib/mocks/record/Record.cjs @@ -1,4 +1,4 @@ -var _initClass, _dec, _dec2, _dec3, _dec4, _init_cancelLine, _dec5, _dec6, _dec7, _init_commitLine, _dec8, _init_executeMacro, _dec9, _dec10, _dec11, _init_getCurrentSublistText, _dec12, _dec13, _dec14, _init_getCurrentSublistValue, _dec15, _dec16, _init_getLineCount, _dec17, _dec18, _init_getSublistText, _dec19, _dec20, _init_getSublistValue, _dec21, _dec22, _init_getSubrecord, _dec23, _dec24, _init_getText, _dec25, _dec26, _init_getValue, _dec27, _dec28, _init_removeLine, _dec29, _dec30, _init_save, _dec31, _dec32, _dec33, _init_selectLine, _dec34, _dec35, _dec36, _init_selectNewLine, _dec37, _dec38, _dec39, _init_setCurrentSublistText, _dec40, _dec41, _dec42, _init_setCurrentSublistValue, _dec43, _dec44, _dec45, _init_setSublistText, _dec46, _dec47, _dec48, _init_setSublistValue, _dec49, _dec50, _init_setText, _dec51, _dec52, _init_setValue; +var _initClass, _dec, _dec2, _dec3, _dec4, _init_cancelLine, _dec5, _dec6, _dec7, _init_commitLine, _dec8, _init_executeMacro, _dec9, _dec10, _init_findSublistLineWithValue, _dec11, _init_getCurrentMatrixSublistValue, _dec12, _dec13, _dec14, _init_getCurrentSublistField, _dec15, _dec16, _dec17, _init_getCurrentSublistIndex, _dec18, _dec19, _init_getCurrentSublistSubrecord, _dec20, _dec21, _dec22, _init_getCurrentSublistText, _dec23, _dec24, _dec25, _init_getCurrentSublistValue, _dec26, _dec27, _init_getField, _dec28, _dec29, _init_getLineCount, _dec30, _dec31, _init_getSublist, _dec32, _dec33, _init_getSublistField, _dec34, _dec35, _init_getSublistFields, _dec36, _dec37, _init_getSublistSubrecord, _dec38, _dec39, _init_getSublistText, _dec40, _dec41, _init_getSublistValue, _dec42, _dec43, _init_getSubrecord, _dec44, _dec45, _init_getText, _dec46, _dec47, _init_getValue, _dec48, _dec49, _dec50, _init_hasCurrentSublistSubrecord, _dec51, _dec52, _init_hasSublistSubrecord, _dec53, _dec54, _init_hasSubrecord, _dec55, _dec56, _init_insertLine, _dec57, _dec58, _dec59, _init_removeCurrentSublistSubrecord, _dec60, _dec61, _init_removeLine, _dec62, _dec63, _dec64, _init_removeSublistSubrecord, _dec65, _dec66, _init_removeSubrecord, _dec67, _dec68, _init_save, _dec69, _dec70, _dec71, _init_selectLine, _dec72, _dec73, _dec74, _init_selectNewLine, _dec75, _dec76, _dec77, _init_setCurrentSublistText, _dec78, _dec79, _dec80, _init_setCurrentSublistValue, _dec81, _dec82, _dec83, _init_setSublistText, _dec84, _dec85, _dec86, _init_setSublistValue, _dec87, _dec88, _init_setText, _dec89, _dec90, _init_setValue; function applyDecs2203RFactory() { function createAddInitializerMethod(e, t) { return function (r) { !function (e, t) { if (e.v) throw new Error("attempted to call " + t + " after decoration was finished"); }(t, "addInitializer"), assertCallable(r, "An initializer"), e.push(r); }; } function memberDec(e, t, r, n, a, i, s, o) { var c; switch (a) { case 1: c = "accessor"; break; case 2: c = "method"; break; case 3: c = "getter"; break; case 4: c = "setter"; break; default: c = "field"; } var l, u, f = { kind: c, name: s ? "#" + t : t, static: i, private: s }, p = { v: !1 }; 0 !== a && (f.addInitializer = createAddInitializerMethod(n, p)), 0 === a ? s ? (l = r.get, u = r.set) : (l = function () { return this[t]; }, u = function (e) { this[t] = e; }) : 2 === a ? l = function () { return r.value; } : (1 !== a && 3 !== a || (l = function () { return r.get.call(this); }), 1 !== a && 4 !== a || (u = function (e) { r.set.call(this, e); })), f.access = l && u ? { get: l, set: u } : l ? { get: l } : { set: u }; try { return e(o, f); } finally { p.v = !0; } } function assertCallable(e, t) { if ("function" != typeof e) throw new TypeError(t + " must be a function"); } function assertValidReturnValue(e, t) { var r = typeof t; if (1 === e) { if ("object" !== r || null === t) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); void 0 !== t.get && assertCallable(t.get, "accessor.get"), void 0 !== t.set && assertCallable(t.set, "accessor.set"), void 0 !== t.init && assertCallable(t.init, "accessor.init"); } else if ("function" !== r) { var n; throw n = 0 === e ? "field" : 10 === e ? "class" : "method", new TypeError(n + " decorators must return a function or void 0"); } } function applyMemberDec(e, t, r, n, a, i, s, o) { var c, l, u, f, p, d, h = r[0]; if (s ? c = 0 === a || 1 === a ? { get: r[3], set: r[4] } : 3 === a ? { get: r[3] } : 4 === a ? { set: r[3] } : { value: r[3] } : 0 !== a && (c = Object.getOwnPropertyDescriptor(t, n)), 1 === a ? u = { get: c.get, set: c.set } : 2 === a ? u = c.value : 3 === a ? u = c.get : 4 === a && (u = c.set), "function" == typeof h) void 0 !== (f = memberDec(h, n, c, o, a, i, s, u)) && (assertValidReturnValue(a, f), 0 === a ? l = f : 1 === a ? (l = f.init, p = f.get || u.get, d = f.set || u.set, u = { get: p, set: d }) : u = f);else for (var v = h.length - 1; v >= 0; v--) { var g; if (void 0 !== (f = memberDec(h[v], n, c, o, a, i, s, u))) assertValidReturnValue(a, f), 0 === a ? g = f : 1 === a ? (g = f.init, p = f.get || u.get, d = f.set || u.set, u = { get: p, set: d }) : u = f, void 0 !== g && (void 0 === l ? l = g : "function" == typeof l ? l = [l, g] : l.push(g)); } if (0 === a || 1 === a) { if (void 0 === l) l = function (e, t) { return t; };else if ("function" != typeof l) { var y = l; l = function (e, t) { for (var r = t, n = 0; n < y.length; n++) r = y[n].call(e, r); return r; }; } else { var m = l; l = function (e, t) { return m.call(e, t); }; } e.push(l); } 0 !== a && (1 === a ? (c.get = u.get, c.set = u.set) : 2 === a ? c.value = u : 3 === a ? c.get = u : 4 === a && (c.set = u), s ? 1 === a ? (e.push(function (e, t) { return u.get.call(e, t); }), e.push(function (e, t) { return u.set.call(e, t); })) : 2 === a ? e.push(u) : e.push(function (e, t) { return u.call(e, t); }) : Object.defineProperty(t, n, c)); } function applyMemberDecs(e, t) { for (var r, n, a = [], i = new Map(), s = new Map(), o = 0; o < t.length; o++) { var c = t[o]; if (Array.isArray(c)) { var l, u, f = c[1], p = c[2], d = c.length > 3, h = f >= 5; if (h ? (l = e, 0 !== (f -= 5) && (u = n = n || [])) : (l = e.prototype, 0 !== f && (u = r = r || [])), 0 !== f && !d) { var v = h ? s : i, g = v.get(p) || 0; if (!0 === g || 3 === g && 4 !== f || 4 === g && 3 !== f) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + p); !g && f > 2 ? v.set(p, f) : v.set(p, !0); } applyMemberDec(a, l, c, p, f, h, d, u); } } return pushInitializers(a, r), pushInitializers(a, n), a; } function pushInitializers(e, t) { t && e.push(function (e) { for (var r = 0; r < t.length; r++) t[r].call(e); return e; }); } return function (e, t, r) { return { e: applyMemberDecs(e, t), get c() { return function (e, t) { if (t.length > 0) { for (var r = [], n = e, a = e.name, i = t.length - 1; i >= 0; i--) { var s = { v: !1 }; try { var o = t[i](n, { kind: "class", name: a, addInitializer: createAddInitializerMethod(r, s) }); } finally { s.v = !0; } void 0 !== o && (assertValidReturnValue(10, o), n = o); } return [n, function () { for (var e = 0; e < r.length; e++) r[e].call(n); }]; } }(e, r); } }; }; } function _applyDecs2203R(e, t, r) { return (_applyDecs2203R = applyDecs2203RFactory())(e, t, r); } const datefns = require("date-fns"); @@ -7,6 +7,8 @@ const { randomUUID } = require("node:crypto"); const SuiteScriptMocks = require("../../index.cjs"); +const Field = require("./Field.cjs"); +const Sublist = require("./Sublist.cjs"); const { options, required, @@ -24,56 +26,94 @@ _dec5 = dynamicModeOnly(); _dec6 = options("sublistId", "ignoreRecalc"); _dec7 = required("sublistId"); _dec8 = addPromise(); -_dec9 = dynamicModeOnly(); -_dec10 = options("sublistId", "fieldId"); -_dec11 = required("sublistId", "fieldId"); +_dec9 = options("sublistId", "fieldId", "value"); +_dec10 = required("sublistId", "fieldId", "value"); +_dec11 = dynamicModeOnly(); _dec12 = dynamicModeOnly(); _dec13 = options("sublistId", "fieldId"); _dec14 = required("sublistId", "fieldId"); -_dec15 = options("sublistId"); -_dec16 = required("sublistId"); -_dec17 = options("sublistId", "fieldId", "line"); -_dec18 = required("sublistId", "fieldId", "line"); -_dec19 = options("sublistId", "fieldId", "line"); -_dec20 = required("sublistId", "fieldId", "line"); -_dec21 = options("fieldId"); -_dec22 = required("fieldId"); -_dec23 = options("fieldId"); -_dec24 = required("fieldId"); -_dec25 = options("fieldId"); -_dec26 = required("fieldId"); -_dec27 = options("sublistId", "line", "ignoreRecalc", "lineInstanceId"); -_dec28 = required("sublistId", "line"); -_dec29 = addPromise(); -_dec30 = options("enableSourcing", "ignoreMandatoryFields"); -_dec31 = dynamicModeOnly(); -_dec32 = options("sublistId", "line"); -_dec33 = required("sublistId", "line"); -_dec34 = dynamicModeOnly(); -_dec35 = options("sublistId"); -_dec36 = required("sublistId"); -_dec37 = dynamicModeOnly(); -_dec38 = options("sublistId", "fieldId", "text"); -_dec39 = required("sublistId", "fieldId", "text"); -_dec40 = dynamicModeOnly(); -_dec41 = options("sublistId", "fieldId", "value"); -_dec42 = required("sublistId", "fieldId", "value"); -_dec43 = standardModeOnly(); -_dec44 = options("sublistId", "fieldId", "line", "text"); -_dec45 = required("sublistId", "fieldId", "line", "text"); -_dec46 = standardModeOnly(); -_dec47 = options("sublistId", "fieldId", "line", "value"); -_dec48 = required("sublistId", "fieldId", "line", "value"); -_dec49 = options("fieldId", "text", "ignoreFieldChange"); -_dec50 = required("fieldId", "text"); -_dec51 = options("fieldId", "value", "ignoreFieldChange"); -_dec52 = required("fieldId", "value"); +_dec15 = dynamicModeOnly(); +_dec16 = options("sublistId"); +_dec17 = required("sublistId"); +_dec18 = dynamicModeOnly(); +_dec19 = options("sublistId", "fieldId"); +_dec20 = dynamicModeOnly(); +_dec21 = options("sublistId", "fieldId"); +_dec22 = required("sublistId", "fieldId"); +_dec23 = dynamicModeOnly(); +_dec24 = options("sublistId", "fieldId"); +_dec25 = required("sublistId", "fieldId"); +_dec26 = options("fieldId"); +_dec27 = required("fieldId"); +_dec28 = options("sublistId"); +_dec29 = required("sublistId"); +_dec30 = options("sublistId"); +_dec31 = required("sublistId"); +_dec32 = options("sublistId", "fieldId", "line"); +_dec33 = required("sublistId", "fieldId", "line"); +_dec34 = options("sublistId"); +_dec35 = required("sublistId"); +_dec36 = options("sublistId", "fieldId", "line"); +_dec37 = required("sublistId", "fieldId", "line"); +_dec38 = options("sublistId", "fieldId", "line"); +_dec39 = required("sublistId", "fieldId", "line"); +_dec40 = options("sublistId", "fieldId", "line"); +_dec41 = required("sublistId", "fieldId", "line"); +_dec42 = options("fieldId"); +_dec43 = required("fieldId"); +_dec44 = options("fieldId"); +_dec45 = required("fieldId"); +_dec46 = options("fieldId"); +_dec47 = required("fieldId"); +_dec48 = dynamicModeOnly(); +_dec49 = options("sublistId", "fieldId"); +_dec50 = required("sublistId", "fieldId"); +_dec51 = options("sublistId", "fieldId", "line"); +_dec52 = required("sublistId", "fieldId", "line"); +_dec53 = options("fieldId"); +_dec54 = required("fieldId"); +_dec55 = options("sublistId", "line", "ignoreRecalc"); +_dec56 = required("sublistId", "line"); +_dec57 = dynamicModeOnly(); +_dec58 = options("sublistId", "fieldId"); +_dec59 = required("sublistId", "fieldId"); +_dec60 = options("sublistId", "line", "ignoreRecalc", "lineInstanceId"); +_dec61 = required("sublistId", "line"); +_dec62 = standardModeOnly(); +_dec63 = options("sublistId", "fieldId", "line"); +_dec64 = required("sublistId", "fieldId", "line"); +_dec65 = options("fieldId"); +_dec66 = required("fieldId"); +_dec67 = addPromise(); +_dec68 = options("enableSourcing", "ignoreMandatoryFields"); +_dec69 = dynamicModeOnly(); +_dec70 = options("sublistId", "line"); +_dec71 = required("sublistId", "line"); +_dec72 = dynamicModeOnly(); +_dec73 = options("sublistId"); +_dec74 = required("sublistId"); +_dec75 = dynamicModeOnly(); +_dec76 = options("sublistId", "fieldId", "text"); +_dec77 = required("sublistId", "fieldId", "text"); +_dec78 = dynamicModeOnly(); +_dec79 = options("sublistId", "fieldId", "value"); +_dec80 = required("sublistId", "fieldId", "value"); +_dec81 = standardModeOnly(); +_dec82 = options("sublistId", "fieldId", "line", "text"); +_dec83 = required("sublistId", "fieldId", "line", "text"); +_dec84 = standardModeOnly(); +_dec85 = options("sublistId", "fieldId", "line", "value"); +_dec86 = required("sublistId", "fieldId", "line", "value"); +_dec87 = options("fieldId", "text", "ignoreFieldChange"); +_dec88 = required("fieldId", "text"); +_dec89 = options("fieldId", "value", "ignoreFieldChange"); +_dec90 = required("fieldId", "value"); class Record { static { ({ - e: [_init_cancelLine, _init_commitLine, _init_executeMacro, _init_getCurrentSublistText, _init_getCurrentSublistValue, _init_getLineCount, _init_getSublistText, _init_getSublistValue, _init_getSubrecord, _init_getText, _init_getValue, _init_removeLine, _init_save, _init_selectLine, _init_selectNewLine, _init_setCurrentSublistText, _init_setCurrentSublistValue, _init_setSublistText, _init_setSublistValue, _init_setText, _init_setValue], + e: [_init_cancelLine, _init_commitLine, _init_executeMacro, _init_findSublistLineWithValue, _init_getCurrentMatrixSublistValue, _init_getCurrentSublistField, _init_getCurrentSublistIndex, _init_getCurrentSublistSubrecord, _init_getCurrentSublistText, _init_getCurrentSublistValue, _init_getField, _init_getLineCount, _init_getSublist, _init_getSublistField, _init_getSublistFields, _init_getSublistSubrecord, _init_getSublistText, _init_getSublistValue, _init_getSubrecord, _init_getText, _init_getValue, _init_hasCurrentSublistSubrecord, _init_hasSublistSubrecord, _init_hasSubrecord, _init_insertLine, _init_removeCurrentSublistSubrecord, _init_removeLine, _init_removeSublistSubrecord, _init_removeSubrecord, _init_save, _init_selectLine, _init_selectNewLine, _init_setCurrentSublistText, _init_setCurrentSublistValue, _init_setSublistText, _init_setSublistValue, _init_setText, _init_setValue], c: [_Record, _initClass] - } = _applyDecs2203R(this, [[[_dec2, _dec3, _dec4], 0, "cancelLine"], [[_dec5, _dec6, _dec7], 0, "commitLine"], [_dec8, 0, "executeMacro"], [[_dec9, _dec10, _dec11], 0, "getCurrentSublistText"], [[_dec12, _dec13, _dec14], 0, "getCurrentSublistValue"], [[_dec15, _dec16], 0, "getLineCount"], [[_dec17, _dec18], 0, "getSublistText"], [[_dec19, _dec20], 0, "getSublistValue"], [[_dec21, _dec22], 0, "getSubrecord"], [[_dec23, _dec24], 0, "getText"], [[_dec25, _dec26], 0, "getValue"], [[_dec27, _dec28], 0, "removeLine"], [[_dec29, _dec30], 0, "save"], [[_dec31, _dec32, _dec33], 0, "selectLine"], [[_dec34, _dec35, _dec36], 0, "selectNewLine"], [[_dec37, _dec38, _dec39], 0, "setCurrentSublistText"], [[_dec40, _dec41, _dec42], 0, "setCurrentSublistValue"], [[_dec43, _dec44, _dec45], 0, "setSublistText"], [[_dec46, _dec47, _dec48], 0, "setSublistValue"], [[_dec49, _dec50], 0, "setText"], [[_dec51, _dec52], 0, "setValue"]], [_dec])); + } = _applyDecs2203R(this, [[[_dec2, _dec3, _dec4], 0, "cancelLine"], [[_dec5, _dec6, _dec7], 0, "commitLine"], [_dec8, 0, "executeMacro"], [[_dec9, _dec10], 0, "findSublistLineWithValue"], [_dec11, 0, "getCurrentMatrixSublistValue"], [[_dec12, _dec13, _dec14], 0, "getCurrentSublistField"], [[_dec15, _dec16, _dec17], 0, "getCurrentSublistIndex"], [[_dec18, _dec19], 0, "getCurrentSublistSubrecord"], [[_dec20, _dec21, _dec22], 0, "getCurrentSublistText"], [[_dec23, _dec24, _dec25], 0, "getCurrentSublistValue"], [[_dec26, _dec27], 0, "getField"], [[_dec28, _dec29], 0, "getLineCount"], [[_dec30, _dec31], 0, "getSublist"], [[_dec32, _dec33], 0, "getSublistField"], [[_dec34, _dec35], 0, "getSublistFields"], [[_dec36, _dec37], 0, "getSublistSubrecord"], [[_dec38, _dec39], 0, "getSublistText"], [[_dec40, _dec41], 0, "getSublistValue"], [[_dec42, _dec43], 0, "getSubrecord"], [[_dec44, _dec45], 0, "getText"], [[_dec46, _dec47], 0, "getValue"], [[_dec48, _dec49, _dec50], 0, "hasCurrentSublistSubrecord"], [[_dec51, _dec52], 0, "hasSublistSubrecord"], [[_dec53, _dec54], 0, "hasSubrecord"], [[_dec55, _dec56], 0, "insertLine"], [[_dec57, _dec58, _dec59], 0, "removeCurrentSublistSubrecord"], [[_dec60, _dec61], 0, "removeLine"], [[_dec62, _dec63, _dec64], 0, "removeSublistSubrecord"], [[_dec65, _dec66], 0, "removeSubrecord"], [[_dec67, _dec68], 0, "save"], [[_dec69, _dec70, _dec71], 0, "selectLine"], [[_dec72, _dec73, _dec74], 0, "selectNewLine"], [[_dec75, _dec76, _dec77], 0, "setCurrentSublistText"], [[_dec78, _dec79, _dec80], 0, "setCurrentSublistValue"], [[_dec81, _dec82, _dec83], 0, "setSublistText"], [[_dec84, _dec85, _dec86], 0, "setSublistValue"], [[_dec87, _dec88], 0, "setText"], [[_dec89, _dec90], 0, "setValue"]], [_dec])); } id = null; type = null; @@ -84,11 +124,25 @@ class Record { version = 1; initialize = () => { this.fields = structuredClone(this.fields); - this.sublists = Object.entries(structuredClone(this.sublists) || {}).reduce((acc, [lineId, lines]) => { + this.sublists = Object.entries(this.sublists || {}).reduce((acc, [lineId, lines]) => { acc[lineId] = { currentline: {}, - lines: "lines" in lines ? lines.lines : lines + lines: [...(("lines" in lines ? lines.lines : lines) || [])] }; + acc[lineId].lines = acc[lineId].lines.map(line => { + line = { + ...line + }; + line._id = line._id || randomUUID(); + Object.entries(line).forEach(([key, value]) => { + if (value instanceof _Record) { + line[key] = new _Record(value); + } else { + line[key] = structuredClone(value); + } + }); + return line; + }); return acc; }, {}); this.subrecords = Object.entries(this.subrecords || {}).reduce((acc, [subrecordId, subrecord]) => { @@ -96,37 +150,73 @@ class Record { return acc; }, {}); }; + #getSublist(options) { + const sublist = this.sublists[options.sublistId]; + if (!sublist) { + throw new Error("Sublist does not exist"); + } + return sublist; + } + #getLine(options) { + const sublist = this.#getSublist(options); + const line = sublist.lines[options.line]; + if (!line) { + throw new Error("Line does not exist"); + } + return line; + } cancelLine = _init_cancelLine(this, options => { this.selectNewLine(options.sublistId); + return this; }); commitLine = _init_commitLine(this, options => { - const sublist = this?.sublists?.[options.sublistId]; - if (sublist === undefined || !("currentline" in sublist)) { - throw new Error(); - } - const existingIndex = sublist.lines.findIndex(a => a._id === sublist.currentline._id); - if (existingIndex > -1) { - sublist.lines[existingIndex] = sublist.currentline; - } else { - sublist.lines.push(sublist.currentline); + const sublist = this.#getSublist(options); + if (!sublist.currentline._id) { + sublist.currentline._id = randomUUID(); } + sublist.lines[this.getCurrentSublistIndex(options.sublistId)] = sublist.currentline; this.selectNewLine(options.sublistId); + return this; }); executeMacro = _init_executeMacro(this, options => {}); findMatrixSublistLineWithValue = options => {}; - findSublistLineWithValue = options => {}; - getCurrentMatrixSublistValue = options => {}; - getCurrentSublistField = options => {}; - getCurrentSublistIndex = options => {}; - getCurrentSublistSubrecord = options => {}; - getCurrentSublistText = _init_getCurrentSublistText(this, options => { - const sublist = this.sublists[options.sublistId]; - if (sublist === undefined) { - throw new Error("Sublist does not exist"); + findSublistLineWithValue = _init_findSublistLineWithValue(this, options => { + for (let i = 0; i < this.getLineCount(options.sublistId); i++) { + if (this.getSublistValue(options.sublistId, options.fieldId, i) == options.value) { + return i; + } } - if (!("currentline" in sublist)) { - this.selectNewLine(sublist); + return -1; + }); + getCurrentMatrixSublistValue = _init_getCurrentMatrixSublistValue(this, options => {}); + getCurrentSublistField = _init_getCurrentSublistField(this, options => { + const sublist = this.#getSublist(options); + if (options.fieldId in sublist.currentline) { + return new Field({ + id: options.fieldId, + label: options.fieldId, + sublistId: options.sublistId + }); } + return null; + }); + getCurrentSublistIndex = _init_getCurrentSublistIndex(this, options => { + const sublist = this?.sublists?.[options.sublistId]; + if (sublist) { + const existingIndex = sublist?.lines.findIndex(a => a._id === sublist.currentline._id); + return existingIndex > -1 ? existingIndex : sublist?.lines.length; + } + return -1; + }); + getCurrentSublistSubrecord = _init_getCurrentSublistSubrecord(this, options => { + const sublist = this.#getSublist(options); + if (!(options.fieldId in sublist.currentline) || !(sublist.currentline[options.fieldId] instanceof _Record)) { + throw new Error(`Field ${options.fieldId} is not a subrecord field`); + } + return sublist.currentline[options.fieldId]; + }); + getCurrentSublistText = _init_getCurrentSublistText(this, options => { + const sublist = this.#getSublist(options); const field = sublist.currentline[options.fieldId]; if (Object.prototype.toString.call(field) === "[object Date]") { return datefns.format(field, SuiteScriptMocks.dateFormat); @@ -138,20 +228,28 @@ class Record { }); getCurrentSublistValue = _init_getCurrentSublistValue(this, options => { const sublist = this.sublists[options.sublistId]; + // this is correct, suitescript doesn't error when supplying a sublistId that doesn't exist if (sublist === undefined) { return null; } - if (!("currentline" in sublist)) { - this.selectNewLine(sublist); - } const field = sublist.currentline[options.fieldId]; if (typeof field === "object" && field !== null && !(Object.prototype.toString.call(field) === "[object Date]")) { return field.value; } return field; }); - getField = options => {}; - getFields = options => {}; + getField = _init_getField(this, options => { + if (options.fieldId in this.fields) { + return new Field({ + id: options.fieldId, + label: options.fieldId + }); + } + return null; + }); + getFields = () => { + return Object.keys(this.fields); + }; getLineCount = _init_getLineCount(this, options => { const sublist = this.sublists[options.sublistId]; if (sublist === undefined) { @@ -166,13 +264,42 @@ class Record { getMatrixHeaderValue = options => {}; getMatrixSublistField = options => {}; getMatrixSublistValue = options => {}; - getSublist = options => {}; - getSublists = options => {}; - getSublistField = options => {}; - getSublistFields = options => {}; - getSublistSubrecord = options => {}; + getSublist = _init_getSublist(this, options => { + if (options.sublistId in this.sublists) { + return new Sublist({ + id: options.sublistId + }); + } + return null; + }); + getSublists = () => { + return Object.keys(this.sublists); + }; + getSublistField = _init_getSublistField(this, options => { + const line = this.#getLine(options); + if (options.fieldId in line) { + return new Field({ + id: options.fieldId, + label: options.fieldId, + sublistId: options.sublistId + }); + } + return null; + }); + getSublistFields = _init_getSublistFields(this, options => { + const sublist = this.#getSublist(options); + return Object.keys(sublist.lines[0] || {}).filter(id => id !== "_id"); + }); + getSublistSubrecord = _init_getSublistSubrecord(this, options => { + const line = this.#getLine(options); + if (!(options.fieldId in line) || !(line[options.fieldId] instanceof _Record)) { + throw new Error(`Field ${options.fieldId} is not a subrecord field`); + } + return line[options.fieldId]; + }); getSublistText = _init_getSublistText(this, options => { - const field = this.sublists[options.sublistId].lines[options.line][options.fieldId]; + const line = this.#getLine(options); + const field = line[options.fieldId]; if (Object.prototype.toString.call(field) === "[object Date]") { return datefns.format(field, SuiteScriptMocks.dateFormat); } @@ -185,7 +312,8 @@ class Record { return field; }); getSublistValue = _init_getSublistValue(this, options => { - const field = this.sublists[options.sublistId].lines[options.line][options.fieldId]; + const line = this.#getLine(options); + const field = line[options.fieldId]; if (typeof field === "object" && field !== null && !(Object.prototype.toString.call(field) === "[object Date]")) { return field.value; } @@ -193,7 +321,7 @@ class Record { }); getSubrecord = _init_getSubrecord(this, options => { if (!(options.fieldId in this.subrecords)) { - throw new Error("Subrecord does not exist."); + throw new Error(`Field ${options.fieldId} is not a subrecord field`); } return this.subrecords[options.fieldId]; }); @@ -217,21 +345,84 @@ class Record { } return field; }); - hasCurrentSublistSubrecord = options => {}; - hasSublistSubrecord = options => {}; - hasSubrecord = options => {}; - insertLine = options => {}; - moveLine = options => {}; - removeCurrentSublistSubrecord = options => {}; - removeLine = _init_removeLine(this, options => { + hasCurrentSublistSubrecord = _init_hasCurrentSublistSubrecord(this, options => { + return Boolean(this.getCurrentSublistSubrecord(options)); + }); + hasSublistSubrecord = _init_hasSublistSubrecord(this, options => { + return Boolean(this.getSublistSubrecord(options)); + }); + hasSubrecord = _init_hasSubrecord(this, options => { + return Boolean(this.getSubrecord(options)); + }); + insertLine = _init_insertLine(this, options => { const sublist = this.sublists[options.sublistId]; - if (sublist === undefined || !(options.line in sublist.lines)) { - throw new Error(); + if (!sublist) { + throw new Error("Sublist does not exist"); + } + if (options.line < 0 || options.line > sublist.lines.length) { + throw new Error("Line is outside valid range"); + } + sublist.lines.splice(options.line, 0, {}); + if (this.isDynamic) { + this.selectLine(options); + } + return this; + }); + + // @options("sublistId", "from", "to") + // @required("sublistId", "from", "to") + // moveLine = (options) => { + // const sublist = this.#getSublist(options); + // if (options.from < 0 || options.from > sublist.lines.length - 1) { + // throw new Error("From is outside valid range"); + // } + // if (options.to < 0 || options.to > sublist.lines.length) { + // throw new Error("To is outside valid range"); + // } + // // if (options.to > options.from) { + // // options.to--; + // // } + // const line = sublist.lines.splice(options.from, 1); + // sublist.lines.splice(options.to, 0, line); + // return this; + // }; + + removeCurrentSublistSubrecord = _init_removeCurrentSublistSubrecord(this, options => { + const sublist = this.#getSublist(options); + if (!(options.fieldId in sublist.currentline) || !(sublist.currentline[options.fieldId] instanceof _Record)) { + throw new Error(`Field ${options.fieldId} is not a subrecord field`); } + sublist.currentline[options.fieldId] = null; + return this; + }); + removeLine = _init_removeLine(this, options => { + const sublist = this.#getSublist(options); + this.#getLine(options); sublist.lines.splice(options.line, 1); + if (this.isDynamic) { + if (sublist.lines.length > 0) { + this.selectLine(options.sublistId, 0); + } else { + this.selectNewLine(options.sublistId); + } + } + return this; + }); + removeSublistSubrecord = _init_removeSublistSubrecord(this, options => { + const line = this.#getLine(options); + if (!(options.fieldId in line) || !(line[options.fieldId] instanceof _Record)) { + throw new Error(`Field ${options.fieldId} is not a subrecord field`); + } + line[options.fieldId] = null; + return this; + }); + removeSubrecord = _init_removeSubrecord(this, options => { + if (!(options.fieldId in this.subrecords)) { + throw new Error(`Field ${options.fieldId} is not a subrecord field`); + } + this.subrecords[options.fieldId] = null; + return this; }); - removeSublistSubrecord = options => {}; - removeSubrecord = options => {}; save = _init_save(this, options => { if (this.id && SuiteScriptMocks.records.get(this).version !== this.version) { throw new Error("Record has changed"); @@ -261,66 +452,55 @@ class Record { SuiteScriptMocks.savedRecords.push(copy); return this.id; }); - - // TODO: edge case where if first line select you do is n + 1 it will give a new line selectLine = _init_selectLine(this, options => { - const sublist = this.sublists[options.sublistId]; - if (sublist === undefined || !(options.line in sublist.lines)) { - throw new Error("sublist or line does not exist"); + const sublist = this.#getSublist(options); + if (options.line != this.getCurrentSublistIndex(options.sublistId)) { + const line = this.#getLine(options); + sublist.currentline = { + ...line + }; + sublist.lines = sublist.lines.filter(a => a._id); } - sublist.currentline = { - ...sublist.lines[options.line] - }; + return this; }); selectNewLine = _init_selectNewLine(this, options => { - const sublist = this.sublists[options.sublistId]; - if (sublist === undefined) { - throw new Error("sublist does not exist"); - } - sublist.currentline = { - _id: randomUUID() - }; + const sublist = this.#getSublist(options); + sublist.currentline = {}; + sublist.lines = sublist.lines.filter(a => a._id); + return this; }); setCurrentMatrixSublistValue = options => {}; setCurrentSublistText = _init_setCurrentSublistText(this, options => { - const sublist = this?.sublists?.[options.sublistId]; - if (sublist === undefined || !("currentline" in sublist)) { - throw new Error("sublist doesn't exist or line is not selected"); - } - return sublist.currentline[options.fieldId] = { + const sublist = this.#getSublist(options); + sublist.currentline[options.fieldId] = { value: options.text, text: options.text }; + return this; }); setCurrentSublistValue = _init_setCurrentSublistValue(this, options => { - const sublist = this?.sublists?.[options.sublistId]; - if (sublist === undefined || !("currentline" in sublist)) { - throw new Error("sublist doesn't exist or line is not selected"); - } - return sublist.currentline[options.fieldId] = { + const sublist = this.#getSublist(options); + sublist.currentline[options.fieldId] = { value: options.value }; + return this; }); setMatrixHeaderValue = options => {}; setMatrixSublistValue = options => {}; setSublistText = _init_setSublistText(this, options => { - const sublist = this?.sublists?.[options.sublistId]; - if (sublist === undefined || !(options.line in sublist.lines)) { - throw new Error("sublist or line doesn't exist"); - } - sublist.lines[options.line][options.fieldId] = { + const line = this.#getLine(options); + line[options.fieldId] = { value: options.text, text: options.text }; + return this; }); setSublistValue = _init_setSublistValue(this, options => { - const sublist = this?.sublists?.[options.sublistId]; - if (sublist === undefined || !(options.line in sublist.lines)) { - throw new Error("sublist or line doesn't exist"); - } - sublist.lines[options.line][options.fieldId] = { + const line = this.#getLine(options); + line[options.fieldId] = { value: options.value }; + return this; }); setText = _init_setText(this, options => { this.fields[options.fieldId] = { @@ -340,4 +520,4 @@ class Record { } } module.exports = _Record; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJkYXRlZm5zIiwicmVxdWlyZSIsInN0cnVjdHVyZWRDbG9uZSIsInJhbmRvbVVVSUQiLCJTdWl0ZVNjcmlwdE1vY2tzIiwib3B0aW9ucyIsInJlcXVpcmVkIiwiYWRkUHJvbWlzZSIsImR5bmFtaWNNb2RlT25seSIsInN0YW5kYXJkTW9kZU9ubHkiLCJhc3NpZ25Db25zdHJ1Y3RvciIsIl9SZWNvcmQiLCJfZGVjIiwiX2RlYzIiLCJfZGVjMyIsIl9kZWM0IiwiX2RlYzUiLCJfZGVjNiIsIl9kZWM3IiwiX2RlYzgiLCJfZGVjOSIsIl9kZWMxMCIsIl9kZWMxMSIsIl9kZWMxMiIsIl9kZWMxMyIsIl9kZWMxNCIsIl9kZWMxNSIsIl9kZWMxNiIsIl9kZWMxNyIsIl9kZWMxOCIsIl9kZWMxOSIsIl9kZWMyMCIsIl9kZWMyMSIsIl9kZWMyMiIsIl9kZWMyMyIsIl9kZWMyNCIsIl9kZWMyNSIsIl9kZWMyNiIsIl9kZWMyNyIsIl9kZWMyOCIsIl9kZWMyOSIsIl9kZWMzMCIsIl9kZWMzMSIsIl9kZWMzMiIsIl9kZWMzMyIsIl9kZWMzNCIsIl9kZWMzNSIsIl9kZWMzNiIsIl9kZWMzNyIsIl9kZWMzOCIsIl9kZWMzOSIsIl9kZWM0MCIsIl9kZWM0MSIsIl9kZWM0MiIsIl9kZWM0MyIsIl9kZWM0NCIsIl9kZWM0NSIsIl9kZWM0NiI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line at end of file diff --git a/lib/mocks/record/Sublist.cjs b/lib/mocks/record/Sublist.cjs new file mode 100644 index 0000000..465a5d2 --- /dev/null +++ b/lib/mocks/record/Sublist.cjs @@ -0,0 +1,22 @@ +var _initClass, _dec; +function applyDecs2203RFactory() { function createAddInitializerMethod(e, t) { return function (r) { !function (e, t) { if (e.v) throw new Error("attempted to call " + t + " after decoration was finished"); }(t, "addInitializer"), assertCallable(r, "An initializer"), e.push(r); }; } function memberDec(e, t, r, n, a, i, s, o) { var c; switch (a) { case 1: c = "accessor"; break; case 2: c = "method"; break; case 3: c = "getter"; break; case 4: c = "setter"; break; default: c = "field"; } var l, u, f = { kind: c, name: s ? "#" + t : t, static: i, private: s }, p = { v: !1 }; 0 !== a && (f.addInitializer = createAddInitializerMethod(n, p)), 0 === a ? s ? (l = r.get, u = r.set) : (l = function () { return this[t]; }, u = function (e) { this[t] = e; }) : 2 === a ? l = function () { return r.value; } : (1 !== a && 3 !== a || (l = function () { return r.get.call(this); }), 1 !== a && 4 !== a || (u = function (e) { r.set.call(this, e); })), f.access = l && u ? { get: l, set: u } : l ? { get: l } : { set: u }; try { return e(o, f); } finally { p.v = !0; } } function assertCallable(e, t) { if ("function" != typeof e) throw new TypeError(t + " must be a function"); } function assertValidReturnValue(e, t) { var r = typeof t; if (1 === e) { if ("object" !== r || null === t) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); void 0 !== t.get && assertCallable(t.get, "accessor.get"), void 0 !== t.set && assertCallable(t.set, "accessor.set"), void 0 !== t.init && assertCallable(t.init, "accessor.init"); } else if ("function" !== r) { var n; throw n = 0 === e ? "field" : 10 === e ? "class" : "method", new TypeError(n + " decorators must return a function or void 0"); } } function applyMemberDec(e, t, r, n, a, i, s, o) { var c, l, u, f, p, d, h = r[0]; if (s ? c = 0 === a || 1 === a ? { get: r[3], set: r[4] } : 3 === a ? { get: r[3] } : 4 === a ? { set: r[3] } : { value: r[3] } : 0 !== a && (c = Object.getOwnPropertyDescriptor(t, n)), 1 === a ? u = { get: c.get, set: c.set } : 2 === a ? u = c.value : 3 === a ? u = c.get : 4 === a && (u = c.set), "function" == typeof h) void 0 !== (f = memberDec(h, n, c, o, a, i, s, u)) && (assertValidReturnValue(a, f), 0 === a ? l = f : 1 === a ? (l = f.init, p = f.get || u.get, d = f.set || u.set, u = { get: p, set: d }) : u = f);else for (var v = h.length - 1; v >= 0; v--) { var g; if (void 0 !== (f = memberDec(h[v], n, c, o, a, i, s, u))) assertValidReturnValue(a, f), 0 === a ? g = f : 1 === a ? (g = f.init, p = f.get || u.get, d = f.set || u.set, u = { get: p, set: d }) : u = f, void 0 !== g && (void 0 === l ? l = g : "function" == typeof l ? l = [l, g] : l.push(g)); } if (0 === a || 1 === a) { if (void 0 === l) l = function (e, t) { return t; };else if ("function" != typeof l) { var y = l; l = function (e, t) { for (var r = t, n = 0; n < y.length; n++) r = y[n].call(e, r); return r; }; } else { var m = l; l = function (e, t) { return m.call(e, t); }; } e.push(l); } 0 !== a && (1 === a ? (c.get = u.get, c.set = u.set) : 2 === a ? c.value = u : 3 === a ? c.get = u : 4 === a && (c.set = u), s ? 1 === a ? (e.push(function (e, t) { return u.get.call(e, t); }), e.push(function (e, t) { return u.set.call(e, t); })) : 2 === a ? e.push(u) : e.push(function (e, t) { return u.call(e, t); }) : Object.defineProperty(t, n, c)); } function applyMemberDecs(e, t) { for (var r, n, a = [], i = new Map(), s = new Map(), o = 0; o < t.length; o++) { var c = t[o]; if (Array.isArray(c)) { var l, u, f = c[1], p = c[2], d = c.length > 3, h = f >= 5; if (h ? (l = e, 0 !== (f -= 5) && (u = n = n || [])) : (l = e.prototype, 0 !== f && (u = r = r || [])), 0 !== f && !d) { var v = h ? s : i, g = v.get(p) || 0; if (!0 === g || 3 === g && 4 !== f || 4 === g && 3 !== f) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + p); !g && f > 2 ? v.set(p, f) : v.set(p, !0); } applyMemberDec(a, l, c, p, f, h, d, u); } } return pushInitializers(a, r), pushInitializers(a, n), a; } function pushInitializers(e, t) { t && e.push(function (e) { for (var r = 0; r < t.length; r++) t[r].call(e); return e; }); } return function (e, t, r) { return { e: applyMemberDecs(e, t), get c() { return function (e, t) { if (t.length > 0) { for (var r = [], n = e, a = e.name, i = t.length - 1; i >= 0; i--) { var s = { v: !1 }; try { var o = t[i](n, { kind: "class", name: a, addInitializer: createAddInitializerMethod(r, s) }); } finally { s.v = !0; } void 0 !== o && (assertValidReturnValue(10, o), n = o); } return [n, function () { for (var e = 0; e < r.length; e++) r[e].call(n); }]; } }(e, r); } }; }; } +function _applyDecs2203R(e, t, r) { return (_applyDecs2203R = applyDecs2203RFactory())(e, t, r); } +const { + assignConstructor +} = require("../../helpers.cjs"); +let _Sublist; +_dec = assignConstructor(); +class Sublist { + static { + [_Sublist, _initClass] = _applyDecs2203R(this, [], [_dec]).c; + } + id; + isChanged = false; + isDisplay = true; + type; + static { + _initClass(); + } +} +module.exports = _Sublist; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJhc3NpZ25Db25zdHJ1Y3RvciIsInJlcXVpcmUiLCJfU3VibGlzdCIsIl9kZWMiLCJTdWJsaXN0IiwiX2luaXRDbGFzcyIsIl9hcHBseURlY3MyMjAzUiIsImMiLCJpZCIsImlzQ2hhbmdlZCIsImlzRGlzcGxheSIsInR5cGUiLCJtb2R1bGUiLCJleHBvcnRzIl0sInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL21vY2tzL3JlY29yZC9TdWJsaXN0LmNqcyJdLCJzb3VyY2VzQ29udGVudCI6WyJjb25zdCB7IGFzc2lnbkNvbnN0cnVjdG9yIH0gPSByZXF1aXJlKFwiLi4vLi4vaGVscGVycy5janNcIik7XG5cbkBhc3NpZ25Db25zdHJ1Y3RvcigpXG5jbGFzcyBTdWJsaXN0IHtcblx0aWQ7XG5cdGlzQ2hhbmdlZCA9IGZhbHNlO1xuXHRpc0Rpc3BsYXkgPSB0cnVlO1xuXHR0eXBlO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IFN1Ymxpc3Q7XG4iXSwibWFwcGluZ3MiOiI7OztBQUFBLE1BQU07RUFBRUE7QUFBa0IsQ0FBQyxHQUFHQyxPQUFPLENBQUMsbUJBQW1CLENBQUM7QUFBQyxJQUFBQyxRQUFBO0FBQUFDLElBQUEsR0FFMURILGlCQUFpQixDQUFDLENBQUM7QUFBcEIsTUFBQUksT0FBQSxDQUNjO0VBQUE7SUFBQSxDQUFBRixRQUFBLEVBQUFHLFVBQUEsSUFBQUMsZUFBQSxZQUFBSCxJQUFBLEdBQUFJLENBQUE7RUFBQTtFQUNiQyxFQUFFO0VBQ0ZDLFNBQVMsR0FBRyxLQUFLO0VBQ2pCQyxTQUFTLEdBQUcsSUFBSTtFQUNoQkMsSUFBSTtFQUFDO0lBQUFOLFVBQUE7RUFBQTtBQUNOO0FBRUFPLE1BQU0sQ0FBQ0MsT0FBTyxHQUFHVCxRQUFPIn0= \ No newline at end of file diff --git a/lib/mocks/record/index.cjs b/lib/mocks/record/index.cjs index 7f974d9..adf49a5 100644 --- a/lib/mocks/record/index.cjs +++ b/lib/mocks/record/index.cjs @@ -8,6 +8,8 @@ const { options } = require("../../helpers.cjs"); const Record = require("./Record.cjs"); +const Field = require("./Field.cjs"); +const Sublist = require("./Sublist.cjs"); _dec = addPromise(); _dec2 = options("record", "to", "attributes"); _dec3 = addPromise(); @@ -29,6 +31,8 @@ class RecordModule { [_init_attach, _init_copy, _init_create, _init_delete, _init_detach, _init_load, _init_submitFields, _init_transform] = _applyDecs2203R(this, [[[_dec, _dec2], 0, "attach"], [[_dec3, _dec4], 0, "copy"], [[_dec5, _dec6], 0, "create"], [[_dec7, _dec8], 0, "delete"], [[_dec9, _dec10], 0, "detach"], [[_dec11, _dec12], 0, "load"], [[_dec13, _dec14], 0, "submitFields"], [[_dec15, _dec16], 0, "transform"]], []).e; } Record = Record; + Field = Field; + Sublist = Sublist; Type = recordStub.Type; attach = _init_attach(this, options => {}); copy = _init_copy(this, options => { @@ -73,11 +77,16 @@ class RecordModule { if (!record) { throw new Error("Record does not exist"); } - record.fields = { - ...record.fields, - ...options.values - }; - return record.id; + const copy = new Record({ + ...record, + fields: { + ...record.fields, + ...options.values + }, + version: record.version + 1 + }); + SuiteScriptMocks.records.set(copy); + return copy.id; }); transform = _init_transform(this, options => { const record = this.load(options.fromType, options.fromId, options.isDynamic, options.defaultValues); @@ -87,4 +96,4 @@ class RecordModule { }); } module.exports = new RecordModule(); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJyZWNvcmRTdHViIiwicmVxdWlyZSIsIlN1aXRlU2NyaXB0TW9ja3MiLCJhZGRQcm9taXNlIiwib3B0aW9ucyIsIlJlY29yZCIsIl9kZWMiLCJfZGVjMiIsIl9kZWMzIiwiX2RlYzQiLCJfZGVjNSIsIl9kZWM2IiwiX2RlYzciLCJfZGVjOCIsIl9kZWM5IiwiX2RlYzEwIiwiX2RlYzExIiwiX2RlYzEyIiwiX2RlYzEzIiwiX2RlYzE0IiwiX2RlYzE1IiwiX2RlYzE2IiwiUmVjb3JkTW9kdWxlIiwiX2luaXRfYXR0YWNoIiwiX2luaXRfY29weSIsIl9pbml0X2NyZWF0ZSIsIl9pbml0X2RlbGV0ZSIsIl9pbml0X2RldGFjaCIsIl9pbml0X2xvYWQiLCJfaW5pdF9zdWJtaXRGaWVsZHMiLCJfaW5pdF90cmFuc2Zvcm0iLCJfYXBwbHlEZWNzMjIwM1IiLCJlIiwiVHlwZSIsImF0dGFjaCIsImNvcHkiLCJyZWNvcmQiLCJsb2FkIiwiaWQiLCJjcmVhdGUiLCJ0eXBlIiwiaXNEeW5hbWljIiwiZmllbGRzIiwiZGVmYXVsdFZhbHVlcyIsImRlbGV0ZSIsInJlYyIsInJlY29yZHMiLCJnZXQiLCJFcnJvciIsImRlbGV0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BQUksQ0FBQ0csRUFBRTtFQUNmLENBQUM7RUFJRG1CLFNBQVMsR0FBQTNCLGVBQUEsT0FBSTVCLE9BQU8sSUFBSztJQUN4QixNQUFNa0MsTUFBTSxHQUFHLElBQUksQ0FBQ0MsSUFBSSxDQUFDbkMsT0FBTyxDQUFDd0QsUUFBUSxFQUFFeEQsT0FBTyxDQUFDeUQsTUFBTSxFQUFFekQsT0FBTyxDQUFDdUMsU0FBUyxFQUFFdkMsT0FBTyxDQUFDeUMsYUFBYSxDQUFDO0lBQ3BHUCxNQUFNLENBQUNJLElBQUksR0FBR3RDLE9BQU8sQ0FBQzBELE1BQU07SUFDNUJ4QixNQUFNLENBQUNFLEVBQUUsR0FBRyxJQUFJO0lBQ2hCLE9BQU9GLE1BQU07RUFDZCxDQUFDO0FBQ0Y7QUFFQXlCLE1BQU0sQ0FBQ0MsT0FBTyxHQUFHLElBQUl4QyxZQUFZLENBQUMsQ0FBQyJ9 \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index b065ea9..5ce77f5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "suitescript-mocks", - "version": "0.1.5", + "version": "0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "suitescript-mocks", - "version": "0.1.5", + "version": "0.2", "license": "ISC", "dependencies": { "@bloomberg/record-tuple-polyfill": "^0.0.4", diff --git a/package.json b/package.json index 80d6ab9..97224ae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "suitescript-mocks", - "version": "0.1.5", + "version": "0.2", "description": "Set of mocks for unit testing Netsuite Suitescript 2.*", "keywords": [ "NetSuite", diff --git a/src/mocks/record/Field.cjs b/src/mocks/record/Field.cjs new file mode 100644 index 0000000..a208e8f --- /dev/null +++ b/src/mocks/record/Field.cjs @@ -0,0 +1,16 @@ +const { assignConstructor, required } = require("../../helpers.cjs"); + +@assignConstructor() +class Field { + label; + id; + type; + isMandatory; + sublistId; + isDisplay; + + @required("filter", "operator") + getSelectOptions = (options) => {}; +} + +module.exports = Field; diff --git a/src/mocks/record/Record.cjs b/src/mocks/record/Record.cjs index c0fafe4..7e585e7 100644 --- a/src/mocks/record/Record.cjs +++ b/src/mocks/record/Record.cjs @@ -2,6 +2,8 @@ const datefns = require("date-fns"); const structuredClone = require("core-js-pure/actual/structured-clone"); const { randomUUID } = require("node:crypto"); const SuiteScriptMocks = require("../../index.cjs"); +const Field = require("./Field.cjs"); +const Sublist = require("./Sublist.cjs"); const { options, required, @@ -23,11 +25,23 @@ class Record { initialize = () => { this.fields = structuredClone(this.fields); - this.sublists = Object.entries(structuredClone(this.sublists) || {}).reduce((acc, [lineId, lines]) => { + this.sublists = Object.entries(this.sublists || {}).reduce((acc, [lineId, lines]) => { acc[lineId] = { currentline: {}, - lines: "lines" in lines ? lines.lines : lines, + lines: [...(("lines" in lines ? lines.lines : lines) || [])], }; + acc[lineId].lines = acc[lineId].lines.map((line) => { + line = { ...line }; + line._id = line._id || randomUUID(); + Object.entries(line).forEach(([key, value]) => { + if (value instanceof Record) { + line[key] = new Record(value); + } else { + line[key] = structuredClone(value); + } + }); + return line; + }); return acc; }, {}); this.subrecords = Object.entries(this.subrecords || {}).reduce((acc, [subrecordId, subrecord]) => { @@ -36,28 +50,42 @@ class Record { }, {}); }; + #getSublist(options) { + const sublist = this.sublists[options.sublistId]; + if (!sublist) { + throw new Error("Sublist does not exist"); + } + return sublist; + } + + #getLine(options) { + const sublist = this.#getSublist(options); + const line = sublist.lines[options.line]; + if (!line) { + throw new Error("Line does not exist"); + } + return line; + } + @dynamicModeOnly() @options("sublistId") @required("sublistId") cancelLine = (options) => { this.selectNewLine(options.sublistId); + return this; }; @dynamicModeOnly() @options("sublistId", "ignoreRecalc") @required("sublistId") commitLine = (options) => { - const sublist = this?.sublists?.[options.sublistId]; - if (sublist === undefined || !("currentline" in sublist)) { - throw new Error(); - } - const existingIndex = sublist.lines.findIndex((a) => a._id === sublist.currentline._id); - if (existingIndex > -1) { - sublist.lines[existingIndex] = sublist.currentline; - } else { - sublist.lines.push(sublist.currentline); + const sublist = this.#getSublist(options); + if (!sublist.currentline._id) { + sublist.currentline._id = randomUUID(); } + sublist.lines[this.getCurrentSublistIndex(options.sublistId)] = sublist.currentline; this.selectNewLine(options.sublistId); + return this; }; @addPromise() @@ -65,27 +93,58 @@ class Record { findMatrixSublistLineWithValue = (options) => {}; - findSublistLineWithValue = (options) => {}; + @options("sublistId", "fieldId", "value") + @required("sublistId", "fieldId", "value") + findSublistLineWithValue = (options) => { + for (let i = 0; i < this.getLineCount(options.sublistId); i++) { + if (this.getSublistValue(options.sublistId, options.fieldId, i) == options.value) { + return i; + } + } + return -1; + }; + @dynamicModeOnly() getCurrentMatrixSublistValue = (options) => {}; - getCurrentSublistField = (options) => {}; + @dynamicModeOnly() + @options("sublistId", "fieldId") + @required("sublistId", "fieldId") + getCurrentSublistField = (options) => { + const sublist = this.#getSublist(options); + if (options.fieldId in sublist.currentline) { + return new Field({ id: options.fieldId, label: options.fieldId, sublistId: options.sublistId }); + } + return null; + }; - getCurrentSublistIndex = (options) => {}; + @dynamicModeOnly() + @options("sublistId") + @required("sublistId") + getCurrentSublistIndex = (options) => { + const sublist = this?.sublists?.[options.sublistId]; + if (sublist) { + const existingIndex = sublist?.lines.findIndex((a) => a._id === sublist.currentline._id); + return existingIndex > -1 ? existingIndex : sublist?.lines.length; + } + return -1; + }; - getCurrentSublistSubrecord = (options) => {}; + @dynamicModeOnly() + @options("sublistId", "fieldId") + getCurrentSublistSubrecord = (options) => { + const sublist = this.#getSublist(options); + if (!(options.fieldId in sublist.currentline) || !(sublist.currentline[options.fieldId] instanceof Record)) { + throw new Error(`Field ${options.fieldId} is not a subrecord field`); + } + return sublist.currentline[options.fieldId]; + }; @dynamicModeOnly() @options("sublistId", "fieldId") @required("sublistId", "fieldId") getCurrentSublistText = (options) => { - const sublist = this.sublists[options.sublistId]; - if (sublist === undefined) { - throw new Error("Sublist does not exist"); - } - if (!("currentline" in sublist)) { - this.selectNewLine(sublist); - } + const sublist = this.#getSublist(options); const field = sublist.currentline[options.fieldId]; if (Object.prototype.toString.call(field) === "[object Date]") { return datefns.format(field, SuiteScriptMocks.dateFormat); @@ -101,12 +160,10 @@ class Record { @required("sublistId", "fieldId") getCurrentSublistValue = (options) => { const sublist = this.sublists[options.sublistId]; + // this is correct, suitescript doesn't error when supplying a sublistId that doesn't exist if (sublist === undefined) { return null; } - if (!("currentline" in sublist)) { - this.selectNewLine(sublist); - } const field = sublist.currentline[options.fieldId]; if ( typeof field === "object" && @@ -118,9 +175,18 @@ class Record { return field; }; - getField = (options) => {}; + @options("fieldId") + @required("fieldId") + getField = (options) => { + if (options.fieldId in this.fields) { + return new Field({ id: options.fieldId, label: options.fieldId }); + } + return null; + }; - getFields = (options) => {}; + getFields = () => { + return Object.keys(this.fields); + }; @options("sublistId") @required("sublistId") @@ -146,20 +212,51 @@ class Record { getMatrixSublistValue = (options) => {}; - getSublist = (options) => {}; + @options("sublistId") + @required("sublistId") + getSublist = (options) => { + if (options.sublistId in this.sublists) { + return new Sublist({ id: options.sublistId }); + } + return null; + }; - getSublists = (options) => {}; + getSublists = () => { + return Object.keys(this.sublists); + }; - getSublistField = (options) => {}; + @options("sublistId", "fieldId", "line") + @required("sublistId", "fieldId", "line") + getSublistField = (options) => { + const line = this.#getLine(options); + if (options.fieldId in line) { + return new Field({ id: options.fieldId, label: options.fieldId, sublistId: options.sublistId }); + } + return null; + }; - getSublistFields = (options) => {}; + @options("sublistId") + @required("sublistId") + getSublistFields = (options) => { + const sublist = this.#getSublist(options); + return Object.keys(sublist.lines[0] || {}).filter((id) => id !== "_id"); + }; - getSublistSubrecord = (options) => {}; + @options("sublistId", "fieldId", "line") + @required("sublistId", "fieldId", "line") + getSublistSubrecord = (options) => { + const line = this.#getLine(options); + if (!(options.fieldId in line) || !(line[options.fieldId] instanceof Record)) { + throw new Error(`Field ${options.fieldId} is not a subrecord field`); + } + return line[options.fieldId]; + }; @options("sublistId", "fieldId", "line") @required("sublistId", "fieldId", "line") getSublistText = (options) => { - const field = this.sublists[options.sublistId].lines[options.line][options.fieldId]; + const line = this.#getLine(options); + const field = line[options.fieldId]; if (Object.prototype.toString.call(field) === "[object Date]") { return datefns.format(field, SuiteScriptMocks.dateFormat); } @@ -177,7 +274,8 @@ class Record { @options("sublistId", "fieldId", "line") @required("sublistId", "fieldId", "line") getSublistValue = (options) => { - const field = this.sublists[options.sublistId].lines[options.line][options.fieldId]; + const line = this.#getLine(options); + const field = line[options.fieldId]; if ( typeof field === "object" && field !== null && @@ -192,7 +290,7 @@ class Record { @required("fieldId") getSubrecord = (options) => { if (!(options.fieldId in this.subrecords)) { - throw new Error("Subrecord does not exist."); + throw new Error(`Field ${options.fieldId} is not a subrecord field`); } return this.subrecords[options.fieldId]; }; @@ -223,31 +321,109 @@ class Record { return field; }; - hasCurrentSublistSubrecord = (options) => {}; + @dynamicModeOnly() + @options("sublistId", "fieldId") + @required("sublistId", "fieldId") + hasCurrentSublistSubrecord = (options) => { + return Boolean(this.getCurrentSublistSubrecord(options)); + }; - hasSublistSubrecord = (options) => {}; + @options("sublistId", "fieldId", "line") + @required("sublistId", "fieldId", "line") + hasSublistSubrecord = (options) => { + return Boolean(this.getSublistSubrecord(options)); + }; - hasSubrecord = (options) => {}; + @options("fieldId") + @required("fieldId") + hasSubrecord = (options) => { + return Boolean(this.getSubrecord(options)); + }; - insertLine = (options) => {}; + @options("sublistId", "line", "ignoreRecalc") + @required("sublistId", "line") + insertLine = (options) => { + const sublist = this.sublists[options.sublistId]; + if (!sublist) { + throw new Error("Sublist does not exist"); + } + if (options.line < 0 || options.line > sublist.lines.length) { + throw new Error("Line is outside valid range"); + } + sublist.lines.splice(options.line, 0, {}); + if (this.isDynamic) { + this.selectLine(options); + } + return this; + }; - moveLine = (options) => {}; + // @options("sublistId", "from", "to") + // @required("sublistId", "from", "to") + // moveLine = (options) => { + // const sublist = this.#getSublist(options); + // if (options.from < 0 || options.from > sublist.lines.length - 1) { + // throw new Error("From is outside valid range"); + // } + // if (options.to < 0 || options.to > sublist.lines.length) { + // throw new Error("To is outside valid range"); + // } + // // if (options.to > options.from) { + // // options.to--; + // // } + // const line = sublist.lines.splice(options.from, 1); + // sublist.lines.splice(options.to, 0, line); + // return this; + // }; - removeCurrentSublistSubrecord = (options) => {}; + @dynamicModeOnly() + @options("sublistId", "fieldId") + @required("sublistId", "fieldId") + removeCurrentSublistSubrecord = (options) => { + const sublist = this.#getSublist(options); + if (!(options.fieldId in sublist.currentline) || !(sublist.currentline[options.fieldId] instanceof Record)) { + throw new Error(`Field ${options.fieldId} is not a subrecord field`); + } + sublist.currentline[options.fieldId] = null; + return this; + }; @options("sublistId", "line", "ignoreRecalc", "lineInstanceId") @required("sublistId", "line") removeLine = (options) => { - const sublist = this.sublists[options.sublistId]; - if (sublist === undefined || !(options.line in sublist.lines)) { - throw new Error(); - } + const sublist = this.#getSublist(options); + this.#getLine(options); sublist.lines.splice(options.line, 1); + if (this.isDynamic) { + if (sublist.lines.length > 0) { + this.selectLine(options.sublistId, 0); + } else { + this.selectNewLine(options.sublistId); + } + } + return this; }; - removeSublistSubrecord = (options) => {}; + @standardModeOnly() + @options("sublistId", "fieldId", "line") + @required("sublistId", "fieldId", "line") + removeSublistSubrecord = (options) => { + const line = this.#getLine(options); + if (!(options.fieldId in line) || !(line[options.fieldId] instanceof Record)) { + throw new Error(`Field ${options.fieldId} is not a subrecord field`); + } + line[options.fieldId] = null; + return this; + }; - removeSubrecord = (options) => {}; + @options("fieldId") + @required("fieldId") + removeSubrecord = (options) => { + if (!(options.fieldId in this.subrecords)) { + throw new Error(`Field ${options.fieldId} is not a subrecord field`); + } + this.subrecords[options.fieldId] = null; + return this; + }; @addPromise() @options("enableSourcing", "ignoreMandatoryFields") @@ -281,29 +457,27 @@ class Record { return this.id; }; - // TODO: edge case where if first line select you do is n + 1 it will give a new line @dynamicModeOnly() @options("sublistId", "line") @required("sublistId", "line") selectLine = (options) => { - const sublist = this.sublists[options.sublistId]; - if (sublist === undefined || !(options.line in sublist.lines)) { - throw new Error("sublist or line does not exist"); + const sublist = this.#getSublist(options); + if (options.line != this.getCurrentSublistIndex(options.sublistId)) { + const line = this.#getLine(options); + sublist.currentline = { ...line }; + sublist.lines = sublist.lines.filter((a) => a._id); } - sublist.currentline = { ...sublist.lines[options.line] }; + return this; }; @dynamicModeOnly() @options("sublistId") @required("sublistId") selectNewLine = (options) => { - const sublist = this.sublists[options.sublistId]; - if (sublist === undefined) { - throw new Error("sublist does not exist"); - } - sublist.currentline = { - _id: randomUUID(), - }; + const sublist = this.#getSublist(options); + sublist.currentline = {}; + sublist.lines = sublist.lines.filter((a) => a._id); + return this; }; setCurrentMatrixSublistValue = (options) => {}; @@ -312,22 +486,18 @@ class Record { @options("sublistId", "fieldId", "text") @required("sublistId", "fieldId", "text") setCurrentSublistText = (options) => { - const sublist = this?.sublists?.[options.sublistId]; - if (sublist === undefined || !("currentline" in sublist)) { - throw new Error("sublist doesn't exist or line is not selected"); - } - return (sublist.currentline[options.fieldId] = { value: options.text, text: options.text }); + const sublist = this.#getSublist(options); + sublist.currentline[options.fieldId] = { value: options.text, text: options.text }; + return this; }; @dynamicModeOnly() @options("sublistId", "fieldId", "value") @required("sublistId", "fieldId", "value") setCurrentSublistValue = (options) => { - const sublist = this?.sublists?.[options.sublistId]; - if (sublist === undefined || !("currentline" in sublist)) { - throw new Error("sublist doesn't exist or line is not selected"); - } - return (sublist.currentline[options.fieldId] = { value: options.value }); + const sublist = this.#getSublist(options); + sublist.currentline[options.fieldId] = { value: options.value }; + return this; }; setMatrixHeaderValue = (options) => {}; @@ -338,22 +508,18 @@ class Record { @options("sublistId", "fieldId", "line", "text") @required("sublistId", "fieldId", "line", "text") setSublistText = (options) => { - const sublist = this?.sublists?.[options.sublistId]; - if (sublist === undefined || !(options.line in sublist.lines)) { - throw new Error("sublist or line doesn't exist"); - } - sublist.lines[options.line][options.fieldId] = { value: options.text, text: options.text }; + const line = this.#getLine(options); + line[options.fieldId] = { value: options.text, text: options.text }; + return this; }; @standardModeOnly() @options("sublistId", "fieldId", "line", "value") @required("sublistId", "fieldId", "line", "value") setSublistValue = (options) => { - const sublist = this?.sublists?.[options.sublistId]; - if (sublist === undefined || !(options.line in sublist.lines)) { - throw new Error("sublist or line doesn't exist"); - } - sublist.lines[options.line][options.fieldId] = { value: options.value }; + const line = this.#getLine(options); + line[options.fieldId] = { value: options.value }; + return this; }; @options("fieldId", "text", "ignoreFieldChange") diff --git a/src/mocks/record/Sublist.cjs b/src/mocks/record/Sublist.cjs new file mode 100644 index 0000000..be3e5ad --- /dev/null +++ b/src/mocks/record/Sublist.cjs @@ -0,0 +1,11 @@ +const { assignConstructor } = require("../../helpers.cjs"); + +@assignConstructor() +class Sublist { + id; + isChanged = false; + isDisplay = true; + type; +} + +module.exports = Sublist; diff --git a/src/mocks/record/index.cjs b/src/mocks/record/index.cjs index 4c9dd6d..bd3f6fa 100644 --- a/src/mocks/record/index.cjs +++ b/src/mocks/record/index.cjs @@ -2,9 +2,13 @@ const recordStub = require("suitecloud-unit-testing-stubs/stubs/record"); const SuiteScriptMocks = require("../../index.cjs"); const { addPromise, options } = require("../../helpers.cjs"); const Record = require("./Record.cjs"); +const Field = require("./Field.cjs"); +const Sublist = require("./Sublist.cjs"); class RecordModule { Record = Record; + Field = Field; + Sublist = Sublist; Type = recordStub.Type; @@ -71,11 +75,16 @@ class RecordModule { if (!record) { throw new Error("Record does not exist"); } - record.fields = { - ...record.fields, - ...options.values, - }; - return record.id; + const copy = new Record({ + ...record, + fields: { + ...record.fields, + ...options.values, + }, + version: record.version + 1, + }); + SuiteScriptMocks.records.set(copy); + return copy.id; }; @addPromise()