Decouple users from people

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2025-09-22 15:02:08 +02:00
parent 104330d3fd
commit 533822b60d
35 changed files with 296 additions and 872 deletions

View File

@@ -92,7 +92,6 @@ func (s *DocumentService) ExportPDF(
document := &coredata.Document{}
version := &coredata.DocumentVersion{}
owner := &coredata.People{}
publishedBy := &coredata.People{}
err := s.svc.pg.WithConn(
ctx,
@@ -109,12 +108,6 @@ func (s *DocumentService) ExportPDF(
return fmt.Errorf("cannot load latest published document version: %w", err)
}
if version.PublishedBy != nil {
if err := publishedBy.LoadByID(ctx, conn, s.svc.scope, *version.PublishedBy); err != nil {
return fmt.Errorf("cannot load published by person: %w", err)
}
}
if err := owner.LoadByID(ctx, conn, s.svc.scope, document.OwnerID); err != nil {
return fmt.Errorf("cannot load document owner: %w", err)
}
@@ -143,7 +136,6 @@ func (s *DocumentService) ExportPDF(
Approver: owner.FullName,
Description: version.Changelog,
PublishedAt: version.PublishedAt,
PublishedBy: publishedBy.FullName,
}
htmlContent, err := docgen.RenderHTML(docData)