@mj-biz-apps/sales-core-entities-server 6.4.0 → 6.5.0

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.
@@ -111,6 +111,38 @@ export declare class DealEntityServer extends DealEntity {
111
111
  */
112
112
  Save(options?: EntitySaveOptions): Promise<boolean>;
113
113
  private saveDeclared;
114
+ /**
115
+ * Is this save a status move into or out of a locking status, and therefore a close or a reopen?
116
+ *
117
+ * Null in every ordinary case. The cheap half comes first, so a save that does not touch the status
118
+ * costs no status lookups at all — this runs on every save, and most saves do not touch it.
119
+ *
120
+ * A DECLARED transition returns null: `Sales.CloseDeal` and `Sales.ReopenDeal` announce themselves
121
+ * before saving, and that IS the flow running. Without this term, the operation's own save would
122
+ * re-enter the flow it is already executing.
123
+ *
124
+ * Creation returns null too. A deal born closed has no transition to have run, and the opening
125
+ * default (`needsStatusDefault`) would otherwise read as one.
126
+ */
127
+ private planStatusTransition;
128
+ /**
129
+ * Run the close or the reopen that the caller's status write asked for.
130
+ *
131
+ * WHY THE OPERATIONS AND NOT A COPY OF THEIR WORK. A close writes a stage event, creates a contract
132
+ * and two finance tasks for a won B2B deal, and voids the order for a lost one; a reopen undoes the
133
+ * stamps and returns the order. All of it already exists, is transactional, and is pinned by the
134
+ * `close-deal` checks. Reimplementing any of it here would be a second copy of the most
135
+ * consequential code in this app.
136
+ *
137
+ * IMPORTED LAZILY because `CloseDealOperation` imports this class, so a top-level import would be a
138
+ * cycle. The module system caches it, so this costs nothing after the first transition in a process.
139
+ *
140
+ * A LOST CLOSE STILL NEEDS ITS LOSS REASON, and a caller who set the status without one gets the
141
+ * operation's own refusal rather than a second, vaguer one from here. `LossReasonID` and `LossNotes`
142
+ * are columns on this deal, so an importer that sets them alongside the status has supplied
143
+ * everything the close needs -- which is the case #205 is about.
144
+ */
145
+ private runStatusTransition;
114
146
  /**
115
147
  * The snapshot an ordinary stage move owes the append-only log, or null when the deal did not move.
116
148
  *
@@ -527,14 +559,48 @@ export declare class DealEntityServer extends DealEntity {
527
559
  private _declaredTransition;
528
560
  private _lastStageEventID;
529
561
  private _lockedAtSave;
562
+ /**
563
+ * The status the caller asked for, held while the field is reverted to its persisted value so the
564
+ * close lock can do its real job. `refuseSave` puts it back; see the note there for why.
565
+ */
566
+ private _revertedStatusTarget;
530
567
  /**
531
568
  * The fields that stay editable on a locked deal — read from the SHARED rule, not redeclared.
532
569
  *
533
- * It moved to `@mj-biz-apps/sales-entities` so the Explorer Deal form can apply the same list. A
534
- * second copy here would drift, and the drift would only ever surface as a user typing into a field
535
- * the server then refuses. See `close-lock.ts` for the reasoning; CD14 pins it to real behaviour.
570
+ * It lives in `@mj-biz-apps/sales-entities` so the Explorer Deal form and the workspace apply the
571
+ * same list. A second copy here would drift, and the drift would only ever surface as a user typing
572
+ * into a field the server then refuses. See `close-lock.ts`; CD14 pins it to real behaviour.
573
+ *
574
+ * A FUNCTION, not a constant, since golive#206's "Loss Notes (Lost deals only)": the answer depends
575
+ * on the deal's outcome, so the outcome has to reach it. It used to be a flat `ReadonlySet` held in
576
+ * a static, which is precisely how a caller ends up with the list and without the condition.
536
577
  */
537
- private static readonly LOCK_EDITABLE_FIELDS;
578
+ private static lockEditableFields;
579
+ /**
580
+ * The child collections that stay editable on a locked deal.
581
+ *
582
+ * Named here rather than in `sales-entities` because, unlike the field list, no other surface needs
583
+ * it yet: the grids decide their own New/delete affordances. If a form ever has to render this, it
584
+ * moves next to `DEAL_FIELDS_EDITABLE_WHILE_LOCKED` for the same reason that one moved.
585
+ *
586
+ * ── WHAT THIS DOES AND DOES NOT CATCH TODAY ─────────────────────────────────────────────────
587
+ *
588
+ * The Deal declares exactly TWO child collections (`metadata/entity-relationships`):
589
+ * `PaymentSchedule` and `Team`. Both are named here, so `dirtyCollections` below is currently
590
+ * always empty and this check refuses nothing in practice.
591
+ *
592
+ * That is deliberate and it is not the same as the check being pointless. It is an ALLOW-LIST, so
593
+ * a collection added later is refused without anyone remembering to add it — which is the whole
594
+ * property the previous "freeze every dirty companion" rule existed for. What it means is that
595
+ * the freeze direction has no companion to demonstrate it on right now, and no check can prove
596
+ * it until a third collection exists. Said out loud so nobody reads the guard as tested.
597
+ *
598
+ * ORDER LINES ARE NOT A COMPANION OF THE DEAL and never were — they belong to the ORDER, in the
599
+ * Orders app. An earlier version of this comment listed `Lines` alongside these two, which made
600
+ * this look like the thing freezing them. It is not: that is bizapps-orders#206, which adds a veto
601
+ * seam Sales registers into.
602
+ */
603
+ private static readonly LOCK_EDITABLE_COMPANIONS;
538
604
  /**
539
605
  * Runs `body` with the close lock suppressed, and always restores it.
540
606
  *
@@ -551,19 +617,59 @@ export declare class DealEntityServer extends DealEntity {
551
617
  * the current value instead would make a deal impossible to close.
552
618
  */
553
619
  /**
554
- * The refusal for a status write that would lock the deal without closing it.
620
+ * Refuse this save, and leave the reason where the CALLER reads it.
555
621
  *
556
- * Null in every ordinary case, including the three that look similar and are not:
622
+ * ── WHY LOGGING WAS NOT ENOUGH ────────────────────────────────────────────────
557
623
  *
558
- * · a DECLARED transition — `Sales.CloseDeal` announced itself, so the close is running;
559
- * · LEAVING a locking status — that is a reopen, and the close lock already refuses a bare one,
560
- * with a message that names `Sales.ReopenDeal`;
561
- * · a status that does not lock — ordinary pipeline movement, which is most saves.
624
+ * Every refusal in `Save` used to be `LogError(...)` followed by `return false`, so a caller got a
625
+ * bare `false` and the reason went to the server log. golive#207 row 18 is explicit about what that
626
+ * message is for: row 17 is what the FORM shows a person, and row 18 is "what the save returns to
627
+ * whoever asked — the form, an import, an agent or a raw API call". Logged, it returned to nobody.
628
+ * The form looked fine only because `DealFormComponentExtended.Validate()` produces row 17 for
629
+ * itself; every other caller got silence.
562
630
  *
563
- * Creation is excluded too: a deal born closed has no transition to have run, and the opening
564
- * default (`needsStatusDefault`) would otherwise be read as one.
631
+ * `RegisterResultHistoryEntry` is what core uses to record a failed write, and it is what puts the
632
+ * text on `LatestResult` — registered rather than assigned, because `LatestResult` returns null
633
+ * when the history is empty while TYPING itself non-null, which is how the same mistake reached
634
+ * production in orders' line delete.
565
635
  */
566
- private bareCloseRefusal;
636
+ private refuseSave;
637
+ /**
638
+ * Report a failure that happened AFTER `super.Save()` already registered a SUCCESS result.
639
+ *
640
+ * ── WHY THIS IS NOT `refuseSave` ──────────────────────────────────────────────────────────────
641
+ *
642
+ * `Save()` returning false was, on these paths, the ONLY signal. `super.Save()` had already
643
+ * registered a success entry and `this.Load(this.ID)` does not clear the history -- core guards
644
+ * its `init()` with `if (!this.IsSaved)` and the deal is saved -- so a caller doing the obvious
645
+ * thing read:
646
+ *
647
+ * await deal.Save() -> false
648
+ * deal.LatestResult.Success -> TRUE
649
+ * deal.LatestResult.CompleteMessage -> undefined -> "Unknown error"
650
+ *
651
+ * A caller following exactly the pattern `deal-workspace.service.ts` uses was told the save
652
+ * succeeded. Worse than silent: the last thing on the history contradicted the return value.
653
+ *
654
+ * Two things differ from `refuseSave` and both matter:
655
+ *
656
+ * 1. IT DOES NOT PUT THE STATUS BACK. `refuseSave` restores the caller's target because nothing
657
+ * was written and a retry must still carry it. Here the row has already moved (or been rolled
658
+ * back) and `Load()` has resynced this object to it -- re-dirtying a field to a value the
659
+ * database just rejected would invite the same failure on the next save.
660
+ * 2. IT CARRIES THE OPERATION'S ISSUES. `CloseDealOperation` returns a structured `Issues` array
661
+ * which was being joined into a `LogError` and dropped. Those sentences are the only thing
662
+ * that says WHY the close refused, and they are what the user needs.
663
+ *
664
+ * AND WHY NOT A TRANSACTION, since "both or neither" is the obvious wish: the transition reaches
665
+ * bizapps-contracts and bizapps-orders through seams, so there is no single database to be atomic
666
+ * in; `CloseDealOperation` is a remote operation that owns its own scope and rollback; and it
667
+ * loads its own copy of this deal, which is exactly why it must run after the commit rather than
668
+ * inside it. Atomicity is not available here, so honesty about the partial apply is the fix.
669
+ * Narrowing the window belongs upstream, in the pre-flight that already refuses a lost close with
670
+ * no loss reason before a single row moves.
671
+ */
672
+ private reportPostSaveFailure;
567
673
  private checkCloseLock;
568
674
  /**
569
675
  * Whether a status carries `LocksDeal`.
@@ -572,6 +678,28 @@ export declare class DealEntityServer extends DealEntity {
572
678
  * working. It is also why the lock is a property of the STATUS TYPE rather than of the stage.
573
679
  */
574
680
  private statusLocksDeal;
681
+ /**
682
+ * The two flags the lock needs off a status row: does it lock the deal, and is it a LOSS.
683
+ *
684
+ * One read for both, because every caller that wants the second also wants the first, and two
685
+ * round trips for two columns of one row is a cost with nothing to show for it.
686
+ *
687
+ * ── THE TWO FAILURE DEFAULTS POINT THE SAME WAY ─────────────────────────────────────────────
688
+ *
689
+ * `LocksDeal` FAILS CLOSED: if the status cannot be read we cannot prove the deal is unlocked, and
690
+ * wrongly allowing an edit to a closed deal is the more expensive mistake. `IsLost` fails to
691
+ * `false` for the same reason read the other way round — `false` means Loss Notes is NOT carved
692
+ * out, so an unreadable status refuses more, never less.
693
+ *
694
+ * ── AND THAT IS WHY `Read` IS REPORTED SEPARATELY ──────────────────────────────────────
695
+ *
696
+ * "Refuses more, never less" holds for the LOCK and inverts for the TRIGGER. `planStatusTransition`
697
+ * reads `LocksDeal` to mean "the target status closes the deal", so the same fail-closed default
698
+ * turns a transient read failure into a REAL CLOSE — stage event, contract, finance tasks, a voided
699
+ * order — on a save that asked for none of it. One default cannot serve both readings, so callers
700
+ * are told whether the row was actually read and decide for themselves.
701
+ */
702
+ private readStatusLockFlags;
575
703
  /**
576
704
  * Forces `Deal.CompanyID` to the pipeline's company, ignoring whatever the caller supplied.
577
705
  *
@@ -633,6 +761,21 @@ export declare class DealEntityServer extends DealEntity {
633
761
  * conditions mirror `stampOwnerFromTeam`'s guard exactly, which is what keeps them from disagreeing.
634
762
  */
635
763
  private ownerStampEditRefusal;
764
+ /**
765
+ * Is the ROSTER driving this save, rather than a caller naming an owner out of thin air?
766
+ *
767
+ * Three places need this answer and they must never disagree, which is how a defect got in:
768
+ * `ownerStampEditRefusal` and `stampOwnerFromTeam` each spelled the condition out, `checkCloseLock`
769
+ * did not ask at all, and `DealEntity.SetOwner()` — which loads the roster and then assigns the
770
+ * stamp — was refused on a locked deal for editing a frozen field. golive#206 item 2 says
771
+ * reassigning a rep after close is record-keeping and must be allowed.
772
+ *
773
+ * `Team.Load()` is what makes it true, and `SetOwner` calls it first. A caller who hand-sets
774
+ * `OwnerEmployeeID` without touching the roster gets `false` here and the refusal it deserves.
775
+ * A caller who sets BOTH gets no advantage: `stampOwnerFromTeam` re-derives the stamp from the
776
+ * roster afterwards and overwrites whatever was supplied.
777
+ */
778
+ private get RosterDrivesThisSave();
636
779
  private stampOwnerFromTeam;
637
780
  }
