# TMF651 v4 Resource Mappings

Before using the TMF651 v4 resource mappings, refer to the following.

## Constraints and Limitations

### Agreement Specification

- The TMF resource `AgreementSpecification` is mapped to `DocumentTemplate` entity. This requires OrgPerm - DocGen and addon license DocGenDesigner.
- Following additional fields are used on the core `Contract` entity by enabling the ContractMgmt OrgPerm.
  - `ContractType`
  - `PreviousContract`
  - `ParentContract`
  - `name`
- The `name` in `AgreementSpecification` is unique. Two records with same name are stored with different version.
- The `version` in `AgreementSpecification` is auto-populated with increasing count for each unique name and is available in the GET method. The POST method does not support `version`.
- POST Method:
  - The `relatedParty` in `AgreementSpecification` is the owner. Only one `relatedParty` is supported in POST method.
  - The `relatedParty` in `AgreementSpecification` must be an existing user in the system. The user license must be `Salesforce`.
  - The `type` field Salesforce entity `DocumentTemplate` must have a picklist value of `Web`.
  - The `TokenMappingType` field in Salesforce entity `DocumentTemplate` must have a picklist value of `JSON`.
  - Validation only checks if the `attachment` and `relatedParty` (user) exists in the system.
  - The API user must have *CLM Admin User* and PSL *Contract Life Cycle Management User* permission set.
  - The `lifecycleStatus` value in the response is always `Draft`.
- Two or more `AgreementSpecification` cannot have same attachment.
- Attribute selection and filter is supported for first level attribute `name`.
- Filtering on the `name` is only with ‘Full word’. Prefix search is not supported.
- Attribute selection is supported for valid fields. In case invalid fields are provided then a list of all items with identifier is displayed.
- The `attachment` is patchable attribute. Non-patchable attributes are sent in the payload are ignored.

### Agreement

