|
| 1 | +/** |
| 2 | + * Schemas describing CMS CompletenessScore events |
| 3 | + * @packageDocumentation |
| 4 | + */ |
| 5 | + |
| 6 | +import { CmsContextModule } from "../Values/CmsContextModule" |
| 7 | +import { CmsActionType } from "." |
| 8 | + |
| 9 | +/** |
| 10 | + * Generic click event in the completeness score flow. |
| 11 | + * |
| 12 | + * @example |
| 13 | + * { |
| 14 | + * action: "click", |
| 15 | + * context_module: "Artworks - completeness score", |
| 16 | + * label: "view details", |
| 17 | + * artwork_ids: ["artwork1", "artwork2", "artwork3"] |
| 18 | + * } |
| 19 | + */ |
| 20 | +export type CmsCompletenessScoreClickLabel = |
| 21 | + | "view details" |
| 22 | + | "improve score" |
| 23 | + | "dismiss" |
| 24 | + |
| 25 | +export interface CmsCompletenessScoreClickedEvent { |
| 26 | + action: "click" |
| 27 | + context_module: CmsContextModule.completenessScore |
| 28 | + label: CmsCompletenessScoreClickLabel |
| 29 | + value?: string | number |
| 30 | + artwork_ids?: string[] |
| 31 | +} |
| 32 | + |
| 33 | +/** |
| 34 | + * Completeness score modal has been shown to a partner. |
| 35 | + * |
| 36 | + * @example |
| 37 | + * ``` |
| 38 | + * { |
| 39 | + * action: "shownCompletenessScoreModal", |
| 40 | + * context_module: "Artworks - completeness score", |
| 41 | + * artwork_id: "artwork123", |
| 42 | + * completeness_score: 75, |
| 43 | + * completeness_tier: "good", |
| 44 | + * checklist: [ |
| 45 | + * { completed: true, key: "title" }, |
| 46 | + * { completed: false, key: "description" } |
| 47 | + * ] |
| 48 | + * } |
| 49 | + * ``` |
| 50 | + */ |
| 51 | +export interface CmsCompletenessScoreModalShown { |
| 52 | + action: CmsActionType.shownCompletenessScoreModal |
| 53 | + context_module: CmsContextModule.completenessScore |
| 54 | + artwork_id: string |
| 55 | + completeness_score: number |
| 56 | + completeness_tier: string |
| 57 | + checklist: Array<{ completed: boolean; key: string }> |
| 58 | +} |
| 59 | + |
| 60 | +export type CmsCompletenessScoreFlow = |
| 61 | + | CmsCompletenessScoreClickedEvent |
| 62 | + | CmsCompletenessScoreModalShown |
0 commit comments