638
781
  //# sourceMappingURL=DealEntityServer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DealEntityServer.d.ts","sourceRoot":"","sources":["../src/DealEntityServer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,OAAO,EAGH,iBAAiB,EAIpB,MAAM,sBAAsB,CAAC;AAQ9B,OAAO,EAEH,UAAU,EAIb,MAAM,6BAA6B,CAAC;AA0DrC;;;;;GAKG;AACH;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,QAAQ,CAAC;AAqBpD,qBACa,gBAAiB,SAAQ,UAAU;IAC5C;;;;OAIG;IACH,IAAoB,0BAA0B,IAAI,OAAO,CAExD;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4CG;IACmB,IAAI,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;YAyB3D,YAAY;IAmN1B;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,cAAc;IAmDtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;YACW,eAAe;IAyI7B;;;;;;OAMG;YACW,gBAAgB;IAqD9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2CG;IACH,OAAO,CA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Q,CAAC,wBAAwB,CAG7C;IAEH;;;;;OAKG;IACU,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAS/D;;;;;;;OAOG;IACH;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,UAAU;IA6BlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,OAAO,CAAC,qBAAqB;YAmBf,cAAc;IAgH5B;;;;;OAKG;YACW,eAAe;IAI7B;;;;;;;;;;;;;;;;;;;;OAoBG;YACW,mBAAmB;IAyBjC;;;;;;;;;;;;;;OAcG;YACW,wBAAwB;IA8BtC;;;;;;;;;;;;;;;OAeG;IACH;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,OAAO,CAAC,qBAAqB;IAa7B;;;;;;;;;;;;;OAaG;IACH,OAAO,KAAK,oBAAoB,GAE/B;YAEa,kBAAkB;CASnC"}
@@ -50,14 +50,14 @@ var DealEntityServer_1;
50
50
  *
51
51
  * @module @mj-biz-apps/sales-core-entities-server
52
52
  */
53
- import { BaseEntity, LogError, } from '@memberjunction/core';
53
+ import { BaseEntity, BaseEntityResult, LogError, } from '@memberjunction/core';
54
54
  import { createHash } from 'node:crypto';
55
55
  import { RegisterClass } from '@memberjunction/global';
56
56
  // ORDERS' OWN RULE, imported rather than restated. `CanTransition` is the same function
57
57
  // `OrderEntityServer.passesStatusTransition()` consults, so a refusal here and a refusal there cannot
58
58
  // disagree — and the reason string the warning carries is orders' wording, not this app's guess at it.
59
59
  import { CanTransition } from '@mj-biz-apps/orders-entities';
60
- import { DEAL_FIELDS_EDITABLE_WHILE_LOCKED, DealEntity, IsBareCloseWrite, } from '@mj-biz-apps/sales-entities';
60
+ import { DealFieldsEditableWhileLocked, DealFieldLabel, DealEntity, JoinLabels, } from '@mj-biz-apps/sales-entities';
61
61
  import { SALES_SCHEMA, getNextDealNumber } from './SequenceService.js';
62
62
  const DEAL_ENTITY = 'MJ_BizApps_Sales: Deals';
63
63
  const PIPELINE_ENTITY = 'MJ_BizApps_Sales: Pipelines';
