Documentation
¶
Overview ¶
Package reportschedule provides domain models for recurring report generation.
Index ¶
- type Recipient
- type ReportSchedule
- func (s *ReportSchedule) Activate()
- func (s *ReportSchedule) CreatedAt() time.Time
- func (s *ReportSchedule) CreatedBy() *shared.ID
- func (s *ReportSchedule) CronExpression() string
- func (s *ReportSchedule) Deactivate()
- func (s *ReportSchedule) DeliveryChannel() string
- func (s *ReportSchedule) Format() string
- func (s *ReportSchedule) ID() shared.ID
- func (s *ReportSchedule) IntegrationID() *shared.ID
- func (s *ReportSchedule) IsActive() bool
- func (s *ReportSchedule) LastRunAt() *time.Time
- func (s *ReportSchedule) LastStatus() string
- func (s *ReportSchedule) Name() string
- func (s *ReportSchedule) NextRunAt() *time.Time
- func (s *ReportSchedule) Options() map[string]any
- func (s *ReportSchedule) Recipients() []Recipient
- func (s *ReportSchedule) RecordRun(status string, nextRunAt *time.Time)
- func (s *ReportSchedule) ReportType() string
- func (s *ReportSchedule) RunCount() int
- func (s *ReportSchedule) SetCreatedBy(userID shared.ID)
- func (s *ReportSchedule) SetDelivery(channel string, integrationID *shared.ID)
- func (s *ReportSchedule) SetOptions(options map[string]any)
- func (s *ReportSchedule) SetRecipients(recipients []Recipient)
- func (s *ReportSchedule) TenantID() shared.ID
- func (s *ReportSchedule) Timezone() string
- func (s *ReportSchedule) Update(name, reportType, format, cron, timezone string)
- func (s *ReportSchedule) UpdatedAt() time.Time
- type Repository
- type ScheduleFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReportSchedule ¶
type ReportSchedule struct {
// contains filtered or unexported fields
}
ReportSchedule represents a recurring report delivery configuration.
func NewReportSchedule ¶
func NewReportSchedule(tenantID shared.ID, name, reportType, format, cron string) (*ReportSchedule, error)
NewReportSchedule creates a new schedule.
func ReconstituteReportSchedule ¶
func ReconstituteReportSchedule( id, tenantID shared.ID, name, reportType, format string, options map[string]any, recipients []Recipient, deliveryChannel string, integrationID *shared.ID, cronExpression, timezone string, isActive bool, lastRunAt, nextRunAt *time.Time, lastStatus string, runCount int, createdBy *shared.ID, createdAt, updatedAt time.Time, ) *ReportSchedule
ReconstituteReportSchedule creates from persisted data.
func (*ReportSchedule) Activate ¶
func (s *ReportSchedule) Activate()
Activate enables the schedule.
func (*ReportSchedule) CreatedAt ¶
func (s *ReportSchedule) CreatedAt() time.Time
func (*ReportSchedule) CreatedBy ¶
func (s *ReportSchedule) CreatedBy() *shared.ID
func (*ReportSchedule) CronExpression ¶
func (s *ReportSchedule) CronExpression() string
func (*ReportSchedule) Deactivate ¶
func (s *ReportSchedule) Deactivate()
Deactivate disables the schedule.
func (*ReportSchedule) DeliveryChannel ¶
func (s *ReportSchedule) DeliveryChannel() string
func (*ReportSchedule) Format ¶
func (s *ReportSchedule) Format() string
func (*ReportSchedule) IntegrationID ¶
func (s *ReportSchedule) IntegrationID() *shared.ID
func (*ReportSchedule) IsActive ¶
func (s *ReportSchedule) IsActive() bool
func (*ReportSchedule) LastRunAt ¶
func (s *ReportSchedule) LastRunAt() *time.Time
func (*ReportSchedule) LastStatus ¶
func (s *ReportSchedule) LastStatus() string
func (*ReportSchedule) Name ¶
func (s *ReportSchedule) Name() string
func (*ReportSchedule) NextRunAt ¶
func (s *ReportSchedule) NextRunAt() *time.Time
func (*ReportSchedule) Options ¶
func (s *ReportSchedule) Options() map[string]any
func (*ReportSchedule) Recipients ¶
func (s *ReportSchedule) Recipients() []Recipient
func (*ReportSchedule) RecordRun ¶
func (s *ReportSchedule) RecordRun(status string, nextRunAt *time.Time)
RecordRun updates after a scheduled run.
func (*ReportSchedule) ReportType ¶
func (s *ReportSchedule) ReportType() string
func (*ReportSchedule) RunCount ¶
func (s *ReportSchedule) RunCount() int
func (*ReportSchedule) SetCreatedBy ¶
func (s *ReportSchedule) SetCreatedBy(userID shared.ID)
SetCreatedBy sets the creator.
func (*ReportSchedule) SetDelivery ¶
func (s *ReportSchedule) SetDelivery(channel string, integrationID *shared.ID)
SetDelivery sets delivery configuration.
func (*ReportSchedule) SetOptions ¶
func (s *ReportSchedule) SetOptions(options map[string]any)
SetOptions sets report generation options.
func (*ReportSchedule) SetRecipients ¶
func (s *ReportSchedule) SetRecipients(recipients []Recipient)
SetRecipients sets delivery recipients.
func (*ReportSchedule) TenantID ¶
func (s *ReportSchedule) TenantID() shared.ID
func (*ReportSchedule) Timezone ¶
func (s *ReportSchedule) Timezone() string
func (*ReportSchedule) Update ¶
func (s *ReportSchedule) Update(name, reportType, format, cron, timezone string)
Update sets mutable fields.
func (*ReportSchedule) UpdatedAt ¶
func (s *ReportSchedule) UpdatedAt() time.Time
type Repository ¶
type Repository interface {
Create(ctx context.Context, schedule *ReportSchedule) error
GetByID(ctx context.Context, tenantID, id shared.ID) (*ReportSchedule, error)
Update(ctx context.Context, schedule *ReportSchedule) error
Delete(ctx context.Context, tenantID, id shared.ID) error
List(ctx context.Context, filter ScheduleFilter, page pagination.Pagination) (pagination.Result[*ReportSchedule], error)
ListDue(ctx context.Context, now time.Time) ([]*ReportSchedule, error)
}
Repository defines persistence for report schedules.
type ScheduleFilter ¶
ScheduleFilter defines criteria for listing schedules.