MGCEarmarkDealAmendment
A proposed change to an approved deal, and the record of what was decided about it. An approved deal cannot be edited: requirement A14 allows exactly one route, an amendment record routed through the same approval workflow the deal itself used, carrying a named field set - expiration date, lifetime cap, headroom alert percentage, name, deal group and deal owner. Anything outside that set is a copy of the deal, not an amendment. The amendment carries the proposed values plus a changed-field mask saying which of them are actually proposed, so that a proposed blank deal group or a proposed zero headroom percentage is unambiguously a change rather than an omission. A deal carries at most one Pending amendment at a time; earlier amendments stay on the deal as Applied or Rejected evidence. The record is evidence and is never deleted and never purged - it is the audit answer to the question of who changed an approved deal, what they changed, why, and who approved it. Frozen accrual instances are untouched by an amendment; a cap amended below the balance already accrued is permitted and produces an immediate Cap reached verdict, because nothing already committed is ever reversed.
Fields
| Name | Type | Mandatory | Description |
|---|---|---|---|
Deal | RefRecId | Yes | The record reference of the deal this amendment proposes to change. The reference is what joins; the deal identifier is stored beside it in its own column because a record reference on its own is unreadable in an export, unusable in a data management load and worthless after a migration. Both are stored, and the table refuses any row whose two keys disagree. |
DealId | MGCEarmarkDealId | Yes | The readable identifier of the deal this amendment proposes to change, stored beside the record reference so the row can be read, exported and re-imported without a join. It is copied from the deal when the amendment is created and is immutable thereafter; a row whose deal identifier does not match the deal it points at is refused. |
Sequence | LineNum | No | The ordinal of this amendment within its deal, counting from one. Amendments do not draw from a number sequence - this package ships two references, the deal identifier and the exception identifier, and neither is an amendment identifier - so an amendment is keyed by the deal it belongs to plus this ordinal. The ordinal is allocated when the row is inserted, under the deal row lock the amendment service already holds, and is never reused and never renumbered. |
Status | MGCEarmarkAmendmentStatus | No | Where this amendment stands. Pending means it is in the approval workflow and is the one amendment currently open on its deal. Applied means it was approved and its proposed values were written to the deal. Rejected means it never took effect - either an approver refused it, or the deal left the Approved status and the amendment was closed automatically with it. Those two cases share one value because the status set has three values and no fourth; what tells them apart afterwards is the Earmark timeline, which records an amendment withdrawn event with the reason the deal was ended. Only a Pending amendment can change status, and only to Applied or Rejected; both are final. |
ChangedFieldMask | Integer | No | Which of the proposed values on this amendment are actually being proposed, held as one bit per amendable field. The mask exists because a proposed value on its own cannot say what a blank means: a blank proposed deal group and a zero proposed headroom alert percentage are legitimate requests to clear a setting, and without the mask they would be indistinguishable from a field this amendment does not touch. The amendable set is fixed - expiration date, lifetime cap, headroom alert percentage, name, deal group and deal owner - and an amendment carrying a bit outside it is refused, because such a row would claim a change the model has no column to apply. An amendment with an empty mask changes nothing and is refused as well. The bit positions are an implementation detail; every reader asks the table whether a named column is amended rather than testing the number. |
ProposedName | MGCEarmarkDealName | No | The name the deal will carry if this amendment is approved. It is read only when the name bit is set in the changed-field mask. Unlike the deal group, a blank is not a clear-the-setting request here - a deal name is mandatory - so an amendment that proposes the name must propose a non-blank one. The value before the change is not stored on the amendment: the before and after pair belongs on the Earmark timeline, which records it when the amendment is applied, so that the same fact is never held in two places where the two could disagree. |
ProposedValidTo | TransDate | No | The date the deal stops being available for new prices if this amendment is approved. It must be on or after the deal effective-from date; an amendment that would invert the deal window is refused. The expiration date ends availability only - accrual instances already committed against the deal keep accruing at their accrual point and settle normally. |
ProposedLifetimeCap | MGCEarmarkAccrualAmount | No | The ceiling on total accrued money for the deal if this amendment is approved, in the deal currency. A proposed cap below the balance already accrued is deliberately permitted: the dialog shows the current accrued figure and the resulting headroom floored at zero, and on approval the balance service writes an immediate Cap reached verdict. Nothing already accrued is reversed. A negative cap is refused; zero means no ceiling. |
ProposedHeadroomAlertPercent | MGCEarmarkRatePercent | No | The proportion of the lifetime cap at which the deal starts warning that headroom is running out, if this amendment is approved. The value must be between zero and one hundred; zero switches the warning off. Changing it changes only when a warning is raised, never whether money accrues. |
ProposedDealGroupId | MGCEarmarkDealGroupId | No | The deal group the deal will belong to if this amendment is approved. It is read only when the deal group bit is set in the changed-field mask, and a blank is a legitimate proposal - it removes the deal from its group, which is why the mask and not the blankness of this column is what says whether the group is being amended at all. Deal group is a reporting and grouping attribute; changing it never changes how a deal resolves, prices or accrues. |
ProposedDealOwner | UserId | No | The user who will own the deal if this amendment is approved. It is read only when the deal owner bit is set in the changed-field mask. The owner is a user rather than a worker because the close-time notification and the headroom alerts key on user. Transferring ownership is an amendment rather than a free edit for the same reason every other change to an approved deal is: an approved deal is a commitment, and who answers for it is part of the record. |
ReasonCode | ReasonCode | Yes | The coded reason this amendment was raised, taken from the financial reasons flagged as applicable to Earmark. A reason is required: an amendment is a governed change to an approved commercial commitment, and a record of what changed without a record of why is not an audit answer. The flag is checked when the amendment is created and never again - unflagging a reason later stops it being offered, it does not invalidate the amendments that already cite it. The Earmark applicability flag itself is held in a side table keyed to the standard reason rather than on the standard reason row, because no stored field is ever added to a standard table. |
ReasonNote | MGCEarmarkReasonNote | No | Free text explaining this amendment beyond the coded reason - the same coded reason plus free note pairing that the Cancel, Close and Abort dialogs use. It is optional, but it is the field a controller reads first when asked six months later why a cap moved. It is frozen when the amendment is created: an approver has to be able to rely on it still saying what it said when the work item was raised. |
SubmittedBy | UserId | No | The user who routed this amendment to the approval workflow. It is written once, when the amendment is submitted, and never again. It is also the author side of the segregation-of-duties test: the user who applies an amendment must not be the user who raised it. For a row that reached the table without ever being routed - a path only a data management load can take - the created-by audit stamp answers the same question. |
SubmittedDateTime | TransDateTime | No | When this amendment was routed to the approval workflow, in coordinated universal time. It is stamped together with the submitting user in the same write, and neither can be set without the other or set twice. |
ApprovedBy | UserId | No | The user who took this amendment out of Pending - the approver who applied it, the approver who rejected it, or the user whose act closed it when the deal left the Approved status. On an application this user must differ from the amendment's author, which is the segregation-of-duties rule the workflow approval step enforces and this table enforces again. On a rejection the table does not repeat the test, because a rejection and an automatic withdrawal share one status value and the withdrawal is performed by the deal owner ending their own deal; the approver-is-author rule for a genuine rejection is enforced where every other Earmark segregation rule is, at the work-item action dispatcher. |
ApprovedDateTime | TransDateTime | No | When this amendment left Pending, in coordinated universal time. It is stamped together with the deciding user and the new status in one write, and none of the three can move without the other two - a status that moved with no record of who moved it is not evidence. |
WorkflowInstanceId | WorkflowInstanceId | No | The native workflow correlation identifier for this amendment's approval. It is what ties the amendment to its work items, its approval history and its escalation and delegation record, so that the approval story is told once, by the platform, rather than copied into Earmark's own columns. It is stamped when the amendment is submitted and never changes. |