Documentation
¶
Index ¶
- type ConsentService
- func (s *ConsentService) CreateConsentRecord(ctx context.Context, req models.CreateConsentRequest) (*models.ConsentResponseInternalView, error)
- func (s *ConsentService) GetConsentInternalView(ctx context.Context, consentID *string, ownerID *string, appID *string) (*models.ConsentResponseInternalView, error)
- func (s *ConsentService) GetConsentPortalView(ctx context.Context, consentID string, ownerID string) (*models.ConsentResponsePortalView, error)
- func (s *ConsentService) ListConsentsByOwner(ctx context.Context, ownerID string, statuses []models.ConsentStatus, ...) (*models.ListConsentsResponse, error)
- func (s *ConsentService) UpdateConsentStatusByPortalAction(ctx context.Context, req models.ConsentPortalActionRequest) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsentService ¶
type ConsentService struct {
// contains filtered or unexported fields
}
ConsentService provides business logic for consent operations
func NewConsentService ¶
func NewConsentService(db *gorm.DB, consentPortalBaseURL string) (*ConsentService, error)
NewConsentService creates a new consent service
func (*ConsentService) CreateConsentRecord ¶
func (s *ConsentService) CreateConsentRecord(ctx context.Context, req models.CreateConsentRequest) (*models.ConsentResponseInternalView, error)
CreateConsentRecord creates a new consent record in the database
func (*ConsentService) GetConsentInternalView ¶
func (s *ConsentService) GetConsentInternalView(ctx context.Context, consentID *string, ownerID *string, appID *string) (*models.ConsentResponseInternalView, error)
GetConsentInternalView retrieves a consent record by ID or by (ownerID AND appID) and returns its internal view
func (*ConsentService) GetConsentPortalView ¶
func (s *ConsentService) GetConsentPortalView(ctx context.Context, consentID string, ownerID string) (*models.ConsentResponsePortalView, error)
GetConsentPortalView retrieves a consent record by ID and returns its portal view. Ownership is verified against ownerID before any lazy-expiry write, so a caller can never mutate a consent that belongs to someone else.
func (*ConsentService) ListConsentsByOwner ¶ added in v0.5.0
func (s *ConsentService) ListConsentsByOwner(ctx context.Context, ownerID string, statuses []models.ConsentStatus, limit, offset int) (*models.ListConsentsResponse, error)
ListConsentsByOwner returns the owner's consent records (newest first), optionally filtered by status. Stale pending/approved records of the owner are expired first so the returned statuses are accurate.
func (*ConsentService) UpdateConsentStatusByPortalAction ¶
func (s *ConsentService) UpdateConsentStatusByPortalAction(ctx context.Context, req models.ConsentPortalActionRequest) error
UpdateConsentStatusByPortalAction updates the consent status based on user action from the consent portal