first drafts for inventory sync page

This commit is contained in:
2026-01-09 18:03:54 -07:00
parent 846f56e50b
commit a7c8fe4d64
40 changed files with 1310 additions and 121 deletions
+2 -13
View File
@@ -20,6 +20,7 @@ import (
)
//go:generate oapi-codegen -generate types,client -package generated_client -o generated_client/client.go openapi.3.0.2.json
//go:generate concurry -s Platform
// TODO:
// - [x] document the flow in the README.md
@@ -36,11 +37,6 @@ type (
apiSharedSecret string
db *pgxpool.Pool
}
PlatformWithContext struct {
ctx context.Context
p *Platform
}
)
// oauth scopes
@@ -77,10 +73,7 @@ func NewPlatform(oAuthRedirectURI func(acctID int64) string, apiKeystring, apiSh
}
func (p *Platform) WithContext(ctx context.Context) *PlatformWithContext {
return &PlatformWithContext{
ctx: ctx,
p: p,
}
return NewPlatformWithContext(ctx, p)
}
func (p *Platform) GenerateConnectionURLForNewAccount(ctx context.Context, acctID int64) (*url.URL, error) {
@@ -113,10 +106,6 @@ func (p *Platform) GenerateConnectionURLForNewAccount(ctx context.Context, acctI
}, nil
}
func (p *PlatformWithContext) GenerateConnectionURLForNewAccount(acctID int64) (*url.URL, error) {
return p.p.GenerateConnectionURLForNewAccount(p.ctx, acctID)
}
// HandleNewAuthCode handles the auth code to get api access
func (p *Platform) HandleNewAuthCode(ctx context.Context, acctID int64, state, authCode string) (bool, error) {
// look up matching oauth request