@@ -104,6 +104,11 @@ let DealEntityServer = class DealEntityServer extends DealEntity {
104
104
  this._declaredTransition = null;
105
105
  this._lastStageEventID = null;
106
106
  this._lockedAtSave = false;
107
+ /**
108
+ * The status the caller asked for, held while the field is reverted to its persisted value so the
109
+ * close lock can do its real job. `refuseSave` puts it back; see the note there for why.
110
+ */
111
+ this._revertedStatusTarget = null;
107
112
  }
108
113
  static { DealEntityServer_1 = this; }
109
114
  /**
@@ -182,6 +187,7 @@ let DealEntityServer = class DealEntityServer extends DealEntity {
182
187
  }
183
188
  finally {
184
189
  this._declaredTransition = null;
190
+ this._revertedStatusTarget = null;
185
191
  }
186
192
  }
187
193
  async saveDeclared(options) {
@@ -191,6 +197,79 @@ let DealEntityServer = class DealEntityServer extends DealEntity {
191
197
  this._orderJustProvisioned = false;
192
198
  this._lockedAtSave = false;
193
199
  this._lastStageEventID = null;
200
+ /**
201
+ * THE STATUS FIELD DRIVES THE CLOSE AND THE REOPEN (bc-aidp-next-golive#205).
202
+ *
203
+ * "The deal entity server should run the existing close and reopen flows when a save moves the
204
+ * status into or out of a locking status."
205
+ *
206
+ * ── IT RUNS BEFORE THE CLOSE LOCK, AND THAT ORDERING IS THE WHOLE THING ─────────────────
207
+ *
208
+ * `close-deal.CD27` measured what happens otherwise. A reopen is a status write on a deal that
209
+ * IS locked, so the lock below sees `DealStatusTypeID` dirty, finds it outside the
210
+ * editable-while-locked set, and refuses — before anything has had the chance to notice the
211
+ * write was a reopen. The close half worked and the reopen half could not, which is precisely
212
+ * the defect golive#205 reported, reintroduced one layer up.
213
+ *
214
+ * ── WHY THE STATUS IS PUT BACK ─────────────────────────────────────────────────────────
215
+ *
216
+ * `Sales.CloseDeal` loads its OWN copy of this deal and saves it. If this save also wrote the
217
+ * status, the two would race over one row and whichever landed second would win. So the field is
218
+ * reverted to what is on disk, the ordinary save below persists every OTHER edit the caller
219
+ * made, and the flow then runs against the committed row. A caller who set the status and three
220
+ * other fields gets all four, in an order that cannot lose any of them.
221
+ *
222
+ * Reverting is also what leaves the close lock doing its real job instead of being bypassed: by
223
+ * the time it runs the status is clean, so a locked deal still refuses every frozen field.
224
+ * DealStatusTypeID stays OUT of `DEAL_FIELDS_EDITABLE_WHILE_LOCKED` for the same reason — the
225
+ * field is reachable through the flow, never by writing it.
226
+ */
227
+ const transition = await this.planStatusTransition();
228
+ /**
229
+ * REFUSED BEFORE THE REVERT, and the order is the whole of why the retry works.
230
+ *
231
+ * The revert below exists so the close lock and `super.Save()` do not write a status the
232
+ * transition is about to move. On this path nothing downstream runs at all, so reverting would
233
+ * serve nothing — and it would cost the one thing this message asks for. A reverted field is
234
+ * CLEAN, so a caller who reads "try again" and re-saves the same object gets
235
+ * `planStatusTransition() === null` on `!field?.Dirty`: no close, the other edits commit, and
236
+ * `Save()` returns true. Leaving it dirty means the retry reads the status again, which is
237
+ * exactly what a transient failure needs.
238
+ */
239
+ if (transition?.Kind === 'Unreadable') {
240
+ return this.refuseSave('The deal status could not be read, so this save cannot tell whether it closes the ' +
241
+ 'deal. Nothing was changed. Try again, and if it persists check that the Deal ' +
242
+ 'Status Types list is readable.');
243
+ }
244
+ if (transition) {
245
+ this._revertedStatusTarget = transition.TargetStatusID;
246
+ this.Set('DealStatusTypeID', transition.PriorStatusID);
247
+ }
248
+ /**
249
+ * A CLOSE THAT CANNOT RUN IS REFUSED BEFORE ANYTHING IS WRITTEN.
250
+ *
251
+ * The transition runs AFTER `super.Save()`, against the committed row, because it loads its own
252
+ * copy of this deal and the two would otherwise race. That ordering has a cost: a caller who
253
+ * sets the status AND three other fields, and whose close then fails, has those three fields on
254
+ * disk and an open deal. The save reports false, so nothing is silent, but it is a partial
255
+ * apply.
256
+ *
257
+ * Closing as lost with no loss reason is the one case worth spending a check to avoid, because
258
+ * it is not an edge: `LossReasonID` is a column on this deal, a form or an importer can set the
259
+ * status without it, and the close then refuses every time — deterministically, for a reason
260
+ * known right here, before a single row moves. Catching it up front turns a partial apply into
261
+ * a clean refusal for the case most likely to hit one.
262
+ *
263
+ * THE PREDICATE IS THE OPERATION'S OWN, and deliberately no wider: `CloseDealOperation.validate`
264
+ * refuses `IsLost` with no `LossReasonID`, and this asks the same question of the same two
265
+ * values. It does NOT duplicate the rest of that validation — whether the chosen reason demands
266
+ * notes needs the loss-reason row, which is a read this path should not be making, and that one
267
+ * stays downstream with the others.
268
+ */
269
+ if (transition?.Kind === 'Close' && transition.TargetIsLost && !this.LossReasonID) {
270
+ return this.refuseSave('A loss reason is required to close a deal as lost. Set LossReasonID alongside the ' +
271
+ 'status, or close the deal through Sales.CloseDeal.');
272
+ }
194
273
  /**
195
274
  * THE CLOSE LOCK (L-17, master plan §7.3) — enforced HERE and nowhere else.
196
275
  *
@@ -208,39 +287,9 @@ let DealEntityServer = class DealEntityServer extends DealEntity {
208
287
  if (this.IsSaved && !this._reopenInProgress) {
209
288
  const refusal = await this.checkCloseLock();
210
289
  if (refusal) {
211
- LogError(`DealEntityServer.Save refused: ${refusal}`);
212
- return false;
290
+ return this.refuseSave(refusal);
213
291
  }
214
292
  }
215
- /**
216
- * A BARE STATUS WRITE MUST NOT CLOSE A DEAL (bc-aidp-next-golive#205).
217
- *
218
- * The close lock above reads the PERSISTED status, so it cannot see this: moving Open -> Won is
219
- * a save on an unlocked deal and passed straight through. The deal came out locked, and none of
220
- * the close ran — no stage event, no contract, no finance tasks, and for a Lost deal no loss
221
- * reason and an order still live. Worse, the lock then refused `DealStatusTypeID` on every later
222
- * save, so the deal could not be reopened either. A field edit on a form had produced a state
223
- * no operation could have produced and none could undo.
224
- *
225
- * WHAT SEPARATES THIS FROM A REAL CLOSE is the declared transition, which `Sales.CloseDeal`
226
- * already sets and a form write has no way to set. So this needs no new flag: it asks whether
227
- * anybody announced a transition, which is the same question `stampClose` asks downstream.
228
- *
229
- * IT RUNS BEFORE THE TRANSACTION, and that placement is what makes it precise. The server
230
- * derives a status from the stage later, inside the transaction (`applyStageOrderStatus`), so at
231
- * THIS point a dirty status can only have come from the caller. Checking here refuses the write
232
- * somebody made and never the one this class is about to make itself.
233
- *
234
- * Refusing rather than closing is deliberate, and is the narrower of the two readings of #205 —
235
- * see the issue for the open question about whether the entity should instead RUN the close.
236
- * Refusing is correct under either: a status write that reaches the database without the close
237
- * having run is the defect, whoever ends up running it.
238
- */
239
- const bareClose = await this.bareCloseRefusal();
240
- if (bareClose) {
241
- LogError(`DealEntityServer.Save refused: ${bareClose}`);
242
- return false;
243
- }
244
293
  /**
245
294
  * THE OWNER STAMP IS NOT A FIELD ANYONE MAY SET (S-US1: "cannot be edited directly").
246
295
  *
@@ -250,16 +299,14 @@ let DealEntityServer = class DealEntityServer extends DealEntity {
250
299
  */
