mirror of
https://github.com/luxfi/captable.git
synced 2026-10-30 17:01:02 +00:00
Merged from luxfi/transfer into captable for single-library TA engine: - pkg/voting: Proxy voting proposals, vote casting, quorum tracking, results aggregation (board elections, mergers, amendments) - pkg/comms: Investor communications — notices (proxy, dividend, regulatory, K-1), recipient tracking, delivery/read status - pkg/disclosure: Investor disclosures — PPM, subscription agreements, supplements, annual reports. Delivery + acknowledgment tracking. All follow captable's repository pattern (types.go + repository.go + service.go).
54 lines
1.3 KiB
Go
54 lines
1.3 KiB
Go
package disclosure
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"time"
|
|
)
|
|
|
|
// Service provides investor disclosure operations.
|
|
type Service struct {
|
|
repo Repository
|
|
}
|
|
|
|
func NewService(repo Repository) *Service {
|
|
return &Service{repo: repo}
|
|
}
|
|
|
|
// Create saves a new disclosure document.
|
|
func (s *Service) Create(ctx context.Context, d *Disclosure) error {
|
|
if d.Name == "" {
|
|
return fmt.Errorf("name required")
|
|
}
|
|
if d.CompanyID == "" {
|
|
return fmt.Errorf("company_id required")
|
|
}
|
|
if d.Type == "" {
|
|
return fmt.Errorf("type required")
|
|
}
|
|
if d.CreatedAt.IsZero() {
|
|
d.CreatedAt = time.Now().UTC()
|
|
}
|
|
return s.repo.Create(ctx, d)
|
|
}
|
|
|
|
// Get returns a disclosure by ID.
|
|
func (s *Service) Get(ctx context.Context, id string) (*Disclosure, error) {
|
|
return s.repo.Get(ctx, id)
|
|
}
|
|
|
|
// List returns disclosures matching the filter.
|
|
func (s *Service) List(ctx context.Context, filter DisclosureFilter) ([]*Disclosure, error) {
|
|
return s.repo.List(ctx, filter)
|
|
}
|
|
|
|
// Deliver marks a disclosure as delivered to a stakeholder.
|
|
func (s *Service) Deliver(ctx context.Context, id, stakeholderID string) error {
|
|
return s.repo.MarkDelivered(ctx, id, stakeholderID)
|
|
}
|
|
|
|
// Acknowledge marks a disclosure as acknowledged by a stakeholder.
|
|
func (s *Service) Acknowledge(ctx context.Context, id, stakeholderID string) error {
|
|
return s.repo.Acknowledge(ctx, id, stakeholderID)
|
|
}
|