Upgrade to kit v0.3.0

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-04-03 10:56:06 +02:00
parent 8adf26ad20
commit f17fb7bf49
191 changed files with 1617 additions and 1617 deletions

View File

@@ -36,7 +36,7 @@ func (s AuditService) Get(
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
err := audit.LoadByID(ctx, conn, s.svc.scope, auditID)
if err != nil {
return fmt.Errorf("cannot load audit: %w", err)
@@ -61,7 +61,7 @@ func (s AuditService) GetByReportID(
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
err := audit.LoadByReportID(ctx, conn, s.svc.scope, reportID)
if err != nil {
return fmt.Errorf("cannot load audit: %w", err)
@@ -87,7 +87,7 @@ func (s AuditService) ListForOrganizationId(
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
filter := coredata.NewAuditTrustCenterFilter()
err := audits.LoadByOrganizationID(ctx, conn, s.svc.scope, organizationID, cursor, filter)
if err != nil {

View File

@@ -37,7 +37,7 @@ func (s ComplianceExternalURLService) ListForTrustCenterID(
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
err := items.LoadByTrustCenterID(ctx, conn, s.svc.scope, trustCenterID, cursor)
if err != nil {
return fmt.Errorf("cannot load compliance external URLs: %w", err)

View File

@@ -37,7 +37,7 @@ func (s ComplianceFrameworkService) ListByTrustCenterID(
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
err := complianceFrameworks.LoadByTrustCenterID(ctx, conn, s.svc.scope, trustCenterID, cursor)
if err != nil {
return fmt.Errorf("cannot load compliance frameworks: %w", err)

View File

@@ -54,7 +54,7 @@ func (s *DocumentService) ListForOrganizationId(
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
filter := coredata.NewDocumentTrustCenterFilter()
if err := documents.LoadPublishedByOrganizationID(ctx, conn, s.svc.scope, organizationID, cursor, filter); err != nil {
@@ -106,7 +106,7 @@ func (s DocumentService) Get(
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
err := document.LoadByID(ctx, conn, s.svc.scope, documentID)
if err != nil {
return fmt.Errorf("cannot load document: %w", err)
@@ -146,7 +146,7 @@ func (s *DocumentService) exportPDFData(
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
if err := document.LoadByID(ctx, conn, s.svc.scope, documentID); err != nil {
return fmt.Errorf("cannot load document: %w", err)
}
@@ -234,7 +234,7 @@ func (s *DocumentService) exportPDFData(
horizontalLogoBase64 := ""
if organization.HorizontalLogoFileID != nil {
fileRecord := &coredata.File{}
fileErr := s.svc.pg.WithConn(ctx, func(conn pg.Conn) error {
fileErr := s.svc.pg.WithConn(ctx, func(ctx context.Context, conn pg.Querier) error {
return fileRecord.LoadByID(ctx, conn, s.svc.scope, *organization.HorizontalLogoFileID)
})
if fileErr == nil {

View File

@@ -35,7 +35,7 @@ func (s FrameworkService) Get(
) (*coredata.Framework, error) {
framework := &coredata.Framework{}
err := s.svc.pg.WithConn(ctx, func(conn pg.Conn) error {
err := s.svc.pg.WithConn(ctx, func(ctx context.Context, conn pg.Querier) error {
err := framework.LoadByID(ctx, conn, s.svc.scope, frameworkID)
if err != nil {
return fmt.Errorf("cannot load framework: %w", err)
@@ -60,7 +60,7 @@ func (s FrameworkService) GenerateLightLogoURL(
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
framework := &coredata.Framework{}
if err := framework.LoadByID(ctx, conn, s.svc.scope, frameworkID); err != nil {
return fmt.Errorf("cannot load framework: %w", err)
@@ -102,7 +102,7 @@ func (s FrameworkService) GenerateDarkLogoURL(
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
framework := &coredata.Framework{}
if err := framework.LoadByID(ctx, conn, s.svc.scope, frameworkID); err != nil {
return fmt.Errorf("cannot load framework: %w", err)

View File

@@ -38,7 +38,7 @@ func (s OrganizationService) Get(
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
err := organization.LoadByID(
ctx,
conn,
@@ -68,7 +68,7 @@ func (s OrganizationService) GetOrganizationCustomDomain(
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
var org coredata.Organization
if err := org.LoadByID(ctx, conn, s.svc.scope, organizationID); err != nil {
return fmt.Errorf("cannot load organization: %w", err)
@@ -111,7 +111,7 @@ func (s OrganizationService) GenerateLogoURL(
file := &coredata.File{}
err = s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
return file.LoadByID(ctx, conn, s.svc.scope, *organization.LogoFileID)
},
)

View File

@@ -57,7 +57,7 @@ func (s ReportService) loadByID(
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
err := report.LoadByID(ctx, conn, s.svc.scope, reportID)
if err != nil {
return fmt.Errorf("cannot load report: %w", err)

View File

@@ -146,7 +146,7 @@ func (s *Service) Get(
err := s.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
err := trustCenter.LoadByID(ctx, conn, coredata.NewNoScope(), id)
if err != nil {
if errors.Is(err, coredata.ErrResourceNotFound) {
@@ -174,7 +174,7 @@ func (s *Service) GetBySlug(
err := s.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
err := trustCenter.LoadBySlug(ctx, conn, slug)
if err != nil {
if errors.Is(err, coredata.ErrResourceNotFound) {
@@ -199,7 +199,7 @@ func (s *Service) GetByDomainName(ctx context.Context, domain string) (*coredata
err := s.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
var customDomain coredata.CustomDomain
if err := customDomain.LoadByDomain(ctx, conn, coredata.NewNoScope(), domain); err != nil {
if errors.Is(err, coredata.ErrResourceNotFound) {
@@ -243,7 +243,7 @@ func (s *Service) GetCustomDomainByOrganizationID(ctx context.Context, organizat
err := s.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
return customDomain.LoadByOrganizationID(ctx, conn, coredata.NewNoScope(), organizationID)
},
)
@@ -264,7 +264,7 @@ func (s *Service) GetCustomDomainByOrganizationID(ctx context.Context, organizat
func (s *Service) EmailPresenterConfigByOrganizationID(ctx context.Context, orgID gid.GID) (emails.PresenterConfig, error) {
var trustCenter coredata.TrustCenter
scope := coredata.NewScopeFromObjectID(orgID)
err := s.pg.WithConn(ctx, func(conn pg.Conn) error {
err := s.pg.WithConn(ctx, func(ctx context.Context, conn pg.Querier) error {
return trustCenter.LoadByOrganizationID(ctx, conn, scope, orgID)
})
if err != nil {
@@ -286,7 +286,7 @@ func (s *Service) GetOrganizationByTrustCenterID(
err = s.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
return org.LoadByID(ctx, conn, coredata.NewNoScope(), trustCenter.OrganizationID)
},
)
@@ -302,7 +302,7 @@ func (s *Service) GetMembershipByCompliancePageIDAndIdentityID(ctx context.Conte
err := s.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
return membership.LoadByTrustCenterIDAndIdentityID(
ctx,
conn,
@@ -334,7 +334,7 @@ func (s *Service) GetNDAFile(
err := s.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
trustCenter := &coredata.TrustCenter{}
if err := trustCenter.LoadByID(ctx, conn, scope, compliancePageID); err != nil {
return fmt.Errorf("cannot load trust center: %w", err)
@@ -376,7 +376,7 @@ func (s *Service) ProvisionMember(
err := s.pg.WithTx(
ctx,
func(tx pg.Conn) error {
func(ctx context.Context, tx pg.Tx) error {
compliancePage := &coredata.TrustCenter{}
if err := compliancePage.LoadByID(ctx, tx, scope, compliancePageID); err != nil {
return fmt.Errorf("cannot load trust center: %w", err)

View File

@@ -60,7 +60,7 @@ func (s TrustCenterAccessService) Request(
err := s.svc.pg.WithTx(
ctx,
func(tx pg.Conn) error {
func(ctx context.Context, tx pg.Tx) error {
trustCenter := &coredata.TrustCenter{}
if err := trustCenter.LoadByID(ctx, tx, s.svc.scope, req.TrustCenterID); err != nil {
return fmt.Errorf("cannot load trust center: %w", err)
@@ -192,7 +192,7 @@ func (s TrustCenterAccessService) GetAccess(
) (coredata.TrustCenterAccess, error) {
var access coredata.TrustCenterAccess
err := s.svc.pg.WithConn(ctx, func(conn pg.Conn) error {
err := s.svc.pg.WithConn(ctx, func(ctx context.Context, conn pg.Querier) error {
return access.LoadByTrustCenterIDAndIdentityID(ctx, conn, s.svc.scope, trustCenterID, identityID)
})
@@ -207,7 +207,7 @@ func (s TrustCenterAccessService) GetDocumentAccess(
) (*coredata.TrustCenterDocumentAccess, error) {
var documentAccess *coredata.TrustCenterDocumentAccess
err := s.svc.pg.WithConn(ctx, func(conn pg.Conn) error {
err := s.svc.pg.WithConn(ctx, func(ctx context.Context, conn pg.Querier) error {
access := &coredata.TrustCenterAccess{}
err := access.LoadByTrustCenterIDAndIdentityID(ctx, conn, s.svc.scope, trustCenterID, identityID)
if err != nil {
@@ -257,7 +257,7 @@ func (s TrustCenterAccessService) GetReportAccess(
) (*coredata.TrustCenterDocumentAccess, error) {
var reportAccess *coredata.TrustCenterDocumentAccess
err := s.svc.pg.WithConn(ctx, func(conn pg.Conn) error {
err := s.svc.pg.WithConn(ctx, func(ctx context.Context, conn pg.Querier) error {
access := &coredata.TrustCenterAccess{}
err := access.LoadByTrustCenterIDAndIdentityID(ctx, conn, s.svc.scope, trustCenterID, identityID)
if err != nil {
@@ -307,7 +307,7 @@ func (s TrustCenterAccessService) GetTrustCenterFileAccess(
) (*coredata.TrustCenterDocumentAccess, error) {
var fileAccess *coredata.TrustCenterDocumentAccess
err := s.svc.pg.WithConn(ctx, func(conn pg.Conn) error {
err := s.svc.pg.WithConn(ctx, func(ctx context.Context, conn pg.Querier) error {
access := &coredata.TrustCenterAccess{}
err := access.LoadByTrustCenterIDAndIdentityID(ctx, conn, s.svc.scope, trustCenterID, identityID)
if err != nil {
@@ -357,7 +357,7 @@ func (s *TrustCenterAccessService) GrantByIDs(
reportIDs []gid.GID,
fileIDs []gid.GID,
) error {
return s.svc.pg.WithTx(ctx, func(tx pg.Conn) error {
return s.svc.pg.WithTx(ctx, func(ctx context.Context, tx pg.Tx) error {
trustCenter := &coredata.TrustCenter{}
if err := trustCenter.LoadByOrganizationID(ctx, tx, s.svc.scope, organizationID); err != nil {
return fmt.Errorf("cannot load trust center: %w", err)
@@ -419,7 +419,7 @@ func (s *TrustCenterAccessService) GrantByIDs(
})
}
func (s *TrustCenterAccessService) sendAccessEmail(ctx context.Context, tx pg.Conn, access *coredata.TrustCenterAccess, profile *coredata.MembershipProfile) error {
func (s *TrustCenterAccessService) sendAccessEmail(ctx context.Context, tx pg.Tx, access *coredata.TrustCenterAccess, profile *coredata.MembershipProfile) error {
organization := &coredata.Organization{}
if err := organization.LoadByID(ctx, tx, s.svc.scope, access.OrganizationID); err != nil {
return fmt.Errorf("cannot load organization: %w", err)
@@ -469,7 +469,7 @@ func (s *TrustCenterAccessService) RejectOrRevokeByIDs(
reportIDs []gid.GID,
fileIDs []gid.GID,
) error {
return s.svc.pg.WithTx(ctx, func(tx pg.Conn) error {
return s.svc.pg.WithTx(ctx, func(ctx context.Context, tx pg.Tx) error {
trustCenter := &coredata.TrustCenter{}
if err := trustCenter.LoadByOrganizationID(ctx, tx, s.svc.scope, organizationID); err != nil {
return fmt.Errorf("cannot load trust center: %w", err)
@@ -524,7 +524,7 @@ func (s *TrustCenterAccessService) RejectOrRevokeByIDs(
func (s *TrustCenterAccessService) sendDocumentAccessRejectedEmail(
ctx context.Context,
tx pg.Conn,
tx pg.Tx,
access *coredata.TrustCenterAccess,
profile *coredata.MembershipProfile,
documentIDs []gid.GID,

View File

@@ -41,7 +41,7 @@ func (s *TrustCenterFileService) Get(
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
err := trustCenterFile.LoadByID(ctx, conn, s.svc.scope, trustCenterFileID)
if err != nil {
return fmt.Errorf("cannot load trust center file: %w", err)
@@ -76,7 +76,7 @@ func (s *TrustCenterFileService) ListForOrganizationId(
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
err := trustCenterFiles.LoadByOrganizationID(ctx, conn, s.svc.scope, organizationID, cursor, filter)
if err != nil {
return fmt.Errorf("cannot load trust center files: %w", err)
@@ -128,7 +128,7 @@ func (s *TrustCenterFileService) exportFileData(
var trustCenterFile *coredata.TrustCenterFile
var file *coredata.File
err := s.svc.pg.WithConn(ctx, func(conn pg.Conn) error {
err := s.svc.pg.WithConn(ctx, func(ctx context.Context, conn pg.Querier) error {
trustCenterFile = &coredata.TrustCenterFile{}
if err := trustCenterFile.LoadByID(ctx, conn, s.svc.scope, trustCenterFileID); err != nil {
return fmt.Errorf("cannot load trust center file: %w", err)

View File

@@ -38,7 +38,7 @@ func (s TrustCenterReferenceService) ListForTrustCenterID(
) (*page.Page[*coredata.TrustCenterReference, coredata.TrustCenterReferenceOrderField], error) {
var references coredata.TrustCenterReferences
err := s.svc.pg.WithConn(ctx, func(conn pg.Conn) error {
err := s.svc.pg.WithConn(ctx, func(ctx context.Context, conn pg.Querier) error {
err := references.LoadByTrustCenterID(ctx, conn, s.svc.scope, trustCenterID, cursor)
if err != nil {
return fmt.Errorf("cannot load trust center references: %w", err)
@@ -61,7 +61,7 @@ func (s TrustCenterReferenceService) GenerateLogoURL(
) (string, error) {
reference := &coredata.TrustCenterReference{}
file := &coredata.File{}
err := s.svc.pg.WithTx(ctx, func(tx pg.Conn) error {
err := s.svc.pg.WithTx(ctx, func(ctx context.Context, tx pg.Tx) error {
err := reference.LoadByID(ctx, tx, s.svc.scope, referenceID)
if err != nil {
return fmt.Errorf("cannot load trust center reference: %w", err)
@@ -108,7 +108,7 @@ func (s TrustCenterReferenceService) Get(
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
err := reference.LoadByID(ctx, conn, s.svc.scope, referenceID)
if err != nil {
return fmt.Errorf("cannot load trust center reference: %w", err)

View File

@@ -39,7 +39,7 @@ func (s TrustCenterService) Get(
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
trustCenter = &coredata.TrustCenter{}
if err := trustCenter.LoadByID(ctx, conn, s.svc.scope, trustCenterID); err != nil {
return fmt.Errorf("cannot load trust center: %w", err)
@@ -64,7 +64,7 @@ func (s TrustCenterService) GetByOrganizationID(
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
err := trustCenter.LoadByOrganizationID(ctx, conn, s.svc.scope, organizationID)
if err != nil {
return fmt.Errorf("cannot load trust center: %w", err)
@@ -89,7 +89,7 @@ func (s TrustCenterService) GetNDAFile(
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
trustCenter := &coredata.TrustCenter{}
if err := trustCenter.LoadByID(ctx, conn, s.svc.scope, trustCenterID); err != nil {
return fmt.Errorf("cannot load trust center: %w", err)
@@ -123,7 +123,7 @@ func (s TrustCenterService) GenerateNDAFileURL(
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
trustCenter := &coredata.TrustCenter{}
if err := trustCenter.LoadByID(ctx, conn, s.svc.scope, trustCenterID); err != nil {
return fmt.Errorf("cannot load trust center: %w", err)
@@ -163,7 +163,7 @@ func (s TrustCenterService) GenerateLogoURL(
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
if err := compliancePage.LoadByID(ctx, conn, s.svc.scope, compliancePageID); err != nil {
return fmt.Errorf("cannot load compliance page: %w", err)
}
@@ -209,7 +209,7 @@ func (s TrustCenterService) GenerateDarkLogoURL(
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
if err := compliancePage.LoadByID(ctx, conn, s.svc.scope, compliancePageID); err != nil {
return fmt.Errorf("cannot load compliance page: %w", err)
}
@@ -258,7 +258,7 @@ func (s *TrustCenterService) EmailPresenterConfig(ctx context.Context, complianc
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
if err := compliancePage.LoadByID(ctx, conn, scope, compliancePageID); err != nil {
return fmt.Errorf("cannot load compliance page: %w", err)
}
@@ -342,7 +342,7 @@ func (s *TrustCenterService) GetMailingList(
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
trustCenter := &coredata.TrustCenter{}
if err := trustCenter.LoadByID(ctx, conn, s.svc.scope, trustCenterID); err != nil {
return fmt.Errorf("cannot load trust center: %w", err)

View File

@@ -36,7 +36,7 @@ func (s VendorService) Get(
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
err := vendor.LoadByID(ctx, conn, s.svc.scope, vendorID)
if err != nil {
return fmt.Errorf("cannot load vendor: %w", err)
@@ -62,7 +62,7 @@ func (s VendorService) ListForOrganizationId(
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
func(ctx context.Context, conn pg.Querier) error {
showOnTrustCenter := true
var nilSnapshotID *gid.GID = nil
filter := coredata.NewVendorFilter(&nilSnapshotID, &showOnTrustCenter)
@@ -91,7 +91,7 @@ func (s VendorService) CountForTrustCenterId(
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) (err error) {
func(ctx context.Context, conn pg.Querier) (err error) {
trustCenter, err := s.svc.TrustCenters.Get(ctx, trustCenterID)
if err != nil {
return fmt.Errorf("cannot load trust center: %w", err)