251
300
  const ownerRefusal = this.ownerStampEditRefusal();
252
301
  if (ownerRefusal) {
253
- LogError(`DealEntityServer.Save refused: ${ownerRefusal}`);
254
- return false;
302
+ return this.refuseSave(ownerRefusal);
255
303
  }
256
304
  try {
257
305
  await this.stampCompanyFromPipeline();
258
306
  await this.stampOwnerFromTeam();
259
307
  }
260
308
  catch (err) {
261
- LogError(`DealEntityServer.Save: could not resolve a server-maintained stamp: ${err}`);
262
- return false;
309
+ return this.refuseSave(`could not resolve a server-maintained stamp: ${err}`);
263
310
  }
264
311
  /**
265
312
  * AFTER the company stamp, deliberately — and NOT AT ALL on a locked deal.
@@ -312,7 +359,7 @@ let DealEntityServer = class DealEntityServer extends DealEntity {
312
359
  *
313
360
  * Drift caused by someone else — finance editing the order directly, which S-US5 explicitly
314
361
  * allows — is deliberately NOT chased here. That is what `AmountSourceHash` is for: a surface
315
- * holding the order can recompute the fingerprint and say "stale, reprice". Polling the order on
362
+ * holding the order can recompute the fingerprint and say so. Polling the order on
316
363
  * every unrelated deal save would be a read per keystroke for a guarantee the hash already gives.
317
364
  */
318
365
  const order = this.OrderID_Object;
@@ -371,8 +418,148 @@ let DealEntityServer = class DealEntityServer extends DealEntity {
371
418
  // covered only this one.
372
419
  if (!saved) {
373
420
  this.explainOrderProvisioningFailure();
421
+ return false;
422
+ }
423
+ /**
424
+ * Everything else is ON DISK by now; the transition runs against that committed row.
425
+ *
426
+ * SO A TRANSITION THAT FAILS HERE LEAVES THE CALLER'S OTHER EDITS COMMITTED. The save returns
427
+ * false and the operation's own issues say why, but the fields that were not the status have
428
+ * already been written. That is the price of running the close against a committed row instead
429
+ * of racing the operation's own copy of this deal, and the close's own work is still
430
+ * transactional within itself — a half-done close is not among the outcomes.
431
+ *
432
+ * The one case common enough to be worth pre-empting is refused above, before anything is
433
+ * written. What is left here is a close that failed for a reason this path could not have known
434
+ * in advance: a downstream route declining, a loss reason that demands notes, a contract or
435
+ * order write failing.
436
+ */
437
+ /**
438
+ * NO `Kind` CHECK IS NEEDED HERE, and that is the point rather than an omission.
439
+ *
440
+ * `runStatusTransition` accepts only `ActionableStatusTransition`, and the `Unreadable`
441
+ * refusal above is an early `return`, so the compiler has already narrowed `transition` to
442
+ * `Close | Reopen` by this line — adding a guard here is rejected as a comparison with no
443
+ * overlap. The invariant the reader used to have to carry is now held by the type.
444
+ */
445
+ if (transition) {
446
+ return this.runStatusTransition(transition);
447
+ }
448
+ return true;
449
+ }
450
+ /**
451
+ * Is this save a status move into or out of a locking status, and therefore a close or a reopen?
452
+ *
453
+ * Null in every ordinary case. The cheap half comes first, so a save that does not touch the status
454
+ * costs no status lookups at all — this runs on every save, and most saves do not touch it.
455
+ *
456
+ * A DECLARED transition returns null: `Sales.CloseDeal` and `Sales.ReopenDeal` announce themselves
457
+ * before saving, and that IS the flow running. Without this term, the operation's own save would
458
+ * re-enter the flow it is already executing.
459
+ *
460
+ * Creation returns null too. A deal born closed has no transition to have run, and the opening
461
+ * default (`needsStatusDefault`) would otherwise read as one.
462
+ */
463
+ async planStatusTransition() {
464
+ const field = this.GetFieldByName('DealStatusTypeID');
465
+ const target = this.DealStatusTypeID;
466
+ if (!this.IsSaved || this._declaredTransition || !field?.Dirty || !target) {
467
+ return null;
468
+ }
469
+ const priorID = field.OldValue ?? null;
470
+ const targetFlags = await this.readStatusLockFlags(target);
471
+ /**
472
+ * AN UNREADABLE TARGET STATUS REFUSES THE SAVE. It does not close, and it does not proceed.
473
+ *
474
+ * `readStatusLockFlags` fails closed — `LocksDeal: true` — which is right for the lock and
475
+ * exactly wrong here: read as "the target closes the deal", a blip on this one row would run a
476
+ * full close on a save that asked for nothing of the kind. Guessing the other way is no better;
477
+ * a status that really does lock would then be written with no close behind it, which is the
478
+ * defect golive#205 was filed about.
479
+ *
480
+ * So neither guess is taken. This is the same instinct `planStageDefaults` already states for
481
+ * its own read — "Unreadable is treated as do not derive" — and the cost is the same shape: a
482
+ * rep retries one save, instead of a deal closing that nobody asked to close.
483
+ */
484
+ if (!targetFlags.Read) {
485
+ return { Kind: 'Unreadable', TargetStatusID: target, PriorStatusID: priorID, TargetIsLost: false };
486
+ }
487
+ const priorLocks = priorID ? await this.statusLocksDeal(priorID) : false;
488
+ if (targetFlags.LocksDeal && !priorLocks) {
489
+ return {
490
+ Kind: 'Close', TargetStatusID: target, PriorStatusID: priorID,
491
+ TargetIsLost: targetFlags.IsLost,
492
+ };
493
+ }
494
+ if (priorLocks && !targetFlags.LocksDeal) {
495
+ return {
496
+ Kind: 'Reopen', TargetStatusID: target, PriorStatusID: priorID,
497
+ TargetIsLost: targetFlags.IsLost,
498
+ };
499
+ }
500
+ // Won -> Lost, or Open -> On Hold. Neither crosses the lock boundary, so neither is a close or
501
+ // a reopen, and the ordinary rules above already decided whether it was allowed.
502
+ return null;
503
+ }
504
+ /**
505
+ * Run the close or the reopen that the caller's status write asked for.
506
+ *
507
+ * WHY THE OPERATIONS AND NOT A COPY OF THEIR WORK. A close writes a stage event, creates a contract
508
+ * and two finance tasks for a won B2B deal, and voids the order for a lost one; a reopen undoes the
509
+ * stamps and returns the order. All of it already exists, is transactional, and is pinned by the
510
+ * `close-deal` checks. Reimplementing any of it here would be a second copy of the most
511
+ * consequential code in this app.
512
+ *
513
+ * IMPORTED LAZILY because `CloseDealOperation` imports this class, so a top-level import would be a
514
+ * cycle. The module system caches it, so this costs nothing after the first transition in a process.
515
+ *
516
+ * A LOST CLOSE STILL NEEDS ITS LOSS REASON, and a caller who set the status without one gets the
517
+ * operation's own refusal rather than a second, vaguer one from here. `LossReasonID` and `LossNotes`
518
+ * are columns on this deal, so an importer that sets them alongside the status has supplied
519
+ * everything the close needs -- which is the case #205 is about.
520
+ */
521
+ async runStatusTransition(plan) {
522
+ const { CloseDealOperation, ReopenDealOperation } = await import('./CloseDealOperation.js');
523
+ const context = {
524
+ provider: this.ProviderToUse,
525
+ user: this.ContextCurrentUser,
526
+ };
527
+ const result = plan.Kind === 'Close'
528
+ ? await new CloseDealOperation().ExecuteServer({
529
+ DealID: this.ID,
530
+ DealStatusTypeID: plan.TargetStatusID,
531
+ LossReasonID: this.LossReasonID ?? null,
532
+ LossNotes: this.LossNotes ?? null,
533
+ }, context)
534
+ : await new ReopenDealOperation().ExecuteServer({
535
+ DealID: this.ID,
536
+ // #205: "No reopen reason is required." One is still RECORDED, because 7.3
537
+ // wants undoing a lock to be explainable and the operation refuses a blank.
538
+ Reason: 'Reopened by setting the deal status back to an open status.',
539
+ DealStatusTypeID: plan.TargetStatusID,
540
+ }, context);
541
+ const output = result.Output;
542
+ const issues = output?.Issues ?? [];
543
+ if (!result.Success || output?.Success === false) {
544
+ // The other edits ARE committed; only the transition failed. Reloading leaves this object
545
+ // agreeing with the row rather than holding a status the database never accepted.
546
+ await this.Load(this.ID);
547
+ const reasons = issues.length > 0
548
+ ? issues.map((i) => i.Message)
549
+ : result.ErrorMessage
550
+ ? [result.ErrorMessage]
551
+ : [];
552
+ // Names BOTH halves. "The save failed" is as wrong as "it worked": the caller's field
553
+ // edits are on disk and only the status did not move, and a caller who cannot tell the
554
+ // difference will either re-send edits that already landed or assume a close that never
555
+ // happened.
556
+ return this.reportPostSaveFailure(`Your edits to this deal were saved, but the ${plan.Kind.toLowerCase()} did not ` +
557
+ `complete, so its status is unchanged. Set the status again once this is resolved:`, reasons);
374
558
  }
375
- return saved;
559
+ // The operation saved its own copy of this row. Without this, the caller keeps an object whose
560
+ // stamps, stage and status all predate the close it just triggered.
561
+ await this.Load(this.ID);
562
+ return true;
376
563
  }