- To generate the `endDate` of a Contract/Agreement, include the attribute `agreementTerm`(term in months) in the POST payload. The response attribute `completionDate` will have the resulting `endDate` generated from `startDate` and `agreementTerm` attributes.
- Obligation `startDate` must be after the agreement `startDate`.
- These are patchable attributes: `description`, `engagedParty`, `associatedAgreement,`agreementSpecification`,`agreementItem\`
- Filtering is supported for attribute `name`. Full word search only is supported.
- Attribute selection is supported for `name`.

## Agreement Specification Resource

| TMF Field<div style="width:120px"></div> | TMF Type<div style="width:120px"></div> | TMF Definition<div style="width:120px"></div>                                                                                                       | Is Mandatory as per TMForum?<div style="width:120px"></div> | Is Supported?<div style="width:120px"></div> | Supported Methods <div style="width:190px">property</div>                                     | Salesforce Definition <div style="width:190px">property</div>   | Salesforce Mapping<div style="width:120px"></div> |
| ---------------------------------------- | --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- | -------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------- |
| href                                     | String                                  | Reference of the agreement specification                                                                                                            | No                                                          | Yes                                          | Not supported in PATCH, DELETE payloads. This is present in GET, POST response.               | URI of the DocumentTemplate                                     | -                                                 |
| id                                       | String                                  | Unique identifier of the agreement specification                                                                                                    | No                                                          | Yes                                          | Not supported in PATCH, DELETE payloads. This is present in GET, POST response.               | Unique identifier of the Salesforce DocumentTemplate record     | SF id                                             |
| lifecycleStatus                          | String                                  | Indicates the current lifecycle status                                                                                                              | No                                                          | Yes                                          | Picklist. This will have value of 'Draft' after POST.<br><br>Supported in GET, POST payloads. | Specifies the status of the document template                   | Status                                            |
| name                                     | String                                  | Name of the agreement specification                                                                                                                 | Yes                                                         | Yes                                          | Supported in GET, POST payloads.                                                              | Name of the DocumentTemplate                                    | Name                                              |
| @type                                    | String                                  | Type of TMF resource                                                                                                                                | No                                                          | Yes                                          | Not supported in GET, POST, PATCH, DELETE payloads. This is present in POST response.         | Type of the TMF Entity e.g. AgreementSpecification              | -                                                 |
| attachment                               | List                                    | An attachment by value or by reference. An attachment complements the description of an element, for example through a document, a video, a picture | Yes                                                         | Yes                                          | Minimum one attachment is required.<br><br>Supported in GET, POST, PATCH payloads.            | Specifies the Content Document associated with DocumentTemplate | Content Document Entity                           |
| relatedParty                             | List                                    | Related Entity reference. A related party defines party or party role linked to a specific entity                                                   | No                                                          | Yes                                          | Supported in GET, POST payloads.                                                              | Owner of the DocumentTemplate                                   | User                                              |

## Sub-resources

### attachment

| TMF Field<div style="width:120px"></div> | TMF Type<div style="width:120px"></div> | TMF Definition<div style="width:120px"></div>                                | Is Mandatory as per TMForum?<div style="width:120px"></div> | Is Supported?<div style="width:120px"></div> | Supported Methods<div style="width:120px"></div> | Salesforce Definition<div style="width:120px"></div> | Salesforce Mapping<div style="width:120px"></div> |
| ---------------------------------------- | --------------------------------------- | ---------------------------------------------------------------------------- | ----------------------------------------------------------- | -------------------------------------------- | ------------------------------------------------ | ---------------------------------------------------- | ------------------------------------------------- |
| attachmentType                           | String                                  | Attachment type such as video, picture.                                      | No                                                          | Yes                                          | Supported in GET response                        | Type of the ContentDocument                          | FileType                                          |
| href                                     | String                                  | URI for this Attachment                                                      | No                                                          | No                                           | Supported in GET response                        | URI of the ContentDocument                           |                                                   |
| id                                       | String                                  | Unique identifier for this particular attachment                             | Yes                                                         | Yes                                          | Supported in GET, POST, PATCH payloads.          | Id of the ContentDocument                            | SF id                                             |
| mimeType                                 | String                                  | Attachment mime type such as extension file for video, picture and document. | No                                                          | Yes                                          | Supported in GET response                        | Specifies the mimetype of the ContentDocument        | FileExtension                                     |
| name                                     | String                                  | The name of the attachment                                                   | No                                                          | Yes                                          | Supported in GET, POST payloads.                 | Title of the ContentDocument                         | Title                                             |

### relatedParty

| TMF Field<div style="width:120px"></div> | TMF Type<div style="width:120px"></div> | TMF Definition<div style="width:120px"></div> | Is Mandatory as per TMForum?<div style="width:120px"></div> | Is Supported?<div style="width:120px"></div> | Supported Methods<div style="width:120px"></div> | Salesforce Mapping<div style="width:120px"></div> |
| ---------------------------------------- | --------------------------------------- | --------------------------------------------- | ----------------------------------------------------------- | -------------------------------------------- | ------------------------------------------------ | ------------------------------------------------- |
| id                                       | String                                  | Unique identifier of a related entity         | No                                                          | Yes                                          | <br>Supported in GET, POST payloads.             | SF id of the user                                 |
| name                                     | String                                  | Reference of the related entity.              | No                                                          | Yes                                          | Supported in GET, POST payloads.                 | name of the User                                  |

## Agreement

| TMF Field<div style="width:120px"></div> | TMF Type<div style="width:120px"></div> | TMF Definition<div style="width:120px"></div>                                                               | Is Mandatory as per TMForum?<div style="width:120px"></div> | Is Supported?<div style="width:120px"></div> | Salesforce Mapping<div style="width:120px"></div>       | Salesforce Description<div style="width:120px"></div> |
| ---------------------------------------- | --------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- | -------------------------------------------- | ------------------------------------------------------- | ----------------------------------------------------- |
| agreementPeriod<br>- startDateTime       | TimePeriod                              | The time period during which the Agreement is in effect                                                     | No (Refer comments)                                         | Yes                                          | startDate                                               | Contract Period.                                      |
| agreementType                            | String                                  | The type of the agreement. For example commercial.                                                          | Yes                                                         | Yes                                          | Contract Type                                           | -                                                     |
| completionDate                           | TimePeriod                              | Date at which the agreement is completed.                                                                   | No                                                          | Yes                                          | EndDate                                                 | -                                                     |
| description                              | String                                  | Narrative that explains the agreement and details about the it , such as why the agreement is taking place. | No                                                          | No                                           | Description                                             | Description of the contract.                          |
| documentNumber                           | Integer                                 | -                                                                                                           | No                                                          | Yes                                          | ContractNumber                                          | Number of the contract.                               |
| href                                     | String                                  | -                                                                                                           | No                                                          | Yes                                          | -                                                       | -                                                     |
| id                                       | String                                  | -                                                                                                           | No                                                          | Yes                                          | Salesforce ID                                           | -                                                     |
| initialDate                              | DateTime                                | Date at which the agreement was initialized                                                                 | No                                                          | Yes                                          | CustomerSignedDate                                      | Date on which the customer signed the contract.       |
| name                                     | String                                  | -                                                                                                           | Yes                                                         | Yes                                          | name                                                    | -                                                     |
| statementOfIntent                        | String                                  | An overview and goals of the Agreement.                                                                     | No                                                          | Yes                                          | Description                                             | -                                                     |
| status                                   | String                                  | -                                                                                                           | No                                                          | Yes                                          | status                                                  | -                                                     |
| @type                                    | String                                  | -                                                                                                           | No                                                          | Yes                                          | -                                                       | -                                                     |
| associatedAgreement                      | List                                    | -                                                                                                           | No                                                          | Yes                                          | [AssociatedAgreement](#associatedagreement)             | ParentContractId                                      |
| agreementItem                            | List                                    | -                                                                                                           | Yes                                                         | Yes                                          | [ProductOffering](#productoffering)                     | -                                                     |
| agreementSpecifcation                    | Object                                  | -                                                                                                           | No                                                          | Yes                                          | [AgreementSpecificationRef](#agreementspecificationref) | -                                                     |
| engagedParty                             | List                                    | -                                                                                                           | Yes                                                         | Yes                                          | AccountID                                               | -                                                     |

**NOTE:** In order to generate endDate as part of agreementPeriod add the field `agreementTerm`(term in months) in POST payload. Salesforce will use this field and `startDate` fields to calculate and populate the field `completionDate`.

### AssociatedAgreement

| TMF Field<div style="width:120px"></div> | TMF Type<div style="width:120px"></div> | TMF Definition<div style="width:120px"></div> | Is Mandatory as per TMForum?<div style="width:120px"></div> | Salesforce Mapping<div style="width:120px"></div> |
| ---------------------------------------- | --------------------------------------- | --------------------------------------------- | ----------------------------------------------------------- | ------------------------------------------------- |
| id                                       | String                                  | Parent Contract of the current contract       | No                                                          | ParentContractId                                  |
| href                                     | String                                  | -                                             | No                                                          | -                                                 |
| name                                     | String                                  | -                                             | No                                                          | name                                              |
| @referredType                            | String                                  | -                                             | No                                                          | -                                                 |

### ProductOffering

This is mapped to Salesforce entity: Sales Contract Line.
A list of product offering references (ProductOfferingRef \[\*]). The list of product offerings referred by this agreement item.

| TMF Field<div style="width:120px"></div> | TMF Type<div style="width:120px"></div> | Is Mandatory as per TMForum?<div style="width:120px"></div> | Salesforce Mapping<div style="width:120px"></div> |
| ---------------------------------------- | --------------------------------------- | ----------------------------------------------------------- | ------------------------------------------------- |
| href                                     | String                                  | No                                                          | -                                                 |
| id                                       | String                                  | Yes                                                         | Product2Id                                        |
| name                                     | String                                  | Yes                                                         | Product2.name                                     |
| @referredType                            | String                                  | No                                                          | -                                                 |

### TermOrCondition

This is mapped to Salesforce entity: Obligation.
A list of agreement term or conditions (AgreementTermOrCondition \[\*]). Aspects of the agreement not formally specified elsewhere in the agreement and that cannot be captured elsewhere in a formal notation, or automatically monitored and require a more human level of management.

| TMF Field<div style="width:120px"></div> | TMF Type<div style="width:120px"></div> | Is Mandatory as per TMForum?<div style="width:120px"></div> | Salesforce Mapping<div style="width:120px"></div> |
| ---------------------------------------- | --------------------------------------- | ----------------------------------------------------------- | ------------------------------------------------- |
| validFor                                 | TimePeriod                              | No                                                          | EndDate, StartDate                                |
| id                                       | String                                  | No                                                          | name                                              |
| description                              | String                                  | No                                                          | Description                                       |

### AgreementSpecificationRef

This is mapped to Salesforce entity: DocumentTemplate.
An agreement specification reference (AgreementSpecificationRef). An AgreementSpecification represents a template of an agreement that can be used when establishing partnerships.

| TMF Field<div style="width:120px"></div> | TMF Type<div style="width:120px"></div> | Is Mandatory as per TMForum?<div style="width:120px"></div> | Salesforce Mapping<div style="width:120px"></div> |
| ---------------------------------------- | --------------------------------------- | ----------------------------------------------------------- | ------------------------------------------------- |
| id                                       | String                                  | No                                                          | Salesforce ID                                     |
| name                                     | String                                  | No                                                          | name                                              |
| @referredType                            | String                                  | No                                                          | -                                                 |

### engagedParty

This is mapped to Salesforce entity: Account (associated Account of the Contract).
A list of related parties (RelatedParty \[1..\*]). Related Entity reference. A related party defines party or party role linked to a specific entity.

| TMF Field<div style="width:120px"></div> | TMF Type<div style="width:120px"></div> | Is Mandatory as per TMForum?<div style="width:120px"></div> | Salesforce Mapping<div style="width:120px"></div> |
| ---------------------------------------- | --------------------------------------- | ----------------------------------------------------------- | ------------------------------------------------- |
| role                                     | String                                  | Yes                                                         | Type                                              |
| id                                       | String                                  | -                                                           | Salesforce ID of the account                      |
| href                                     | String                                  | -                                                           | -                                                 |
| name                                     | String                                  | Yes                                                         | name                                              |
| @referredType                            | String                                  | -                                                           | -                                                 |

NOTE: As the `role` field is a picklist, add configuration details for customer setup on what values must be used for initial setup.
