Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(payments): v3 implementation #107

Draft
wants to merge 367 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
367 commits
Select commit Hold shift + click to select a range
bbb79d0
Merge pull request #127 from formancehq/feat/payments-v3-ENG-1481-grp…
laouji Oct 15, 2024
24cd717
feat(modulr): add payout/transfer
paul-nicolas Oct 15, 2024
2e34a06
fixes after reviews
paul-nicolas Oct 16, 2024
445c42d
Merge pull request #129 from formancehq/feat/modulr-payout-transfer
paul-nicolas Oct 16, 2024
b01b0c3
fix(modulr): fix modulr date formatting
paul-nicolas Oct 16, 2024
cb3ffcd
feat(payments): update payment initiation from payment
paul-nicolas Oct 14, 2024
8c92441
fix balances name
paul-nicolas Oct 16, 2024
517d15e
Merge pull request #126 from formancehq/feat/update-pi-from-payment
paul-nicolas Oct 16, 2024
a10d850
chore(deps): update to go-libs/v2 v2.0.0
laouji Oct 17, 2024
6509415
fix(deps): ensure storage tests also use pgx driver
laouji Oct 17, 2024
3d108aa
Merge pull request #131 from formancehq/feat/payments-v3-chore-update…
laouji Oct 17, 2024
2d6bc44
paginator: rework
paul-nicolas Oct 17, 2024
9f40305
feat(currencycloud): add transfer/payout and fix loops page size
paul-nicolas Oct 17, 2024
5842196
fix(currencycloud): fix test names
paul-nicolas Oct 17, 2024
0d56180
fix moneycorp crash
paul-nicolas Oct 17, 2024
de5f9df
fix(modulr): fix modulr page size
paul-nicolas Oct 17, 2024
18adb2d
fix after rebase
paul-nicolas Oct 17, 2024
2899598
Merge pull request #133 from formancehq/feat/moneycorp-transfer-payou…
paul-nicolas Oct 17, 2024
cf9c3ee
fix(storage): fix balances insertion
paul-nicolas Oct 18, 2024
1c00bd9
no log error
paul-nicolas Oct 18, 2024
9a3b75d
Merge pull request #134 from formancehq/fix/balances
paul-nicolas Oct 18, 2024
08595f2
feat(mangopay): simplify loops and add lots of tests
paul-nicolas Oct 22, 2024
34be566
fix test name
paul-nicolas Oct 23, 2024
3abb7dd
feat(wise): simplify loops and add tests
paul-nicolas Oct 23, 2024
6696960
Merge pull request #136 from formancehq/feat/mangopay-tests
paul-nicolas Oct 23, 2024
222e474
Merge pull request #138 from formancehq/feat/wise-simplify-loops
paul-nicolas Oct 23, 2024
3687a49
feat(wise): add transfer/payout implementation
paul-nicolas Oct 22, 2024
b541ac6
add error when payment is not supported
paul-nicolas Oct 23, 2024
5323e59
send an error in case of unsupported currencies
paul-nicolas Oct 23, 2024
4c554fc
Merge pull request #137 from formancehq/feat/wise-add-transfer-payouts
paul-nicolas Oct 24, 2024
3e1ae43
feat(events): do not send an already sent event
paul-nicolas Oct 24, 2024
cefd4c4
feat(*): send events in background when creating formance object
paul-nicolas Oct 24, 2024
4f44494
Merge pull request #139 from formancehq/feat/deduplicate-send-events
paul-nicolas Oct 24, 2024
09cfed8
feat(connectors): uninstall in background and send accepted
paul-nicolas Oct 24, 2024
ac2341d
fixes after review
paul-nicolas Oct 25, 2024
b3b9509
Merge pull request #140 from formancehq/feat/uninstall-accepted
paul-nicolas Oct 25, 2024
ec74de4
Merge pull request #141 from formancehq/feat/calls-hanging-formance-o…
paul-nicolas Oct 25, 2024
6fa9636
feat(metrics): pass raw flags to Stripe plugin subprocess
laouji Oct 17, 2024
4919150
fix: add metrics package
laouji Oct 17, 2024
90ba63f
use service.NewWithLogger
laouji Oct 18, 2024
c0f7438
feat(metrics): measure req duration in httpwrapper by default
laouji Oct 23, 2024
4d69d2a
feat(metrics): hardcode logger settings in plugins
laouji Oct 23, 2024
695109a
Enforce use of grpc metrics inside plugins
laouji Oct 24, 2024
544730e
feat(metrics): add operator metric attribute via context in httpwrapper
laouji Oct 24, 2024
0dbd6b4
feat(metrics): add operator metric attributes in moneycorp calls
laouji Oct 24, 2024
51026e3
feat(metrics): add operator metric attributes in wise calls
laouji Oct 24, 2024
4e8fb18
feat(metrics): add go-libs hash from main branch
laouji Oct 24, 2024
aed2391
feat(metrics): add operator metric attributes in bankingcircle calls
laouji Oct 25, 2024
b2cd242
feat(metrics): add operator metric attributes in currencycloud calls
laouji Oct 25, 2024
88f24be
feat(metrics): add operator metric attributes in mangopay calls
laouji Oct 25, 2024
eaaa9c5
feat(metrics): add operator metric attributes in modulr calls
laouji Oct 25, 2024
24def79
fix: rename operation attribute tag to match old implementation
laouji Oct 25, 2024
a197734
feat(metrics): add operator metric attributes in generic connector calls
laouji Oct 25, 2024
a79fd7a
feat(metrics): add operator metric attributes in adyen calls
laouji Oct 25, 2024
2eae739
feat(metrics): add operator metric attributes in stripe calls
laouji Oct 25, 2024
c5c7708
feat(*): add bank account forward background and tasks
paul-nicolas Oct 25, 2024
581d22c
feat(metrics): add metrics to remaining functions following rebase
laouji Oct 28, 2024
49c5ec0
fixes after review
paul-nicolas Oct 28, 2024
c21b0e6
models package handles the formatting
paul-nicolas Oct 28, 2024
f88850b
Merge pull request #142 from formancehq/feat/forward-account
paul-nicolas Oct 28, 2024
89feb8e
feat(*): transfers/payouts are sent in background for v3
paul-nicolas Oct 28, 2024
76ccd01
feat(connector): launch first tasks in background
paul-nicolas Oct 28, 2024
d6c300c
fix: simplify metrics initiation
laouji Oct 28, 2024
d1823d9
fix: assume that stack will be set in OTEL_RESOURCE_ATTRIBUTES
laouji Oct 28, 2024
bba5602
fix: use noop metrics exporter in plugins if stdout exporter is used …
laouji Oct 28, 2024
f2b3d1f
Merge pull request #132 from formancehq/feat/payments-v3-fix-plugin-l…
laouji Oct 28, 2024
abcb263
fix uninstall
paul-nicolas Oct 28, 2024
a45030d
fix after review
paul-nicolas Oct 28, 2024
c7e6291
Merge pull request #143 from formancehq/feat/transfer-payouts
paul-nicolas Oct 28, 2024
7760eca
Merge pull request #144 from formancehq/feat/install
paul-nicolas Oct 28, 2024
882fdaf
feat(stripe): add transfer and payout
paul-nicolas Oct 29, 2024
a040d09
Update internal/connectors/plugins/public/stripe/client/payouts.go
paul-nicolas Oct 29, 2024
de17c2f
Update internal/connectors/plugins/public/stripe/client/payouts.go
paul-nicolas Oct 29, 2024
ddbd738
Update internal/connectors/plugins/public/stripe/client/transfers.go
paul-nicolas Oct 29, 2024
c564556
fix compilation problem
paul-nicolas Oct 29, 2024
e5af457
Merge pull request #148 from formancehq/feat/stripe-transfer-payouts
paul-nicolas Oct 29, 2024
abe708c
feat(testing): add unit tests for api v3 account handlers
laouji Oct 29, 2024
d7dbca7
feat(testing): add unit tests for api v2 account handlers
laouji Oct 29, 2024
f2e6d36
feat(testing): add unit tests for api v3 bank account handlers
laouji Oct 29, 2024
8ab5bc3
feat(testing): add unit tests for api v2 bank account handlers
laouji Oct 29, 2024
ae2ef7c
feat(testing): add unit tests for api v3 connector handlers
laouji Oct 29, 2024
3a88090
feat(testing): add unit tests for api v2 connector handlers
laouji Oct 29, 2024
ce2416e
Merge pull request #149 from formancehq/feat/payments-v3-ENG-1408-api…
laouji Oct 30, 2024
8b52fd5
feat(testing): add unit tests for api v3 payment initiation handlers
laouji Oct 30, 2024
e5b4ccf
feat(testing): add unit tests for api v3 payment handlers
laouji Oct 30, 2024
53a1baa
feat(testing): add unit tests for api v2 payment handlers
laouji Oct 30, 2024
0a34953
feat(bankingcircle): fix loop and add tests
paul-nicolas Oct 30, 2024
0c56ddf
fix: ensure that payments metadata validation happens before update
laouji Oct 30, 2024
39ae84f
fix: return validation error if pool created without account ids
laouji Oct 30, 2024
70aea3b
feat(generic): fix loop and add tests
paul-nicolas Oct 30, 2024
56a3a5e
feat(testing): add unit tests for api v3 pools handlers
laouji Oct 30, 2024
4795c14
feat(testing): add unit tests for api v2 pools handlers
laouji Oct 30, 2024
fd87292
feat(testing): add unit tests for api v3 schedules, tasks and instances
laouji Oct 30, 2024
971f758
feat(testing): add unit tests for api v2 tasks handlers
laouji Oct 30, 2024
95cf3a3
feat(testing): add unit tests for api v2 transfer intiations handlers
laouji Oct 30, 2024
a3d81b3
Merge pull request #152 from formancehq/feat/banking-circle-testing
paul-nicolas Oct 31, 2024
6591642
Merge pull request #153 from formancehq/feat/generic-tests
paul-nicolas Oct 31, 2024
2771e2f
Merge pull request #151 from formancehq/feat/payments-v3-ENG-1408-api…
laouji Oct 31, 2024
235ef40
feat(capability): use capability to create accounts/payments
paul-nicolas Oct 31, 2024
13ab218
Merge pull request #154 from formancehq/feat/use-capability
paul-nicolas Oct 31, 2024
bb5ade6
feat(tracing): add otel contrib middleware to grpc server and client
laouji Oct 31, 2024
0a15eb8
fix: use gomock.Any in tests for context matching
laouji Nov 4, 2024
7610f34
fix: use gomock.Any in tests for context matching
laouji Nov 4, 2024
ce78f75
fix: use gomock.Any in tests for context matching
laouji Nov 4, 2024
db558fc
fix: use gomock.Any in tests for context matching
laouji Nov 4, 2024
d22135e
fix: use gomock.Any in tests for context matching
laouji Nov 4, 2024
04921f9
fix: use gomock.Any in tests for context matching
laouji Nov 4, 2024
e897f2f
fix: use gomock.Any in tests for context matching
laouji Nov 4, 2024
a156c06
fix: use gomock.Any in tests for context matching
laouji Nov 4, 2024
e0da9fb
fix: use gomock.Any in tests for context matching
laouji Nov 4, 2024
b6923fc
feat(traces): add Name() function to plugin interface
laouji Nov 4, 2024
347999e
feat(traces): add StartSpan convenience function
laouji Nov 4, 2024
6abddf3
feat(traces): start trace span in plugin wrapper
laouji Nov 4, 2024
102ec2c
Merge pull request #155 from formancehq/feat/payments-v3-ENG-1373
laouji Nov 4, 2024
898df3d
feat(workflows): call temporal client in activities
paul-nicolas Nov 5, 2024
f564c38
log when failed to delete schedules
paul-nicolas Nov 5, 2024
6fe61e2
Merge pull request #158 from formancehq/feat/remove-context-background
paul-nicolas Nov 6, 2024
309a758
fix(temporal): continue a new when terminating workflows
paul-nicolas Nov 8, 2024
600eca9
feat(atlar): add atlar connector
paul-nicolas Nov 6, 2024
2d385e0
add tests
paul-nicolas Nov 7, 2024
70bc1a9
fixes
paul-nicolas Nov 7, 2024
4d51050
fix tests
paul-nicolas Nov 7, 2024
4852207
fixes after review
paul-nicolas Nov 8, 2024
9c7f8e6
feat(*): add span everywhere + span errors
paul-nicolas Nov 8, 2024
c8b813b
fix moneycorp balances
paul-nicolas Nov 12, 2024
0d06dc6
feat(temporal): ensure workflows and schedules unique per stack
paul-nicolas Nov 12, 2024
5b27186
fix(generic): fix wrong starting page
paul-nicolas Nov 18, 2024
b647c13
feat(temporal): continue as new when fetching too much data
paul-nicolas Nov 17, 2024
dce5dec
fix: disable retry of connector install when plugin cannot boot corre…
laouji Nov 20, 2024
e513dc6
Merge pull request #171 from formancehq/feat/payments-v3-ENG-1533-dis…
laouji Nov 20, 2024
7d3d7bd
fix: stop waiting for run.Get() calls to complete in case of http cli…
laouji Nov 20, 2024
70bbbfb
fix: use closures to prevent concurrent access of maps in dummy data …
laouji Nov 20, 2024
b7d9a20
test(e2e): create test server
laouji Nov 8, 2024
7216bfd
test(e2e): make some variables public for access in e2e tests
laouji Nov 8, 2024
c2feb84
test(e2e): update migration up function for go-lib update
laouji Nov 8, 2024
db91f5f
test(e2e): create bank account creation e2e test
laouji Nov 8, 2024
dd616fe
test(e2e): make BankAccount request structs public
laouji Nov 12, 2024
0299ead
test(e2e): add e2e tests for v2 and v3 bank account endpoints
laouji Nov 12, 2024
d4fb668
test(e2e): make httpwrapper unmarshal errors more easy to debug
laouji Nov 15, 2024
4d66865
fix: gomod
laouji Nov 15, 2024
9df2e32
test(e2e): use go-libs temporaltest in e2e setup
laouji Nov 15, 2024
4cd14af
test(e2e): add temporal search attributes to testserver
laouji Nov 15, 2024
15c622c
test(e2e): bank account forward
laouji Nov 15, 2024
808eb44
test(e2e): rename bank accounts testing file
laouji Nov 15, 2024
d2aaa31
fix: go.mod
laouji Nov 15, 2024
3fddff3
fix: storage after go-libs update
laouji Nov 18, 2024
daeef5a
test(e2e): set magic cookie in e2e test env to allow plugins to run
laouji Nov 20, 2024
178bf54
test(e2e): test details of response in bank account forward requests
laouji Nov 20, 2024
1a7c44f
test(e2e): make api metadata req structure public
laouji Nov 20, 2024
a755e3a
test(e2e): create e2e tests for bank account metadata update
laouji Nov 20, 2024
4482fff
Merge pull request #172 from formancehq/feat/payments-v3-ENG-1529-req…
laouji Nov 21, 2024
d25f188
feat(scalability): add jitter to temporal schedules
laouji Nov 21, 2024
994b906
Merge pull request #176 from formancehq/feat/payments-v3-ENG-1524-jitter
laouji Nov 21, 2024
b1c1eab
Merge pull request #164 from formancehq/feat/payments-v3-eng-1510
laouji Nov 21, 2024
44e31be
feat(profiling): enable profiling routes on 9090 by default
laouji Nov 22, 2024
36d29cf
fix: use FxModuleFromFlags
laouji Nov 22, 2024
b0b1c2f
fix: use go-libs commit hash from main branch
laouji Nov 25, 2024
cf0e2ba
Merge pull request #177 from formancehq/feat/payments-v3-ENG-1537-pprof
laouji Nov 25, 2024
b95d0f9
feat(temporal): only create default worker if needed
paul-nicolas Nov 25, 2024
361ba24
remove plugins
paul-nicolas Nov 22, 2024
015fd85
add support for multipods
paul-nicolas Nov 22, 2024
0d8220f
last fixes
paul-nicolas Nov 22, 2024
bd00b47
fix tests
paul-nicolas Nov 22, 2024
b2e6f42
fix go mod
paul-nicolas Nov 22, 2024
9e5995b
fix go.mod and sum
paul-nicolas Nov 22, 2024
7727e43
do not store capabilities
paul-nicolas Nov 25, 2024
6f872c8
fix: run e2e tests on CI by default
laouji Nov 25, 2024
7387e9b
fix
laouji Nov 26, 2024
4f22a6e
fix
laouji Nov 26, 2024
6efd455
feat(payments): add reversal models
paul-nicolas Nov 25, 2024
8c91ae8
feat(storage): add reversals
paul-nicolas Nov 25, 2024
d477b34
feaat(plugins): add reverse transfer and payouts
paul-nicolas Nov 25, 2024
a2dad34
feat(temporal): add reverse transfer and payouts
paul-nicolas Nov 25, 2024
c251d28
feat(engine): add reverse transfer and payout
paul-nicolas Nov 25, 2024
b37107d
feat(api): add reverse transfer and payouts
paul-nicolas Nov 25, 2024
b0db187
fix pre commit
paul-nicolas Nov 25, 2024
0353d44
fix tests
paul-nicolas Nov 25, 2024
0ecb34b
last fixes
paul-nicolas Nov 25, 2024
5105a5e
fixes after review
paul-nicolas Nov 25, 2024
36fe384
feat(config): set a minimum polling period to 30s
paul-nicolas Nov 26, 2024
c8dea07
add tests
paul-nicolas Nov 26, 2024
0ef0ec0
close conn when closing store
paul-nicolas Nov 26, 2024
4940207
add mutex
paul-nicolas Nov 26, 2024
b4527e0
call close when service is cut
paul-nicolas Nov 26, 2024
ba234d8
Merge pull request #181 from formancehq/fix-run-e2e-test-by-default
laouji Nov 26, 2024
0ae82c2
fix(temporal): fix schedule workflow search attributes
paul-nicolas Nov 27, 2024
4490668
test(e2e): connectors install
laouji Nov 26, 2024
0f74d7b
test(e2e): connectors uninstall
laouji Nov 26, 2024
3666e2e
test (e2e): add connector schedule test
laouji Nov 26, 2024
0660a89
test (e2e): use httptest server handler for generic connector endpoint
laouji Nov 27, 2024
0068c2b
test (e2e): inject stack flag into test server
laouji Nov 27, 2024
baef4fd
fix (race): use worker.Start() instead of worker.Run() to avoid data …
laouji Nov 27, 2024
492d746
test (e2e): add convenience method to block for workflow completion
laouji Nov 27, 2024
9af2cff
Merge pull request #184 from formancehq/feat/payments-v3-ENG-1512-con…
laouji Nov 27, 2024
28133c5
fix (metrics): initialize metrics registry at service start
laouji Nov 27, 2024
1475845
Merge pull request #187 from formancehq/feat/payments-v3-fix-connecto…
laouji Nov 28, 2024
5055621
feat(metrics): update go-libs version to enable temporal SDK metrics
laouji Nov 29, 2024
4ac0aa7
Merge pull request #188 from formancehq/feat/payments-v3-temporal-sdk…
laouji Nov 29, 2024
948a583
test(e2e): test creation of new accounts
laouji Nov 29, 2024
82d2b7b
test(e2e): implement dummypay connector base for use in e2e tests
laouji Dec 2, 2024
d27ed08
test(e2e): implement FetchNextBalances for dummypay
laouji Dec 3, 2024
c342a38
test(e2e): allow account creation in dummypay
laouji Dec 4, 2024
6330a5d
test(e2e): use dummypay in e2e tests
laouji Dec 4, 2024
caa5bc5
test(e2e): test accounts v2 balance endpoint
laouji Dec 4, 2024
18fe5e5
test(e2e): prevent dummypay from being installed if the it tag is not…
laouji Dec 4, 2024
932ee64
fix: add nolint:unused tag to compensate for dynamic build tag use in…
laouji Dec 4, 2024
c78aaf1
Merge pull request #189 from formancehq/feat/payments-v3-e2e-test-acc…
laouji Dec 5, 2024
6a6ba9d
fix: add autoincrement sort_id to tables
laouji Dec 6, 2024
35011cb
fix: use both created_at and sort_id in list endpoints
laouji Dec 9, 2024
2106264
fix: test cursor of accounts list when some entries have same timestamp
laouji Dec 9, 2024
33caf82
fix: use multicolumn index for created_at, sort_id
laouji Dec 9, 2024
7f675e4
feat(temporal): rename task queue by adding the stack
paul-nicolas Dec 2, 2024
748f686
fix: keep unique sort_id index for tables without created_at
laouji Dec 9, 2024
d05a162
Merge pull request #194 from formancehq/feat/payments-v3-paging-migra…
laouji Dec 9, 2024
3541c77
feat(storage): add migrations from v2
paul-nicolas Dec 5, 2024
8fd9556
add on conflict everywhere
paul-nicolas Dec 9, 2024
abbfe3d
fix migrations
paul-nicolas Dec 10, 2024
53c25ef
fix migrations
paul-nicolas Dec 11, 2024
58dd23f
fix migrations
paul-nicolas Dec 11, 2024
86281f2
feat(temporal): add max concurrent task pollers flag
paul-nicolas Dec 9, 2024
2da26b7
feat(install): do not sent 404 when config is invalid
paul-nicolas Dec 12, 2024
0d7cbe0
test(e2e): make payment init request structs public
laouji Dec 5, 2024
c3d9648
test(e2e): implement transfer create function in dummypay
laouji Dec 5, 2024
f31be88
test: (e2e) make events structs public for use in test packages
laouji Dec 10, 2024
591ff5a
fix: use received nats event to find imported balance instead of wait…
laouji Dec 10, 2024
42f638c
test: (e2e) implement bank account forwarding in dummypay and adjust …
laouji Dec 10, 2024
b042f25
test: (e2e) add initial payment initiation test
laouji Dec 11, 2024
17fce23
fix: update dummypay implementation to reduce flakeyness
laouji Dec 11, 2024
d845c8c
test: (e2e) add payment rejection test
laouji Dec 11, 2024
3ee13eb
fix: rename e2e payment initiation test file
laouji Dec 11, 2024
d68399f
test: (e2e) make payment initiation not processed error type public
laouji Dec 11, 2024
0016289
fix: uncomment payment initiation reversal tests
laouji Dec 11, 2024
7fe32d3
test: (e2e) implement payment reversal in dummypay
laouji Dec 11, 2024
d0314f8
test: (e2e) test payment reversal
laouji Dec 11, 2024
46134a4
test: (e2e) reduce test flakiness by additing some conditions to Even…
laouji Dec 11, 2024
6348ce7
test (e2e): test payout initiation
laouji Dec 11, 2024
b37882a
fix: adjust Eventually timeouts
laouji Dec 11, 2024
1d92662
test: (e2e) make payment creation request structs public
laouji Dec 11, 2024
58c6772
test: (e2e) make v2 PaymentResponse public
laouji Dec 12, 2024
e6de379
test: (e2e) add payment creation api e2e tests
laouji Dec 12, 2024
f7e4580
test: (e2e) generate less test data so Eventually functions do not ha…
laouji Dec 12, 2024
761e6a3
fix: adjust error message in dummypay reverse payout function
laouji Dec 12, 2024
6b441a4
fix: move defer res.Body.Close() after error check
laouji Dec 12, 2024
e40f856
fix: truncate time in storage test to avoid errors with drift
laouji Dec 12, 2024
b86577f
Merge pull request #193 from formancehq/feat/payments-v3-e2e-payments
laouji Dec 12, 2024
5c6de74
fix: update BankAccount event json tag
laouji Dec 12, 2024
1e7593d
Merge pull request #197 from formancehq/feat/payments-v3-bank-account…
laouji Dec 12, 2024
13867a9
fix(pools): remove pools accounts when connector is removed
paul-nicolas Dec 12, 2024
7172df4
fix after review
paul-nicolas Dec 12, 2024
b46837f
remove unused function
paul-nicolas Dec 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(temporal): fix schedule workflow search attributes
paul-nicolas committed Nov 27, 2024
commit 0ae82c2916c40036cfcf67afe5d4074e266f64a6
14 changes: 14 additions & 0 deletions internal/connectors/engine/activities/temporal_schedule_create.go
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ import (

"go.temporal.io/api/enums/v1"
"go.temporal.io/sdk/client"
"go.temporal.io/sdk/temporal"
"go.temporal.io/sdk/workflow"
)