377
564
  /* ── STAGE PROVENANCE ─────────────────────────────────────────────────────────────────────────
378
565
  *
@@ -557,10 +744,12 @@ let DealEntityServer = class DealEntityServer extends DealEntity {
557
744
  }
558
745
  catch (err) {
559
746
  LogError(`DealEntityServer.saveWithinScope failed for deal ${this.ID}: ${err}`);
747
+ let rolledBack = true;
560
748
  try {
561
749
  await scope.Rollback();
562
750
  }
563
751
  catch (rollbackErr) {
752
+ rolledBack = false;
564
753
  LogError(`Failed to roll back after a failed deal save: ${rollbackErr}`);
565
754
  }
566
755
  /**
@@ -587,7 +776,20 @@ let DealEntityServer = class DealEntityServer extends DealEntity {
587
776
  if (work.assignNumber) {
588
777
  this.DealNumber = null;
589
778
  }
590
- return false;
779
+ /**
780
+ * `super.Save()` may already have registered a SUCCESS entry inside this scope, and the
781
+ * rollback does not reach the result history -- so without this the caller reads
782
+ * `Save() === false` beside `LatestResult.Success === true`. Reported last, after the
783
+ * compensation above, so the message describes the state the object is actually left in.
784
+ *
785
+ * The rollback outcome is in the sentence because the two are genuinely different
786
+ * situations for whoever reads it: a clean rollback means retry, a failed one means the
787
+ * row needs looking at before anything else is tried.
788
+ */
789
+ return this.reportPostSaveFailure(rolledBack
790
+ ? `This deal could not be saved, and the change was rolled back: ${err}`
791
+ : `This deal could not be saved AND the rollback failed, so the row may be ` +
792
+ `partly written. Check it before retrying: ${err}`);
591
793
  }
592
794
  }
593
795
  /**
@@ -1260,8 +1462,8 @@ let DealEntityServer = class DealEntityServer extends DealEntity {
1260
1462
  * SD23 does not reach.
1261
1463
  */
1262
1464
  /**
1263
- * The fingerprint, so a surface can say "stale, reprice" instead of showing an untraceable
1264
- * number. It covers the ORDER and the TOTAL, which is exactly what the cache was derived from —
1465
+ * The fingerprint, so a surface can say the amount no longer describes its order instead of
1466
+ * showing an untraceable number. It covers the ORDER and the TOTAL, which is exactly what the cache was derived from —
1265
1467
  * a reader holding the order can recompute this and compare without a second table.
1266
1468
  */
1267
1469
  const hash = createHash('sha256').update(`${this.OrderID}|${total}`).digest('hex');
