Skip to main content

MGCEarmarkDealTarget

A targeting row says what a deal applies to, in the familiar Table / Group / Category / All grammar carried forward from the trade-agreement vocabulary and extended to every axis: item, account, inventory dimension and unit. The two axes carry different vocabularies and different types - the item axis offers Table, Group, Category and All, the account axis offers Table, Group and All, and the absence of Category from the account axis is a property of the type rather than a rule a writer could break. A deal needs at least one targeting row before it may be submitted. Within a deal the most specific matching row wins and resolution yields at most one winning row; across deals resolution is set-valued and every Approved deal with a matching row qualifies. Rows are configuration owned by a governed parent - they may be written only while their deal is in Planning. Requirements A4 and A5; rules BR-03 to BR-06.

Fields​

NameTypeMandatoryDescription
DealRefRecIdYesThe record reference to the Earmark deal this row targets for. The reference is stored as a record id because that is what joins cheaply and indexes well, and the deal ID is stored beside it because a record id alone is unreadable in an export, unusable in a data-management load and worthless after a migration. Deleting the deal cascades to its targeting rows, which is reachable only while the deal is in Planning. Table standard TDD-EAR-000 section 7.1; rule BR-16.
DealIdMGCEarmarkDealIdNoThe deal ID of the Earmark deal this row targets for, stored alongside the record reference as the readable half of the key. It is stamped from the parent deal when the row is written and is what a data-management export, a migration load or a support engineer reads. Table standard TDD-EAR-000 section 7.1.
LineNumLineNumNoThe display order of this targeting row within its deal, and the readable half of the row's natural key. Deal ID plus line number is what the targeting data entity imports against, because a record ID is meaningless in an export and worthless after a migration. The number is allocated by the row itself when a writer does not supply one, it is unique within the deal, and it never participates in resolution - precedence is decided by the four axes, then by priority, then by effective date, then by creation order. Requirement A4.
ItemSelectorMGCEarmarkItemSelectorNoHow this row selects products - a specific item (Table), an item group (Group), a category in the targeting category hierarchy (Category), or everything (All). The item axis is the only axis that carries Category, and Category rows resolve against the hierarchy named in Earmark parameters, which is why that parameter cannot be changed or cleared while any live deal carries a Category row. Precedence on this axis runs Table before Group before Category before All. Table is the default rather than All, deliberately: a row nobody finishes is refused for a missing relation rather than silently targeting the whole catalog. Requirements A1, A4 and A5; rule BR-04.
ItemRelationMGCEarmarkItemRelationNoThe item, item group or category name this row selects, read according to the item code. It holds up to 60 characters, which is wider than the native trade-agreement relation, because a merchandising category name does not fit in 20. It is mandatory for every item code except All, and it must be left empty when the item code is All - a row that claims to target everything and also names a relation is refusing to say what it means, so it is refused. On a Category row it is stamped from the category reference rather than typed. Changing the item code clears it, per axis and per row. Requirement A4; rules BR-04 and BR-05.
CategoryRecIdRefRecIdNoThe merchandising category this row selects, when the item code is Category. It must be a node of the targeting category hierarchy named in Earmark parameters, which is why that parameter cannot be changed or cleared while a live deal carries a Category row. The category reference is what the resolver matches on; the item relation beside it carries the category's name and is stamped from this reference rather than typed, so the readable half and the resolvable half of the row cannot disagree. It must be left empty on every row whose item code is not Category. Requirement A4.
AccountSelectorMGCEarmarkAccountSelectorNoHow this row selects counterparties - a specific customer or vendor account (Table), an account group (Group), or every account (All). Which side is read follows the deal's module. The account axis has no Category value at all: category targeting is an item-side concept, and the account side of a category-targeted deal resolves by item group. Precedence on this axis runs Table before Group before All. On an inventory deal the account axis carries no meaning and must be set to All. Requirements A4 and A5; rules BR-03 and BR-06.
AccountRelationMGCEarmarkAccountRelationNoThe customer, vendor or account group this row selects, read according to the account code and the deal's module. It holds up to 60 characters, matching the item relation beside it. It is mandatory for every account code except All, and it must be left empty when the account code is All. Changing the account code clears the relation, per axis and per row. Requirement A4; rules BR-03 and BR-05.
InventDimIdInventDimIdNoThe inventory dimension combination this row narrows to - a specific configuration, color, size, style, site or warehouse combination. Blank means the row matches any dimension combination, and that is the shipped default. Precedence treats a specified dimension as more specific than a blank one, so a dimension-bearing row outranks an otherwise identical row that leaves it blank. Requirements A4 and A5.
UnitSymbolUnitOfMeasureSymbolNoThe unit of measure this row applies to. Leaving it empty means any unit, and a row that names a unit is more specific than one that does not - the unit is the least significant of the four specificity axes, consulted only when item, account and inventory dimension have all tied. Requirements A4 and A5.
PriorityMGCEarmarkPriorityNoThe author's own tie-break between rows that are equally specific. It is consulted only after every axis has been compared, and a lower number wins. If priority is also equal the later effective-from date wins, and if that is equal too the row created first wins - so resolution is total and deterministic and never depends on the order rows happen to be read in. Requirement A5.
EffectiveFromTransDateNoThe first date this targeting row is live, within its deal's validity window. Leaving it blank means the row is live from the start of the deal's window. A stated date that falls before the deal's effective date is refused, because a targeting row can only ever narrow its deal's availability, never widen it. Requirement A4.
EffectiveToTransDateNoThe last date this targeting row is live, within its deal's validity window. Leaving it blank means the row is live to the end of the deal's window. A stated date after the deal's expiration date is refused, and the expiration must not fall before the row's own effective date. Requirement A4.
DlvModeCodeMGCEarmarkOriginSelectorNoWhether this targeting row's third-party carrier scope names one mode of delivery or every mode. Added by the vendor-shapes package (EAR-005, F-1) as the fifth targeting axis; defaults to All so a row written before this axis existed is unaffected until an operator deliberately narrows it.
DlvModeIdDlvModeIdNoThe mode of delivery this row is scoped to, when the selector is Table.
SpecificityRankMGCEarmarkSpecificityRankNoThe row's own specificity, computed from its four axes and stored so that the qualifying row recorded on an accrual instance can be compared and reported without re-deriving it. The formula is fixed and published, because other Earmark packages read this number: the item weight times a thousand, plus the account weight times a hundred, plus the dimension weight times ten, plus the unit weight - item Table 4, Group 3, Category 2, All 1; account Table 3, Group 2, All 1; a specified dimension or unit 2 against a blank one 1. A higher rank is more specific. The rank is stamped by the row itself on every write and a supplied value is discarded; comparing candidate rows, applying the tie-breaks and choosing the single winning row within a deal is the deal resolver's work and is implemented once, there. Requirement A5.