v0.1.20 v0.1.20
Vernon Keenan 2021-01-19 12:11:18 -08:00
parent c3d872fff1
commit be55d9117a
2 changed files with 10 additions and 13 deletions

View File

@ -9,8 +9,8 @@ import (
"go.temporal.io/sdk/workflow"
)
// NewDeveloperWrapper wraps a contact, account, payment method and a user identifier (app.User)
type NewDeveloperWrapper struct {
// NewDeveloperWorkflowWrapper wraps a contact, account, payment method with auth and saga info
type NewDeveloperWorkflowWrapper struct {
AccountName string
BillingStreet string
BillingCity string
@ -32,16 +32,13 @@ type NewDeveloperWrapper struct {
}
// NewDeveloperWorkflow is a Temporal workflow
func NewDeveloperWorkflow(
ctx workflow.Context,
w *NewDeveloperWrapper,
) error {
func NewDeveloperWorkflow(ctx workflow.Context, w NewDeveloperWorkflowWrapper) error { //nolint:funlen,gocritic,lll // don't care
ctx = workflow.WithActivityOptions(ctx, workflow.ActivityOptions{
StartToCloseTimeout: time.Minute,
})
err := workflow.ExecuteActivity(ctx,
StoreContactActivity,
&app.ContactChannelWrapper{
app.ContactChannelWrapper{
Obj: crm_models.Contact{
AccountID: "",
AssistantName: "",

View File

@ -8,9 +8,9 @@ import (
temporal_workflow "go.temporal.io/sdk/workflow"
)
// NewLeadWrapper wraps a Lead and a user identifier (app.User)
type NewLeadWrapper struct {
// Address *crm_models.Address
// NewLeadWorkflowWrapper wraps a Lead with auth and saga info
type NewLeadWorkflowWrapper struct {
// Address crm_models.Address
Company string
Description string
Email string
@ -40,7 +40,7 @@ type NewLeadWrapper struct {
}
// NewLeadWorkflow is a Temporal workflow
func NewLeadWorkflow(ctx temporal_workflow.Context, w *NewLeadWrapper) error {
func NewLeadWorkflow(ctx temporal_workflow.Context, w NewLeadWorkflowWrapper) error { //nolint:gocritic // don't care
obj := crm_models.Lead{
// Address: w.Address,
Company: w.Company,
@ -76,7 +76,7 @@ func NewLeadWorkflow(ctx temporal_workflow.Context, w *NewLeadWrapper) error {
ExecuteActivity(
ctx,
StoreLeadActivity,
&app.LeadChannelWrapper{
app.LeadChannelWrapper{
Obj: obj,
SagaID: w.SagaID,
SagaType: w.SagaType,
@ -89,7 +89,7 @@ func NewLeadWorkflow(ctx temporal_workflow.Context, w *NewLeadWrapper) error {
ExecuteActivity(
ctx,
NotifyLeadActivity,
&app.LeadChannelWrapper{
app.LeadChannelWrapper{
Obj: obj,
APIKey: w.APIKey,
}).Get(ctx, nil)