mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 02:30:55 +00:00
add contract hazard declaration, DO collection dates, and booking request currency migrations; implement article body diff component and integrate into contract revision timeline
This commit is contained in:
@@ -4,8 +4,9 @@ import type {
|
||||
} from './entities/contract.entity';
|
||||
|
||||
/**
|
||||
* One recorded change between two document snapshots. Granularity is per
|
||||
* article: a body edit is reported as "the body changed", not as a text diff.
|
||||
* One recorded change between two document snapshots. A body edit carries the
|
||||
* text on both sides so the audit trail shows WHAT was rewritten, not merely
|
||||
* that something was — the UI diffs the two strings for display.
|
||||
*/
|
||||
export type ContractDocumentChange =
|
||||
| { kind: 'ARTICLE_ADDED'; articleId: string; title: string }
|
||||
@@ -16,7 +17,14 @@ export type ContractDocumentChange =
|
||||
title: string;
|
||||
fromTitle: string;
|
||||
}
|
||||
| { kind: 'ARTICLE_BODY_CHANGED'; articleId: string; title: string }
|
||||
| {
|
||||
kind: 'ARTICLE_BODY_CHANGED';
|
||||
articleId: string;
|
||||
title: string;
|
||||
/** Body before / after the edit. Absent on revisions recorded earlier. */
|
||||
fromBody?: string;
|
||||
toBody?: string;
|
||||
}
|
||||
| {
|
||||
kind: 'ARTICLE_REORDERED';
|
||||
articleId: string;
|
||||
@@ -120,6 +128,8 @@ export function diffSnapshots(
|
||||
kind: 'ARTICLE_BODY_CHANGED',
|
||||
articleId: article.id,
|
||||
title: article.title,
|
||||
fromBody: previous.body,
|
||||
toBody: article.body,
|
||||
});
|
||||
}
|
||||
if (previous.order !== article.order) {
|
||||
|
||||
Reference in New Issue
Block a user