@@ -1354,11 +1556,45 @@ let DealEntityServer = class DealEntityServer extends DealEntity {
1354
1556
  /**
1355
1557
  * The fields that stay editable on a locked deal — read from the SHARED rule, not redeclared.
1356
1558
  *
1357
- * It moved to `@mj-biz-apps/sales-entities` so the Explorer Deal form can apply the same list. A
1358
- * second copy here would drift, and the drift would only ever surface as a user typing into a field
1359
- * the server then refuses. See `close-lock.ts` for the reasoning; CD14 pins it to real behaviour.
1559
+ * It lives in `@mj-biz-apps/sales-entities` so the Explorer Deal form and the workspace apply the
1560
+ * same list. A second copy here would drift, and the drift would only ever surface as a user typing
1561
+ * into a field the server then refuses. See `close-lock.ts`; CD14 pins it to real behaviour.
1562
+ *
1563
+ * A FUNCTION, not a constant, since golive#206's "Loss Notes (Lost deals only)": the answer depends
1564
+ * on the deal's outcome, so the outcome has to reach it. It used to be a flat `ReadonlySet` held in
1565
+ * a static, which is precisely how a caller ends up with the list and without the condition.
1566
+ */
1567
+ static lockEditableFields(isLost) {
1568
+ return DealFieldsEditableWhileLocked(isLost);
1569
+ }
1570
+ /**
1571
+ * The child collections that stay editable on a locked deal.
1572
+ *
1573
+ * Named here rather than in `sales-entities` because, unlike the field list, no other surface needs
1574
+ * it yet: the grids decide their own New/delete affordances. If a form ever has to render this, it
1575
+ * moves next to `DEAL_FIELDS_EDITABLE_WHILE_LOCKED` for the same reason that one moved.
1576
+ *
1577
+ * ── WHAT THIS DOES AND DOES NOT CATCH TODAY ─────────────────────────────────────────────────
1578
+ *
1579
+ * The Deal declares exactly TWO child collections (`metadata/entity-relationships`):
1580
+ * `PaymentSchedule` and `Team`. Both are named here, so `dirtyCollections` below is currently
1581
+ * always empty and this check refuses nothing in practice.
1582
+ *
1583
+ * That is deliberate and it is not the same as the check being pointless. It is an ALLOW-LIST, so
1584
+ * a collection added later is refused without anyone remembering to add it — which is the whole
1585
+ * property the previous "freeze every dirty companion" rule existed for. What it means is that
1586
+ * the freeze direction has no companion to demonstrate it on right now, and no check can prove
1587
+ * it until a third collection exists. Said out loud so nobody reads the guard as tested.
1588
+ *
1589
+ * ORDER LINES ARE NOT A COMPANION OF THE DEAL and never were — they belong to the ORDER, in the
1590
+ * Orders app. An earlier version of this comment listed `Lines` alongside these two, which made
1591
+ * this look like the thing freezing them. It is not: that is bizapps-orders#206, which adds a veto
1592
+ * seam Sales registers into.
1360
1593
  */
1361
- static { this.LOCK_EDITABLE_FIELDS = DEAL_FIELDS_EDITABLE_WHILE_LOCKED; }
1594
+ static { this.LOCK_EDITABLE_COMPANIONS = new Set([
1595
+ 'Team',
1596
+ 'PaymentSchedule',
1597
+ ]); }
1362
1598
  /**
1363
1599
  * Runs `body` with the close lock suppressed, and always restores it.
1364
1600
  *
@@ -1383,83 +1619,207 @@ let DealEntityServer = class DealEntityServer extends DealEntity {
1383
1619
  * the current value instead would make a deal impossible to close.
1384
1620
  */
1385
1621
  /**
1386
- * The refusal for a status write that would lock the deal without closing it.
1622
+ * Refuse this save, and leave the reason where the CALLER reads it.
1387
1623
  *
1388
- * Null in every ordinary case, including the three that look similar and are not:
1624
+ * ── WHY LOGGING WAS NOT ENOUGH ────────────────────────────────────────────────
1389
1625
  *
1390
- * · a DECLARED transition — `Sales.CloseDeal` announced itself, so the close is running;
1391
- * · LEAVING a locking status — that is a reopen, and the close lock already refuses a bare one,
1392
- * with a message that names `Sales.ReopenDeal`;
1393
- * · a status that does not lock — ordinary pipeline movement, which is most saves.
1626
+ * Every refusal in `Save` used to be `LogError(...)` followed by `return false`, so a caller got a
1627
+ * bare `false` and the reason went to the server log. golive#207 row 18 is explicit about what that
1628
+ * message is for: row 17 is what the FORM shows a person, and row 18 is "what the save returns to
1629
+ * whoever asked — the form, an import, an agent or a raw API call". Logged, it returned to nobody.
1630
+ * The form looked fine only because `DealFormComponentExtended.Validate()` produces row 17 for
1631
+ * itself; every other caller got silence.
1394
1632
  *
1395
- * Creation is excluded too: a deal born closed has no transition to have run, and the opening
1396
- * default (`needsStatusDefault`) would otherwise be read as one.
1633
+ * `RegisterResultHistoryEntry` is what core uses to record a failed write, and it is what puts the
1634
+ * text on `LatestResult` — registered rather than assigned, because `LatestResult` returns null
1635
+ * when the history is empty while TYPING itself non-null, which is how the same mistake reached
1636
+ * production in orders' line delete.
1397
1637
  */
1398
- async bareCloseRefusal() {
1399
- const field = this.GetFieldByName('DealStatusTypeID');
1400
- const target = this.DealStatusTypeID;
1401
- // The cheap half first, so an ordinary save costs no status lookups at all — this runs on
1402
- // every save, and most saves do not touch the status.
1403
- if (!this.IsSaved || this._declaredTransition || !field?.Dirty || !target) {
1404
- return null;
1638
+ refuseSave(message) {
1639
+ /**
1640
+ * PUT THE CALLER'S STATUS BACK BEFORE REFUSING, or the retry they were just invited to make
1641
+ * silently does nothing.
1642
+ *
1643
+ * The status is reverted to its persisted value above so the close lock sees a clean field.
1644
+ * That revert is correct for a save that PROCEEDS. On a refusal it is a trap: the field is now
1645
+ * clean, so a caller who reads this message, fixes what it named and saves the SAME object gets
1646
+ * `planStatusTransition() === null` on `!field?.Dirty`, no close runs, the other edits commit,
1647
+ * and `Save()` returns TRUE. An open deal carrying a loss reason, and a caller told it worked.
1648
+ *
1649
+ * Restored HERE rather than at each `return false` for the reason the `finally` above exists:
1650
+ * the bug is always the exit somebody adds later, and there are four of these already.
1651
+ */
1652
+ if (this._revertedStatusTarget) {
1653
+ this.Set('DealStatusTypeID', this._revertedStatusTarget);
1405
1654
  }
1406
- const priorID = field.OldValue ?? null;
1407
- const facts = {
1408
- IsSaved: true,
1409
- HasDeclaredTransition: false,
1410
- StatusIsDirty: true,
1411
- TargetLocks: await this.statusLocksDeal(target),
1412
- PriorLocks: priorID ? await this.statusLocksDeal(priorID) : null,
1413
- };
1414
- if (!IsBareCloseWrite(facts)) {
1415
- return null;
1655
+ LogError(`DealEntityServer.Save refused: ${message}`);
1656
+ const failed = new BaseEntityResult();
1657
+ failed.Success = false;
1658
+ failed.Type = this.IsSaved ? 'update' : 'create';
1659
+ failed.Message = message;
1660
+ failed.StartedAt = new Date();
1661
+ failed.EndedAt = new Date();
1662
+ failed.OriginalValues = this.Fields.map((f) => ({ FieldName: f.CodeName, Value: f.OldValue }));
1663
+ this.RegisterResultHistoryEntry(failed);
1664
+ return false;
1665
+ }
1666
+ /**
1667
+ * Report a failure that happened AFTER `super.Save()` already registered a SUCCESS result.
1668
+ *
1669
+ * ── WHY THIS IS NOT `refuseSave` ──────────────────────────────────────────────────────────────
1670
+ *
1671
+ * `Save()` returning false was, on these paths, the ONLY signal. `super.Save()` had already
1672
+ * registered a success entry and `this.Load(this.ID)` does not clear the history -- core guards
1673
+ * its `init()` with `if (!this.IsSaved)` and the deal is saved -- so a caller doing the obvious
1674
+ * thing read:
1675
+ *
1676
+ * await deal.Save() -> false
1677
+ * deal.LatestResult.Success -> TRUE
1678
+ * deal.LatestResult.CompleteMessage -> undefined -> "Unknown error"
1679
+ *
1680
+ * A caller following exactly the pattern `deal-workspace.service.ts` uses was told the save
1681
+ * succeeded. Worse than silent: the last thing on the history contradicted the return value.
1682
+ *
1683
+ * Two things differ from `refuseSave` and both matter:
1684
+ *
1685
+ * 1. IT DOES NOT PUT THE STATUS BACK. `refuseSave` restores the caller's target because nothing
1686
+ * was written and a retry must still carry it. Here the row has already moved (or been rolled
1687
+ * back) and `Load()` has resynced this object to it -- re-dirtying a field to a value the
1688
+ * database just rejected would invite the same failure on the next save.
1689
+ * 2. IT CARRIES THE OPERATION'S ISSUES. `CloseDealOperation` returns a structured `Issues` array
1690
+ * which was being joined into a `LogError` and dropped. Those sentences are the only thing
1691
+ * that says WHY the close refused, and they are what the user needs.
1692
+ *
1693
+ * AND WHY NOT A TRANSACTION, since "both or neither" is the obvious wish: the transition reaches
1694
+ * bizapps-contracts and bizapps-orders through seams, so there is no single database to be atomic
1695
+ * in; `CloseDealOperation` is a remote operation that owns its own scope and rollback; and it
1696
+ * loads its own copy of this deal, which is exactly why it must run after the commit rather than
1697
+ * inside it. Atomicity is not available here, so honesty about the partial apply is the fix.
1698
+ * Narrowing the window belongs upstream, in the pre-flight that already refuses a lost close with
1699
+ * no loss reason before a single row moves.
1700
+ */
1701
+ reportPostSaveFailure(message, issues = []) {
1702
+ // Into the MESSAGE, not only into `Errors`: `CompleteMessage` is what the resolver reads, and
1703
+ // it builds from `Message`. An issue list that renders nowhere is the defect being fixed.
1704
+ const full = issues.length > 0 ? `${message} ${issues.join(' | ')}` : message;
1705
+ LogError(`DealEntityServer.Save: ${full}`);
1706
+ const failed = new BaseEntityResult();
1707
+ failed.Success = false;
1708
+ failed.Type = this.IsSaved ? 'update' : 'create';
1709
+ failed.Message = full;
1710
+ if (issues.length > 0) {
1711
+ failed.Errors = issues.map((issue) => ({ Message: issue, Source: 'DealEntityServer' }));
1416
1712
  }
1417
- return ('this status closes the deal, and closing it needs the close to actually run — the stage ' +
1418
- 'event, the contract and the finance tasks for a won deal, the loss reason and the voided ' +
1419
- 'order for a lost one. Setting DealStatusTypeID on its own would lock the deal without any ' +
1420
- 'of that, and the lock would then refuse the status field, so it could not be undone. Close ' +
1421
- 'it through Sales.CloseDeal.');
1713
+ failed.StartedAt = new Date();
1714
+ failed.EndedAt = new Date();
1715
+ failed.OriginalValues = this.Fields.map((f) => ({ FieldName: f.CodeName, Value: f.OldValue }));
1716
+ this.RegisterResultHistoryEntry(failed);
1717
+ return false;
1422
1718
  }
1423
1719
  async checkCloseLock() {
1424
1720
  const persistedStatusID = this.GetFieldByName('DealStatusTypeID')?.OldValue;
1425
1721
  if (!persistedStatusID) {
1426
1722
  return null;
1427
1723
  }
1428
- if (!(await this.statusLocksDeal(persistedStatusID))) {
1724
+ const persisted = await this.readStatusLockFlags(persistedStatusID);
1725
+ if (!persisted.LocksDeal) {
1429
1726
  return null;
1430
1727
  }
1431
1728
  // FROM HERE THE DEAL IS LOCKED, whatever this particular edit turns out to be. Recorded before
1432
1729
  // the field-by-field verdict below, because the writers downstream care about the LOCK, not about
1433
1730
  // whether this one edit was permitted.
1434
1731
  this._lockedAtSave = true;
1435
- const changed = this.Fields.filter((f) => f.Dirty && !DealEntityServer_1.LOCK_EDITABLE_FIELDS.has(f.Name)).map((f) => f.Name);
1732
+ /**
1733
+ * The outcome decides one field. golive#206: Loss Notes stays editable on a LOST deal and is
1734
+ * frozen on a won one, and the form asks the same function with the same flag — both take it
1735
+ * from the status ROW, never from a name.
1736
+ */
1737
+ const editable = DealEntityServer_1.lockEditableFields(persisted.IsLost);
1738
+ /**
1739
+ * `OwnerEmployeeID` IS FROZEN, AND IS STILL WRITTEN HERE WHEN THE ROSTER DRIVES IT.
1740
+ *
1741
+ * It stays out of the editable set on purpose — `SD26` proves a hand-set one is refused, and
1742
+ * golive#206 classes Owner as server-written provenance. But golive#206 item 2 also says
1743
+ * reassigning a rep on a closed deal is record-keeping and must be allowed, and the stamp has
1744
+ * to follow the roster when it does.
1745
+ *
1746
+ * The form's team panel edits `DealTeamMember` rows, leaving this field clean, so it passed.
1747
+ * `DealEntity.SetOwner()` assigns the stamp itself after loading the roster, so it arrived here
1748
+ * DIRTY and the lock refused it — which is the deal workspace's owner picker, and it did not
1749
+ * work on a closed deal. `CD29` is that case.
1750
+ *
1751
+ * Asking `RosterDrivesThisSave` is the same question `ownerStampEditRefusal` already asks, which
1752
+ * is what stops the two from disagreeing again. It grants nothing a caller could exploit:
1753
+ * `stampOwnerFromTeam` re-derives the value from the roster a moment later.
1754
+ */
1755
+ const frozen = (f) => f.Dirty
1756
+ && !editable.has(f.Name)
1757
+ && !(f.Name === 'OwnerEmployeeID' && this.RosterDrivesThisSave);
1758
+ const changed = this.Fields.filter(frozen).map((f) => f.Name);
1436
1759
  /**
1437
1760
  * THE CHILD COLLECTIONS COUNT AS CHANGES TOO, and this half did not exist when the lock was
1438
1761
  * written — the collections did not exist either.
1439
1762
  *
1440
- * A deal's lines are exactly what a contract and an order were derived from, so editing or
1441
- * removing one on a closed deal falsifies the same provenance the header lock protects. But
1442
- * `Lines`, `PaymentSchedule` and `Team` are COMPANIONS, not fields: they never appear in
1443
- * `this.Fields`, so the header check above cannot see them. Without this the lock would refuse a
1444
- * renamed deal and happily accept a deleted line, which is the more damaging edit of the two.
1763
+ * `PaymentSchedule` and `Team` are COMPANIONS, not fields: they never appear in `this.Fields`,
1764
+ * so the header check above cannot see them at all. Without this half, the lock would refuse a
1765
+ * renamed deal while a companion edit went straight through.
1766
+ *
1767
+ * A deal's ORDER LINES are exactly what a contract was derived from, and they are NOT reachable
1768
+ * from here — they belong to the order, in the Orders app, and this entity never sees them.
1769
+ * Freezing those is bizapps-orders#206.
1770
+ *
1771
+ * WHICH COLLECTIONS ARE FROZEN IS NOW AN ALLOW-LIST, AND THE DIRECTION MATTERS
1772
+ * (bc-aidp-next-golive#206 item 2). Reassigning a rep or correcting a payment schedule after a
1773
+ * close is record-keeping, not a change to what was agreed, so `Team` and `PaymentSchedule` are
1774
+ * permitted — which today is both of them.
1445
1775
  *
1446
- * Enumerated as `Companions` rather than as the three collections by name, deliberately: anything
1447
- * that contributes work to this record's save is something the lock has to see, and naming them
1448
- * individually would mean a collection added later is silently unprotected.
1776
+ * This was previously "freeze every dirty companion", enumerated that way deliberately so that a
1777
+ * collection added later would be protected without anyone remembering to add it. That property
1778
+ * is kept -- which is why this names what is ALLOWED rather than what is frozen. Listing the
1779
+ * frozen ones instead would leave the next collection silently editable on a closed deal, and
1780
+ * that is the failure the original comment was written against.
1449
1781
  *
1450
1782
  * Guarded by the same already-closed test, so the closing transition may still carry final
1451
1783
  * collection state — a close that writes its last line is legal; editing that line tomorrow is
1452
1784
  * not.
1453
1785
  */
1454
1786
  const dirtyCollections = this.Companions
1455
- .filter((c) => c.Dirty)
1787
+ .filter((c) => c.Dirty && !DealEntityServer_1.LOCK_EDITABLE_COMPANIONS.has(c.Name))
1456
1788
  .map((c) => c.Name);
1457
1789
  const all = [...changed, ...dirtyCollections];
1458
1790
  if (all.length === 0) {
1459
1791
  return null;
1460
1792
  }
1461
- return (`this deal is closed and locked; ${all.join(', ')} cannot be changed. ` +
1462
- `Reopen it through Sales.ReopenDeal, which records a reason.`);
1793
+ /**
1794
+ * golive#207 row 18, verbatim: "This deal is closed. {fields} cannot be changed until the
1795
+ * status is set back to Open."
1796
+ *
1797
+ * The third of the three lock messages, with rows 16 and 17 on this PR. It began on the #205
1798
+ * branch, which is where the sentence became TRUE -- until that trigger landed, a status write
1799
+ * could not reopen a deal and this refusal had to send the reader to `Sales.ReopenDeal`. It is
1800
+ * here instead so that one PR owns one issue, and the sequencing the tester already called out
1801
+ * ("the three lock messages assume the close/reopen issue lands") is unchanged: this PR merges
1802
+ * with #205's, never before it.
1803
+ *
1804
+ * NOTHING IS APPENDED FOR INTEGRATORS. An earlier revision added a second sentence naming
1805
+ * `Sales.ReopenDeal` and its arguments, on the reasoning that this string reaches an API caller
1806
+ * as well as a person. Once setting the status back RUNS the reopen from any path, that is the
1807
+ * same instruction spelled longer. A caller who wants the operation directly still finds it
1808
+ * named, with its arguments, in the refusal a close that cannot run produces.
1809
+ *
1810
+ * {fields} IS INTERPOLATED, not spelled out, which the tester asked for in the same breath:
1811
+ * the notice "should match whatever #206 settles on". #206 item 3 grows that set from two fields to
1812
+ * six -- seven on a Lost deal -- and a hardcoded sentence would have started lying the day
1813
+ * it merged.
1814
+ *
1815
+ * THE SAME LABELS AND THE SAME JOIN AS ROW 16. This sentence used to print raw column names
1816
+ * while row 16 printed the on-screen ones, so one refusal said "DealStatusTypeID" and the other
1817
+ * said "Deal Status" about the same field. `DealFieldLabel` falls back to the field name, so a
1818
+ * frozen field nobody has labelled still reads as its column ─ slightly wrong, rather than
1819
+ * taking the notice down.
1820
+ */
1821
+ const named = JoinLabels(all.map(DealFieldLabel));
1822
+ return `This deal is closed. ${named} cannot be changed until the status is set back to Open.`;
1463
1823
  }
1464
1824
  /**
1465
1825
  * Whether a status carries `LocksDeal`.
@@ -1468,21 +1828,43 @@ let DealEntityServer = class DealEntityServer extends DealEntity {
1468
1828
  * working. It is also why the lock is a property of the STATUS TYPE rather than of the stage.
1469
1829
  */
1470
1830
  async statusLocksDeal(statusID) {
1831
+ return (await this.readStatusLockFlags(statusID)).LocksDeal;
1832
+ }
1833
+ /**
1834
+ * The two flags the lock needs off a status row: does it lock the deal, and is it a LOSS.
1835
+ *
1836
+ * One read for both, because every caller that wants the second also wants the first, and two
1837
+ * round trips for two columns of one row is a cost with nothing to show for it.
1838
+ *
1839
+ * ── THE TWO FAILURE DEFAULTS POINT THE SAME WAY ─────────────────────────────────────────────
1840
+ *
1841
+ * `LocksDeal` FAILS CLOSED: if the status cannot be read we cannot prove the deal is unlocked, and
1842
+ * wrongly allowing an edit to a closed deal is the more expensive mistake. `IsLost` fails to
1843
+ * `false` for the same reason read the other way round — `false` means Loss Notes is NOT carved
1844
+ * out, so an unreadable status refuses more, never less.
1845
+ *
1846
+ * ── AND THAT IS WHY `Read` IS REPORTED SEPARATELY ──────────────────────────────────────
1847
+ *
1848
+ * "Refuses more, never less" holds for the LOCK and inverts for the TRIGGER. `planStatusTransition`
1849
+ * reads `LocksDeal` to mean "the target status closes the deal", so the same fail-closed default
1850
+ * turns a transient read failure into a REAL CLOSE — stage event, contract, finance tasks, a voided
1851
+ * order — on a save that asked for none of it. One default cannot serve both readings, so callers
1852
+ * are told whether the row was actually read and decide for themselves.
1853
+ */
1854
+ async readStatusLockFlags(statusID) {
1471
1855
  const provider = this.ProviderToUse;
1472
1856
  const result = await provider.RunView({
1473
1857
  EntityName: DEAL_STATUS_ENTITY,
1474
1858
  ExtraFilter: `ID = '${statusID}'`,
1475
1859
  ResultType: 'simple',
1476
- Fields: ['LocksDeal'],
1860
+ Fields: ['LocksDeal', 'IsLost'],
1477
1861
  }, this.ContextCurrentUser);
1478
1862
  if (!result.Success) {
1479
- // FAIL CLOSED. If the status cannot be read we cannot prove the deal is unlocked, and
1480
- // wrongly allowing an edit to a closed deal is the more expensive mistake.
1481
- LogError(`DealEntityServer.statusLocksDeal: could not read status ${statusID}: ${result.ErrorMessage}`);
1482
- return true;
1863
+ LogError(`DealEntityServer.readStatusLockFlags: could not read status ${statusID}: ${result.ErrorMessage}`);
1864
+ return { LocksDeal: true, IsLost: false, Read: false };
1483
1865
  }
1484
1866
  const row = (result.Results ?? [])[0];
1485
- return row?.LocksDeal === true;
1867
+ return { LocksDeal: row?.LocksDeal === true, IsLost: row?.IsLost === true, Read: !!row };
1486
1868
  }
1487
1869
  /* ── Selling company ────────────────────────────────────────────────────── */
1488
1870
  /**
@@ -1566,7 +1948,7 @@ let DealEntityServer = class DealEntityServer extends DealEntity {
1566
1948
  * conditions mirror `stampOwnerFromTeam`'s guard exactly, which is what keeps them from disagreeing.
1567
1949
  */
1568
1950
  ownerStampEditRefusal() {
1569
- if (this.Team.IsLoaded || this.Team.Count > 0) {
1951
+ if (this.RosterDrivesThisSave) {
1570
1952
  return null; // the roster is part of this save; the stamp is derived from it below
1571
1953
  }
1572
1954
  if (!this.callerSuppliedValue('OwnerEmployeeID', this.OwnerEmployeeID)) {
@@ -1575,8 +1957,25 @@ let DealEntityServer = class DealEntityServer extends DealEntity {
1575
1957
  return ('The owner is set from the deal team. Change the Owner role on the Internal team panel ' +
1576
1958
  'instead.');
1577
1959
  }
1960
+ /**
1961
+ * Is the ROSTER driving this save, rather than a caller naming an owner out of thin air?
1962
+ *
1963
+ * Three places need this answer and they must never disagree, which is how a defect got in:
1964
+ * `ownerStampEditRefusal` and `stampOwnerFromTeam` each spelled the condition out, `checkCloseLock`
1965
+ * did not ask at all, and `DealEntity.SetOwner()` — which loads the roster and then assigns the
1966
+ * stamp — was refused on a locked deal for editing a frozen field. golive#206 item 2 says
1967
+ * reassigning a rep after close is record-keeping and must be allowed.
1968
+ *
1969
+ * `Team.Load()` is what makes it true, and `SetOwner` calls it first. A caller who hand-sets
1970
+ * `OwnerEmployeeID` without touching the roster gets `false` here and the refusal it deserves.
1971
+ * A caller who sets BOTH gets no advantage: `stampOwnerFromTeam` re-derives the stamp from the
1972
+ * roster afterwards and overwrites whatever was supplied.
1973
+ */
1974
+ get RosterDrivesThisSave() {
1975
+ return this.Team.IsLoaded || this.Team.Count > 0;
1976
+ }
1578
1977
  async stampOwnerFromTeam() {
1579
- if (!this.Team.IsLoaded && this.Team.Count === 0) {
1978
+ if (!this.RosterDrivesThisSave) {
1580
1979
  return; // the roster is not part of this save; leave the stamp alone
1581
1980
  }
1582
1981
  const ownerRoleID = await this.ResolveOwnerRoleID();
@@ -1 +1 @@
1
- {"version":3,"file":"DealEntityServer.js","sourceRoot":"","sources":["../src/DealEntityServer.ts"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,OAAO,EACH,UAAU,EAKV,QAAQ,GACX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,wFAAwF;AACxF,sGAAsG;AACtG,uGAAuG;AACvG,OAAO,EAAE,aAAa,EAAoB,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EACH,iCAAiC,EACjC,UAAU,EAEV,gBAAgB,GAEnB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEvE,MAAM,WAAW,GAAG,yBAAyB,CAAC;AAC9C,MAAM,eAAe,GAAG,6BAA6B,CAAC;AACtD,MAAM,kBAAkB,GAAG,qCAAqC,CAAC;AAUjE,MAAM,YAAY,GAAG,mCAAmC,CAAC;AACzD,MAAM,mBAAmB,GAAG,kCAAkC,CAAC;AA0ExD,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,UAAU;IAAzC;;QA2rBH,+EAA+E;Q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ACH;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACK,qBAAqB;QACzB,IAAI,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC5B,OAAO,IAAI,CAAC,CAAG,sEAAsE;QACzF,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,iBAAiB,EAAE,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC;YACrE,OAAO,IAAI,CAAC,CAAG,uCAAuC;QAC1D,CAAC;QACD,OAAO,CACH,wFAAwF;YACxF,UAAU,CACb,CAAC;IACN,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,IAAY,oBAAoB;QAC5B,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IACrD,CAAC;IAEO,KAAK,CAAC,kBAAkB;QAC5B,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC7B,OAAO,CAAC,6DAA6D;QACzE,CAAC;QAED,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACpD,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,WAAW,CAAC,CAAC;QACxE,IAAI,CAAC,eAAe,GAAG,KAAK,EAAE,UAAU,IAAI,IAAI,CAAC;IACrD,CAAC;;AA9jEQ,gBAAgB;IAD5B,aAAa,CAAC,UAAU,EAAE,WAAW,CAAC;GAC1B,gBAAgB,CA+jE5B"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mj-biz-apps/sales-core-entities-server",
3
3
  "type": "module",
4
- "version": "6.4.0",
4
+ "version": "6.5.0",
5
5
  "description": "Server-side entity subclasses for BizApps Sales — the close lock (L-17), the OwnerEmployeeID denormalized stamp, and deal lifecycle hooks.",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -19,10 +19,10 @@
19
19
  "vitest": "^4.0.18"
20
20
  },
21
21
  "dependencies": {
22
- "@mj-biz-apps/common-activity-sync": "^5.37.0",
23
- "@mj-biz-apps/common-entities": "^5.37.0",
22
+ "@mj-biz-apps/common-activity-sync": "^5.43.0",
23
+ "@mj-biz-apps/common-entities": "^5.43.0",
24
24
  "@mj-biz-apps/orders-entities": "^5.2.1",
25
- "@mj-biz-apps/sales-entities": "6.4.0",
25
+ "@mj-biz-apps/sales-entities": "6.5.0",
26
26
  "@mj-biz-apps/tasks-core": "^1.4.1",
27
27
  "@mj-biz-apps/tasks-entities": "^1.4.1"
28
28
  },