Add document approval workflow

Introduce a complete approval system for document publishing. Document
versions can now require approval from selected reviewers before being
published, with automatic publishing once all approvers have approved.

- Add approval quorum and decision tables with backfill migration
- Implement request approval, approve, and reject flows with electronic
  signature support for approve decisions
- Add employee approvals page with dedicated tab and pending approvals view
- Add changelog field to publish and request approval flows
- Pre-select previous version's approvers in the publish dialog
- Show quorum approvers in document list with 100 approver hard limit
- Expose approval workflow through GraphQL, MCP, and CLI
- Remove legacy default approvers feature entirely
- Add comprehensive e2e test coverage for approval workflows

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2026-03-27 17:22:54 +01:00
parent 4a2d308da0
commit 999171a626
78 changed files with 6483 additions and 1600 deletions

View File

@@ -824,7 +824,7 @@ func (b *MeetingBuilder) Create() string {
return CreateMeeting(b.client, b.attrs)
}
func CreateDocument(c *testutil.Client, approverID string, attrs ...Attrs) string {
func CreateDocument(c *testutil.Client, attrs ...Attrs) string {
c.T.Helper()
var a Attrs
@@ -844,7 +844,6 @@ func CreateDocument(c *testutil.Client, approverID string, attrs ...Attrs) strin
input := map[string]any{
"organizationId": c.GetOrganizationID().String(),
"approverIds": []string{approverID},
"title": a.getString("title", SafeName("Document")),
"content": a.getString("content", "Document content"),
"documentType": a.getString("documentType", "POLICY"),
@@ -868,13 +867,12 @@ func CreateDocument(c *testutil.Client, approverID string, attrs ...Attrs) strin
}
type DocumentBuilder struct {
client *testutil.Client
approverID string
attrs Attrs
client *testutil.Client
attrs Attrs
}
func NewDocument(c *testutil.Client, approverID string) *DocumentBuilder {
return &DocumentBuilder{client: c, approverID: approverID, attrs: Attrs{}}
func NewDocument(c *testutil.Client) *DocumentBuilder {
return &DocumentBuilder{client: c, attrs: Attrs{}}
}
func (b *DocumentBuilder) WithTitle(title string) *DocumentBuilder {
@@ -898,7 +896,7 @@ func (b *DocumentBuilder) WithClassification(classification string) *DocumentBui
}
func (b *DocumentBuilder) Create() string {
return CreateDocument(b.client, b.approverID, b.attrs)
return CreateDocument(b.client, b.attrs)
}
func CreateProcessingActivity(c *testutil.Client, attrs ...Attrs) string {