admin

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2025 License: AGPL-3.0, AGPL-3.0-or-later Imports: 8 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: AGPL-3.0-or-later

SPDX-License-Identifier: AGPL-3.0-or-later

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddExpectedSignerRequest

type AddExpectedSignerRequest struct {
	Email string  `json:"email"`
	Name  string  `json:"name"`
	Notes *string `json:"notes,omitempty"`
}

AddExpectedSignerRequest represents the request body for adding an expected signer

type CreateWebhookRequest

type CreateWebhookRequest struct {
	Title       string            `json:"title"`
	TargetURL   string            `json:"targetUrl"`
	Secret      string            `json:"secret"`
	Active      bool              `json:"active"`
	Events      []string          `json:"events"`
	Headers     map[string]string `json:"headers,omitempty"`
	Description string            `json:"description,omitempty"`
}

type DocumentResponse

type DocumentResponse struct {
	DocID             string `json:"docId"`
	Title             string `json:"title"`
	URL               string `json:"url"`
	Checksum          string `json:"checksum,omitempty"`
	ChecksumAlgorithm string `json:"checksumAlgorithm,omitempty"`
	Description       string `json:"description"`
	CreatedAt         string `json:"createdAt"`
	UpdatedAt         string `json:"updatedAt"`
	CreatedBy         string `json:"createdBy"`
}

DocumentResponse represents a document in API responses

type DocumentStatsResponse

type DocumentStatsResponse struct {
	DocID          string  `json:"docId"`
	ExpectedCount  int     `json:"expectedCount"`
	SignedCount    int     `json:"signedCount"`
	PendingCount   int     `json:"pendingCount"`
	CompletionRate float64 `json:"completionRate"`
}

DocumentStatsResponse represents document statistics

type DocumentStatusResponse

type DocumentStatusResponse struct {
	DocID                string                         `json:"docId"`
	Document             *DocumentResponse              `json:"document,omitempty"`
	ExpectedSigners      []*ExpectedSignerResponse      `json:"expectedSigners"`
	UnexpectedSignatures []*UnexpectedSignatureResponse `json:"unexpectedSignatures"`
	Stats                *DocumentStatsResponse         `json:"stats"`
	ReminderStats        *ReminderStatsResponse         `json:"reminderStats,omitempty"`
	ShareLink            string                         `json:"shareLink"`
}

DocumentStatusResponse represents complete document status including everything

type ExpectedSignerResponse

type ExpectedSignerResponse struct {
	ID                    int64   `json:"id"`
	DocID                 string  `json:"docId"`
	Email                 string  `json:"email"`
	Name                  string  `json:"name"`
	AddedAt               string  `json:"addedAt"`
	AddedBy               string  `json:"addedBy"`
	Notes                 *string `json:"notes,omitempty"`
	HasSigned             bool    `json:"hasSigned"`
	SignedAt              *string `json:"signedAt,omitempty"`
	UserName              *string `json:"userName,omitempty"`
	LastReminderSent      *string `json:"lastReminderSent,omitempty"`
	ReminderCount         int     `json:"reminderCount"`
	DaysSinceAdded        int     `json:"daysSinceAdded"`
	DaysSinceLastReminder *int    `json:"daysSinceLastReminder,omitempty"`
}

ExpectedSignerResponse represents an expected signer in API responses

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler handles admin API requests

func NewHandler

func NewHandler(documentRepo documentRepository, expectedSignerRepo expectedSignerRepository, reminderService reminderService, signatureService signatureService, baseURL string) *Handler

NewHandler creates a new admin handler

func (*Handler) HandleAddExpectedSigner

func (h *Handler) HandleAddExpectedSigner(w http.ResponseWriter, r *http.Request)

HandleAddExpectedSigner handles POST /api/v1/admin/documents/{docId}/signers

func (*Handler) HandleDeleteDocument

func (h *Handler) HandleDeleteDocument(w http.ResponseWriter, r *http.Request)

HandleDeleteDocument handles DELETE /api/v1/admin/documents/{docId}

func (*Handler) HandleGetDocument

func (h *Handler) HandleGetDocument(w http.ResponseWriter, r *http.Request)

HandleGetDocument handles GET /api/v1/admin/documents/{docId}

func (*Handler) HandleGetDocumentStatus

func (h *Handler) HandleGetDocumentStatus(w http.ResponseWriter, r *http.Request)

HandleGetDocumentStatus handles GET /api/v1/admin/documents/{docId}/status

func (*Handler) HandleGetDocumentWithSigners

