-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathactivities.go
37 lines (29 loc) · 1.54 KB
/
activities.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// @@@SNIPSTART subscription-go-activities
package subscription
import (
"context"
"go.temporal.io/sdk/activity"
)
type Activities struct {
}
func (a *Activities) SendWelcomeEmail(ctx context.Context, customer Customer) (string, error) {
activity.GetLogger(ctx).Info("sending welcome email to customer", customer.Id)
return "Sending welcome email completed for " + customer.Id, nil
}
func (a *Activities) SendCancellationEmailDuringTrialPeriod(ctx context.Context, customer Customer) (string, error) {
activity.GetLogger(ctx).Info("sending cancellation email during trial period to: ", customer.Email)
return "Sending cancellation email during trial period completed for " + customer.Id, nil
}
func (a *Activities) ChargeCustomerForBillingPeriod(ctx context.Context, customer Customer) (string, error) {
activity.GetLogger(ctx).Info("charging customer for billing period.")
return "Charging for billing period completed for: " + customer.Id, nil
}
func (a *Activities) SendCancellationEmailDuringActiveSubscription(ctx context.Context, customer Customer) (string, error) {
activity.GetLogger(ctx).Info("sending cancellation email during active subscription to: ", customer.Id)
return "Sending cancellation email during active subscription completed for: " + customer.Id, nil
}
func (a *Activities) SendSubscriptionOverEmail(ctx context.Context, customer Customer) (string, error) {
activity.GetLogger(ctx).Info("sending subscription over email to: ", customer.Id)
return "Sending subscription over email completed for: " + customer.Id, nil
}
// @@@SNIPEND