@@ -20,6 +21,19 @@ type ScheduleCreateOptions struct {
}

func (a Activities) TemporalScheduleCreate(ctx context.Context, options ScheduleCreateOptions) (string, error) {
attributes := make([]temporal.SearchAttributeUpdate, 0, len(options.SearchAttributes))
for key, value := range options.SearchAttributes {
v, ok := value.(string)
if !ok {
continue
}

attributes = append(attributes,
temporal.NewSearchAttributeKeyKeyword(key).ValueSet(v),
)
}
options.Action.TypedSearchAttributes = temporal.NewSearchAttributes(attributes...)

handle, err := a.temporalClient.ScheduleClient().Create(ctx, client.ScheduleOptions{
ID: options.ScheduleID,
Spec: client.ScheduleSpec{
6 changes: 0 additions & 6 deletions internal/connectors/engine/workflow/plugin_workflow.go
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@ import (
"github.com/pkg/errors"
"go.temporal.io/api/enums/v1"
"go.temporal.io/sdk/client"
"go.temporal.io/sdk/temporal"
"go.temporal.io/sdk/workflow"
)

@@ -123,11 +122,6 @@ func (w Workflow) run(
task.NextTasks,
},
TaskQueue: connectorID.String(),
// Search attributes are used to query workflows
TypedSearchAttributes: temporal.NewSearchAttributes(
temporal.NewSearchAttributeKeyKeyword(SearchAttributeScheduleID).ValueSet(scheduleID),
temporal.NewSearchAttributeKeyKeyword(SearchAttributeStack).ValueSet(w.stack),
),
},
Overlap: enums.SCHEDULE_OVERLAP_POLICY_SKIP,
TriggerImmediately: true,