v0.1.15
Vernon Keenan 2021-01-18 17:50:45 -08:00
parent f5aa06ed82
commit 54392e385e
86 changed files with 450 additions and 342 deletions

View File

@ -8,10 +8,10 @@ import (
// AccountChannelWrapper wraps the object with workflow params
type AccountChannelWrapper struct {
Obj crm_models.Account
Principal User
SagaID string
SagaType string
Obj crm_models.Account
APIKey string
SagaID string
SagaType string
}
// Account is a DB struct

View File

@ -8,10 +8,10 @@ import (
// AccountingRuleChannelWrapper wraps the object with workflow params
type AccountingRuleChannelWrapper struct {
Obj ledger_models.AccountingRule
Principal User
SagaID string
SagaType string
Obj ledger_models.AccountingRule
APIKey string
SagaID string
SagaType string
}
// AccountingRule is a first class object type

View File

@ -8,10 +8,10 @@ import (
// AccountingRulesetChannelWrapper wraps the object with workflow params
type AccountingRulesetChannelWrapper struct {
Obj ledger_models.AccountingRuleset
Principal User
SagaID string
SagaType string
Obj ledger_models.AccountingRuleset
APIKey string
SagaID string
SagaType string
}
// AccountingRuleset is exported

View File

@ -8,10 +8,10 @@ import (
// AccountingRulesetItemChannelWrapper wraps the object with workflow params
type AccountingRulesetItemChannelWrapper struct {
Obj ledger_models.AccountingRulesetItem
Principal User
SagaID string
SagaType string
Obj ledger_models.AccountingRulesetItem
APIKey string
SagaID string
SagaType string
}
// AccountingRulesetItem is a first class object type

27
app/auth.go Normal file
View File

@ -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
}

View File

@ -8,10 +8,10 @@ import (
// BackendChannelWrapper wraps the object with workflow params
type BackendChannelWrapper struct {
Obj regs_models.Backend
Principal User
SagaID string
SagaType string
Obj regs_models.Backend
APIKey string
SagaID string
SagaType string
}
// Backend is a first class object type

View File

@ -8,10 +8,10 @@ import (
// CashReceiptChannelWrapper wraps the object with workflow params
type CashReceiptChannelWrapper struct {
Obj ops_models.CashReceipt
Principal User
SagaID string
SagaType string
Obj ops_models.CashReceipt
APIKey string
SagaID string
SagaType string
}
// CashReceipt is a first class object type

View File

@ -8,10 +8,10 @@ import (
// ChargeChannelWrapper wraps the object with workflow params
type ChargeChannelWrapper struct {
Obj ops_models.Charge
Principal User
SagaID string
SagaType string
Obj ops_models.Charge
APIKey string
SagaID string
SagaType string
}
// Charge is a first class object type

View File

@ -8,10 +8,10 @@ import (
// ClusterChannelWrapper wraps the object with workflow params
type ClusterChannelWrapper struct {
Obj devops_models.Cluster
Principal User
SagaID string
SagaType string
Obj devops_models.Cluster
APIKey string
SagaID string
SagaType string
}
// Cluster is a first class object type

View File

@ -8,10 +8,10 @@ import (
// CompanyChannelWrapper wraps the object with workflow params
type CompanyChannelWrapper struct {
Obj crm_models.Company
Principal User
SagaID string
SagaType string
Obj crm_models.Company
APIKey string
SagaID string
SagaType string
}
// Company is a DB struct

View File

@ -11,10 +11,10 @@ const NewContactActivity = "NEW_CONTACT_ACTIVITY"
// ContactChannelWrapper wraps the object with workflow params
type ContactChannelWrapper struct {
Obj crm_models.Contact
Principal User
SagaID string
SagaType string
Obj crm_models.Contact
APIKey string
SagaID string
SagaType string
}
// Contact is a first-class object

View File

@ -8,10 +8,10 @@ import (
// CoordinateBasicChannelWrapper wraps the object with workflow params
type CoordinateBasicChannelWrapper struct {
Obj geo_models.CoordinateBasic
Principal User
SagaID string
SagaType string
Obj geo_models.CoordinateBasic
APIKey string
SagaID string
SagaType string
}
// CoordinateBasic is a first class object type
@ -31,10 +31,10 @@ type CoordinateBasic struct {
// CoordinateChannelWrapper wraps the object with workflow params
type CoordinateChannelWrapper struct {
Obj geo_models.Coordinate
Principal User
SagaID string
SagaType string
Obj geo_models.Coordinate
APIKey string
SagaID string
SagaType string
}
// Coordinate is a first class object type

View File

@ -8,10 +8,10 @@ import (
// CountryChannelWrapper wraps the object with workflow params
type CountryChannelWrapper struct {
Obj geo_models.Country
Principal User
SagaID string
SagaType string
Obj geo_models.Country
APIKey string
SagaID string
SagaType string
}
// Country is a first class object type

View File

@ -8,10 +8,10 @@ import (
// CountyChannelWrapper wraps the object with workflow params
type CountyChannelWrapper struct {
Obj geo_models.County
Principal User
SagaID string
SagaType string
Obj geo_models.County
APIKey string
SagaID string
SagaType string
}
// County is a first class object type

View File

@ -8,10 +8,10 @@ import (
// DatabaseChannelWrapper wraps the object with workflow params
type DatabaseChannelWrapper struct {
Obj devops_models.Database
Principal User
SagaID string
SagaType string
Obj devops_models.Database
APIKey string
SagaID string
SagaType string
}
// Database is a first-class object type

View File

@ -4,10 +4,10 @@ import "code.tnxs.net/taxnexus/lib/api/geo/geo_models"
// DomainChannelWrapper wraps the object with workflow params
type DomainChannelWrapper struct {
Obj geo_models.Domain
Principal User
SagaID string
SagaType string
Obj geo_models.Domain
APIKey string
SagaID string
SagaType string
}
// Domain is a first class object type

View File

@ -8,10 +8,10 @@ import (
// EftChannelWrapper wraps the object with workflow params
type EftChannelWrapper struct {
Obj ops_models.Eft
Principal User
SagaID string
SagaType string
Obj ops_models.Eft
APIKey string
SagaID string
SagaType string
}
// Eft is a first class object type

View File

@ -8,10 +8,10 @@ import (
// EftItemChannelWrapper wraps the object with workflow params
type EftItemChannelWrapper struct {
Obj ops_models.EftItem
Principal User
SagaID string
SagaType string
Obj ops_models.EftItem
APIKey string
SagaID string
SagaType string
}
// EftItem is a first class object type

View File

@ -8,10 +8,10 @@ import (
// EmailMessageChannelWrapper wraps the object with workflow params
type EmailMessageChannelWrapper struct {
Obj workflow_models.EmailMessage
Principal User
SagaID string
SagaType string
Obj workflow_models.EmailMessage
APIKey string
SagaID string
SagaType string
}
// EmailMessage is a first class object type

View File

@ -7,9 +7,9 @@ import (
// EmailTemplateChannelWrapper wraps the object with workflow params
type EmailTemplateChannelWrapper struct {
// Obj workflow_models.EmailTemplate
Principal User
SagaID string
SagaType string
APIKey string
SagaID string
SagaType string
}
// EmailTemplate is a first class object type

View File

@ -8,10 +8,10 @@ import (
// FilingChannelWrapper wraps the object with workflow params
type FilingChannelWrapper struct {
Obj regs_models.Filing
Principal User
SagaID string
SagaType string
Obj regs_models.Filing
APIKey string
SagaID string
SagaType string
}
// Filing is a first class object type

View File

@ -8,10 +8,10 @@ import (
// FilingScheduleItemChannelWrapper wraps the object with workflow params
type FilingScheduleItemChannelWrapper struct {
Obj regs_models.FilingScheduleItem
Principal User
SagaID string
SagaType string
Obj regs_models.FilingScheduleItem
APIKey string
SagaID string
SagaType string
}
// FilingScheduleItem is a first class object type

View File

@ -8,10 +8,10 @@ import (
// FilingTypeChannelWrapper wraps the object with workflow params
type FilingTypeChannelWrapper struct {
Obj regs_models.FilingType
Principal User
SagaID string
SagaType string
Obj regs_models.FilingType
APIKey string
SagaID string
SagaType string
}
// FilingType is a first class object type

View File

@ -8,10 +8,10 @@ import (
// FilingTypeInstanceChannelWrapper wraps the object with workflow params
type FilingTypeInstanceChannelWrapper struct {
Obj regs_models.FilingTypeInstance
Principal User
SagaID string
SagaType string
Obj regs_models.FilingTypeInstance
APIKey string
SagaID string
SagaType string
}
// FilingTypeInstance is a first class object type

View File

@ -7,9 +7,9 @@ import (
// FolderChannelWrapper wraps the object with workflow params
type FolderChannelWrapper struct {
// Obj workflow_models.Folder
Principal User
SagaID string
SagaType string
APIKey string
SagaID string
SagaType string
}
// Folder is a first class object type

View File

@ -8,10 +8,10 @@ import (
// GlAccountChannelWrapper wraps the object with workflow params
type GlAccountChannelWrapper struct {
Obj ledger_models.GlAccount
Principal User
SagaID string
SagaType string
Obj ledger_models.GlAccount
APIKey string
SagaID string
SagaType string
}
// GlAccount is a first class object type

View File

@ -8,10 +8,10 @@ import (
// GlBalanceChannelWrapper wraps the object with workflow params
type GlBalanceChannelWrapper struct {
Obj ledger_models.GlBalance
Principal User
SagaID string
SagaType string
Obj ledger_models.GlBalance
APIKey string
SagaID string
SagaType string
}
// GlBalance is a first class object type

View File

@ -8,10 +8,10 @@ import (
// IngestChannelWrapper wraps the object with workflow params
type IngestChannelWrapper struct {
Obj devops_models.Ingest
Principal User
SagaID string
SagaType string
Obj devops_models.Ingest
APIKey string
SagaID string
SagaType string
}
// Ingest is a first class object type

View File

@ -8,10 +8,10 @@ import (
// InvoiceChannelWrapper wraps the object with workflow params
type InvoiceChannelWrapper struct {
Obj ops_models.Invoice
Principal User
SagaID string
SagaType string
Obj ops_models.Invoice
APIKey string
SagaID string
SagaType string
}
// Invoice is the in-memory struct for invoices

View File

@ -8,10 +8,10 @@ import (
// InvoiceItemChannelWrapper wraps the object with workflow params
type InvoiceItemChannelWrapper struct {
Obj ops_models.InvoiceItem
Principal User
SagaID string
SagaType string
Obj ops_models.InvoiceItem
APIKey string
SagaID string
SagaType string
}
// InvoiceItem is a large struct

View File

@ -8,10 +8,10 @@ import (
// JobChannelWrapper wraps the object with workflow params
type JobChannelWrapper struct {
Obj devops_models.Job
Principal User
SagaID string
SagaType string
Obj devops_models.Job
APIKey string
SagaID string
SagaType string
}
// Job is a first class object type

View File

@ -8,10 +8,10 @@ import (
// JournalEntryChannelWrapper wraps the object with workflow params
type JournalEntryChannelWrapper struct {
Obj ledger_models.JournalEntry
Principal User
SagaID string
SagaType string
Obj ledger_models.JournalEntry
APIKey string
SagaID string
SagaType string
}
// JournalEntry is a first class object type

View File

@ -8,10 +8,10 @@ import (
// JournalItemChannelWrapper wraps the object with workflow params
type JournalItemChannelWrapper struct {
Obj ledger_models.JournalItem
Principal User
SagaID string
SagaType string
Obj ledger_models.JournalItem
APIKey string
SagaID string
SagaType string
}
// JournalItem is a first class object type

View File

@ -8,10 +8,10 @@ import (
// LeadChannelWrapper wraps the object with workflow params
type LeadChannelWrapper struct {
Obj crm_models.Lead
Principal User
SagaID string
SagaType string
Obj crm_models.Lead
APIKey string
SagaID string
SagaType string
}
// Lead is a first-class object type

View File

@ -8,10 +8,10 @@ import (
// LicenseChannelWrapper wraps the object with workflow params
type LicenseChannelWrapper struct {
Obj regs_models.License
Principal User
SagaID string
SagaType string
Obj regs_models.License
APIKey string
SagaID string
SagaType string
}
// License is a first class object type

View File

@ -8,10 +8,10 @@ import (
// LicenseTypeChannelWrapper wraps the object with workflow params
type LicenseTypeChannelWrapper struct {
Obj regs_models.LicenseType
Principal User
SagaID string
SagaType string
Obj regs_models.LicenseType
APIKey string
SagaID string
SagaType string
}
// LicenseType is a first class object type
@ -41,10 +41,10 @@ type LicenseType struct {
// GeoLicenseTypeInstanceChannelWrapper wraps the object with workflow params
type GeoLicenseTypeInstanceChannelWrapper struct {
Obj regs_models.GeoLicenseTypeInstance
Principal User
SagaID string
SagaType string
Obj regs_models.GeoLicenseTypeInstance
APIKey string
SagaID string
SagaType string
}
// GeoLicenseTypeInstance is a first class object type
@ -67,9 +67,9 @@ type GeoLicenseTypeInstance struct {
// DomainLicenseTypeInstanceChannelWrapper wraps the object with workflow params
type DomainLicenseTypeInstanceChannelWrapper struct {
// Obj regs_models.DomainLicenseTypeInstance
Principal User
SagaID string
SagaType string
APIKey string
SagaID string
SagaType string
}
// DomainLicenseTypeInstance is a first class object type

View File

@ -5,9 +5,9 @@ import "database/sql"
// LogChannelWrapper wraps the object with workflow params
type LogChannelWrapper struct {
// Obj devops_models.AppLog
Principal User
SagaID string
SagaType string
APIKey string
SagaID string
SagaType string
}
// Log is a first class object type

View File

@ -8,10 +8,10 @@ import (
// NotebookChannelWrapper wraps the object with workflow params
type NotebookChannelWrapper struct {
Obj regs_models.Notebook
Principal User
SagaID string
SagaType string
Obj regs_models.Notebook
APIKey string
SagaID string
SagaType string
}
// Notebook is a first class object type

View File

@ -8,10 +8,10 @@ import (
// NotebookItemChannelWrapper wraps the object with workflow params
type NotebookItemChannelWrapper struct {
Obj regs_models.NotebookItem
Principal User
SagaID string
SagaType string
Obj regs_models.NotebookItem
APIKey string
SagaID string
SagaType string
}
// NotebookItem is a first class object type

View File

@ -8,10 +8,10 @@ import (
// OrderChannelWrapper wraps the object with workflow params
type OrderChannelWrapper struct {
Obj ops_models.Order
Principal User
SagaID string
SagaType string
Obj ops_models.Order
APIKey string
SagaID string
SagaType string
}
// Order is a first class object type

View File

@ -8,10 +8,10 @@ import (
// OrderItemChannelWrapper wraps the object with workflow params
type OrderItemChannelWrapper struct {
Obj ops_models.OrderItem
Principal User
SagaID string
SagaType string
Obj ops_models.OrderItem
APIKey string
SagaID string
SagaType string
}
// OrderItem is a first class object type

View File

@ -4,10 +4,10 @@ import "code.tnxs.net/taxnexus/lib/api/workflow/workflow_models"
// OutgoingEmailMessageChannelWrapper wraps the object with workflow params
type OutgoingEmailMessageChannelWrapper struct {
Obj workflow_models.OutgoingEmailMessage
Principal User
SagaID string
SagaType string
Obj workflow_models.OutgoingEmailMessage
APIKey string
SagaID string
SagaType string
}
// OutgoingEmailMessage is a first class object type

View File

@ -3,9 +3,9 @@ package app
// OutgoingEmailMessageReceiptChannelWrapper wraps the object with workflow params
type OutgoingEmailMessageReceiptChannelWrapper struct {
// Obj workflow_models.OutgoingEmailMessageReceipt
Principal User
SagaID string
SagaType string
APIKey string
SagaID string
SagaType string
}
// OutgoingEmailMessageReceipt is a first class object type

View File

@ -8,10 +8,10 @@ import (
// PaymentMethodChannelWrapper wraps the object with workflow params
type PaymentMethodChannelWrapper struct {
Obj ops_models.PaymentMethod
Principal User
SagaID string
SagaType string
Obj ops_models.PaymentMethod
APIKey string
SagaID string
SagaType string
}
// PaymentMethod is a first class object type

View File

@ -5,9 +5,9 @@ import "database/sql"
// PDFChannelWrapper wraps the object with workflow params
type PDFChannelWrapper struct {
// Obj stash_models.Pdf
Principal User
SagaID string
SagaType string
APIKey string
SagaID string
SagaType string
}
// PDF is a first class object type

View File

@ -8,10 +8,10 @@ import (
// PeriodChannelWrapper wraps the object with workflow params
type PeriodChannelWrapper struct {
Obj ledger_models.Period
Principal User
SagaID string
SagaType string
Obj ledger_models.Period
APIKey string
SagaID string
SagaType string
}
// Period is a first class object type

View File

@ -8,10 +8,10 @@ import (
// PlaceChannelWrapper wraps the object with workflow params
type PlaceChannelWrapper struct {
Obj geo_models.Place
Principal User
SagaID string
SagaType string
Obj geo_models.Place
APIKey string
SagaID string
SagaType string
}
// Place is a first class object type

View File

@ -8,10 +8,10 @@ import (
// PurchaseOrderChannelWrapper wraps the object with workflow params
type PurchaseOrderChannelWrapper struct {
Obj ops_models.PurchaseOrder
Principal User
SagaID string
SagaType string
Obj ops_models.PurchaseOrder
APIKey string
SagaID string
SagaType string
}
// PurchaseOrder is a first class object type

View File

@ -8,10 +8,10 @@ import (
// PurchaseOrderItemChannelWrapper wraps the object with workflow params
type PurchaseOrderItemChannelWrapper struct {
Obj ops_models.PurchaseOrderItem
Principal User
SagaID string
SagaType string
Obj ops_models.PurchaseOrderItem
APIKey string
SagaID string
SagaType string
}
// PurchaseOrderItem is a first class object type

View File

@ -8,10 +8,10 @@ import (
// ProductChannelWrapper wraps the object with workflow params
type ProductChannelWrapper struct {
Obj ops_models.Product
Principal User
SagaID string
SagaType string
Obj ops_models.Product
APIKey string
SagaID string
SagaType string
}
// Product is a first class object type

View File

@ -8,10 +8,10 @@ import (
// QuoteChannelWrapper wraps the object with workflow params
type QuoteChannelWrapper struct {
Obj ops_models.Quote
Principal User
SagaID string
SagaType string
Obj ops_models.Quote
APIKey string
SagaID string
SagaType string
}
// Quote is a first class object type

View File

@ -8,10 +8,10 @@ import (
// QuoteItemChannelWrapper wraps the object with workflow params
type QuoteItemChannelWrapper struct {
Obj ops_models.QuoteItem
Principal User
SagaID string
SagaType string
Obj ops_models.QuoteItem
APIKey string
SagaID string
SagaType string
}
// QuoteItem is a first class object type

View File

@ -7,10 +7,10 @@ import (
// RatingengineChannelWrapper wraps the object with workflow params
type RatingengineChannelWrapper struct {
Obj regs_models.RatingEngine
Principal User
SagaID string
SagaType string
Obj regs_models.RatingEngine
APIKey string
SagaID string
SagaType string
}
// RatingEngine is a first class object type

View File

@ -7,10 +7,10 @@ import (
// RatingEngineItemChannelWrapper wraps the object with workflow params
type RatingEngineItemChannelWrapper struct {
Obj regs_models.RatingEngineItem
Principal User
SagaID string
SagaType string
Obj regs_models.RatingEngineItem
APIKey string
SagaID string
SagaType string
}
// RatingEngineItem is a first class object type

View File

@ -8,10 +8,10 @@ import (
// RoleChannelWrapper wraps the object with workflow params
type RoleChannelWrapper struct {
Obj devops_models.Role
Principal User
SagaID string
SagaType string
Obj devops_models.Role
APIKey string
SagaID string
SagaType string
}
// Role is a first class object type

View File

@ -7,6 +7,7 @@ import (
"code.tnxs.net/taxnexus/lib/api/auth0/auth0_client"
"code.tnxs.net/taxnexus/lib/app/logger"
httptransport "github.com/go-openapi/runtime/client"
"github.com/spf13/viper"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
@ -17,6 +18,7 @@ var config = Configuration{}
var appViper = viper.New()
var auth0Client = auth0_client.Default
var configured = false
var apiUsers map[string]User
const getTimeout = 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 = logger.New(GetLogLevel())
apiUsers = initAPIUsers()
sugar.Debugf("app.InitConfig: 👍 📤 serviceAccounts: %d", len(config.ServiceAccounts))
configured = true
}
// FirstClassObject is a struct
type FirstClassObject interface {
Marshal() interface{}
UnMarshal() interface{}
func initAPIUsers() map[string]User {
sugar.Info("board.initAPIUsers: 📥")
users := map[string]User{
"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
}

View File

@ -8,10 +8,10 @@ import (
// ServiceChannelWrapper wraps the object with workflow params
type ServiceChannelWrapper struct {
Obj devops_models.Service
Principal User
SagaID string
SagaType string
Obj devops_models.Service
APIKey string
SagaID string
SagaType string
}
// Service is a first class object type

View File

@ -8,10 +8,10 @@ import (
// StateChannelWrapper wraps the object with workflow params
type StateChannelWrapper struct {
Obj geo_models.State
Principal User
SagaID string
SagaType string
Obj geo_models.State
APIKey string
SagaID string
SagaType string
}
// State is a first class object type

View File

@ -8,10 +8,10 @@ import (
// SubmissionChannelWrapper wraps the object with workflow params
type SubmissionChannelWrapper struct {
Obj regs_models.Submission
Principal User
SagaID string
SagaType string
Obj regs_models.Submission
APIKey string
SagaID string
SagaType string
}
// Submission is a first class object type

View File

@ -7,9 +7,9 @@ import (
// TaskChannelWrapper wraps the object with workflow params
type TaskChannelWrapper struct {
// Obj workflow_models.Task
Principal User
SagaID string
SagaType string
APIKey string
SagaID string
SagaType string
}
// Task is a first class object type

View File

@ -7,9 +7,9 @@ import (
// TaskRelationChannelWrapper wraps the object with workflow params
type TaskRelationChannelWrapper struct {
// Obj workflow_models.TaskRelation
Principal User
SagaID string
SagaType string
APIKey string
SagaID string
SagaType string
}
// TaskRelation is a first class object type

View File

@ -7,9 +7,9 @@ import (
// TaskWhoRelationChannelWrapper wraps the object with workflow params
type TaskWhoRelationChannelWrapper struct {
// Obj workflow_models.TaskWhoRelation
Principal User
SagaID string
SagaType string
APIKey string
SagaID string
SagaType string
}
// TaskWhoRelation is a first class object type

View File

@ -8,10 +8,10 @@ import (
// TaxInstanceChannelWrapper wraps the object with workflow params
type TaxInstanceChannelWrapper struct {
Obj geo_models.TaxInstance
Principal User
SagaID string
SagaType string
Obj geo_models.TaxInstance
APIKey string
SagaID string
SagaType string
}
// TaxInstance is a first class object type

View File

@ -8,10 +8,10 @@ import (
// TaxnexusCodeChannelWrapper wraps the object with workflow params
type TaxnexusCodeChannelWrapper struct {
Obj geo_models.TaxnexusCode
Principal User
SagaID string
SagaType string
Obj geo_models.TaxnexusCode
APIKey string
SagaID string
SagaType string
}
// TaxnexusCode is a first class object type

View File

@ -4,10 +4,10 @@ import "code.tnxs.net/taxnexus/lib/api/geo/geo_models"
// TaxRateChannelWrapper wraps the object with workflow params
type TaxRateChannelWrapper struct {
Obj geo_models.TaxRate
Principal User
SagaID string
SagaType string
Obj geo_models.TaxRate
APIKey string
SagaID string
SagaType string
}
// TaxRate is a principal object type

View File

@ -8,10 +8,10 @@ import (
// TaxTransactionChannelWrapper wraps the object with workflow params
type TaxTransactionChannelWrapper struct {
Obj ops_models.TaxTransaction
Principal User
SagaID string
SagaType string
Obj ops_models.TaxTransaction
APIKey string
SagaID string
SagaType string
}
// TaxTransaction is the in-memory struct for a Taxnexus Tax Transaction

View File

@ -8,10 +8,10 @@ import (
// TaxTypeChannelWrapper wraps the object with workflow params
type TaxTypeChannelWrapper struct {
Obj geo_models.TaxType
Principal User
SagaID string
SagaType string
Obj geo_models.TaxType
APIKey string
SagaID string
SagaType string
}
// TaxType is a first class object type

View File

@ -8,10 +8,10 @@ import (
// TaxTypeAccountChannelWrapper wraps the object with workflow params
type TaxTypeAccountChannelWrapper struct {
Obj regs_models.TaxTypeAccount
Principal User
SagaID string
SagaType string
Obj regs_models.TaxTypeAccount
APIKey string
SagaID string
SagaType string
}
// TaxTypeAccount is a first class object type

View File

@ -8,10 +8,10 @@ import (
// TemplateChannelWrapper wraps the object with workflow params
type TemplateChannelWrapper struct {
Obj devops_models.Template
Principal User
SagaID string
SagaType string
Obj devops_models.Template
APIKey string
SagaID string
SagaType string
}
// Template is a first class object type

View File

@ -8,10 +8,10 @@ import (
// TenantChannelWrapper wraps the object with workflow params
type TenantChannelWrapper struct {
Obj devops_models.Tenant
Principal User
SagaID string
SagaType string
Obj devops_models.Tenant
APIKey string
SagaID string
SagaType string
}
// Tenant is a first class object type

View File

@ -4,10 +4,10 @@ import "code.tnxs.net/taxnexus/lib/api/devops/devops_models"
// TenantUserChannelWrapper wraps the object with workflow params
type TenantUserChannelWrapper struct {
Obj devops_models.TenantUser
Principal User
SagaID string
SagaType string
Obj devops_models.TenantUser
APIKey string
SagaID string
SagaType string
}
// TenantUser is a first class object type

View File

@ -4,10 +4,10 @@ import "code.tnxs.net/taxnexus/lib/api/ops/ops_models"
// TotalChannelWrapper wraps the object with workflow params
type TotalChannelWrapper struct {
Obj ops_models.Total
Principal User
SagaID string
SagaType string
Obj ops_models.Total
APIKey string
SagaID string
SagaType string
}
// Total is a DB object

View File

@ -4,10 +4,10 @@ import "code.tnxs.net/taxnexus/lib/api/ops/ops_models"
// TotalItemChannelWrapper wraps the object with workflow params
type TotalItemChannelWrapper struct {
Obj ops_models.TotalItem
Principal User
SagaID string
SagaType string
Obj ops_models.TotalItem
APIKey string
SagaID string
SagaType string
}
// TotalItem is a DB struct

View File

@ -4,10 +4,10 @@ import "code.tnxs.net/taxnexus/lib/api/ops/ops_models"
// TotalTaxItemChannelWrapper wraps the object with workflow params
type TotalTaxItemChannelWrapper struct {
Obj ops_models.TotalTaxItem
Principal User
SagaID string
SagaType string
Obj ops_models.TotalTaxItem
APIKey string
SagaID string
SagaType string
}
// TotalTaxItem is a DB struct

View File

@ -8,10 +8,10 @@ import (
// TransactionItemChannelWrapper wraps the object with workflow params
type TransactionItemChannelWrapper struct {
Obj regs_models.Transaction
Principal User
SagaID string
SagaType string
Obj regs_models.Transaction
APIKey string
SagaID string
SagaType string
}
// Transaction is a first class object type

View File

@ -7,10 +7,10 @@ import (
// UserChannelWrapper wraps the object with workflow params
type UserChannelWrapper struct {
Obj devops_models.User
Principal User
SagaID string
SagaType string
Obj devops_models.User
APIKey string
SagaID string
SagaType string
}
// User is a first class object type

View File

@ -4,10 +4,10 @@ import "code.tnxs.net/taxnexus/lib/api/devops/devops_models"
// UserRoleChannelWrapper wraps the object with workflow params
type UserRoleChannelWrapper struct {
Obj devops_models.UserRole
Principal User
SagaID string
SagaType string
Obj devops_models.UserRole
APIKey string
SagaID string
SagaType string
}
// UserRole is a first class object type

View File

@ -4,6 +4,7 @@ import (
"code.tnxs.net/taxnexus/lib/api/crm/crm_client/accounts"
"code.tnxs.net/taxnexus/lib/api/crm/crm_models"
"code.tnxs.net/taxnexus/lib/app"
httptransport "github.com/go-openapi/runtime/client"
"go.temporal.io/sdk/workflow"
)
@ -16,7 +17,13 @@ func StoreAccountActivity(ctx workflow.Context, w app.AccountChannelWrapper) err
postAccountParams.AccountRequest = &crm_models.AccountRequest{
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 {
return err
}

View File

@ -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_models"
"code.tnxs.net/taxnexus/lib/app"
httptransport "github.com/go-openapi/runtime/client"
"go.temporal.io/sdk/workflow"
)
@ -33,7 +34,12 @@ func StoreAuth0UserActivity(ctx workflow.Context, w app.UserChannelWrapper) erro
putUserParams.UserRequest = &devops_models.UserRequest{
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 {
return err
}
@ -52,7 +58,11 @@ func StoreAuth0UserActivity(ctx workflow.Context, w app.UserChannelWrapper) erro
OutgoingEmailMessage.
PostOutgoingEmailMessages(
emailParams,
w.Principal.Auth,
httptransport.APIKeyAuth(
"X-API-Key",
"header",
w.APIKey,
),
)
if err != nil {
return err

View File

@ -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_models"
"code.tnxs.net/taxnexus/lib/app"
httptransport "github.com/go-openapi/runtime/client"
"go.temporal.io/sdk/workflow"
)
@ -22,7 +23,12 @@ func StoreContactActivity(ctx workflow.Context, w app.ContactChannelWrapper) err
postContactParams.ContactsRequest = &crm_models.ContactRequest{
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 {
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 {
return err
}

View File

@ -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_models"
"code.tnxs.net/taxnexus/lib/app"
httptransport "github.com/go-openapi/runtime/client"
"go.temporal.io/sdk/workflow"
)
@ -22,7 +23,12 @@ func StoreLeadActivity(ctx workflow.Context, w app.LeadChannelWrapper) error { /
postLeadParams.LeadRequest = &crm_models.LeadRequest{
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 {
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 {
return err
}

View File

@ -30,10 +30,10 @@ func NewDeveloperWorkflow(
err := workflow.ExecuteActivity(ctx,
StoreContactActivity,
&app.ContactChannelWrapper{
Obj: payload.Contact,
Principal: payload.Principal,
SagaID: payload.SagaID,
SagaType: payload.SagaType,
Obj: payload.Contact,
APIKey: payload.Principal.APIKey,
SagaID: payload.SagaID,
SagaType: payload.SagaType,
}).Get(ctx, nil)
if err != nil {
return err
@ -41,10 +41,10 @@ func NewDeveloperWorkflow(
err = workflow.ExecuteActivity(ctx,
StoreAccountActivity,
&app.AccountChannelWrapper{
Obj: payload.Account,
Principal: payload.Principal,
SagaID: payload.SagaID,
SagaType: payload.SagaType,
Obj: payload.Account,
APIKey: payload.Principal.APIKey,
SagaID: payload.SagaID,
SagaType: payload.SagaType,
}).Get(ctx, nil)
if err != nil {
return err
@ -52,10 +52,10 @@ func NewDeveloperWorkflow(
err = workflow.ExecuteActivity(ctx,
StorePaymentMethodActivity,
&app.PaymentMethodChannelWrapper{
Obj: payload.PaymentMethod,
Principal: payload.Principal,
SagaID: payload.SagaID,
SagaType: payload.SagaType,
Obj: payload.PaymentMethod,
APIKey: payload.Principal.APIKey,
SagaID: payload.SagaID,
SagaType: payload.SagaType,
}).Get(ctx, nil)
if err != nil {
return err
@ -63,10 +63,10 @@ func NewDeveloperWorkflow(
err = workflow.ExecuteActivity(ctx,
NotifyContactActivity,
&app.ContactChannelWrapper{
Obj: payload.Contact,
Principal: payload.Principal,
SagaID: payload.SagaID,
SagaType: payload.SagaType,
Obj: payload.Contact,
APIKey: payload.Principal.APIKey,
SagaID: payload.SagaID,
SagaType: payload.SagaType,
}).Get(ctx, nil)
if err != nil {
return err

View File

@ -29,8 +29,8 @@ func NewLeadWorkflow(ctx temporal_workflow.Context, payload *NewLeadWrapper) err
ctx,
StoreLeadActivity,
&app.LeadChannelWrapper{
Obj: payload.Lead,
Principal: payload.Principal,
Obj: payload.Lead,
APIKey: payload.Principal.APIKey,
}).Get(ctx, nil)
if err != nil {
return err
@ -40,8 +40,8 @@ func NewLeadWorkflow(ctx temporal_workflow.Context, payload *NewLeadWrapper) err
ctx,
NotifyLeadActivity,
&app.LeadChannelWrapper{
Obj: payload.Lead,
Principal: payload.Principal,
Obj: payload.Lead,
APIKey: payload.Principal.APIKey,
}).Get(ctx, nil)
if err != nil {
return err

View File

@ -26,10 +26,10 @@ func NewUserWorkflow(ctx workflow.Context, payload *NewUserChannelWrapper) error
err := workflow.ExecuteActivity(ctx,
StoreUserActivity,
&app.UserChannelWrapper{
Obj: payload.User,
Principal: payload.Principal,
SagaID: payload.SagaID,
SagaType: payload.SagaType,
Obj: payload.User,
APIKey: payload.Principal.APIKey,
SagaID: payload.SagaID,
SagaType: payload.SagaType,
}).Get(ctx, nil)
if err != nil {
return err

View File

@ -4,6 +4,7 @@ import (
"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/app"
httptransport "github.com/go-openapi/runtime/client"
"go.temporal.io/sdk/workflow"
)
@ -16,7 +17,12 @@ func StorePaymentMethodActivity(
postPaymentMethodParams.PaymentMethodRequest = &ops_models.PaymentMethodRequest{
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 {
return err
}

View File

@ -9,6 +9,7 @@ import (
"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_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_models"
@ -25,7 +26,12 @@ func StoreUserActivity(ctx workflow.Context, w app.UserChannelWrapper) error { /
postUserParams.UserRequest = &devops_models.UserRequest{
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 {
return err
}
@ -63,7 +69,12 @@ func StoreUserActivity(ctx workflow.Context, w app.UserChannelWrapper) error { /
putUserParams.UserRequest = &devops_models.UserRequest{
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 {
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 {
return err
}