export

package
v1.0.49 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompleteTaskInput

type CompleteTaskInput struct {
	TaskID      string
	TenantID    string
	EnvID       string
	UserID      string
	FileURL     string
	RecordCount int
	FileSize    int64
}

CompleteTaskInput represents input for completing a task

type CreateTaskInput

type CreateTaskInput struct {
	TaskID          string // Pre-generated task ID
	WorkflowID      string // Temporal workflow ID
	ScheduledTaskID string
	TenantID        string
	EnvID           string
	UserID          string // User who triggered the export (empty for scheduled runs)
	EntityType      types.ScheduledTaskEntityType
	StartTime       time.Time
	EndTime         time.Time
}

CreateTaskInput represents input for creating a task

type CreateTaskOutput

type CreateTaskOutput struct {
	TaskID string
}

CreateTaskOutput represents output from creating a task

type ExportActivity

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

ExportActivity handles the actual export operations

func NewExportActivity

func NewExportActivity(
	featureUsageRepo events.FeatureUsageRepository,
	invoiceRepo invoice.Repository,
	walletRepo wallet.Repository,
	walletBalanceGetter syncExport.WalletBalanceGetter,
	customerRepo customer.Repository,
	connectionRepo connection.Repository,
	integrationFactory *integration.Factory,
	logger *logger.Logger,
) *ExportActivity

NewExportActivity creates a new export activity

func (*ExportActivity) ExportData

func (a *ExportActivity) ExportData(ctx context.Context, input ExportDataInput) (*ExportDataOutput, error)

ExportData performs the complete export: prepare data, generate CSV, upload to provider

type ExportDataInput

type ExportDataInput struct {
	EntityType   types.ScheduledTaskEntityType
	ConnectionID string
	TenantID     string
	EnvID        string
	StartTime    time.Time
	EndTime      time.Time
	JobConfig    *types.S3JobConfig
}

ExportDataInput represents input for exporting data

type ExportDataOutput

type ExportDataOutput struct {
	FileURL       string
	RecordCount   int
	FileSizeBytes int64
}

ExportDataOutput represents output from export

type GetScheduledTaskDetailsInput

type GetScheduledTaskDetailsInput struct {
	ScheduledTaskID       string
	TenantID              string
	EnvID                 string
	WorkflowExecutionTime time.Time // Actual workflow execution time
	// Optional custom time range for force runs
	CustomStartTime *time.Time
	CustomEndTime   *time.Time
}

GetScheduledTaskDetailsInput represents input for getting task details

type IntervalBoundaryCalculator

type IntervalBoundaryCalculator interface {
	CalculateIntervalBoundaries(currentTime time.Time, interval types.ScheduledTaskInterval) (startTime, endTime time.Time)
}

IntervalBoundaryCalculator defines the interface for calculating interval boundaries

type RecordInfo

type RecordInfo struct {
	TotalRecords      int
	ProcessedRecords  int
	SuccessfulRecords int
	FailedRecords     int
}

RecordInfo holds record count information

type ScheduledTaskActivity

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

ScheduledTaskActivity handles scheduled task operations

func NewScheduledTaskActivity

func NewScheduledTaskActivity(
	scheduledTaskRepo scheduledtask.Repository,
	taskRepo task.Repository,
	logger *logger.Logger,
	boundaryCalculator IntervalBoundaryCalculator,
) *ScheduledTaskActivity

NewScheduledTaskActivity creates a new scheduled task activity

func (*ScheduledTaskActivity) GetScheduledTaskDetails

GetScheduledTaskDetails fetches scheduled task and calculates time range

type ScheduledTaskDetails

type ScheduledTaskDetails struct {
	ScheduledTaskID string
	TenantID        string
	EnvID           string
	EntityType      types.ScheduledTaskEntityType
	Enabled         bool
	ConnectionID    string
	StartTime       time.Time
	EndTime         time.Time
	JobConfig       *types.S3JobConfig
}

ScheduledTaskDetails contains task details needed for export

type TaskActivity

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

TaskActivity handles task-related operations

func NewTaskActivity

func NewTaskActivity(taskRepo task.Repository, logger *logger.Logger) *TaskActivity

NewTaskActivity creates a new task activity

func (*TaskActivity) CompleteTask

func (a *TaskActivity) CompleteTask(ctx context.Context, input CompleteTaskInput) error

CompleteTask marks a task as completed with final details

func (*TaskActivity) CreateTask

func (a *TaskActivity) CreateTask(ctx context.Context, input CreateTaskInput) (*CreateTaskOutput, error)

CreateTask creates a new export task

func (*TaskActivity) UpdateTaskStatus

func (a *TaskActivity) UpdateTaskStatus(ctx context.Context, input UpdateTaskStatusInput) error

UpdateTaskStatus updates the status of a task

type UpdateTaskStatusInput

type UpdateTaskStatusInput struct {
	TaskID     string
	TenantID   string
	EnvID      string
	UserID     string
	Status     types.TaskStatus
	RecordInfo *RecordInfo // Optional: for tracking progress
	Error      string      // Optional: for failures
}

UpdateTaskStatusInput represents input for updating task status

Jump to

Keyboard shortcuts

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