func (h *Handler) HandleGetDocumentWithSigners(w http.ResponseWriter, r *http.Request)

HandleGetDocumentWithSigners handles GET /api/v1/admin/documents/{docId}/signers

func (*Handler) HandleGetReminderHistory

func (h *Handler) HandleGetReminderHistory(w http.ResponseWriter, r *http.Request)

HandleGetReminderHistory handles GET /api/v1/admin/documents/{docId}/reminders

func (*Handler) HandleListDocuments

func (h *Handler) HandleListDocuments(w http.ResponseWriter, r *http.Request)

HandleListDocuments handles GET /api/v1/admin/documents

func (*Handler) HandleRemoveExpectedSigner

func (h *Handler) HandleRemoveExpectedSigner(w http.ResponseWriter, r *http.Request)

HandleRemoveExpectedSigner handles DELETE /api/v1/admin/documents/{docId}/signers/{email}

func (*Handler) HandleSendReminders

func (h *Handler) HandleSendReminders(w http.ResponseWriter, r *http.Request)

HandleSendReminders handles POST /api/v1/admin/documents/{docId}/reminders

func (*Handler) HandleUpdateDocumentMetadata

func (h *Handler) HandleUpdateDocumentMetadata(w http.ResponseWriter, r *http.Request)

HandleUpdateDocumentMetadata handles PUT /api/v1/admin/documents/{docId}/metadata

type ReminderLogResponse

type ReminderLogResponse struct {
	ID             int64   `json:"id"`
	DocID          string  `json:"docId"`
	RecipientEmail string  `json:"recipientEmail"`
	SentAt         string  `json:"sentAt"`
	SentBy         string  `json:"sentBy"`
	TemplateUsed   string  `json:"templateUsed"`
	Status         string  `json:"status"`
	ErrorMessage   *string `json:"errorMessage,omitempty"`
}

ReminderLogResponse represents a reminder log entry in API responses

type ReminderStatsResponse

type ReminderStatsResponse struct {
	TotalSent    int     `json:"totalSent"`
	PendingCount int     `json:"pendingCount"`
	LastSentAt   *string `json:"lastSentAt,omitempty"`
}

ReminderStatsResponse represents reminder statistics

type SendRemindersRequest

type SendRemindersRequest struct {
	Emails []string `json:"emails,omitempty"` // If empty, send to all pending signers
}

SendRemindersRequest represents the request body for sending reminders

type UnexpectedSignatureResponse

type UnexpectedSignatureResponse struct {
	UserEmail   string  `json:"userEmail"`
	UserName    *string `json:"userName,omitempty"`
	SignedAtUTC string  `json:"signedAtUTC"`
}

UnexpectedSignatureResponse represents an unexpected signature

type UpdateDocumentMetadataRequest

type UpdateDocumentMetadataRequest struct {
	Title             *string `json:"title,omitempty"`
	URL               *string `json:"url,omitempty"`
	Checksum          *string `json:"checksum,omitempty"`
	ChecksumAlgorithm *string `json:"checksumAlgorithm,omitempty"`
	Description       *string `json:"description,omitempty"`
}

UpdateDocumentMetadataRequest represents the request body for updating document metadata

type WebhooksHandler

type WebhooksHandler struct {
	// contains filtered or unexported fields
}

WebhooksHandler groups operations on webhooks

func NewWebhooksHandler

func NewWebhooksHandler(repo webhookRepository, deliveries webhookDeliveryRepository) *WebhooksHandler

func (*WebhooksHandler) HandleCreateWebhook

func (h *WebhooksHandler) HandleCreateWebhook(w http.ResponseWriter, r *http.Request)

func (*WebhooksHandler) HandleDeleteWebhook

func (h *WebhooksHandler) HandleDeleteWebhook(w http.ResponseWriter, r *http.Request)

func (*WebhooksHandler) HandleGetWebhook

func (h *WebhooksHandler) HandleGetWebhook(w http.ResponseWriter, r *http.Request)

func (*WebhooksHandler) HandleListDeliveries

func (h *WebhooksHandler) HandleListDeliveries(w http.ResponseWriter, r *http.Request)

func (*WebhooksHandler) HandleListWebhooks

func (h *WebhooksHandler) HandleListWebhooks(w http.ResponseWriter, r *http.Request)

func (*WebhooksHandler) HandleToggleWebhook

func (h *WebhooksHandler) HandleToggleWebhook(w http.ResponseWriter, r *http.Request)

func (*WebhooksHandler) HandleUpdateWebhook

func (h *WebhooksHandler) HandleUpdateWebhook(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL