APIKey
parent
f5aa06ed82
commit
54392e385e
|
@ -9,7 +9,7 @@ import (
|
||||||
// AccountChannelWrapper wraps the object with workflow params
|
// AccountChannelWrapper wraps the object with workflow params
|
||||||
type AccountChannelWrapper struct {
|
type AccountChannelWrapper struct {
|
||||||
Obj crm_models.Account
|
Obj crm_models.Account
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// AccountingRuleChannelWrapper wraps the object with workflow params
|
// AccountingRuleChannelWrapper wraps the object with workflow params
|
||||||
type AccountingRuleChannelWrapper struct {
|
type AccountingRuleChannelWrapper struct {
|
||||||
Obj ledger_models.AccountingRule
|
Obj ledger_models.AccountingRule
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// AccountingRulesetChannelWrapper wraps the object with workflow params
|
// AccountingRulesetChannelWrapper wraps the object with workflow params
|
||||||
type AccountingRulesetChannelWrapper struct {
|
type AccountingRulesetChannelWrapper struct {
|
||||||
Obj ledger_models.AccountingRuleset
|
Obj ledger_models.AccountingRuleset
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// AccountingRulesetItemChannelWrapper wraps the object with workflow params
|
// AccountingRulesetItemChannelWrapper wraps the object with workflow params
|
||||||
type AccountingRulesetItemChannelWrapper struct {
|
type AccountingRulesetItemChannelWrapper struct {
|
||||||
Obj ledger_models.AccountingRulesetItem
|
Obj ledger_models.AccountingRulesetItem
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
package app
|
||||||
|
|
||||||
|
import (
|
||||||
|
"code.tnxs.net/taxnexus/lib/api/auth/auth_client"
|
||||||
|
"code.tnxs.net/taxnexus/lib/api/auth/auth_client/user"
|
||||||
|
"code.tnxs.net/taxnexus/lib/api/auth/auth_models"
|
||||||
|
)
|
||||||
|
|
||||||
|
var authClient = auth_client.Default
|
||||||
|
|
||||||
|
// CheckAPIUser is exported
|
||||||
|
func CheckAPIUser(token *string) (*User, error) {
|
||||||
|
sugar.Debug("app.CheckAPIUser: 📥")
|
||||||
|
params := user.NewGetUsersParams()
|
||||||
|
params.Apikey = token
|
||||||
|
response, err := authClient.User.GetUsers(params, apiUsers["auth"].Auth)
|
||||||
|
if err != nil {
|
||||||
|
sugar.Warnf("app.CheckAPIUser: ❗ Access attempt with invalid API key: %s", *token)
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
var obj *auth_models.User
|
||||||
|
for _, itm := range response.Payload.Data { // single iteration execution
|
||||||
|
obj = itm
|
||||||
|
}
|
||||||
|
sugar.Debugf("app.CheckAPIUser: 📤 👍 ID = %s, Name = %s", obj.ID, obj.Name)
|
||||||
|
return MarshalAuthUserToSwagger(obj), nil
|
||||||
|
}
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// BackendChannelWrapper wraps the object with workflow params
|
// BackendChannelWrapper wraps the object with workflow params
|
||||||
type BackendChannelWrapper struct {
|
type BackendChannelWrapper struct {
|
||||||
Obj regs_models.Backend
|
Obj regs_models.Backend
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// CashReceiptChannelWrapper wraps the object with workflow params
|
// CashReceiptChannelWrapper wraps the object with workflow params
|
||||||
type CashReceiptChannelWrapper struct {
|
type CashReceiptChannelWrapper struct {
|
||||||
Obj ops_models.CashReceipt
|
Obj ops_models.CashReceipt
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// ChargeChannelWrapper wraps the object with workflow params
|
// ChargeChannelWrapper wraps the object with workflow params
|
||||||
type ChargeChannelWrapper struct {
|
type ChargeChannelWrapper struct {
|
||||||
Obj ops_models.Charge
|
Obj ops_models.Charge
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// ClusterChannelWrapper wraps the object with workflow params
|
// ClusterChannelWrapper wraps the object with workflow params
|
||||||
type ClusterChannelWrapper struct {
|
type ClusterChannelWrapper struct {
|
||||||
Obj devops_models.Cluster
|
Obj devops_models.Cluster
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// CompanyChannelWrapper wraps the object with workflow params
|
// CompanyChannelWrapper wraps the object with workflow params
|
||||||
type CompanyChannelWrapper struct {
|
type CompanyChannelWrapper struct {
|
||||||
Obj crm_models.Company
|
Obj crm_models.Company
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ const NewContactActivity = "NEW_CONTACT_ACTIVITY"
|
||||||
// ContactChannelWrapper wraps the object with workflow params
|
// ContactChannelWrapper wraps the object with workflow params
|
||||||
type ContactChannelWrapper struct {
|
type ContactChannelWrapper struct {
|
||||||
Obj crm_models.Contact
|
Obj crm_models.Contact
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// CoordinateBasicChannelWrapper wraps the object with workflow params
|
// CoordinateBasicChannelWrapper wraps the object with workflow params
|
||||||
type CoordinateBasicChannelWrapper struct {
|
type CoordinateBasicChannelWrapper struct {
|
||||||
Obj geo_models.CoordinateBasic
|
Obj geo_models.CoordinateBasic
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ type CoordinateBasic struct {
|
||||||
// CoordinateChannelWrapper wraps the object with workflow params
|
// CoordinateChannelWrapper wraps the object with workflow params
|
||||||
type CoordinateChannelWrapper struct {
|
type CoordinateChannelWrapper struct {
|
||||||
Obj geo_models.Coordinate
|
Obj geo_models.Coordinate
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// CountryChannelWrapper wraps the object with workflow params
|
// CountryChannelWrapper wraps the object with workflow params
|
||||||
type CountryChannelWrapper struct {
|
type CountryChannelWrapper struct {
|
||||||
Obj geo_models.Country
|
Obj geo_models.Country
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// CountyChannelWrapper wraps the object with workflow params
|
// CountyChannelWrapper wraps the object with workflow params
|
||||||
type CountyChannelWrapper struct {
|
type CountyChannelWrapper struct {
|
||||||
Obj geo_models.County
|
Obj geo_models.County
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// DatabaseChannelWrapper wraps the object with workflow params
|
// DatabaseChannelWrapper wraps the object with workflow params
|
||||||
type DatabaseChannelWrapper struct {
|
type DatabaseChannelWrapper struct {
|
||||||
Obj devops_models.Database
|
Obj devops_models.Database
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import "code.tnxs.net/taxnexus/lib/api/geo/geo_models"
|
||||||
// DomainChannelWrapper wraps the object with workflow params
|
// DomainChannelWrapper wraps the object with workflow params
|
||||||
type DomainChannelWrapper struct {
|
type DomainChannelWrapper struct {
|
||||||
Obj geo_models.Domain
|
Obj geo_models.Domain
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// EftChannelWrapper wraps the object with workflow params
|
// EftChannelWrapper wraps the object with workflow params
|
||||||
type EftChannelWrapper struct {
|
type EftChannelWrapper struct {
|
||||||
Obj ops_models.Eft
|
Obj ops_models.Eft
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// EftItemChannelWrapper wraps the object with workflow params
|
// EftItemChannelWrapper wraps the object with workflow params
|
||||||
type EftItemChannelWrapper struct {
|
type EftItemChannelWrapper struct {
|
||||||
Obj ops_models.EftItem
|
Obj ops_models.EftItem
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// EmailMessageChannelWrapper wraps the object with workflow params
|
// EmailMessageChannelWrapper wraps the object with workflow params
|
||||||
type EmailMessageChannelWrapper struct {
|
type EmailMessageChannelWrapper struct {
|
||||||
Obj workflow_models.EmailMessage
|
Obj workflow_models.EmailMessage
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
// EmailTemplateChannelWrapper wraps the object with workflow params
|
// EmailTemplateChannelWrapper wraps the object with workflow params
|
||||||
type EmailTemplateChannelWrapper struct {
|
type EmailTemplateChannelWrapper struct {
|
||||||
// Obj workflow_models.EmailTemplate
|
// Obj workflow_models.EmailTemplate
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// FilingChannelWrapper wraps the object with workflow params
|
// FilingChannelWrapper wraps the object with workflow params
|
||||||
type FilingChannelWrapper struct {
|
type FilingChannelWrapper struct {
|
||||||
Obj regs_models.Filing
|
Obj regs_models.Filing
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// FilingScheduleItemChannelWrapper wraps the object with workflow params
|
// FilingScheduleItemChannelWrapper wraps the object with workflow params
|
||||||
type FilingScheduleItemChannelWrapper struct {
|
type FilingScheduleItemChannelWrapper struct {
|
||||||
Obj regs_models.FilingScheduleItem
|
Obj regs_models.FilingScheduleItem
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// FilingTypeChannelWrapper wraps the object with workflow params
|
// FilingTypeChannelWrapper wraps the object with workflow params
|
||||||
type FilingTypeChannelWrapper struct {
|
type FilingTypeChannelWrapper struct {
|
||||||
Obj regs_models.FilingType
|
Obj regs_models.FilingType
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// FilingTypeInstanceChannelWrapper wraps the object with workflow params
|
// FilingTypeInstanceChannelWrapper wraps the object with workflow params
|
||||||
type FilingTypeInstanceChannelWrapper struct {
|
type FilingTypeInstanceChannelWrapper struct {
|
||||||
Obj regs_models.FilingTypeInstance
|
Obj regs_models.FilingTypeInstance
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
// FolderChannelWrapper wraps the object with workflow params
|
// FolderChannelWrapper wraps the object with workflow params
|
||||||
type FolderChannelWrapper struct {
|
type FolderChannelWrapper struct {
|
||||||
// Obj workflow_models.Folder
|
// Obj workflow_models.Folder
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// GlAccountChannelWrapper wraps the object with workflow params
|
// GlAccountChannelWrapper wraps the object with workflow params
|
||||||
type GlAccountChannelWrapper struct {
|
type GlAccountChannelWrapper struct {
|
||||||
Obj ledger_models.GlAccount
|
Obj ledger_models.GlAccount
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// GlBalanceChannelWrapper wraps the object with workflow params
|
// GlBalanceChannelWrapper wraps the object with workflow params
|
||||||
type GlBalanceChannelWrapper struct {
|
type GlBalanceChannelWrapper struct {
|
||||||
Obj ledger_models.GlBalance
|
Obj ledger_models.GlBalance
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// IngestChannelWrapper wraps the object with workflow params
|
// IngestChannelWrapper wraps the object with workflow params
|
||||||
type IngestChannelWrapper struct {
|
type IngestChannelWrapper struct {
|
||||||
Obj devops_models.Ingest
|
Obj devops_models.Ingest
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// InvoiceChannelWrapper wraps the object with workflow params
|
// InvoiceChannelWrapper wraps the object with workflow params
|
||||||
type InvoiceChannelWrapper struct {
|
type InvoiceChannelWrapper struct {
|
||||||
Obj ops_models.Invoice
|
Obj ops_models.Invoice
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// InvoiceItemChannelWrapper wraps the object with workflow params
|
// InvoiceItemChannelWrapper wraps the object with workflow params
|
||||||
type InvoiceItemChannelWrapper struct {
|
type InvoiceItemChannelWrapper struct {
|
||||||
Obj ops_models.InvoiceItem
|
Obj ops_models.InvoiceItem
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// JobChannelWrapper wraps the object with workflow params
|
// JobChannelWrapper wraps the object with workflow params
|
||||||
type JobChannelWrapper struct {
|
type JobChannelWrapper struct {
|
||||||
Obj devops_models.Job
|
Obj devops_models.Job
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// JournalEntryChannelWrapper wraps the object with workflow params
|
// JournalEntryChannelWrapper wraps the object with workflow params
|
||||||
type JournalEntryChannelWrapper struct {
|
type JournalEntryChannelWrapper struct {
|
||||||
Obj ledger_models.JournalEntry
|
Obj ledger_models.JournalEntry
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// JournalItemChannelWrapper wraps the object with workflow params
|
// JournalItemChannelWrapper wraps the object with workflow params
|
||||||
type JournalItemChannelWrapper struct {
|
type JournalItemChannelWrapper struct {
|
||||||
Obj ledger_models.JournalItem
|
Obj ledger_models.JournalItem
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// LeadChannelWrapper wraps the object with workflow params
|
// LeadChannelWrapper wraps the object with workflow params
|
||||||
type LeadChannelWrapper struct {
|
type LeadChannelWrapper struct {
|
||||||
Obj crm_models.Lead
|
Obj crm_models.Lead
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// LicenseChannelWrapper wraps the object with workflow params
|
// LicenseChannelWrapper wraps the object with workflow params
|
||||||
type LicenseChannelWrapper struct {
|
type LicenseChannelWrapper struct {
|
||||||
Obj regs_models.License
|
Obj regs_models.License
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// LicenseTypeChannelWrapper wraps the object with workflow params
|
// LicenseTypeChannelWrapper wraps the object with workflow params
|
||||||
type LicenseTypeChannelWrapper struct {
|
type LicenseTypeChannelWrapper struct {
|
||||||
Obj regs_models.LicenseType
|
Obj regs_models.LicenseType
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ type LicenseType struct {
|
||||||
// GeoLicenseTypeInstanceChannelWrapper wraps the object with workflow params
|
// GeoLicenseTypeInstanceChannelWrapper wraps the object with workflow params
|
||||||
type GeoLicenseTypeInstanceChannelWrapper struct {
|
type GeoLicenseTypeInstanceChannelWrapper struct {
|
||||||
Obj regs_models.GeoLicenseTypeInstance
|
Obj regs_models.GeoLicenseTypeInstance
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ type GeoLicenseTypeInstance struct {
|
||||||
// DomainLicenseTypeInstanceChannelWrapper wraps the object with workflow params
|
// DomainLicenseTypeInstanceChannelWrapper wraps the object with workflow params
|
||||||
type DomainLicenseTypeInstanceChannelWrapper struct {
|
type DomainLicenseTypeInstanceChannelWrapper struct {
|
||||||
// Obj regs_models.DomainLicenseTypeInstance
|
// Obj regs_models.DomainLicenseTypeInstance
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import "database/sql"
|
||||||
// LogChannelWrapper wraps the object with workflow params
|
// LogChannelWrapper wraps the object with workflow params
|
||||||
type LogChannelWrapper struct {
|
type LogChannelWrapper struct {
|
||||||
// Obj devops_models.AppLog
|
// Obj devops_models.AppLog
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// NotebookChannelWrapper wraps the object with workflow params
|
// NotebookChannelWrapper wraps the object with workflow params
|
||||||
type NotebookChannelWrapper struct {
|
type NotebookChannelWrapper struct {
|
||||||
Obj regs_models.Notebook
|
Obj regs_models.Notebook
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// NotebookItemChannelWrapper wraps the object with workflow params
|
// NotebookItemChannelWrapper wraps the object with workflow params
|
||||||
type NotebookItemChannelWrapper struct {
|
type NotebookItemChannelWrapper struct {
|
||||||
Obj regs_models.NotebookItem
|
Obj regs_models.NotebookItem
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// OrderChannelWrapper wraps the object with workflow params
|
// OrderChannelWrapper wraps the object with workflow params
|
||||||
type OrderChannelWrapper struct {
|
type OrderChannelWrapper struct {
|
||||||
Obj ops_models.Order
|
Obj ops_models.Order
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// OrderItemChannelWrapper wraps the object with workflow params
|
// OrderItemChannelWrapper wraps the object with workflow params
|
||||||
type OrderItemChannelWrapper struct {
|
type OrderItemChannelWrapper struct {
|
||||||
Obj ops_models.OrderItem
|
Obj ops_models.OrderItem
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import "code.tnxs.net/taxnexus/lib/api/workflow/workflow_models"
|
||||||
// OutgoingEmailMessageChannelWrapper wraps the object with workflow params
|
// OutgoingEmailMessageChannelWrapper wraps the object with workflow params
|
||||||
type OutgoingEmailMessageChannelWrapper struct {
|
type OutgoingEmailMessageChannelWrapper struct {
|
||||||
Obj workflow_models.OutgoingEmailMessage
|
Obj workflow_models.OutgoingEmailMessage
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ package app
|
||||||
// OutgoingEmailMessageReceiptChannelWrapper wraps the object with workflow params
|
// OutgoingEmailMessageReceiptChannelWrapper wraps the object with workflow params
|
||||||
type OutgoingEmailMessageReceiptChannelWrapper struct {
|
type OutgoingEmailMessageReceiptChannelWrapper struct {
|
||||||
// Obj workflow_models.OutgoingEmailMessageReceipt
|
// Obj workflow_models.OutgoingEmailMessageReceipt
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// PaymentMethodChannelWrapper wraps the object with workflow params
|
// PaymentMethodChannelWrapper wraps the object with workflow params
|
||||||
type PaymentMethodChannelWrapper struct {
|
type PaymentMethodChannelWrapper struct {
|
||||||
Obj ops_models.PaymentMethod
|
Obj ops_models.PaymentMethod
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import "database/sql"
|
||||||
// PDFChannelWrapper wraps the object with workflow params
|
// PDFChannelWrapper wraps the object with workflow params
|
||||||
type PDFChannelWrapper struct {
|
type PDFChannelWrapper struct {
|
||||||
// Obj stash_models.Pdf
|
// Obj stash_models.Pdf
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// PeriodChannelWrapper wraps the object with workflow params
|
// PeriodChannelWrapper wraps the object with workflow params
|
||||||
type PeriodChannelWrapper struct {
|
type PeriodChannelWrapper struct {
|
||||||
Obj ledger_models.Period
|
Obj ledger_models.Period
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// PlaceChannelWrapper wraps the object with workflow params
|
// PlaceChannelWrapper wraps the object with workflow params
|
||||||
type PlaceChannelWrapper struct {
|
type PlaceChannelWrapper struct {
|
||||||
Obj geo_models.Place
|
Obj geo_models.Place
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// PurchaseOrderChannelWrapper wraps the object with workflow params
|
// PurchaseOrderChannelWrapper wraps the object with workflow params
|
||||||
type PurchaseOrderChannelWrapper struct {
|
type PurchaseOrderChannelWrapper struct {
|
||||||
Obj ops_models.PurchaseOrder
|
Obj ops_models.PurchaseOrder
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// PurchaseOrderItemChannelWrapper wraps the object with workflow params
|
// PurchaseOrderItemChannelWrapper wraps the object with workflow params
|
||||||
type PurchaseOrderItemChannelWrapper struct {
|
type PurchaseOrderItemChannelWrapper struct {
|
||||||
Obj ops_models.PurchaseOrderItem
|
Obj ops_models.PurchaseOrderItem
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// ProductChannelWrapper wraps the object with workflow params
|
// ProductChannelWrapper wraps the object with workflow params
|
||||||
type ProductChannelWrapper struct {
|
type ProductChannelWrapper struct {
|
||||||
Obj ops_models.Product
|
Obj ops_models.Product
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// QuoteChannelWrapper wraps the object with workflow params
|
// QuoteChannelWrapper wraps the object with workflow params
|
||||||
type QuoteChannelWrapper struct {
|
type QuoteChannelWrapper struct {
|
||||||
Obj ops_models.Quote
|
Obj ops_models.Quote
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// QuoteItemChannelWrapper wraps the object with workflow params
|
// QuoteItemChannelWrapper wraps the object with workflow params
|
||||||
type QuoteItemChannelWrapper struct {
|
type QuoteItemChannelWrapper struct {
|
||||||
Obj ops_models.QuoteItem
|
Obj ops_models.QuoteItem
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
// RatingengineChannelWrapper wraps the object with workflow params
|
// RatingengineChannelWrapper wraps the object with workflow params
|
||||||
type RatingengineChannelWrapper struct {
|
type RatingengineChannelWrapper struct {
|
||||||
Obj regs_models.RatingEngine
|
Obj regs_models.RatingEngine
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
// RatingEngineItemChannelWrapper wraps the object with workflow params
|
// RatingEngineItemChannelWrapper wraps the object with workflow params
|
||||||
type RatingEngineItemChannelWrapper struct {
|
type RatingEngineItemChannelWrapper struct {
|
||||||
Obj regs_models.RatingEngineItem
|
Obj regs_models.RatingEngineItem
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// RoleChannelWrapper wraps the object with workflow params
|
// RoleChannelWrapper wraps the object with workflow params
|
||||||
type RoleChannelWrapper struct {
|
type RoleChannelWrapper struct {
|
||||||
Obj devops_models.Role
|
Obj devops_models.Role
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
28
app/root.go
28
app/root.go
|
@ -7,6 +7,7 @@ import (
|
||||||
|
|
||||||
"code.tnxs.net/taxnexus/lib/api/auth0/auth0_client"
|
"code.tnxs.net/taxnexus/lib/api/auth0/auth0_client"
|
||||||
"code.tnxs.net/taxnexus/lib/app/logger"
|
"code.tnxs.net/taxnexus/lib/app/logger"
|
||||||
|
httptransport "github.com/go-openapi/runtime/client"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"go.uber.org/zap/zapcore"
|
"go.uber.org/zap/zapcore"
|
||||||
|
@ -17,6 +18,7 @@ var config = Configuration{}
|
||||||
var appViper = viper.New()
|
var appViper = viper.New()
|
||||||
var auth0Client = auth0_client.Default
|
var auth0Client = auth0_client.Default
|
||||||
var configured = false
|
var configured = false
|
||||||
|
var apiUsers map[string]User
|
||||||
|
|
||||||
const getTimeout = 6 * time.Minute
|
const getTimeout = 6 * time.Minute
|
||||||
const postTimeout = 6 * time.Minute
|
const postTimeout = 6 * time.Minute
|
||||||
|
@ -48,12 +50,30 @@ func InitConfig(systemName string) {
|
||||||
sugar.Fatalf("app.InitConfig: 💣 ⛔ can't unmarshal system config: %w", err)
|
sugar.Fatalf("app.InitConfig: 💣 ⛔ can't unmarshal system config: %w", err)
|
||||||
}
|
}
|
||||||
sugar = logger.New(GetLogLevel())
|
sugar = logger.New(GetLogLevel())
|
||||||
|
apiUsers = initAPIUsers()
|
||||||
sugar.Debugf("app.InitConfig: 👍 📤 serviceAccounts: %d", len(config.ServiceAccounts))
|
sugar.Debugf("app.InitConfig: 👍 📤 serviceAccounts: %d", len(config.ServiceAccounts))
|
||||||
configured = true
|
configured = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// FirstClassObject is a struct
|
func initAPIUsers() map[string]User {
|
||||||
type FirstClassObject interface {
|
sugar.Info("board.initAPIUsers: 📥")
|
||||||
Marshal() interface{}
|
users := map[string]User{
|
||||||
UnMarshal() interface{}
|
"auth": {
|
||||||
|
APIKey: GetServiceAccount("auth").APIKey,
|
||||||
|
Auth: httptransport.APIKeyAuth(
|
||||||
|
"X-API-Key",
|
||||||
|
"header",
|
||||||
|
GetServiceAccount("auth").APIKey,
|
||||||
|
),
|
||||||
|
},
|
||||||
|
"test-service-account": {
|
||||||
|
APIKey: GetServiceAccount("test-service-account").APIKey,
|
||||||
|
Auth: httptransport.APIKeyAuth(
|
||||||
|
"X-API-Key",
|
||||||
|
"header",
|
||||||
|
GetServiceAccount("test-service-account").APIKey),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
sugar.Debugf("board.initAPIUsers: 👍 📤")
|
||||||
|
return users
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// ServiceChannelWrapper wraps the object with workflow params
|
// ServiceChannelWrapper wraps the object with workflow params
|
||||||
type ServiceChannelWrapper struct {
|
type ServiceChannelWrapper struct {
|
||||||
Obj devops_models.Service
|
Obj devops_models.Service
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// StateChannelWrapper wraps the object with workflow params
|
// StateChannelWrapper wraps the object with workflow params
|
||||||
type StateChannelWrapper struct {
|
type StateChannelWrapper struct {
|
||||||
Obj geo_models.State
|
Obj geo_models.State
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// SubmissionChannelWrapper wraps the object with workflow params
|
// SubmissionChannelWrapper wraps the object with workflow params
|
||||||
type SubmissionChannelWrapper struct {
|
type SubmissionChannelWrapper struct {
|
||||||
Obj regs_models.Submission
|
Obj regs_models.Submission
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
// TaskChannelWrapper wraps the object with workflow params
|
// TaskChannelWrapper wraps the object with workflow params
|
||||||
type TaskChannelWrapper struct {
|
type TaskChannelWrapper struct {
|
||||||
// Obj workflow_models.Task
|
// Obj workflow_models.Task
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
// TaskRelationChannelWrapper wraps the object with workflow params
|
// TaskRelationChannelWrapper wraps the object with workflow params
|
||||||
type TaskRelationChannelWrapper struct {
|
type TaskRelationChannelWrapper struct {
|
||||||
// Obj workflow_models.TaskRelation
|
// Obj workflow_models.TaskRelation
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
// TaskWhoRelationChannelWrapper wraps the object with workflow params
|
// TaskWhoRelationChannelWrapper wraps the object with workflow params
|
||||||
type TaskWhoRelationChannelWrapper struct {
|
type TaskWhoRelationChannelWrapper struct {
|
||||||
// Obj workflow_models.TaskWhoRelation
|
// Obj workflow_models.TaskWhoRelation
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// TaxInstanceChannelWrapper wraps the object with workflow params
|
// TaxInstanceChannelWrapper wraps the object with workflow params
|
||||||
type TaxInstanceChannelWrapper struct {
|
type TaxInstanceChannelWrapper struct {
|
||||||
Obj geo_models.TaxInstance
|
Obj geo_models.TaxInstance
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// TaxnexusCodeChannelWrapper wraps the object with workflow params
|
// TaxnexusCodeChannelWrapper wraps the object with workflow params
|
||||||
type TaxnexusCodeChannelWrapper struct {
|
type TaxnexusCodeChannelWrapper struct {
|
||||||
Obj geo_models.TaxnexusCode
|
Obj geo_models.TaxnexusCode
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import "code.tnxs.net/taxnexus/lib/api/geo/geo_models"
|
||||||
// TaxRateChannelWrapper wraps the object with workflow params
|
// TaxRateChannelWrapper wraps the object with workflow params
|
||||||
type TaxRateChannelWrapper struct {
|
type TaxRateChannelWrapper struct {
|
||||||
Obj geo_models.TaxRate
|
Obj geo_models.TaxRate
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// TaxTransactionChannelWrapper wraps the object with workflow params
|
// TaxTransactionChannelWrapper wraps the object with workflow params
|
||||||
type TaxTransactionChannelWrapper struct {
|
type TaxTransactionChannelWrapper struct {
|
||||||
Obj ops_models.TaxTransaction
|
Obj ops_models.TaxTransaction
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// TaxTypeChannelWrapper wraps the object with workflow params
|
// TaxTypeChannelWrapper wraps the object with workflow params
|
||||||
type TaxTypeChannelWrapper struct {
|
type TaxTypeChannelWrapper struct {
|
||||||
Obj geo_models.TaxType
|
Obj geo_models.TaxType
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// TaxTypeAccountChannelWrapper wraps the object with workflow params
|
// TaxTypeAccountChannelWrapper wraps the object with workflow params
|
||||||
type TaxTypeAccountChannelWrapper struct {
|
type TaxTypeAccountChannelWrapper struct {
|
||||||
Obj regs_models.TaxTypeAccount
|
Obj regs_models.TaxTypeAccount
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// TemplateChannelWrapper wraps the object with workflow params
|
// TemplateChannelWrapper wraps the object with workflow params
|
||||||
type TemplateChannelWrapper struct {
|
type TemplateChannelWrapper struct {
|
||||||
Obj devops_models.Template
|
Obj devops_models.Template
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// TenantChannelWrapper wraps the object with workflow params
|
// TenantChannelWrapper wraps the object with workflow params
|
||||||
type TenantChannelWrapper struct {
|
type TenantChannelWrapper struct {
|
||||||
Obj devops_models.Tenant
|
Obj devops_models.Tenant
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import "code.tnxs.net/taxnexus/lib/api/devops/devops_models"
|
||||||
// TenantUserChannelWrapper wraps the object with workflow params
|
// TenantUserChannelWrapper wraps the object with workflow params
|
||||||
type TenantUserChannelWrapper struct {
|
type TenantUserChannelWrapper struct {
|
||||||
Obj devops_models.TenantUser
|
Obj devops_models.TenantUser
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import "code.tnxs.net/taxnexus/lib/api/ops/ops_models"
|
||||||
// TotalChannelWrapper wraps the object with workflow params
|
// TotalChannelWrapper wraps the object with workflow params
|
||||||
type TotalChannelWrapper struct {
|
type TotalChannelWrapper struct {
|
||||||
Obj ops_models.Total
|
Obj ops_models.Total
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import "code.tnxs.net/taxnexus/lib/api/ops/ops_models"
|
||||||
// TotalItemChannelWrapper wraps the object with workflow params
|
// TotalItemChannelWrapper wraps the object with workflow params
|
||||||
type TotalItemChannelWrapper struct {
|
type TotalItemChannelWrapper struct {
|
||||||
Obj ops_models.TotalItem
|
Obj ops_models.TotalItem
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import "code.tnxs.net/taxnexus/lib/api/ops/ops_models"
|
||||||
// TotalTaxItemChannelWrapper wraps the object with workflow params
|
// TotalTaxItemChannelWrapper wraps the object with workflow params
|
||||||
type TotalTaxItemChannelWrapper struct {
|
type TotalTaxItemChannelWrapper struct {
|
||||||
Obj ops_models.TotalTaxItem
|
Obj ops_models.TotalTaxItem
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// TransactionItemChannelWrapper wraps the object with workflow params
|
// TransactionItemChannelWrapper wraps the object with workflow params
|
||||||
type TransactionItemChannelWrapper struct {
|
type TransactionItemChannelWrapper struct {
|
||||||
Obj regs_models.Transaction
|
Obj regs_models.Transaction
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
// UserChannelWrapper wraps the object with workflow params
|
// UserChannelWrapper wraps the object with workflow params
|
||||||
type UserChannelWrapper struct {
|
type UserChannelWrapper struct {
|
||||||
Obj devops_models.User
|
Obj devops_models.User
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import "code.tnxs.net/taxnexus/lib/api/devops/devops_models"
|
||||||
// UserRoleChannelWrapper wraps the object with workflow params
|
// UserRoleChannelWrapper wraps the object with workflow params
|
||||||
type UserRoleChannelWrapper struct {
|
type UserRoleChannelWrapper struct {
|
||||||
Obj devops_models.UserRole
|
Obj devops_models.UserRole
|
||||||
Principal User
|
APIKey string
|
||||||
SagaID string
|
SagaID string
|
||||||
SagaType string
|
SagaType string
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"code.tnxs.net/taxnexus/lib/api/crm/crm_client/accounts"
|
"code.tnxs.net/taxnexus/lib/api/crm/crm_client/accounts"
|
||||||
"code.tnxs.net/taxnexus/lib/api/crm/crm_models"
|
"code.tnxs.net/taxnexus/lib/api/crm/crm_models"
|
||||||
"code.tnxs.net/taxnexus/lib/app"
|
"code.tnxs.net/taxnexus/lib/app"
|
||||||
|
httptransport "github.com/go-openapi/runtime/client"
|
||||||
"go.temporal.io/sdk/workflow"
|
"go.temporal.io/sdk/workflow"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -16,7 +17,13 @@ func StoreAccountActivity(ctx workflow.Context, w app.AccountChannelWrapper) err
|
||||||
postAccountParams.AccountRequest = &crm_models.AccountRequest{
|
postAccountParams.AccountRequest = &crm_models.AccountRequest{
|
||||||
Data: []*crm_models.Account{&w.Obj},
|
Data: []*crm_models.Account{&w.Obj},
|
||||||
}
|
}
|
||||||
_, err := crmClient.Accounts.PostAccounts(postAccountParams, w.Principal.Auth)
|
_, err := crmClient.Accounts.PostAccounts(
|
||||||
|
postAccountParams,
|
||||||
|
httptransport.APIKeyAuth(
|
||||||
|
"X-API-Key",
|
||||||
|
"header",
|
||||||
|
w.APIKey,
|
||||||
|
))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import (
|
||||||
"code.tnxs.net/taxnexus/lib/api/workflow/workflow_client/outgoing_email_message"
|
"code.tnxs.net/taxnexus/lib/api/workflow/workflow_client/outgoing_email_message"
|
||||||
"code.tnxs.net/taxnexus/lib/api/workflow/workflow_models"
|
"code.tnxs.net/taxnexus/lib/api/workflow/workflow_models"
|
||||||
"code.tnxs.net/taxnexus/lib/app"
|
"code.tnxs.net/taxnexus/lib/app"
|
||||||
|
httptransport "github.com/go-openapi/runtime/client"
|
||||||
"go.temporal.io/sdk/workflow"
|
"go.temporal.io/sdk/workflow"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -33,7 +34,12 @@ func StoreAuth0UserActivity(ctx workflow.Context, w app.UserChannelWrapper) erro
|
||||||
putUserParams.UserRequest = &devops_models.UserRequest{
|
putUserParams.UserRequest = &devops_models.UserRequest{
|
||||||
Data: []*devops_models.User{&putUser},
|
Data: []*devops_models.User{&putUser},
|
||||||
}
|
}
|
||||||
_, err = devopsClient.User.PutUsers(putUserParams, w.Principal.Auth)
|
_, err = devopsClient.User.PutUsers(putUserParams,
|
||||||
|
httptransport.APIKeyAuth(
|
||||||
|
"X-API-Key",
|
||||||
|
"header",
|
||||||
|
w.APIKey,
|
||||||
|
))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -52,7 +58,11 @@ func StoreAuth0UserActivity(ctx workflow.Context, w app.UserChannelWrapper) erro
|
||||||
OutgoingEmailMessage.
|
OutgoingEmailMessage.
|
||||||
PostOutgoingEmailMessages(
|
PostOutgoingEmailMessages(
|
||||||
emailParams,
|
emailParams,
|
||||||
w.Principal.Auth,
|
httptransport.APIKeyAuth(
|
||||||
|
"X-API-Key",
|
||||||
|
"header",
|
||||||
|
w.APIKey,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -10,6 +10,7 @@ import (
|
||||||
"code.tnxs.net/taxnexus/lib/api/workflow/workflow_client/outgoing_email_message"
|
"code.tnxs.net/taxnexus/lib/api/workflow/workflow_client/outgoing_email_message"
|
||||||
"code.tnxs.net/taxnexus/lib/api/workflow/workflow_models"
|
"code.tnxs.net/taxnexus/lib/api/workflow/workflow_models"
|
||||||
"code.tnxs.net/taxnexus/lib/app"
|
"code.tnxs.net/taxnexus/lib/app"
|
||||||
|
httptransport "github.com/go-openapi/runtime/client"
|
||||||
"go.temporal.io/sdk/workflow"
|
"go.temporal.io/sdk/workflow"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -22,7 +23,12 @@ func StoreContactActivity(ctx workflow.Context, w app.ContactChannelWrapper) err
|
||||||
postContactParams.ContactsRequest = &crm_models.ContactRequest{
|
postContactParams.ContactsRequest = &crm_models.ContactRequest{
|
||||||
Data: []*crm_models.Contact{&w.Obj},
|
Data: []*crm_models.Contact{&w.Obj},
|
||||||
}
|
}
|
||||||
_, err := crmClient.Contacts.PostContacts(postContactParams, w.Principal.Auth)
|
_, err := crmClient.Contacts.PostContacts(postContactParams,
|
||||||
|
httptransport.APIKeyAuth(
|
||||||
|
"X-API-Key",
|
||||||
|
"header",
|
||||||
|
w.APIKey,
|
||||||
|
))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -64,7 +70,12 @@ Alert! New Contact Inquiry from Taxnexus.io website.
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
_, err = workflowClient.OutgoingEmailMessage.PostOutgoingEmailMessages(emailParams, w.Principal.Auth)
|
_, err = workflowClient.OutgoingEmailMessage.PostOutgoingEmailMessages(emailParams,
|
||||||
|
httptransport.APIKeyAuth(
|
||||||
|
"X-API-Key",
|
||||||
|
"header",
|
||||||
|
w.APIKey,
|
||||||
|
))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ import (
|
||||||
"code.tnxs.net/taxnexus/lib/api/workflow/workflow_client/outgoing_email_message"
|
"code.tnxs.net/taxnexus/lib/api/workflow/workflow_client/outgoing_email_message"
|
||||||
"code.tnxs.net/taxnexus/lib/api/workflow/workflow_models"
|
"code.tnxs.net/taxnexus/lib/api/workflow/workflow_models"
|
||||||
"code.tnxs.net/taxnexus/lib/app"
|
"code.tnxs.net/taxnexus/lib/app"
|
||||||
|
httptransport "github.com/go-openapi/runtime/client"
|
||||||
"go.temporal.io/sdk/workflow"
|
"go.temporal.io/sdk/workflow"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -22,7 +23,12 @@ func StoreLeadActivity(ctx workflow.Context, w app.LeadChannelWrapper) error { /
|
||||||
postLeadParams.LeadRequest = &crm_models.LeadRequest{
|
postLeadParams.LeadRequest = &crm_models.LeadRequest{
|
||||||
Data: []*crm_models.Lead{&w.Obj},
|
Data: []*crm_models.Lead{&w.Obj},
|
||||||
}
|
}
|
||||||
_, err := crmClient.Leads.PostLeads(postLeadParams, w.Principal.Auth)
|
_, err := crmClient.Leads.PostLeads(postLeadParams,
|
||||||
|
httptransport.APIKeyAuth(
|
||||||
|
"X-API-Key",
|
||||||
|
"header",
|
||||||
|
w.APIKey,
|
||||||
|
))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -64,7 +70,12 @@ Alert! New Lead Inquiry from Taxnexus.io website.
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
_, err = workflowClient.OutgoingEmailMessage.PostOutgoingEmailMessages(emailParams, w.Principal.Auth)
|
_, err = workflowClient.OutgoingEmailMessage.PostOutgoingEmailMessages(emailParams,
|
||||||
|
httptransport.APIKeyAuth(
|
||||||
|
"X-API-Key",
|
||||||
|
"header",
|
||||||
|
w.APIKey,
|
||||||
|
))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ func NewDeveloperWorkflow(
|
||||||
StoreContactActivity,
|
StoreContactActivity,
|
||||||
&app.ContactChannelWrapper{
|
&app.ContactChannelWrapper{
|
||||||
Obj: payload.Contact,
|
Obj: payload.Contact,
|
||||||
Principal: payload.Principal,
|
APIKey: payload.Principal.APIKey,
|
||||||
SagaID: payload.SagaID,
|
SagaID: payload.SagaID,
|
||||||
SagaType: payload.SagaType,
|
SagaType: payload.SagaType,
|
||||||
}).Get(ctx, nil)
|
}).Get(ctx, nil)
|
||||||
|
@ -42,7 +42,7 @@ func NewDeveloperWorkflow(
|
||||||
StoreAccountActivity,
|
StoreAccountActivity,
|
||||||
&app.AccountChannelWrapper{
|
&app.AccountChannelWrapper{
|
||||||
Obj: payload.Account,
|
Obj: payload.Account,
|
||||||
Principal: payload.Principal,
|
APIKey: payload.Principal.APIKey,
|
||||||
SagaID: payload.SagaID,
|
SagaID: payload.SagaID,
|
||||||
SagaType: payload.SagaType,
|
SagaType: payload.SagaType,
|
||||||
}).Get(ctx, nil)
|
}).Get(ctx, nil)
|
||||||
|
@ -53,7 +53,7 @@ func NewDeveloperWorkflow(
|
||||||
StorePaymentMethodActivity,
|
StorePaymentMethodActivity,
|
||||||
&app.PaymentMethodChannelWrapper{
|
&app.PaymentMethodChannelWrapper{
|
||||||
Obj: payload.PaymentMethod,
|
Obj: payload.PaymentMethod,
|
||||||
Principal: payload.Principal,
|
APIKey: payload.Principal.APIKey,
|
||||||
SagaID: payload.SagaID,
|
SagaID: payload.SagaID,
|
||||||
SagaType: payload.SagaType,
|
SagaType: payload.SagaType,
|
||||||
}).Get(ctx, nil)
|
}).Get(ctx, nil)
|
||||||
|
@ -64,7 +64,7 @@ func NewDeveloperWorkflow(
|
||||||
NotifyContactActivity,
|
NotifyContactActivity,
|
||||||
&app.ContactChannelWrapper{
|
&app.ContactChannelWrapper{
|
||||||
Obj: payload.Contact,
|
Obj: payload.Contact,
|
||||||
Principal: payload.Principal,
|
APIKey: payload.Principal.APIKey,
|
||||||
SagaID: payload.SagaID,
|
SagaID: payload.SagaID,
|
||||||
SagaType: payload.SagaType,
|
SagaType: payload.SagaType,
|
||||||
}).Get(ctx, nil)
|
}).Get(ctx, nil)
|
||||||
|
|
|
@ -30,7 +30,7 @@ func NewLeadWorkflow(ctx temporal_workflow.Context, payload *NewLeadWrapper) err
|
||||||
StoreLeadActivity,
|
StoreLeadActivity,
|
||||||
&app.LeadChannelWrapper{
|
&app.LeadChannelWrapper{
|
||||||
Obj: payload.Lead,
|
Obj: payload.Lead,
|
||||||
Principal: payload.Principal,
|
APIKey: payload.Principal.APIKey,
|
||||||
}).Get(ctx, nil)
|
}).Get(ctx, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -41,7 +41,7 @@ func NewLeadWorkflow(ctx temporal_workflow.Context, payload *NewLeadWrapper) err
|
||||||
NotifyLeadActivity,
|
NotifyLeadActivity,
|
||||||
&app.LeadChannelWrapper{
|
&app.LeadChannelWrapper{
|
||||||
Obj: payload.Lead,
|
Obj: payload.Lead,
|
||||||
Principal: payload.Principal,
|
APIKey: payload.Principal.APIKey,
|
||||||
}).Get(ctx, nil)
|
}).Get(ctx, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -27,7 +27,7 @@ func NewUserWorkflow(ctx workflow.Context, payload *NewUserChannelWrapper) error
|
||||||
StoreUserActivity,
|
StoreUserActivity,
|
||||||
&app.UserChannelWrapper{
|
&app.UserChannelWrapper{
|
||||||
Obj: payload.User,
|
Obj: payload.User,
|
||||||
Principal: payload.Principal,
|
APIKey: payload.Principal.APIKey,
|
||||||
SagaID: payload.SagaID,
|
SagaID: payload.SagaID,
|
||||||
SagaType: payload.SagaType,
|
SagaType: payload.SagaType,
|
||||||
}).Get(ctx, nil)
|
}).Get(ctx, nil)
|
||||||
|
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"code.tnxs.net/taxnexus/lib/api/ops/ops_client/payment_method"
|
"code.tnxs.net/taxnexus/lib/api/ops/ops_client/payment_method"
|
||||||
"code.tnxs.net/taxnexus/lib/api/ops/ops_models"
|
"code.tnxs.net/taxnexus/lib/api/ops/ops_models"
|
||||||
"code.tnxs.net/taxnexus/lib/app"
|
"code.tnxs.net/taxnexus/lib/app"
|
||||||
|
httptransport "github.com/go-openapi/runtime/client"
|
||||||
"go.temporal.io/sdk/workflow"
|
"go.temporal.io/sdk/workflow"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -16,7 +17,12 @@ func StorePaymentMethodActivity(
|
||||||
postPaymentMethodParams.PaymentMethodRequest = &ops_models.PaymentMethodRequest{
|
postPaymentMethodParams.PaymentMethodRequest = &ops_models.PaymentMethodRequest{
|
||||||
Data: []*ops_models.PaymentMethod{&w.Obj},
|
Data: []*ops_models.PaymentMethod{&w.Obj},
|
||||||
}
|
}
|
||||||
_, err := opsClient.PaymentMethod.PostPaymentMethods(postPaymentMethodParams, w.Principal.Auth)
|
_, err := opsClient.PaymentMethod.PostPaymentMethods(postPaymentMethodParams,
|
||||||
|
httptransport.APIKeyAuth(
|
||||||
|
"X-API-Key",
|
||||||
|
"header",
|
||||||
|
w.APIKey,
|
||||||
|
))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ import (
|
||||||
"code.tnxs.net/taxnexus/lib/api/auth0/auth0_models"
|
"code.tnxs.net/taxnexus/lib/api/auth0/auth0_models"
|
||||||
"code.tnxs.net/taxnexus/lib/api/devops/devops_client/user"
|
"code.tnxs.net/taxnexus/lib/api/devops/devops_client/user"
|
||||||
"code.tnxs.net/taxnexus/lib/api/devops/devops_models"
|
"code.tnxs.net/taxnexus/lib/api/devops/devops_models"
|
||||||
|
httptransport "github.com/go-openapi/runtime/client"
|
||||||
|
|
||||||
"code.tnxs.net/taxnexus/lib/api/workflow/workflow_client/outgoing_email_message"
|
"code.tnxs.net/taxnexus/lib/api/workflow/workflow_client/outgoing_email_message"
|
||||||
"code.tnxs.net/taxnexus/lib/api/workflow/workflow_models"
|
"code.tnxs.net/taxnexus/lib/api/workflow/workflow_models"
|
||||||
|
@ -25,7 +26,12 @@ func StoreUserActivity(ctx workflow.Context, w app.UserChannelWrapper) error { /
|
||||||
postUserParams.UserRequest = &devops_models.UserRequest{
|
postUserParams.UserRequest = &devops_models.UserRequest{
|
||||||
Data: []*devops_models.User{&w.Obj},
|
Data: []*devops_models.User{&w.Obj},
|
||||||
}
|
}
|
||||||
devopsResponse, err := devopsClient.User.PostUsers(postUserParams, w.Principal.Auth)
|
devopsResponse, err := devopsClient.User.PostUsers(postUserParams,
|
||||||
|
httptransport.APIKeyAuth(
|
||||||
|
"X-API-Key",
|
||||||
|
"header",
|
||||||
|
w.APIKey,
|
||||||
|
))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -63,7 +69,12 @@ func StoreUserActivity(ctx workflow.Context, w app.UserChannelWrapper) error { /
|
||||||
putUserParams.UserRequest = &devops_models.UserRequest{
|
putUserParams.UserRequest = &devops_models.UserRequest{
|
||||||
Data: []*devops_models.User{newUser},
|
Data: []*devops_models.User{newUser},
|
||||||
}
|
}
|
||||||
_, err = devopsClient.User.PutUsers(putUserParams, w.Principal.Auth)
|
_, err = devopsClient.User.PutUsers(putUserParams,
|
||||||
|
httptransport.APIKeyAuth(
|
||||||
|
"X-API-Key",
|
||||||
|
"header",
|
||||||
|
w.APIKey,
|
||||||
|
))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -108,7 +119,12 @@ Alert! New User Inquiry from Taxnexus.io website.
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
_, err = workflowClient.OutgoingEmailMessage.PostOutgoingEmailMessages(emailParams, w.Principal.Auth)
|
_, err = workflowClient.OutgoingEmailMessage.PostOutgoingEmailMessages(emailParams,
|
||||||
|
httptransport.APIKeyAuth(
|
||||||
|
"X-API-Key",
|
||||||
|
"header",
|
||||||
|
w.APIKey,
|
||||||
|
))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue