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 // 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
} }
// Account is a DB struct // Account is a DB struct

View File

@ -8,10 +8,10 @@ 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
} }
// AccountingRule is a first class object type // AccountingRule is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// AccountingRuleset is exported // AccountingRuleset is exported

View File

@ -8,10 +8,10 @@ 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
} }
// AccountingRulesetItem is a first class object type // 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 // 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
} }
// Backend is a first class object type // Backend is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// CashReceipt is a first class object type // CashReceipt is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// Charge is a first class object type // Charge is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// Cluster is a first class object type // Cluster is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// Company is a DB struct // Company is a DB struct

View File

@ -11,10 +11,10 @@ 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
} }
// Contact is a first-class object // Contact is a first-class object

View File

@ -8,10 +8,10 @@ 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
} }
// CoordinateBasic is a first class object type // CoordinateBasic is a first class object type
@ -31,10 +31,10 @@ 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
} }
// Coordinate is a first class object type // Coordinate is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// Country is a first class object type // Country is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// County is a first class object type // County is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// Database is a first-class object type // 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 // 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
} }
// Domain is a first class object type // Domain is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// Eft is a first class object type // Eft is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// EftItem is a first class object type // EftItem is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// EmailMessage is a first class object type // EmailMessage is a first class object type

View File

@ -7,9 +7,9 @@ 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
} }
// EmailTemplate is a first class object type // EmailTemplate is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// Filing is a first class object type // Filing is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// FilingScheduleItem is a first class object type // FilingScheduleItem is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// FilingType is a first class object type // FilingType is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// FilingTypeInstance is a first class object type // FilingTypeInstance is a first class object type

View File

@ -7,9 +7,9 @@ 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
} }
// Folder is a first class object type // Folder is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// GlAccount is a first class object type // GlAccount is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// GlBalance is a first class object type // GlBalance is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// Ingest is a first class object type // Ingest is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// Invoice is the in-memory struct for invoices // Invoice is the in-memory struct for invoices

View File

@ -8,10 +8,10 @@ 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
} }
// InvoiceItem is a large struct // InvoiceItem is a large struct

View File

@ -8,10 +8,10 @@ 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
} }
// Job is a first class object type // Job is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// JournalEntry is a first class object type // JournalEntry is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// JournalItem is a first class object type // JournalItem is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// Lead is a first-class object type // Lead is a first-class object type

View File

@ -8,10 +8,10 @@ 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
} }
// License is a first class object type // License is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// LicenseType is a first class object type // LicenseType is a first class object type
@ -41,10 +41,10 @@ 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
} }
// GeoLicenseTypeInstance is a first class object type // GeoLicenseTypeInstance is a first class object type
@ -67,9 +67,9 @@ 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
} }
// DomainLicenseTypeInstance is a first class object type // DomainLicenseTypeInstance is a first class object type

View File

@ -5,9 +5,9 @@ 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
} }
// Log is a first class object type // Log is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// Notebook is a first class object type // Notebook is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// NotebookItem is a first class object type // NotebookItem is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// Order is a first class object type // Order is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// OrderItem is a first class object type // 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 // 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
} }
// OutgoingEmailMessage is a first class object type // OutgoingEmailMessage is a first class object type

View File

@ -3,9 +3,9 @@ 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
} }
// OutgoingEmailMessageReceipt is a first class object type // OutgoingEmailMessageReceipt is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// PaymentMethod is a first class object type // PaymentMethod is a first class object type

View File

@ -5,9 +5,9 @@ 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
} }
// PDF is a first class object type // PDF is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// Period is a first class object type // Period is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// Place is a first class object type // Place is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// PurchaseOrder is a first class object type // PurchaseOrder is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// PurchaseOrderItem is a first class object type // PurchaseOrderItem is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// Product is a first class object type // Product is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// Quote is a first class object type // Quote is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// QuoteItem is a first class object type // QuoteItem is a first class object type

View File

@ -7,10 +7,10 @@ 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
} }
// RatingEngine is a first class object type // RatingEngine is a first class object type

View File

@ -7,10 +7,10 @@ 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
} }
// RatingEngineItem is a first class object type // RatingEngineItem is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// Role is a first class object type // 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/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
} }

View File

@ -8,10 +8,10 @@ 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
} }
// Service is a first class object type // Service is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// State is a first class object type // State is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// Submission is a first class object type // Submission is a first class object type

View File

@ -7,9 +7,9 @@ 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
} }
// Task is a first class object type // Task is a first class object type

View File

@ -7,9 +7,9 @@ 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
} }
// TaskRelation is a first class object type // TaskRelation is a first class object type

View File

@ -7,9 +7,9 @@ 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
} }
// TaskWhoRelation is a first class object type // TaskWhoRelation is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// TaxInstance is a first class object type // TaxInstance is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// TaxnexusCode is a first class object type // 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 // 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
} }
// TaxRate is a principal object type // TaxRate is a principal object type

View File

@ -8,10 +8,10 @@ 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
} }
// TaxTransaction is the in-memory struct for a Taxnexus Tax Transaction // 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 // 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
} }
// TaxType is a first class object type // TaxType is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// TaxTypeAccount is a first class object type // TaxTypeAccount is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// Template is a first class object type // Template is a first class object type

View File

@ -8,10 +8,10 @@ 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
} }
// Tenant is a first class object type // 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 // 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
} }
// TenantUser is a first class object type // 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 // 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
} }
// Total is a DB object // 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 // 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
} }
// TotalItem is a DB struct // 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 // 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
} }
// TotalTaxItem is a DB struct // TotalTaxItem is a DB struct

View File

@ -8,10 +8,10 @@ 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
} }
// Transaction is a first class object type // Transaction is a first class object type

View File

@ -7,10 +7,10 @@ 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
} }
// User is a first class object type // 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 // 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
} }
// UserRole is a first class object type // 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_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
} }

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_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

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

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

View File

@ -30,10 +30,10 @@ func NewDeveloperWorkflow(
err := workflow.ExecuteActivity(ctx, err := workflow.ExecuteActivity(ctx,
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)
if err != nil { if err != nil {
return err return err
@ -41,10 +41,10 @@ func NewDeveloperWorkflow(
err = workflow.ExecuteActivity(ctx, err = workflow.ExecuteActivity(ctx,
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)
if err != nil { if err != nil {
return err return err
@ -52,10 +52,10 @@ func NewDeveloperWorkflow(
err = workflow.ExecuteActivity(ctx, err = workflow.ExecuteActivity(ctx,
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)
if err != nil { if err != nil {
return err return err
@ -63,10 +63,10 @@ func NewDeveloperWorkflow(
err = workflow.ExecuteActivity(ctx, err = workflow.ExecuteActivity(ctx,
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)
if err != nil { if err != nil {
return err return err

View File

@ -29,8 +29,8 @@ func NewLeadWorkflow(ctx temporal_workflow.Context, payload *NewLeadWrapper) err
ctx, ctx,
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
@ -40,8 +40,8 @@ func NewLeadWorkflow(ctx temporal_workflow.Context, payload *NewLeadWrapper) err
ctx, ctx,
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

View File

@ -26,10 +26,10 @@ func NewUserWorkflow(ctx workflow.Context, payload *NewUserChannelWrapper) error
err := workflow.ExecuteActivity(ctx, err := workflow.ExecuteActivity(ctx,
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)
if err != nil { if err != nil {
return err 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_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
} }

View File

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