Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/1294 add documentation of retention policy and upgrade test cases #1865

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion @types/lib/metadataTypes/DataExtension.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions lib/metadataTypes/DataExtension.js
Original file line number Diff line number Diff line change
Expand Up @@ -1286,6 +1286,35 @@ class DataExtension extends MetadataType {
if (json.r__dataExtensionTemplate_name) {
output += `**Template:** ${json.r__dataExtensionTemplate_name}\n\n`;
}
// Retention
output += `**Retention Policy:** ${json.c__retentionPolicy}\n\n`;
switch (json.c__retentionPolicy) {
case 'allRecords':
case 'allRecordsAndDataextension': {
if (json.DataRetentionPeriodLength) {
// if period length was selected, show it plus the optional reset-on-import; the retain-until date IS returned by the api but does not matter for documentation
output += `- **Retention Period:** ${json.DataRetentionPeriodLength} ${json.c__dataRetentionPeriodUnitOfMeasure}\n`;
output += `- **Reset Retention Period on import:** ${json.ResetRetentionPeriodOnImport ? 'yes' : 'no'}\n`;
} else {
// if a date was selected instead, the GUI auto-deselects reset-on-import
output += `- **Retain Until:** ${json.c__retainUntil}\n`;
}
// add empty line after retention:
output += `\n`;
break;
}
case 'individialRecords': {
output += `- **Retention Period:** ${json.DataRetentionPeriodLength} ${json.c__dataRetentionPeriodUnitOfMeasure}\n`;
output += `- **Reset Retention Period on import:** ${json.ResetRetentionPeriodOnImport ? 'yes' : 'no'}\n`;
// add empty line after retention:
output += `\n`;
break;
}
case 'none': {
// nothing else to do
break;
}
}

let tableSeparator = '';
for (const column of tabled[0]) {
Expand Down
5 changes: 5 additions & 0 deletions test/resources/1111111/dataExtension/retrieve-expected.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

**Testable:** Yes

**Retention Policy:** individialRecords

- **Retention Period:** 6 Months
- **Reset Retention Period on import:** no

| Name | FieldType | MaxLength | IsPrimaryKey | IsNullable | DefaultValue |
| --- | --- | --- | --- | --- | --- |
| FirstName | Text | 50 | - | + | |
Expand Down
5 changes: 5 additions & 0 deletions test/resources/9999999/dataExtension/retrieve-expected.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

**Testable:** Yes

**Retention Policy:** allRecords

- **Retention Period:** 6 Months
- **Reset Retention Period on import:** no

| Name | FieldType | MaxLength | IsPrimaryKey | IsNullable | DefaultValue |
| --- | --- | --- | --- | --- | --- |
| FirstName | Text | 50 | - | + | |
Expand Down
Loading