parent
c3d872fff1
commit
be55d9117a
|
@ -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: "",
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue