hvp-shared 7.9.1 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -121,6 +121,18 @@ export type SubmitForReviewRequest = Record<string, never>;
121
121
  export interface PublishDocumentRequest {
122
122
  /** Required if publishing without prior in_review (audit trail). */
123
123
  changeNotes?: string;
124
+ /** Collaborator id that authored the content. Default: current user. */
125
+ elaboratedBy?: string;
126
+ /** ISO date the content was authored. Default: draft creation date or now. */
127
+ elaboratedAt?: string;
128
+ /** Collaborator id that reviewed/validated the content. Default: null. */
129
+ reviewedBy?: string;
130
+ /** ISO date of review. Default: now (only used when reviewedBy set). */
131
+ reviewedAt?: string;
132
+ /** Collaborator id that authorized the publication. Default: current user. */
133
+ authorizedBy?: string;
134
+ /** ISO date of authorization. Default: now. Used as the version's `authorizedAt`. */
135
+ authorizedAt?: string;
124
136
  }
125
137
  /**
126
138
  * Archive Document Request
@@ -7,6 +7,18 @@
7
7
  */
8
8
  import { ChangeType, ContentType, Criticality, DocumentStatus, DocumentType, ExternalLinkProvider, Purpose } from "../../constants/document.enums";
9
9
  import { DocumentAudienceEntry } from "./requests";
10
+ /**
11
+ * Compact reference to a document's current version, embedded in
12
+ * DocumentSummaryResponse so list views can show version + content-type info
13
+ * without a per-doc fetch.
14
+ */
15
+ export interface DocumentSummaryVersionRef {
16
+ versionNumber: string;
17
+ contentType: ContentType;
18
+ externalLinkProvider: ExternalLinkProvider | null;
19
+ /** Date the version was authorized — i.e. promoted to `current`. */
20
+ authorizedAt: string | null;
21
+ }
10
22
  /**
11
23
  * Public Document Response
12
24
  *
@@ -68,6 +80,13 @@ export interface DocumentSummaryResponse {
68
80
  status: DocumentStatus;
69
81
  criticality: Criticality;
70
82
  tags: string[];
83
+ audience: DocumentAudienceEntry[];
84
+ requiredForOnboarding: boolean;
85
+ requiresAcknowledgment: boolean;
86
+ /** Compact current-version data; null when the doc has no published version yet. */
87
+ currentVersion: DocumentSummaryVersionRef | null;
88
+ /** Collaborator id of the document author. Frontend resolves to col_code via Redux store. */
89
+ createdBy: string;
71
90
  updatedAt: string;
72
91
  /** Match snippet — only present in search responses. */
73
92
  snippet?: string;
@@ -78,8 +97,15 @@ export interface DocumentSummaryResponse {
78
97
  * Full version row. Returned by the viewer, version history, and
79
98
  * acknowledgment lookups.
80
99
  *
81
- * A version has a single meaningful date `publishedAt` — which is null while
82
- * the version is draft / in_review and set when it transitions to `current`.
100
+ * Three independent business-attribution axes per version (all may be set
101
+ * independently):
102
+ * - elaborated: who wrote the content + when ("Elaboró")
103
+ * - reviewed: who reviewed the content + when ("Revisó")
104
+ * - authorized: who authorized publication + when ("Autorizó / Validó")
105
+ *
106
+ * Versions do NOT carry system audit (`createdBy`, `createdAt`, etc.) because
107
+ * those would duplicate the business fields above. Forensic insertion timestamp
108
+ * remains derivable from the row's ObjectId.
83
109
  */
84
110
  export interface DocumentVersionResponse {
85
111
  id: string;
@@ -94,11 +120,15 @@ export interface DocumentVersionResponse {
94
120
  } | null;
95
121
  changeType: ChangeType;
96
122
  changeNotes: string | null;
97
- /** Set only when the version reached `current` (or was demoted to `superseded`). Null for draft / in_review. */
98
- publishedAt: string | null;
99
- publishedBy: string | null;
100
- /** Author of this version row (typically who started the draft). */
101
- createdBy?: string;
123
+ /** Author of the content. Defaults to the publisher on legacy versions. */
124
+ elaboratedBy: string | null;
125
+ elaboratedAt: string | null;
126
+ /** Reviewer (validó). Optional may stay null when no formal review happened. */
127
+ reviewedBy: string | null;
128
+ reviewedAt: string | null;
129
+ /** Authorizer of the publication (autorizó). Set when the version reaches `current`. */
130
+ authorizedBy: string | null;
131
+ authorizedAt: string | null;
102
132
  }
103
133
  /**
104
134
  * Document Acknowledgment Response
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hvp-shared",
3
- "version": "7.9.1",
3
+ "version": "8.0.0",
4
4
  "description": "Shared types and utilities for HVP backend and frontend",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",