From 061af6b092c70951bddb9aca21e2e3f745e56f50 Mon Sep 17 00:00:00 2001 From: Vernon Keenan Date: Wed, 13 Jan 2021 22:36:35 -0800 Subject: [PATCH] marshal methods --- api/geo/geo_models/coordinate.go | 15 + api/geo/geo_models/country.go | 15 + api/geo/geo_models/county.go | 15 + api/geo/geo_models/place.go | 18 + api/geo/geo_models/state.go | 15 + api/geo/geo_models/tax_instance.go | 3 + api/geo/geo_models/tax_type.go | 21 + api/ops/ops_client/order/order_client.go | 4 +- api/ops/ops_client/quote/quote_client.go | 2 +- api/ops/ops_models/cash_receipt.go | 39 +- api/ops/ops_models/charge.go | 26 +- api/ops/ops_models/product.go | 6 +- api/ops/ops_models/purchase_order_item.go | 3 + app/account-helpers.go | 211 + app/account.go | 10 +- app/accountingrule-helpers.go | 69 + app/accountingrule.go | 2 +- app/accountingruleset-helpers.go | 62 + app/accountingruleset.go | 2 +- app/accountingrulesetitem.go | 2 +- app/address.go | 69 + app/applog-helpers.go | 52 + app/applog.go | 18 + app/authority-helpers.go | 107 + app/authority.go | 37 + app/backend-helpers.go | 106 + app/backend.go | 2 +- app/cashreceipt-helpers.go | 104 + app/cashreceipt.go | 2 +- app/charge-helpers.go | 88 + app/charge.go | 2 +- app/cluster-helpers.go | 64 + app/cluster.go | 2 +- app/company-helpers.go | 108 + app/company.go | 6 +- app/contact-helpers.go | 126 + app/contact.go | 6 +- app/coordinate-helpers.go | 53 + app/coordinate.go | 4 +- app/country-helpers.go | 99 + app/country.go | 2 +- app/county-helpers.go | 141 + app/county.go | 3 +- app/database-helpers.go | 58 + app/database.go | 2 +- app/domain-helpers.go | 20 + app/domain.go | 2 +- app/eft-helpers.go | 94 + app/eft.go | 2 +- app/eftitem-helpers.go | 50 + app/eftitem.go | 2 +- app/emailmessage-helpers.go | 55 + app/emailmessage.go | 2 +- app/emaitemplate.go | 2 +- app/filing-helpers.go | 128 + app/filing.go | 2 +- app/filingscheduleitem-helpers.go | 0 app/filingscheduleitem.go | 2 +- app/filingtype-helpers.go | 133 + app/filingtype.go | 2 +- app/filingtypeinstance-helpers.go | 0 app/filingtypeinstance.go | 2 +- app/folder-helpers.go | 0 app/folder.go | 2 +- app/glaccount-helpers.go | 73 + app/glaccount.go | 2 +- app/glbalance-helpers.go | 71 + app/glbalance.go | 2 +- app/ingest-helpers.go | 137 + app/ingest.go | 8 +- app/invoice-helpers.go | 115 + app/invoice.go | 2 +- app/invoiceitem-helpers.go | 39 + app/invoiceitem.go | 2 +- app/job-helpers.go | 112 + app/job.go | 3 +- app/journalentry-helpers.go | 90 + app/journalentry.go | 2 +- app/journalitem-helpers.go | 72 + app/journalitem.go | 2 +- app/lead-helpers.go | 86 + app/lead.go | 4 +- app/license-helpers.go | 83 + app/license.go | 2 +- app/licensetype-helpers.go | 96 + app/licensetype.go | 6 +- app/log.go | 2 +- app/notebook-helpers.go | 97 + app/notebook.go | 2 +- app/notebookitem.go | 2 +- app/order-helpers.go | 235 ++ app/order.go | 2 +- app/orderitem-helpers.go | 130 + app/orderitem.go | 2 +- app/outgoingemail-helpers.go | 22 + app/outgoingemail.go | 2 +- app/outgoingemailreceipt-helpers.go | 14 + app/outgoingemailreceipt.go | 2 +- app/paymentmethod-helpers.go | 88 + app/paymentmethod.go | 2 +- app/pdf-helpers.go | 27 + app/pdf.go | 2 +- app/period-helpers.go | 75 + app/period.go | 2 +- app/place-helpers.go | 151 + app/place.go | 3 +- app/po-helpers.go | 203 + app/po.go | 2 +- app/poitem-helpers.go | 94 + app/poitem.go | 2 +- app/product-helpers.go | 102 + app/product.go | 2 +- app/quote-helpers.go | 96 + app/quote.go | 2 +- app/quoteitem-helpers.go | 34 + app/quoteitem.go | 2 +- app/ratingengine-helpers.go | 0 app/ratingengine.go | 2 +- app/ratingengineitem-helpers.go | 0 app/ratingengineitem.go | 2 +- app/role-helpers.go | 50 + app/role.go | 2 +- app/root.go | 5 +- app/service-helpers.go | 78 + app/service.go | 2 +- app/state-helpers.go | 116 + app/state.go | 2 +- app/submission-helpers.go | 89 + app/submission.go | 2 +- app/task.go | 2 +- app/taskrelation.go | 2 +- app/taskwhorelation.go | 2 +- app/taxinstance-helpers.go | 51 + app/taxinstance.go | 2 +- app/taxnexuscode-helpers.go | 74 + app/taxnexuscode.go | 52 +- app/taxrate.go | 2 +- app/taxtransaction-helpers.go | 58 + app/taxtransaction.go | 2 +- app/taxtype-helpers.go | 144 + app/taxtype.go | 2 +- app/taxtypeaccount-helpers.go | 103 + app/taxtypeaccount.go | 2 +- app/template-helpers.go | 64 + app/template.go | 2 +- app/tenant-helpers.go | 84 + app/tenant.go | 2 +- app/tenantuser-helpers.go | 44 + app/tenantuser.go | 2 +- app/total-helpers.go | 37 + app/total.go | 2 +- app/totalitem.go | 4 +- app/totaltaxitem.go | 2 +- app/transaction-helpers.go | 45 + app/transaction.go | 2 +- app/user.go | 2 +- app/userrole-helpers.go | 0 app/userrole.go | 2 +- go.mod | 1 + rules/new-developer.go | 41 +- rules/new-lead.go | 43 +- swagger/apex-taxnexus.yaml | 4605 +++++++++++++++++++++ swagger/geo-taxnexus.yaml | 113 + swagger/ops-taxnexus.yaml | 93 +- swagger/wordpress.yaml | 1035 +++++ 165 files changed, 11560 insertions(+), 224 deletions(-) create mode 100644 app/account-helpers.go create mode 100644 app/accountingrule-helpers.go create mode 100644 app/accountingruleset-helpers.go create mode 100644 app/applog-helpers.go create mode 100644 app/applog.go create mode 100644 app/authority-helpers.go create mode 100644 app/authority.go create mode 100644 app/backend-helpers.go create mode 100644 app/cashreceipt-helpers.go create mode 100644 app/charge-helpers.go create mode 100644 app/cluster-helpers.go create mode 100644 app/company-helpers.go create mode 100644 app/contact-helpers.go create mode 100644 app/coordinate-helpers.go create mode 100644 app/country-helpers.go create mode 100644 app/county-helpers.go create mode 100644 app/database-helpers.go create mode 100644 app/domain-helpers.go create mode 100644 app/eft-helpers.go create mode 100644 app/eftitem-helpers.go create mode 100644 app/emailmessage-helpers.go create mode 100644 app/filing-helpers.go create mode 100644 app/filingscheduleitem-helpers.go create mode 100644 app/filingtype-helpers.go create mode 100644 app/filingtypeinstance-helpers.go create mode 100644 app/folder-helpers.go create mode 100644 app/glaccount-helpers.go create mode 100644 app/glbalance-helpers.go create mode 100644 app/ingest-helpers.go create mode 100644 app/invoice-helpers.go create mode 100644 app/invoiceitem-helpers.go create mode 100644 app/job-helpers.go create mode 100644 app/journalentry-helpers.go create mode 100644 app/journalitem-helpers.go create mode 100644 app/lead-helpers.go create mode 100644 app/license-helpers.go create mode 100644 app/licensetype-helpers.go create mode 100644 app/notebook-helpers.go create mode 100644 app/order-helpers.go create mode 100644 app/orderitem-helpers.go create mode 100644 app/outgoingemail-helpers.go create mode 100644 app/outgoingemailreceipt-helpers.go create mode 100644 app/paymentmethod-helpers.go create mode 100644 app/pdf-helpers.go create mode 100644 app/period-helpers.go create mode 100644 app/place-helpers.go create mode 100644 app/po-helpers.go create mode 100644 app/poitem-helpers.go create mode 100644 app/product-helpers.go create mode 100644 app/quote-helpers.go create mode 100644 app/quoteitem-helpers.go create mode 100644 app/ratingengine-helpers.go create mode 100644 app/ratingengineitem-helpers.go create mode 100644 app/role-helpers.go create mode 100644 app/service-helpers.go create mode 100644 app/state-helpers.go create mode 100644 app/submission-helpers.go create mode 100644 app/taxinstance-helpers.go create mode 100644 app/taxnexuscode-helpers.go create mode 100644 app/taxtransaction-helpers.go create mode 100644 app/taxtype-helpers.go create mode 100644 app/taxtypeaccount-helpers.go create mode 100644 app/template-helpers.go create mode 100644 app/tenant-helpers.go create mode 100644 app/tenantuser-helpers.go create mode 100644 app/total-helpers.go create mode 100644 app/transaction-helpers.go create mode 100644 app/userrole-helpers.go create mode 100644 swagger/apex-taxnexus.yaml create mode 100644 swagger/wordpress.yaml diff --git a/api/geo/geo_models/coordinate.go b/api/geo/geo_models/coordinate.go index e773d3a..2843640 100644 --- a/api/geo/geo_models/coordinate.go +++ b/api/geo/geo_models/coordinate.go @@ -34,6 +34,12 @@ type Coordinate struct { // Taxnexus County ID CountyID string `json:"CountyID,omitempty"` + // The Taxnexus ID of the user who created this record + CreatedByID string `json:"CreatedByID,omitempty"` + + // The creation date of this database record + CreatedDate string `json:"CreatedDate,omitempty"` + // Situs Focus for tax determination Focus string `json:"Focus,omitempty"` @@ -46,6 +52,12 @@ type Coordinate struct { // Situs Incorporated District? IsDistrict bool `json:"IsDistrict,omitempty"` + // The Taxnexus ID of the user last modified this record + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // The last modification date of this database record + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + // Latitude of coordinate Latitude float64 `json:"Latitude,omitempty"` @@ -62,6 +74,9 @@ type Coordinate struct { // Geocoder Neighborhood Neighborhood string `json:"Neighborhood,omitempty"` + // The Taxnexus ID of the user who owns this record + OwnerID string `json:"OwnerID,omitempty"` + // Geocoder Place Place string `json:"Place,omitempty"` diff --git a/api/geo/geo_models/country.go b/api/geo/geo_models/country.go index 89551b1..dbfc223 100644 --- a/api/geo/geo_models/country.go +++ b/api/geo/geo_models/country.go @@ -34,6 +34,12 @@ type Country struct { // Contact ContactID string `json:"ContactID,omitempty"` + // The Taxnexus ID of the user who created this record + CreatedByID string `json:"CreatedByID,omitempty"` + + // The creation date of this database record + CreatedDate string `json:"CreatedDate,omitempty"` + // Enrollment Status EnrollmentStatus string `json:"EnrollmentStatus,omitempty"` @@ -43,6 +49,12 @@ type Country struct { // Interest Interest float64 `json:"Interest,omitempty"` + // The Taxnexus ID of the user last modified this record + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // The last modification date of this database record + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + // Latitude of the center of this geographic entity Latitude float64 `json:"Latitude,omitempty"` @@ -52,6 +64,9 @@ type Country struct { // Country Name Name string `json:"Name,omitempty"` + // The Taxnexus ID of the user who owns this record + OwnerID string `json:"OwnerID,omitempty"` + // Penalty Penalty float64 `json:"Penalty,omitempty"` diff --git a/api/geo/geo_models/county.go b/api/geo/geo_models/county.go index 50ae8b3..539aa69 100644 --- a/api/geo/geo_models/county.go +++ b/api/geo/geo_models/county.go @@ -37,6 +37,12 @@ type County struct { // Country Taxnexus ID CountryID string `json:"CountryID,omitempty"` + // The Taxnexus ID of the user who created this record + CreatedByID string `json:"CreatedByID,omitempty"` + + // The creation date of this database record + CreatedDate string `json:"CreatedDate,omitempty"` + // Enrollment Status EnrollmentStatus string `json:"EnrollmentStatus,omitempty"` @@ -67,6 +73,12 @@ type County struct { // Land Area LandArea int64 `json:"LandArea,omitempty"` + // The Taxnexus ID of the user last modified this record + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // The last modification date of this database record + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + // Latitude of the center of this geographic entity Latitude float64 `json:"Latitude,omitempty"` @@ -79,6 +91,9 @@ type County struct { // County Name Name string `json:"Name,omitempty"` + // The Taxnexus ID of the user who owns this record + OwnerID string `json:"OwnerID,omitempty"` + // Penalty Penalty float64 `json:"Penalty,omitempty"` diff --git a/api/geo/geo_models/place.go b/api/geo/geo_models/place.go index b8738d2..b00ffb7 100644 --- a/api/geo/geo_models/place.go +++ b/api/geo/geo_models/place.go @@ -43,6 +43,12 @@ type Place struct { // County CountyID string `json:"CountyID,omitempty"` + // The Taxnexus ID of the user who created this record + CreatedByID string `json:"CreatedByID,omitempty"` + + // The creation date of this database record + CreatedDate string `json:"CreatedDate,omitempty"` + // Enrollment Status EnrollmentStatus string `json:"EnrollmentStatus,omitempty"` @@ -73,6 +79,12 @@ type Place struct { // Land Area LandArea int64 `json:"LandArea,omitempty"` + // The Taxnexus ID of the user last modified this record + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // The last modification date of this database record + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + // Latitude of the center of this geographic entity Latitude float64 `json:"Latitude,omitempty"` @@ -85,6 +97,9 @@ type Place struct { // Place Name Name string `json:"Name,omitempty"` + // The Taxnexus ID of the user who owns this record + OwnerID string `json:"OwnerID,omitempty"` + // Penalty Penalty float64 `json:"Penalty,omitempty"` @@ -118,6 +133,9 @@ type Place struct { // sales tax rate SalesTaxRate *TaxRate `json:"SalesTaxRate,omitempty"` + // State Code + StateCode string `json:"StateCode,omitempty"` + // State StateID string `json:"StateID,omitempty"` diff --git a/api/geo/geo_models/state.go b/api/geo/geo_models/state.go index bedcf06..60131ec 100644 --- a/api/geo/geo_models/state.go +++ b/api/geo/geo_models/state.go @@ -37,6 +37,12 @@ type State struct { // Country CountryID string `json:"CountryID,omitempty"` + // The Taxnexus ID of the user who created this record + CreatedByID string `json:"CreatedByID,omitempty"` + + // The creation date of this database record + CreatedDate string `json:"CreatedDate,omitempty"` + // Division Division string `json:"Division,omitempty"` @@ -61,6 +67,12 @@ type State struct { // Land Area LandArea int64 `json:"LandArea,omitempty"` + // The Taxnexus ID of the user last modified this record + LastModifiedByID string `json:"LastModifiedByID,omitempty"` + + // The last modification date of this database record + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + // Latitude of the center of this geographic entity Latitude float64 `json:"Latitude,omitempty"` @@ -70,6 +82,9 @@ type State struct { // State Name Name string `json:"Name,omitempty"` + // The Taxnexus ID of the user who owns this record + OwnerID string `json:"OwnerID,omitempty"` + // Penalty Penalty float64 `json:"Penalty,omitempty"` diff --git a/api/geo/geo_models/tax_instance.go b/api/geo/geo_models/tax_instance.go index ba11bb4..b149c4f 100644 --- a/api/geo/geo_models/tax_instance.go +++ b/api/geo/geo_models/tax_instance.go @@ -31,6 +31,9 @@ type TaxInstance struct { // The creation date of this database record CreatedDate string `json:"CreatedDate,omitempty"` + // Taxnexus Record ID + ID string `json:"ID,omitempty"` + // last modified by ID LastModifiedByID string `json:"LastModifiedByID,omitempty"` diff --git a/api/geo/geo_models/tax_type.go b/api/geo/geo_models/tax_type.go index 60b593a..b516869 100644 --- a/api/geo/geo_models/tax_type.go +++ b/api/geo/geo_models/tax_type.go @@ -25,12 +25,18 @@ type TaxType struct { // The Accounting Rule Code for this Tax Type AccountingRuleCode string `json:"AccountingRuleCode,omitempty"` + // Is this tax type currently active? (not used for tax ratings) + Active bool `json:"Active,omitempty"` + // Agency Type AgencyType string `json:"AgencyType,omitempty"` // Collection Agent Id AgentID string `json:"AgentID,omitempty"` + // Total tax amount + Amount float64 `json:"Amount,omitempty"` + // Category Category string `json:"Category,omitempty"` @@ -115,6 +121,9 @@ type TaxType struct { // Tax Type Name (unique) Name string `json:"Name,omitempty"` + // User ID of the owner of this TaxType + OwnerID string `json:"OwnerID,omitempty"` + // Is this tax allowed to be passed-through to retail customers? PassThrough bool `json:"PassThrough,omitempty"` @@ -130,6 +139,15 @@ type TaxType struct { // Tax Authority Website Reference Reference string `json:"Reference,omitempty"` + // Revenue Base for this Tax Type + RevenueBase float64 `json:"RevenueBase,omitempty"` + + // Revenue Net + RevenueNet float64 `json:"RevenueNet,omitempty"` + + // Revenue Not Taxable + RevenueNotTaxable float64 `json:"RevenueNotTaxable,omitempty"` + // Salesregulation Code for this TaxType SalesRegulation string `json:"SalesRegulation,omitempty"` @@ -145,6 +163,9 @@ type TaxType struct { // Rendering Template Id TemplateID string `json:"TemplateID,omitempty"` + // Unit Base + UnitBase float64 `json:"UnitBase,omitempty"` + // Units Units string `json:"Units,omitempty"` } diff --git a/api/ops/ops_client/order/order_client.go b/api/ops/ops_client/order/order_client.go index 866b463..9007954 100644 --- a/api/ops/ops_client/order/order_client.go +++ b/api/ops/ops_client/order/order_client.go @@ -154,9 +154,9 @@ func (a *Client) PostOrders(params *PostOrdersParams, authInfo runtime.ClientAut } /* - PutOrders creates new orders + PutOrders updates orders - Create new Orders + Update orders */ func (a *Client) PutOrders(params *PutOrdersParams, authInfo runtime.ClientAuthInfoWriter) (*PutOrdersOK, error) { // TODO: Validate the params before sending diff --git a/api/ops/ops_client/quote/quote_client.go b/api/ops/ops_client/quote/quote_client.go index 6da6e36..8276898 100644 --- a/api/ops/ops_client/quote/quote_client.go +++ b/api/ops/ops_client/quote/quote_client.go @@ -80,7 +80,7 @@ func (a *Client) DeleteQuote(params *DeleteQuoteParams, authInfo runtime.ClientA } /* - GetQuotes gets a list of invoices + GetQuotes gets a list of quotes Return a list of available quotes */ diff --git a/api/ops/ops_models/cash_receipt.go b/api/ops/ops_models/cash_receipt.go index 8c561d6..a241c93 100644 --- a/api/ops/ops_models/cash_receipt.go +++ b/api/ops/ops_models/cash_receipt.go @@ -28,18 +28,12 @@ type CashReceipt struct { // Applied Amount AppliedAmount float64 `json:"AppliedAmount,omitempty"` - // Attempt Number - AttemptNumber float64 `json:"AttemptNumber,omitempty"` - - // Audit Trail Message - AuditMessage string `json:"AuditMessage,omitempty"` - - // Autopay? - AutoPay bool `json:"AutoPay,omitempty"` - // Billing Contact BillingContactID string `json:"BillingContactID,omitempty"` + // The ID of the Billing Run that generated this Cash Receipt + BillingRunID string `json:"BillingRunID,omitempty"` + // Journal Date CashReceiptDate string `json:"CashReceiptDate,omitempty"` @@ -67,9 +61,12 @@ type CashReceipt struct { // GatewayTxn? GatewayTransaction bool `json:"GatewayTransaction,omitempty"` - // Salesforce Record Id + // Taxnexus Record Id ID string `json:"ID,omitempty"` + // Invoice paid by this cash receipt + InvoiceID string `json:"InvoiceID,omitempty"` + // Is Valid? IsValid bool `json:"IsValid,omitempty"` @@ -82,36 +79,21 @@ type CashReceipt struct { // Partner Account PartnerAccountID string `json:"PartnerAccountID,omitempty"` - // Payment Method + // ID of the Payment Method used for this Cash Receipt PaymentMethodID string `json:"PaymentMethodID,omitempty"` - // Payment Number - PaymentNumber string `json:"PaymentNumber,omitempty"` - - // Pending? - Pending bool `json:"Pending,omitempty"` - // Period PeriodID string `json:"PeriodID,omitempty"` // Posted to external system? Posted bool `json:"Posted,omitempty"` - // Processed - Processed bool `json:"Processed,omitempty"` - - // Processing - Processing bool `json:"Processing,omitempty"` - // Record Type - RecordTypeID string `json:"RecordTypeID,omitempty"` + RecordType string `json:"RecordType,omitempty"` // Reference Ref string `json:"Ref,omitempty"` - // Reference Number - ReferenceNumber string `json:"ReferenceNumber,omitempty"` - // Rejected? Rejected bool `json:"Rejected,omitempty"` @@ -121,6 +103,9 @@ type CashReceipt struct { // Payment Status Status string `json:"Status,omitempty"` + // ID of the Template to be used for rendering this cashreceipt + TemplateID string `json:"TemplateID,omitempty"` + // ID of the Tenant that owns this object TenantID string `json:"TenantID,omitempty"` diff --git a/api/ops/ops_models/charge.go b/api/ops/ops_models/charge.go index eb6a46f..9719568 100644 --- a/api/ops/ops_models/charge.go +++ b/api/ops/ops_models/charge.go @@ -22,12 +22,24 @@ type Charge struct { // Account AccountID string `json:"AccountID,omitempty"` + // The Accounting Ruleset Code + AccountingRulesetCode string `json:"AccountingRulesetCode,omitempty"` + // Amount Amount float64 `json:"Amount,omitempty"` // Billing Contact ID BillingContactID string `json:"BillingContactID,omitempty"` + // The Email Address to send this charge notification + BillingEmail string `json:"BillingEmail,omitempty"` + + // The ID of the BillingRun that generated this Charge + BillingRunID string `json:"BillingRunID,omitempty"` + + // The Contract Hourly Rate + ContractHourlyRate float64 `json:"ContractHourlyRate,omitempty"` + // Contract ContractID string `json:"ContractID,omitempty"` @@ -43,10 +55,7 @@ type Charge struct { // Email Message EmailMessage string `json:"EmailMessage,omitempty"` - // External Message - ExternalMessage string `json:"ExternalMessage,omitempty"` - - // Salesforce Record Id + // Taxnexus Record Id ID string `json:"ID,omitempty"` // Journal Date @@ -76,9 +85,18 @@ type Charge struct { // Quantity Quantity float64 `json:"Quantity,omitempty"` + // external reference, if any + Ref string `json:"Ref,omitempty"` + + // The ID of the Template used to render this object + TemplateID string `json:"TemplateID,omitempty"` + // ID of the Tenant that owns this object TenantID string `json:"TenantID,omitempty"` + // Charge Type + Type string `json:"Type,omitempty"` + // Unit Price UnitPrice float64 `json:"UnitPrice,omitempty"` } diff --git a/api/ops/ops_models/product.go b/api/ops/ops_models/product.go index b530afe..4644e55 100644 --- a/api/ops/ops_models/product.go +++ b/api/ops/ops_models/product.go @@ -64,12 +64,12 @@ type Product struct { // isGeneric IsGeneric bool `json:"IsGeneric,omitempty"` - // Last Modified Date - LastModifiedByDate string `json:"LastModifiedByDate,omitempty"` - // Last modified by ID LastModifiedByID string `json:"LastModifiedByID,omitempty"` + // Last Modified Date + LastModifiedDate string `json:"LastModifiedDate,omitempty"` + // MRC Interval MRCInterval int64 `json:"MRCInterval,omitempty"` diff --git a/api/ops/ops_models/purchase_order_item.go b/api/ops/ops_models/purchase_order_item.go index 122e462..c23922a 100644 --- a/api/ops/ops_models/purchase_order_item.go +++ b/api/ops/ops_models/purchase_order_item.go @@ -61,6 +61,9 @@ type PurchaseOrderItem struct { // Product ID ProductID string `json:"ProductID,omitempty"` + // Product Name + ProductName string `json:"ProductName,omitempty"` + // Purchase Order PurchaseOrderID string `json:"PurchaseOrderID,omitempty"` diff --git a/app/account-helpers.go b/app/account-helpers.go new file mode 100644 index 0000000..a627fa1 --- /dev/null +++ b/app/account-helpers.go @@ -0,0 +1,211 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/crm/crm_models" + "github.com/google/uuid" +) + +// UnMarshalAccount decodes swagger to a first class object +func UnMarshalAccount(s *crm_models.Account) *Account { //nolint:funlen // too bad + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + clientEndDate, e2 := time.Parse(dateTimeFormat, s.ClientEndDate) + clientStartDate, e3 := time.Parse(dateTimeFormat, s.ClientStartDate) + return &Account{ + AccountNumber: s.AccountNumber, + AccountSource: s.AccountSource, + Active: s.Active, + AdministrativeLevel: s.AdministrativeLevel, + Amount: s.Amount, + AmountInvoiced: s.AmountInvoiced, + AmountPaid: s.AmountPaid, + AnnualRevenue: s.AnnualRevenue, + Balance: s.Balance, + BillingAddress: UnMarshalCrmAddress(s.BillingAddress), + BillingContactID: s.BillingContactID, + BillingPreference: s.BillingPreference, + BusinessAddress: UnMarshalCrmAddress(s.BusinessAddress), + CannabisCustomer: s.CannabisCustomer, + ChannelProgramLevelName: s.ChannelProgramLevelName, + ChannelProgramName: s.ChannelProgramName, + CompanyID: s.CompanyID, + CoordinateID: s.CoordinateID, + CreatedByID: s.CreatedByID, + CustomerID: s.CustomerID, + CustomerPriority: s.CustomerPriority, + DandBCompanyID: s.DandBCompanyID, + DBA: s.DBA, + DefaultAddress: UnMarshalCrmAddress(s.DefaultAddress), + DefaultBackendID: s.DefaultBackendID, + DefaultDeliveryContactID: s.DefaultDeliveryContactID, + DefaultEndUserID: s.DefaultEndUserID, + Description: s.Description, + DunsNumber: s.DUNSNumber, + EIN: s.EIN, + Email: s.Email, + EnrollmentStatus: s.EnrollmentStatus, + Fax: s.Fax, + ID: s.ID, + Industry: s.Industry, + IsCustomerPortal: s.IsCustomerPortal, + IsPartner: s.IsPartner, + ISPCustomer: s.ISPCustomer, + Jigsaw: s.JigSaw, + LastModifiedByID: s.LastModifiedByID, + MSPCustomer: s.MSPCustomer, + NaicsCode: s.NAICSCode, + NaicsDesc: s.NAICSDesc, + Name: s.Name, + NumberOfEmployees: s.NumberOfEmployees, + NumberOfLocations: s.NumberOfLocations, + OpenCharges: s.OpenCharges, + OrderContactID: s.OrderContactID, + OrderEmail: s.OrderEmail, + OwnerID: s.OwnerID, + Ownership: s.Ownership, + ParentFK: s.ParentFK, + ParentID: s.ParentID, + Phone: s.Phone, + PlaceID: s.PlaceID, + PreparerID: s.PreparerID, + Rating: s.Rating, + RatingEngineID: s.RatingEngineID, + Ref: s.Ref, + RevenueBase: s.RevenueBase, + RevenueNet: s.RevenueNet, + RevenueNotTaxable: s.RevenueNotTaxable, + ShippingAddress: UnMarshalCrmAddress(s.ShippingAddress), + ShippingCensusTract: s.ShippingCensusTract, + ShippingContactID: s.ShippingCensusTract, + ShippingCounty: s.ShippingCounty, + SIC: s.SIC, + SicDesc: s.SICDesc, + Site: s.Site, + Status: s.Status, + TaxExemption: s.TaxExemption, + TaxOnTax: s.TaxOnTax, + TelecomCustomer: s.TelecomCustomer, + TenantID: s.TenantID, + TickerSymbol: s.TickerSymbol, + TradeStyle: s.TradeStyle, + Type: s.Type, + UnappliedPayments: s.UnappliedPayments, + UnitBase: s.UnitBase, + UpsellOpportunity: s.UpsellOpportunity, + Website: s.Website, + WHMCSClientID: s.WHMCSClientID, + XeroContactID: s.XeroContactID, + YearStarted: s.YearStarted, + ClientEndDate: sql.NullTime{ + Time: clientEndDate, Valid: e2 == nil, + }, + ClientStartDate: sql.NullTime{ + Time: clientStartDate, Valid: e3 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, Valid: e1 == nil, + }, + CreatedDate: sql.NullTime{ + Time: createdDate, Valid: e0 == nil, + }, + } +} + +// MarshalToSwagger encodes a first class object to swagger +func (obj *Account) MarshalToSwagger() *crm_models.Account { + return &crm_models.Account{ + ID: obj.ID, + AccountNumber: obj.AccountNumber, + AccountSource: obj.AccountSource, + Active: obj.Active, + AdministrativeLevel: obj.AdministrativeLevel, + Amount: obj.Amount, + AmountInvoiced: obj.AmountInvoiced, + AmountPaid: obj.AmountPaid, + AnnualRevenue: obj.AnnualRevenue, + Balance: obj.Balance, + BillingAddress: obj.BillingAddress.MarshalToCrm(), + BillingContactID: obj.BillingContactID, + BillingPreference: obj.BillingPreference, + BusinessAddress: obj.BusinessAddress.MarshalToCrm(), + CannabisCustomer: obj.CannabisCustomer, + ChannelProgramLevelName: obj.ChannelProgramLevelName, + ChannelProgramName: obj.ChannelProgramName, + ClientEndDate: obj.ClientEndDate.Time.Format(dateTimeFormat), + ClientStartDate: obj.ClientStartDate.Time.Format(dateTimeFormat), + CompanyID: obj.CompanyID, + CoordinateID: obj.CoordinateID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + CustomerID: obj.CompanyID, + CustomerPriority: obj.CustomerPriority, + DandBCompanyID: obj.DandBCompanyID, + DBA: obj.DBA, + DefaultAddress: obj.DefaultAddress.MarshalToCrm(), + DefaultBackendID: obj.DefaultBackendID, + DefaultDeliveryContactID: obj.DefaultDeliveryContactID, + DefaultEndUserID: obj.DefaultEndUserID, + Description: obj.Description, + DUNSNumber: obj.DunsNumber, + EIN: obj.EIN, + Email: obj.Email, + EnrollmentStatus: obj.EnrollmentStatus, + Fax: obj.Fax, + Industry: obj.Industry, + IsCustomerPortal: obj.IsCustomerPortal, + IsPartner: obj.IsPartner, + ISPCustomer: obj.ISPCustomer, + JigSaw: obj.Jigsaw, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + MSPCustomer: obj.MSPCustomer, + NAICSCode: obj.NaicsCode, + NAICSDesc: obj.NaicsDesc, + Name: obj.Name, + NumberOfEmployees: obj.NumberOfEmployees, + NumberOfLocations: obj.NumberOfLocations, + OpenCharges: obj.OpenCharges, + OrderContactID: obj.OrderContactID, + OrderEmail: obj.OrderEmail, + OwnerID: obj.OwnerID, + Ownership: obj.Ownership, + ParentFK: obj.ParentFK, + ParentID: obj.ParentID, + Phone: obj.Phone, + PlaceID: obj.PlaceID, + PreparerID: obj.PreparerID, + Rating: obj.Rating, + RatingEngineID: obj.RatingEngineID, + Ref: obj.Ref, + RevenueBase: obj.RevenueBase, + RevenueNet: obj.RevenueNet, + RevenueNotTaxable: obj.RevenueNotTaxable, + ShippingAddress: obj.ShippingAddress.MarshalToCrm(), + ShippingCensusTract: obj.ShippingCensusTract, + ShippingConactID: obj.ShippingContactID, + SIC: obj.SIC, + SICDesc: obj.SicDesc, + Site: obj.Site, + Status: obj.Status, + TaxExemption: obj.TaxExemption, + TaxOnTax: obj.TaxOnTax, + TelecomCustomer: obj.TelecomCustomer, + TenantID: obj.TenantID, + TickerSymbol: obj.TickerSymbol, + TradeStyle: obj.TradeStyle, + Type: obj.Type, + UnappliedPayments: obj.UnappliedPayments, + UnitBase: obj.UnitBase, + UpsellOpportunity: obj.UpsellOpportunity, + Website: obj.Website, + WHMCSClientID: obj.WHMCSClientID, + XeroContactID: obj.XeroContactID, + YearStarted: obj.YearStarted, + } +} diff --git a/app/account.go b/app/account.go index 154ab97..c7e9fbf 100644 --- a/app/account.go +++ b/app/account.go @@ -9,7 +9,7 @@ import ( // NewAccountActivity is an activity identifier const NewAccountActivity = "NEW_ACCOUNT_ACTIVITY" -// AccountChannelWrapper wraps the object with the security principal +// AccountChannelWrapper wraps the object with workflow params type AccountChannelWrapper struct { Obj crm_models.Account Principal User @@ -29,10 +29,10 @@ type Account struct { AmountPaid float64 AnnualRevenue float64 Balance float64 - BillingAddress Address + BillingAddress *Address BillingContactID string BillingPreference string - BusinessAddress Address + BusinessAddress *Address CannabisCustomer bool ChannelProgramLevelName string ChannelProgramName string @@ -46,7 +46,7 @@ type Account struct { CustomerPriority string DandBCompanyID string DBA string - DefaultAddress Address + DefaultAddress *Address DefaultBackendID string DefaultDeliveryContactID string DefaultEndUserID string @@ -85,7 +85,7 @@ type Account struct { RevenueBase float64 RevenueNet float64 RevenueNotTaxable float64 - ShippingAddress Address + ShippingAddress *Address ShippingCensusTract string ShippingContactID string ShippingCounty string diff --git a/app/accountingrule-helpers.go b/app/accountingrule-helpers.go new file mode 100644 index 0000000..2886c69 --- /dev/null +++ b/app/accountingrule-helpers.go @@ -0,0 +1,69 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/ledger/ledger_models" + "github.com/google/uuid" +) + +func UnMarshalAccountingRule(s *ledger_models.AccountingRule) *AccountingRule { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + return &AccountingRule{ + ID: s.ID, + AccountID: s.AcountID, + Code: s.Code, + COGSaccountID: s.COGSAccountID, + COGSaccountName: s.COGSAccountName, + CreatedByID: s.CreatedByID, + CreditAccountID: s.CreditAccountID, + CreditAccountName: s.CreditAccountName, + DebitAccountID: s.DebitAccountID, + DebitAccountName: s.DebitAccountName, + Description: s.Description, + InventoryAccountID: s.InventoryAccountID, + InventoryAccountName: s.InventoryAccountName, + IsDeferred: s.IsDeferred, + LastModifiedByID: s.LastModifiedByID, + ParentFK: s.ParentFK, + Proportion: s.Proportion, + TenantID: s.TenantID, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + } +} +func (obj *AccountingRule) marshalToSwagger() *ledger_models.AccountingRule { + return &ledger_models.AccountingRule{ + ID: obj.ID, + AcountID: obj.AccountID, + Code: obj.Code, + COGSAccountID: obj.COGSaccountID, + COGSAccountName: obj.COGSaccountName, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + CreditAccountID: obj.CreditAccountID, + CreditAccountName: obj.CreditAccountName, + DebitAccountID: obj.DebitAccountID, + DebitAccountName: obj.DebitAccountName, + Description: obj.Description, + InventoryAccountID: obj.InventoryAccountID, + InventoryAccountName: obj.InventoryAccountName, + IsDeferred: obj.IsDeferred, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + ParentFK: obj.ParentFK, + Proportion: obj.Proportion, + TenantID: obj.TenantID, + } +} diff --git a/app/accountingrule.go b/app/accountingrule.go index 62fddd4..1d95b15 100644 --- a/app/accountingrule.go +++ b/app/accountingrule.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/ledger/ledger_models" ) -// AccountingRuleChannelWrapper wraps the object with the security principal +// AccountingRuleChannelWrapper wraps the object with workflow params type AccountingRuleChannelWrapper struct { Obj ledger_models.AccountingRule Principal User diff --git a/app/accountingruleset-helpers.go b/app/accountingruleset-helpers.go new file mode 100644 index 0000000..971343d --- /dev/null +++ b/app/accountingruleset-helpers.go @@ -0,0 +1,62 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/ledger/ledger_models" + "github.com/google/uuid" +) + +func UnMarshalAccountingRuleset(s *ledger_models.AccountingRuleset) *AccountingRuleset { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + theItems := []*AccountingRulesetItem{} + for _, itm := range s.Items { + theItems = append(theItems, &AccountingRulesetItem{ + ID: itm.ID, + AccountingRuleCode: itm.AccountingRuleCode, + }) + } + return &AccountingRuleset{ + ID: s.ID, + AccountID: s.AccountID, + Code: s.Code, + Description: s.Description, + Items: theItems, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + } +} +func (obj *AccountingRuleset) marshalToSwagger() *ledger_models.AccountingRuleset { + theItems := []*ledger_models.AccountingRulesetItem{} + for _, itm := range obj.Items { + theItems = append(theItems, + &ledger_models.AccountingRulesetItem{ + ID: itm.ID, + AccountingRuleCode: itm.AccountingRuleCode, + TenantID: itm.TenantID, + }) + } + return &ledger_models.AccountingRuleset{ + ID: obj.ID, + AccountID: obj.AccountID, + Code: obj.Code, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Description: obj.Description, + Items: theItems, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + TenantID: obj.TenantID, + } +} diff --git a/app/accountingruleset.go b/app/accountingruleset.go index a6d72d3..7847e00 100644 --- a/app/accountingruleset.go +++ b/app/accountingruleset.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/ledger/ledger_models" ) -// AccountingRulesetChannelWrapper wraps the object with the security principal +// AccountingRulesetChannelWrapper wraps the object with workflow params type AccountingRulesetChannelWrapper struct { Obj ledger_models.AccountingRuleset Principal User diff --git a/app/accountingrulesetitem.go b/app/accountingrulesetitem.go index b032ae6..752e206 100644 --- a/app/accountingrulesetitem.go +++ b/app/accountingrulesetitem.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/ledger/ledger_models" ) -// AccountingRulesetItemChannelWrapper wraps the object with the security principal +// AccountingRulesetItemChannelWrapper wraps the object with workflow params type AccountingRulesetItemChannelWrapper struct { Obj ledger_models.AccountingRulesetItem Principal User diff --git a/app/address.go b/app/address.go index 1575afa..17ee4d6 100644 --- a/app/address.go +++ b/app/address.go @@ -1,5 +1,10 @@ package app +import ( + "code.tnxs.net/taxnexus/lib/api/crm/crm_models" + "code.tnxs.net/taxnexus/lib/api/ops/ops_models" +) + // Address address struct type Address struct { City string @@ -10,3 +15,67 @@ type Address struct { StateCode string Street string } + +// MarshalToCrm converts a first class object to swagger +func (obj *Address) MarshalToCrm() *crm_models.Address { + if obj == nil { + return nil + } + return &crm_models.Address{ + City: obj.City, + Country: obj.Country, + CountryCode: obj.CountryCode, + PostalCode: obj.PostalCode, + State: obj.State, + StateCode: obj.StateCode, + Street: obj.Street, + } +} + +// MarshalToOps converts a first class object to swagger +func (obj *Address) MarshalToOps() *ops_models.Address { + if obj == nil { + return nil + } + return &ops_models.Address{ + City: obj.City, + Country: obj.Country, + CountryCode: obj.CountryCode, + PostalCode: obj.PostalCode, + State: obj.State, + StateCode: obj.StateCode, + Street: obj.Street, + } +} + +// UnMarshalCrmAddress converts a first class object to swagger +func UnMarshalCrmAddress(s *crm_models.Address) *Address { + if s == nil { + return nil + } + return &Address{ + City: s.City, + Country: s.Country, + CountryCode: s.CountryCode, + PostalCode: s.PostalCode, + State: s.State, + StateCode: s.StateCode, + Street: s.Street, + } +} + +// UnMarshalOpsAddress converts a first class object to swagger +func UnMarshalOpsAddress(s *ops_models.Address) *Address { + if s == nil { + return nil + } + return &Address{ + City: s.City, + Country: s.Country, + CountryCode: s.CountryCode, + PostalCode: s.PostalCode, + State: s.State, + StateCode: s.StateCode, + Street: s.Street, + } +} diff --git a/app/applog-helpers.go b/app/applog-helpers.go new file mode 100644 index 0000000..228a9b6 --- /dev/null +++ b/app/applog-helpers.go @@ -0,0 +1,52 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/workflow/workflow_models" + "github.com/google/uuid" +) + +func unMarshalAppLog(s *workflow_models.AppLog) *AppLog { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + sourceTimestamp, e1 := time.Parse(dateTimeFormat, s.SourceTimestamp) + return &AppLog{ + AccountID: s.AccountID, + CompanyID: s.CompanyID, + CreatedByID: s.CreatedByID, + ID: s.ID, + Message: s.Message, + ObjectID: s.ObjectID, + ObjectType: s.ObjectType, + Severity: s.Severity, + Source: s.Source, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + SourceTimestamp: sql.NullTime{ + Time: sourceTimestamp, + Valid: e1 == nil, + }, + } +} + +func (obj *AppLog) marshalToSwagger() *workflow_models.AppLog { + return &workflow_models.AppLog{ + ID: obj.ID, + AccountID: obj.AccountID, + CompanyID: obj.CompanyID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Message: obj.Message, + ObjectType: obj.ObjectType, + ObjectID: obj.ObjectID, + Severity: obj.Severity, + Source: obj.Source, + SourceTimestamp: obj.SourceTimestamp.Time.Format(dateTimeFormat), + } +} diff --git a/app/applog.go b/app/applog.go new file mode 100644 index 0000000..2516195 --- /dev/null +++ b/app/applog.go @@ -0,0 +1,18 @@ +package app + +import "database/sql" + +// AppLog is a first class object type +type AppLog struct { + ID string + AccountID string + CompanyID string + CreatedByID string + CreatedDate sql.NullTime + Message string + ObjectType string + ObjectID string + Severity string + Source string + SourceTimestamp sql.NullTime +} diff --git a/app/authority-helpers.go b/app/authority-helpers.go new file mode 100644 index 0000000..d426ee5 --- /dev/null +++ b/app/authority-helpers.go @@ -0,0 +1,107 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/regs/regs_models" + "github.com/google/uuid" +) + +func UnMarshalSwaggerAuthority(s *regs_models.Authority) *Authority { + if s.ID == "" { + s.ID = uuid.New().String() + } + authorityDate, e4 := time.Parse(dateFormat, s.Date) + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + dateApproved, e2 := time.Parse(dateFormat, s.DateApproved) + if e2 != nil { + dateApproved, e2 = time.Parse(dateFormatAlt, s.DateApproved) + } + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + transferDate, e3 := time.Parse(dateFormat, s.TransferDate) + if e3 != nil { + transferDate, e3 = time.Parse(dateFormatAlt, s.TransferDate) + } + return &Authority{ + ID: s.ID, + AccountID: s.AccountID, + AddressLine1: s.AddressLine1, + AddressLine2: s.AddressLine2, + BTN: s.BTN, + City: s.City, + ContactID: s.ContactID, + Country: s.Country, + CreatedByID: s.CreatedByID, + LastModifiedByID: s.LastModifiedByID, + LosingCarrier: s.LosingCarrier, + Name: s.Name, + NameLine1: s.NameLine1, + NameLine2: s.NameLine2, + OpportunityID: s.OpportunityID, + OrderID: s.OrderID, + ParentFK: s.ParentFK, + PostalCode: s.PostalCode, + QuoteID: s.QuoteID, + Ref: s.Ref, + State: s.State, + Status: s.Status, + TemplateID: s.TemplateID, + TenantID: s.TenantID, + Type: s.Type, + Date: sql.NullTime{ + Time: authorityDate, + Valid: e4 == nil, + }, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + DateApproved: sql.NullTime{ + Time: dateApproved, + Valid: e2 == nil, + }, + TransferDate: sql.NullTime{ + Time: transferDate, + Valid: e3 == nil, + }, + } +} +func (obj *Authority) MarshalToSwagger() *regs_models.Authority { + return ®s_models.Authority{ + ID: obj.ID, + AccountID: obj.AccountID, + AddressLine1: obj.AddressLine1, + AddressLine2: obj.AddressLine2, + BTN: obj.BTN, + City: obj.City, + ContactID: obj.ContactID, + Country: obj.Country, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Date: obj.Date.Time.Format(dateFormat), + DateApproved: obj.DateApproved.Time.Format(dateFormat), + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + LosingCarrier: obj.LosingCarrier, + Name: obj.Name, + NameLine1: obj.NameLine1, + NameLine2: obj.NameLine2, + OpportunityID: obj.OpportunityID, + OrderID: obj.OrderID, + ParentFK: obj.ParentFK, + PostalCode: obj.PostalCode, + QuoteID: obj.QuoteID, + Ref: obj.Ref, + State: obj.State, + Status: obj.Status, + TransferDate: obj.TransferDate.Time.Format(dateFormat), + TenantID: obj.TenantID, + TemplateID: obj.TemplateID, + Type: obj.Type, + } +} diff --git a/app/authority.go b/app/authority.go new file mode 100644 index 0000000..1692311 --- /dev/null +++ b/app/authority.go @@ -0,0 +1,37 @@ +package app + +import "database/sql" + +// Authority is a first class object type +type Authority struct { + ID string + AccountID string + AddressLine1 string + AddressLine2 string + BTN string + City string + ContactID string + Country string + CreatedByID string + CreatedDate sql.NullTime + Date sql.NullTime + DateApproved sql.NullTime + LastModifiedByID string + LastModifiedDate sql.NullTime + LosingCarrier string + Name string + NameLine1 string + NameLine2 string + OpportunityID string + OrderID string + ParentFK string + PostalCode string + QuoteID string + Ref string + State string + Status string + TemplateID string + TransferDate sql.NullTime + Type string + TenantID string +} diff --git a/app/backend-helpers.go b/app/backend-helpers.go new file mode 100644 index 0000000..fcd2e04 --- /dev/null +++ b/app/backend-helpers.go @@ -0,0 +1,106 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/regs/regs_models" + "github.com/google/uuid" +) + +// UnMarshalBackend decodes swagger to a first class object +func UnMarshalBackend(s *regs_models.Backend) *Backend { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + return &Backend{ + ID: s.ID, + AccountID: s.AccountID, + Active: s.Active, + APIKey: s.APIKey, + ApplicationName: s.ApplicationName, + AuthType: s.AuthType, + BackendName: s.BackendName, + BaseURL: s.BaseURL, + CallbackURL: s.CallbackURL, + ClientID: s.ClientID, + ClientSecret: s.ClientSecret, + CompanyID: s.CompanyID, + CreatedByID: s.CreatedByID, + Description: s.Description, + LastModifiedByID: s.LastModifiedByID, + LoginURL: s.LoginURL, + ManagementPassword: s.ManagementPassword, + ManagementURL: s.ManagementURL, + ManagementUsername: s.ManagementUsername, + MetrcLicense: s.MetrcLicense, + MetrcState: s.MetrcState, + OwnerID: s.OwnerID, + Password: s.Password, + ProjectID: s.ProjectID, + ProviderCredentials: s.ProviderCredentials, + Realm: s.Realm, + Ref: s.Ref, + ResellerBackendID: s.ResellerBackendID, + SecurityToken: s.SecurityToken, + Timeout: s.Timeout, + TokenURI: s.TokenURI, + Type: s.Type, + Username: s.Username, + Vendor: s.Vendor, + TenantID: s.TenantID, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + } +} + +// MarshalToSwagger encodes a first class object to swagger +func (obj *Backend) MarshalToSwagger() *regs_models.Backend { + return ®s_models.Backend{ + ID: obj.ID, + AccountID: obj.AccountID, + Active: obj.Active, + APIKey: obj.APIKey, + ApplicationName: obj.ApplicationName, + AuthType: obj.AuthType, + BackendName: obj.BackendName, + BaseURL: obj.BaseURL, + CallbackURL: obj.CallbackURL, + ClientID: obj.ClientID, + ClientSecret: obj.ClientSecret, + CompanyID: obj.CompanyID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Description: obj.Description, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + LoginURL: obj.LoginURL, + ManagementPassword: obj.ManagementPassword, + ManagementURL: obj.ManagementURL, + ManagementUsername: obj.ManagementUsername, + MetrcLicense: obj.MetrcLicense, + MetrcState: obj.MetrcState, + OwnerID: obj.OwnerID, + Password: obj.Password, + ProjectID: obj.ProjectID, + ProviderCredentials: obj.ProviderCredentials, + Realm: obj.Realm, + Ref: obj.Ref, + ResellerBackendID: obj.ResellerBackendID, + SecurityToken: obj.SecurityToken, + TenantID: obj.TenantID, + Timeout: obj.Timeout, + TokenURI: obj.TokenURI, + Type: obj.Type, + Username: obj.Username, + Vendor: obj.Vendor, + } +} diff --git a/app/backend.go b/app/backend.go index 194a984..1b77a9b 100644 --- a/app/backend.go +++ b/app/backend.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/regs/regs_models" ) -// BackendChannelWrapper wraps the object with the security principal +// BackendChannelWrapper wraps the object with workflow params type BackendChannelWrapper struct { Obj regs_models.Backend Principal User diff --git a/app/cashreceipt-helpers.go b/app/cashreceipt-helpers.go new file mode 100644 index 0000000..a1d9c46 --- /dev/null +++ b/app/cashreceipt-helpers.go @@ -0,0 +1,104 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/ops/ops_models" + "github.com/google/uuid" +) + +// UnMarshalCashReceipt decodes swagger to a first class object +func UnMarshalCashReceipt(s *ops_models.CashReceipt) *CashReceipt { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + cashReceiptDate, e2 := time.Parse(dateTimeFormat, s.CashReceiptDate) + return &CashReceipt{ + ID: s.ID, + AccountID: s.AccountID, + Amount: s.Amount, + AppliedAmount: s.AppliedAmount, + BillingContactID: s.BillingContactID, + CashReceiptNumber: s.CashReceiptNumber, + CreatedByID: s.CreatedByID, + Description: s.Description, + Gateway: s.Gateway, + GatewayKey: s.GatewayKey, + GatewayMessage: s.GatewayMessage, + GatewayTransaction: s.GatewayTransaction, + IsValid: s.IsValid, + LastModifiedByID: s.LastModifiedByID, + PartnerAccountID: s.PartnerAccountID, + PaymentMethodID: s.PaymentMethodID, + PeriodID: s.PeriodID, + Posted: s.Posted, + RecordType: s.RecordType, + Ref: s.Ref, + Rejected: s.Rejected, + Source: s.Source, + Status: s.Status, + TenantID: s.TenantID, + TemplateID: s.TemplateID, + Type: s.Type, + UnappliedAmount: s.UnappliedAmount, + ValidPayment: s.ValidPayment, + XeroID: s.XeroID, + BillingRunID: s.BillingRunID, + InvoiceID: s.InvoiceID, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + CashReceiptDate: sql.NullTime{ + Time: cashReceiptDate, + Valid: e2 == nil, + }, + } +} + +// MarshalToSwagger encodes a first class object to swagger +func (obj *CashReceipt) MarshalToSwagger() *ops_models.CashReceipt { + return &ops_models.CashReceipt{ + ID: obj.ID, + AccountID: obj.AccountID, + Amount: obj.Amount, + AppliedAmount: obj.AppliedAmount, + BillingContactID: obj.BillingContactID, + BillingRunID: obj.BillingRunID, + CashReceiptDate: obj.CashReceiptDate.Time.Format(dateTimeFormat), + CashReceiptNumber: obj.CashReceiptNumber, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Description: obj.Description, + Gateway: obj.Gateway, + GatewayKey: obj.GatewayKey, + GatewayMessage: obj.GatewayMessage, + GatewayTransaction: obj.GatewayTransaction, + InvoiceID: obj.InvoiceID, + IsValid: obj.IsValid, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + PartnerAccountID: obj.PartnerAccountID, + PaymentMethodID: obj.PaymentMethodID, + PeriodID: obj.PeriodID, + Posted: obj.Posted, + RecordType: obj.RecordType, + Ref: obj.Ref, + Rejected: obj.Rejected, + Source: obj.Source, + Status: obj.Status, + TemplateID: obj.TemplateID, + TenantID: obj.TenantID, + Type: obj.Type, + UnappliedAmount: obj.UnappliedAmount, + ValidPayment: obj.ValidPayment, + XeroID: obj.XeroID, + } +} diff --git a/app/cashreceipt.go b/app/cashreceipt.go index 6c47b17..4389aa5 100644 --- a/app/cashreceipt.go +++ b/app/cashreceipt.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/ops/ops_models" ) -// CashReceiptChannelWrapper wraps the object with the security principal +// CashReceiptChannelWrapper wraps the object with workflow params type CashReceiptChannelWrapper struct { Obj ops_models.CashReceipt Principal User diff --git a/app/charge-helpers.go b/app/charge-helpers.go new file mode 100644 index 0000000..855c4a2 --- /dev/null +++ b/app/charge-helpers.go @@ -0,0 +1,88 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/ops/ops_models" + "github.com/google/uuid" +) + +// UnMarshalCharge decodes swagger to a first class object +func UnMarshalCharge(s *ops_models.Charge) *Charge { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + journalDate, e2 := time.Parse(dateTimeFormat, s.JournalDate) + return &Charge{ + ID: s.ID, + AccountID: s.AccountID, + Amount: s.Amount, + BillingContactID: s.BillingContactID, + ContractID: s.ContractID, + CreatedByID: s.CreatedByID, + Description: s.Description, + EmailMessage: s.EmailMessage, + LastModifiedByID: s.LastModifiedByID, + PartnerAccountID: s.PartnerAccountID, + PaymentTerms: s.PaymentTerms, + PeriodID: s.PeriodID, + Posted: s.Posted, + ProductID: s.ProductID, + Quantity: s.Quantity, + TenantID: s.TenantID, + UnitPrice: s.UnitPrice, + AccountingRulesetCode: s.AccountingRulesetCode, + BillingEmail: s.BillingEmail, + BillingRunID: s.BillingRunID, + ContractHourlyRate: s.ContractHourlyRate, + Ref: s.Ref, + TemplateID: s.TemplateID, + Type: s.Type, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + JournalDate: sql.NullTime{ + Time: journalDate, + Valid: e2 == nil, + }, + } +} + +// MarshalToSwagger encodes a first class object to swagger +func (obj *Charge) MarshalToSwagger() *ops_models.Charge { + return &ops_models.Charge{ + ID: obj.ID, + AccountID: obj.AccountID, + Amount: obj.Amount, + BillingContactID: obj.BillingContactID, + ContractID: obj.ContractID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Description: obj.Description, + EmailMessage: obj.EmailMessage, + JournalDate: obj.JournalDate.Time.Format(dateTimeFormat), + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + PartnerAccountID: obj.PartnerAccountID, + PaymentTerms: obj.PaymentTerms, + PeriodID: obj.PeriodID, + Posted: obj.Posted, + ProductID: obj.ProductID, + Quantity: obj.Quantity, + TenantID: obj.TenantID, + UnitPrice: obj.UnitPrice, + AccountingRulesetCode: obj.AccountingRulesetCode, + BillingEmail: obj.BillingEmail, + BillingRunID: obj.BillingRunID, + ContractHourlyRate: obj.ContractHourlyRate, + Ref: obj.Ref, + } +} diff --git a/app/charge.go b/app/charge.go index c4b3b1a..297e9b4 100644 --- a/app/charge.go +++ b/app/charge.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/ops/ops_models" ) -// ChargeChannelWrapper wraps the object with the security principal +// ChargeChannelWrapper wraps the object with workflow params type ChargeChannelWrapper struct { Obj ops_models.Charge Principal User diff --git a/app/cluster-helpers.go b/app/cluster-helpers.go new file mode 100644 index 0000000..4d15c71 --- /dev/null +++ b/app/cluster-helpers.go @@ -0,0 +1,64 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/devops/devops_models" + "github.com/google/uuid" +) + +// UnMarshalCluster decodes swagger to first class object +func UnMarshalCluster(s *devops_models.Cluster) *Cluster { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + return &Cluster{ + ID: s.ID, + CreatedByID: s.CreatedByID, + Description: s.Description, + Environment: s.Environment, + Gateway: s.Gateway, + IPAddress: s.IPAddress, + LastModifiedByID: s.LastModifiedDate, + Name: s.Name, + OwnerID: s.OwnerID, + Ref: s.Ref, + Status: s.Status, + Subnet: s.Subnet, + Type: s.Type, + Zone: s.Zone, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + } +} + +// MarshalToSwagger encodes a first class object to swagger +func (obj *Cluster) MarshalToSwagger() *devops_models.Cluster { + return &devops_models.Cluster{ + ID: obj.ID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Description: obj.Description, + Environment: obj.Environment, + Gateway: obj.Gateway, + IPAddress: obj.IPAddress, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + Name: obj.Name, + OwnerID: obj.OwnerID, + Ref: obj.Ref, + Status: obj.Status, + Subnet: obj.Subnet, + Type: obj.Type, + Zone: obj.Zone, + } +} diff --git a/app/cluster.go b/app/cluster.go index b28cfc4..35ebd6b 100644 --- a/app/cluster.go +++ b/app/cluster.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/devops/devops_models" ) -// ClusterChannelWrapper wraps the object with the security principal +// ClusterChannelWrapper wraps the object with workflow params type ClusterChannelWrapper struct { Obj devops_models.Cluster Principal User diff --git a/app/company-helpers.go b/app/company-helpers.go new file mode 100644 index 0000000..bb5c21b --- /dev/null +++ b/app/company-helpers.go @@ -0,0 +1,108 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/crm/crm_models" + "github.com/google/uuid" +) + +// UnMarshalCompany decodes swagger to first class object +func UnMarshalCompany(s *crm_models.Company) *Company { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + dateClosed, e2 := time.Parse(dateTimeFormat, s.DateClosed) + return &Company{ + ID: s.ID, + AccountID: s.AccountID, + AccountNumberPrefix: s.AccountNumberPrefix, + BillingAddress: UnMarshalCrmAddress(s.BillingAddress), + BillingAdvice: s.BillingAdvice, + BillingContactID: s.BillingContactID, + BillingEmail: s.BillingEmail, + BillingPhone: s.BillingPhone, + BillingWebsite: s.BillingWebsite, + CoaTemplateID: s.COATemplateID, + ColorAccent1: s.ColorAccent1, + ColorAccent2: s.ColorAccent2, + ColorPrimary: s.ColorPrimary, + CreatedByID: s.CreatedByID, + CustomerSuccessID: s.CustomerSuccessID, + DefaultAddress: UnMarshalCrmAddress(s.DefaultAddress), + DefaultCompany: s.DefaultCompany, + FontBody: s.FontBody, + FontHeading: s.FontBody, + FontHeadingNarrow: s.FontHeadingNarrow, + FontLink: s.FontLink, + FontMono: s.FontMono, + International: s.International, + LastAccountNumber: s.LastAccountNumber, + LastModifiedByID: s.LastModifiedByID, + LastTaxtypeNumber: s.LastTaxTypeNumber, + Logo: s.Logo, + Name: s.Name, + OwnerID: s.OwnerID, + PreparerID: s.PreparerID, + PricebookID: s.PricebookID, + TenantID: s.TenantID, + UserTechLeadID: s.UserTechLeadID, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + DateClosed: sql.NullTime{ + Time: dateClosed, + Valid: e2 == nil, + }, + } +} + +// MarshalToSwagger encodes a first class object to swagger +func (obj *Company) MarshalToSwagger() *crm_models.Company { + return &crm_models.Company{ + ID: obj.ID, + AccountID: obj.AccountID, + AccountNumberPrefix: obj.AccountNumberPrefix, + BillingAddress: obj.BillingAddress.MarshalToCrm(), + BillingAdvice: obj.BillingAdvice, + BillingContactID: obj.BillingContactID, + BillingEmail: obj.BillingEmail, + BillingPhone: obj.BillingPhone, + BillingWebsite: obj.BillingWebsite, + COATemplateID: obj.CoaTemplateID, + ColorAccent1: obj.ColorAccent1, + ColorAccent2: obj.ColorAccent2, + ColorPrimary: obj.ColorPrimary, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + CustomerSuccessID: obj.CustomerSuccessID, + DateClosed: obj.DateClosed.Time.Format(dateTimeFormat), + DefaultAddress: obj.DefaultAddress.MarshalToCrm(), + DefaultCompany: obj.DefaultCompany, + FontBody: obj.FontBody, + FontHeading: obj.FontHeading, + FontHeadingNarrow: obj.FontHeadingNarrow, + FontLink: obj.FontLink, + FontMono: obj.FontMono, + International: obj.International, + LastAccountNumber: obj.LastAccountNumber, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + LastTaxTypeNumber: obj.LastTaxtypeNumber, + Logo: obj.Logo, + Name: obj.Name, + OwnerID: obj.OwnerID, + PreparerID: obj.PreparerID, + PricebookID: obj.PricebookID, + TenantID: obj.TenantID, + UserTechLeadID: obj.UserTechLeadID, + } +} diff --git a/app/company.go b/app/company.go index b678885..9ff5090 100644 --- a/app/company.go +++ b/app/company.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/crm/crm_models" ) -// CompanyChannelWrapper wraps the object with the security principal +// CompanyChannelWrapper wraps the object with workflow params type CompanyChannelWrapper struct { Obj crm_models.Company Principal User @@ -20,7 +20,7 @@ type Company struct { AccountID string AccountNumberPrefix string AdvancePeriodID string - BillingAddress Address + BillingAddress *Address BillingAdvice string BillingContactID string BillingEmail string @@ -37,7 +37,7 @@ type Company struct { CurrentPeriodStatus string CustomerSuccessID string DateClosed sql.NullTime - DefaultAddress Address + DefaultAddress *Address DefaultCompany bool FontBody string FontHeading string diff --git a/app/contact-helpers.go b/app/contact-helpers.go new file mode 100644 index 0000000..19b8780 --- /dev/null +++ b/app/contact-helpers.go @@ -0,0 +1,126 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/crm/crm_models" + "github.com/google/uuid" +) + +func UnMarshalContact(s *crm_models.Contact) *Contact { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + birthDate, e2 := time.Parse(dateTimeFormat, s.BirthDate) + emailBounceDate, e3 := time.Parse(dateTimeFormat, s.EmailBounceDate) + return &Contact{ + ID: s.ID, + AccountID: s.AccountID, + AssistantName: s.AssistantName, + AssistantPhone: s.AssistantPhone, + CreatedByID: s.CreatedByID, + Department: s.Department, + Description: s.Description, + DoNotCall: s.DoNotCall, + Email: s.Email, + EmailBouncedReason: s.EmailBouncedReason, + EnrollmentStatus: s.EnrollmentStatus, + Fax: s.Fax, + FirstName: s.FirstName, + HasOptedOutOfEmail: s.HasOptedOutOfEmail, + HasOptedOutOfFax: s.HasOptedOutOfFax, + HomePhone: s.HomePhone, + IsEmailBounced: s.IsEmailBounced, + IsProvisioned: s.IsProvisioned, + LastModifiedByID: s.LastModifiedByID, + LastName: s.LastName, + LeadSource: s.LeadSource, + Level: s.Level, + LinkedIn: s.LinkedIn, + MailingAddress: UnMarshalCrmAddress(s.MailingAddress), + MailingLists: s.MailingLists, + MobilePhone: s.MobilePhone, + Name: s.Name, + OtherAddress: UnMarshalCrmAddress(s.OtherAddress), + OtherPhone: s.OtherPhone, + OwnerID: s.OwnerID, + PersonalEmail: s.PersonalEmail, + Phone: s.Phone, + PhotoURL: s.PhotoURL, + RecruitingStatus: s.RecruitingStatus, + Ref: s.Ref, + ReportsToID: s.ReportsToID, + Salutation: s.Salutation, + Status: s.Status, + Title: s.Title, + Type: s.Type, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + BirthDate: sql.NullTime{ + Time: birthDate, + Valid: e2 == nil, + }, + EmailBounceDate: sql.NullTime{ + Time: emailBounceDate, + Valid: e3 == nil, + }, + } +} +func (obj *Contact) MarshalToSwagger() *crm_models.Contact { + return &crm_models.Contact{ + ID: obj.ID, + AccountID: obj.AccountID, + AssistantName: obj.AssistantName, + AssistantPhone: obj.AssistantPhone, + BirthDate: obj.BirthDate.Time.Format(dateTimeFormat), + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Department: obj.Department, + Description: obj.Description, + DoNotCall: obj.DoNotCall, + Email: obj.Email, + EmailBounceDate: obj.EmailBounceDate.Time.Format(dateTimeFormat), + EmailBouncedReason: obj.EmailBouncedReason, + EnrollmentStatus: obj.EnrollmentStatus, + Fax: obj.Fax, + FirstName: obj.FirstName, + HasOptedOutOfEmail: obj.HasOptedOutOfEmail, + HasOptedOutOfFax: obj.HasOptedOutOfFax, + HomePhone: obj.HomePhone, + IsEmailBounced: obj.IsEmailBounced, + IsProvisioned: obj.IsProvisioned, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + LastName: obj.LastName, + LeadSource: obj.LeadSource, + Level: obj.Level, + LinkedIn: obj.LinkedIn, + MailingAddress: obj.MailingAddress.MarshalToCrm(), + MailingLists: obj.MailingLists, + MobilePhone: obj.MobilePhone, + Name: obj.Name, + OtherAddress: obj.OtherAddress.MarshalToCrm(), + OtherPhone: obj.OtherPhone, + OwnerID: obj.OwnerID, + PersonalEmail: obj.PersonalEmail, + Phone: obj.Phone, + PhotoURL: obj.PhotoURL, + RecruitingStatus: obj.RecruitingStatus, + Ref: obj.Ref, + ReportsToID: obj.ReportsToID, + Salutation: obj.Salutation, + Status: obj.Status, + TenantID: obj.TenantID, + Title: obj.Title, + Type: obj.Type, + } +} diff --git a/app/contact.go b/app/contact.go index 655f398..72225d0 100644 --- a/app/contact.go +++ b/app/contact.go @@ -9,7 +9,7 @@ import ( // NewContactActivity is an activity identifier const NewContactActivity = "NEW_CONTACT_ACTIVITY" -// ContactChannelWrapper wraps the object with the security principal +// ContactChannelWrapper wraps the object with workflow params type ContactChannelWrapper struct { Obj crm_models.Contact Principal User @@ -46,11 +46,11 @@ type Contact struct { LeadSource string Level string LinkedIn string - MailingAddress Address + MailingAddress *Address MailingLists string MobilePhone string Name string - OtherAddress Address + OtherAddress *Address OtherPhone string OwnerID string PersonalEmail string diff --git a/app/coordinate-helpers.go b/app/coordinate-helpers.go new file mode 100644 index 0000000..09d76fa --- /dev/null +++ b/app/coordinate-helpers.go @@ -0,0 +1,53 @@ +package app + +import "code.tnxs.net/taxnexus/lib/api/geo/geo_models" + +// Coordinate is never ingested, hence no UnMarshal method + +// MarshalToSwagger encodes a first class object to swagger +func (obj *Coordinate) MarshalToSwagger() *geo_models.Coordinate { + theTaxTypes := []*geo_models.TaxType{} + if obj.TaxTypes != nil { + for _, itm := range obj.TaxTypes { + theTaxTypes = append(theTaxTypes, itm.MarshalToSwagger()) + } + } + var taxRate geo_models.TaxRate + if obj.TaxRate != nil { + taxRate = geo_models.TaxRate{ + CombinedRate: obj.TaxRate.CombinedRate, + County: obj.TaxRate.County, + CountyID: obj.TaxRate.CountyID, + CountyRate: obj.TaxRate.CountyRate, + Date: obj.TaxRate.Date, + } + } + return &geo_models.Coordinate{ + ID: obj.ID, + Country: obj.Country, + CountryID: obj.CountryID, + County: obj.County, + CountyID: obj.CountyID, + Focus: obj.Focus, + FormattedAddress: obj.FormattedAddress, + IsDistrict: obj.IsDistrict, + Latitude: obj.Latitude, + Longitude: obj.Longitude, + Map: obj.Map, + Name: obj.Name, + Neighborhood: obj.Neighborhood, + Place: obj.Place, + PlaceGeocode: obj.Geocode, + PlaceID: obj.PlaceID, + PostalCode: obj.PostalCode, + Ref: obj.Ref, + State: obj.State, + StateID: obj.StateID, + Status: obj.Status, + Street: obj.Street, + StreetNumber: obj.StreetNumber, + StreetView: obj.StreetView, + TaxTypes: theTaxTypes, + TaxRate: &taxRate, + } +} diff --git a/app/coordinate.go b/app/coordinate.go index 74e32cb..dab67dc 100644 --- a/app/coordinate.go +++ b/app/coordinate.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/geo/geo_models" ) -// CoordinateBasicChannelWrapper wraps the object with the security principal +// CoordinateBasicChannelWrapper wraps the object with workflow params type CoordinateBasicChannelWrapper struct { Obj geo_models.CoordinateBasic Principal User @@ -29,7 +29,7 @@ type CoordinateBasic struct { TaxTypes []*string } -// CoordinateChannelWrapper wraps the object with the security principal +// CoordinateChannelWrapper wraps the object with workflow params type CoordinateChannelWrapper struct { Obj geo_models.Coordinate Principal User diff --git a/app/country-helpers.go b/app/country-helpers.go new file mode 100644 index 0000000..e3bb0df --- /dev/null +++ b/app/country-helpers.go @@ -0,0 +1,99 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/geo/geo_models" + "github.com/google/uuid" +) + +func unMarshalCountry(s *geo_models.Country) *Country { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + theInstances := []*TaxInstance{} + for _, itm := range s.TaxInstances { + theInstances = append(theInstances, unMarshalTaxInstance(itm)) + } + return &Country{ + ID: s.ID, + AccountID: s.AccountID, + Amount: s.Amount, + Code: s.Code, + ContactID: s.ContactID, + CreatedByID: s.CreatedByID, + EnrollmentStatus: s.EnrollmentStatus, + Interest: s.Interest, + LastModifiedByID: s.LastModifiedByID, + Latitude: s.Latitude, + Longitude: s.Longitude, + Name: s.Name, + OwnerID: s.OwnerID, + Penalty: s.Penalty, + Ref: s.Ref, + ReportedAdjustments: s.ReportedAdjustments, + ReportedDeductions: s.ReportedDeductions, + ReportedNetRevenue: s.ReportedNetRevenue, + ReportedRate: s.ReportedRate, + ReportedRevenue: s.ReportedRevenue, + RevenueBase: s.RevenueBase, + RevenueNet: s.RevenueNet, + RevenueNotTaxable: s.RevenueNotTaxable, + Status: s.Status, + Subtotal: s.Subtotal, + TaxInstances: theInstances, + TemplateID: s.TemplateID, + TotalAmount: s.TotalAmount, + UnitBase: s.UnitBase, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + } +} +func (obj *Country) marshalToSwagger() *geo_models.Country { + taxInstances := []*geo_models.TaxInstance{} + for _, itm := range obj.TaxInstances { + taxInstances = append(taxInstances, itm.marshalToSwagger()) + } + return &geo_models.Country{ + ID: obj.ID, + AccountID: obj.AccountID, + Amount: obj.Amount, + Code: obj.Code, + ContactID: obj.ContactID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + EnrollmentStatus: obj.EnrollmentStatus, + Interest: obj.Interest, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + Latitude: obj.Latitude, + Longitude: obj.Longitude, + Name: obj.Name, + OwnerID: obj.OwnerID, + Penalty: obj.Penalty, + Ref: obj.Ref, + ReportedAdjustments: obj.ReportedAdjustments, + ReportedDeductions: obj.ReportedDeductions, + ReportedNetRevenue: obj.ReportedNetRevenue, + ReportedRate: obj.ReportedRate, + ReportedRevenue: obj.ReportedRevenue, + RevenueBase: obj.RevenueBase, + RevenueNet: obj.RevenueNet, + RevenueNotTaxable: obj.RevenueNotTaxable, + Status: obj.Status, + Subtotal: obj.Subtotal, + TaxInstances: taxInstances, + TemplateID: obj.TemplateID, + TotalAmount: obj.TotalAmount, + UnitBase: obj.UnitBase, + } +} diff --git a/app/country.go b/app/country.go index 68858df..3bfc23a 100644 --- a/app/country.go +++ b/app/country.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/geo/geo_models" ) -// CountryChannelWrapper wraps the object with the security principal +// CountryChannelWrapper wraps the object with workflow params type CountryChannelWrapper struct { Obj geo_models.Country Principal User diff --git a/app/county-helpers.go b/app/county-helpers.go new file mode 100644 index 0000000..fc1d93d --- /dev/null +++ b/app/county-helpers.go @@ -0,0 +1,141 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/geo/geo_models" + "github.com/google/uuid" +) + +func unMarshalCounty(s *geo_models.County) *County { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + theInstances := []*TaxInstance{} + for _, itm := range s.TaxInstances { + theInstances = append(theInstances, unMarshalTaxInstance(itm)) + } + return &County{ + ID: s.ID, + AccountID: s.AccountID, + Amount: s.Amount, + AreaDescription: s.AreaDescription, + ContactID: s.ContactID, + CountryID: s.CountryID, + EnrollmentStatus: s.EnrollmentStatus, + FIPS: s.FIPS, + FIPSclass: s.FIPSclass, + FunctionalStatus: s.FunctionalStatus, + Geocode: s.Geocode, + GNIS: s.GNIS, + Interest: s.Interest, + LandArea: s.LandArea, + LegalName: s.LegalName, + Latitude: s.Latitude, + Longitude: s.Longitude, + Name: s.Name, + Penalty: s.Penalty, + Ref: s.Ref, + ReportedAdjustments: s.ReportedAdjustments, + ReportedDeductions: s.ReportedDeductions, + ReportedNetRevenue: s.ReportedNetRevenue, + ReportedRate: s.ReportedRate, + ReportedRevenue: s.ReportedNetRevenue, + RevenueBase: s.RevenueBase, + RevenueNet: s.RevenueNet, + RevenueNotTaxable: s.RevenueNotTaxable, + StateID: s.StateID, + Status: s.Status, + Subtotal: s.Subtotal, + TaxInstances: theInstances, + TemplateID: s.TemplateID, + TotalAmount: s.TotalAmount, + TotalArea: s.TotalArea, + UnitBase: s.UnitBase, + WaterArea: s.WaterArea, + CreatedByID: s.CreatedByID, + HasDistrictTaxes: s.HasDistrictTaxes, + LastModifiedByID: s.LastModifiedByID, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + } +} +func (obj *County) marshalToSwagger() *geo_models.County { + theInstances := []*geo_models.TaxInstance{} + for _, itm := range obj.TaxInstances { + theInstances = append(theInstances, itm.marshalToSwagger()) + } + var salesTaxRate *geo_models.TaxRate + if obj.SalesTaxRate != nil { + salesTaxRate = &geo_models.TaxRate{ + CombinedRate: obj.SalesTaxRate.CombinedRate, + County: obj.SalesTaxRate.County, + CountyID: obj.SalesTaxRate.CountyID, + CountyRate: obj.SalesTaxRate.CountyRate, + Date: obj.SalesTaxRate.Date, + Focus: obj.SalesTaxRate.Focus, + Geocode: obj.SalesTaxRate.Geocode, + Place: obj.SalesTaxRate.Place, + PlaceID: obj.SalesTaxRate.PlaceID, + PlaceRate: obj.SalesTaxRate.PlaceRate, + State: obj.SalesTaxRate.State, + StateID: obj.SalesTaxRate.StateID, + StateRate: obj.SalesTaxRate.StateRate, + } + } + return &geo_models.County{ + ID: obj.ID, + AccountID: obj.AccountID, + Amount: obj.Amount, + AreaDescription: obj.AreaDescription, + ContactID: obj.ContactID, + CountryID: obj.CountryID, + EnrollmentStatus: obj.EnrollmentStatus, + FIPS: obj.FIPS, + FIPSclass: obj.FIPSclass, + FunctionalStatus: obj.FunctionalStatus, + Geocode: obj.Geocode, + GNIS: obj.GNIS, + HasDistrictTaxes: obj.HasDistrictTaxes, + Interest: obj.Interest, + LandArea: obj.LandArea, + LegalName: obj.LegalName, + Latitude: obj.Latitude, + Longitude: obj.Longitude, + Name: obj.Name, + Penalty: obj.Penalty, + Ref: obj.Ref, + ReportedAdjustments: obj.ReportedAdjustments, + ReportedDeductions: obj.ReportedDeductions, + ReportedNetRevenue: obj.ReportedNetRevenue, + ReportedRate: obj.ReportedRate, + ReportedRevenue: obj.ReportedRevenue, + RevenueBase: obj.RevenueBase, + RevenueNet: obj.RevenueNet, + RevenueNotTaxable: obj.RevenueNotTaxable, + SalesTaxRate: salesTaxRate, + StateID: obj.StateID, + Status: obj.Status, + Subtotal: obj.Subtotal, + TaxInstances: theInstances, + TemplateID: obj.TemplateID, + TotalAmount: obj.TotalAmount, + TotalArea: obj.TotalArea, + UnitBase: obj.UnitBase, + WaterArea: obj.WaterArea, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + OwnerID: obj.OwnerID, + } +} diff --git a/app/county.go b/app/county.go index e679a3d..b6e3667 100644 --- a/app/county.go +++ b/app/county.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/geo/geo_models" ) -// CountyChannelWrapper wraps the object with the security principal +// CountyChannelWrapper wraps the object with workflow params type CountyChannelWrapper struct { Obj geo_models.County Principal User @@ -39,6 +39,7 @@ type County struct { Latitude float64 LegalName string Name string + OwnerID string Penalty float64 Ref string ReportedAdjustments float64 diff --git a/app/database-helpers.go b/app/database-helpers.go new file mode 100644 index 0000000..f1a9769 --- /dev/null +++ b/app/database-helpers.go @@ -0,0 +1,58 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/devops/devops_models" + "github.com/google/uuid" +) + +// UnMarshalDatabase decodes swagger to a first class object +func UnMarshalDatabase(s *devops_models.Database) *Database { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + return &Database{ + ID: s.ID, + Active: s.Active, + ClusterID: s.ClusterID, + CreatedByID: s.CreatedByID, + DatabaseName: s.DatabaseName, + DSN: s.DSN, + LastModifiedByID: s.LastModifiedByID, + Microservices: s.Microservices, + Status: s.Status, + TenantID: s.TenantID, + Type: s.Type, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + } +} + +// MarshalToSwagger encodes a first class object to swagger +func (obj *Database) MarshalToSwagger() *devops_models.Database { + return &devops_models.Database{ + ID: obj.ID, + Active: obj.Active, + ClusterID: obj.ClusterID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + DatabaseName: obj.DatabaseName, + DSN: obj.DSN, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + Microservices: obj.Microservices, + Status: obj.Status, + TenantID: obj.TenantID, + Type: obj.Type, + } +} diff --git a/app/database.go b/app/database.go index 986d6a0..c1a2a2a 100644 --- a/app/database.go +++ b/app/database.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/devops/devops_models" ) -// DatabaseChannelWrapper wraps the object with the security principal +// DatabaseChannelWrapper wraps the object with workflow params type DatabaseChannelWrapper struct { Obj devops_models.Database Principal User diff --git a/app/domain-helpers.go b/app/domain-helpers.go new file mode 100644 index 0000000..912d294 --- /dev/null +++ b/app/domain-helpers.go @@ -0,0 +1,20 @@ +package app + +import "code.tnxs.net/taxnexus/lib/api/geo/geo_models" + +func unMarshalDomain(swag *geo_models.Domain) *Domain { + return &Domain{ + Description: swag.Description, + Active: swag.Active, + ID: swag.ID, + Name: swag.Name, + } +} +func (obj *Domain) marshalToSwagger() *geo_models.Domain { + return &geo_models.Domain{ + ID: obj.ID, + Active: obj.Active, + Description: obj.Description, + Name: obj.Name, + } +} diff --git a/app/domain.go b/app/domain.go index a73d24d..b2934db 100644 --- a/app/domain.go +++ b/app/domain.go @@ -2,7 +2,7 @@ package app import "code.tnxs.net/taxnexus/lib/api/geo/geo_models" -// DomainChannelWrapper wraps the object with the security principal +// DomainChannelWrapper wraps the object with workflow params type DomainChannelWrapper struct { Obj geo_models.Domain Principal User diff --git a/app/eft-helpers.go b/app/eft-helpers.go new file mode 100644 index 0000000..e2f47ac --- /dev/null +++ b/app/eft-helpers.go @@ -0,0 +1,94 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/ops/ops_models" + "github.com/google/uuid" +) + +// UnMarshalEft decodes swagger to a first class object +func UnMarshalEft(s *ops_models.Eft) *Eft { + if s.ID == "" { + s.ID = uuid.New().String() + } + items := []*EftItem{} + for _, itm := range s.Items { + items = append(items, UnMarshalEftItem(itm)) + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + journalDate, e2 := time.Parse(dateTimeFormat, s.JournalDate) + executed, e3 := time.Parse(dateTimeFormat, s.Executed) + return &Eft{ + ID: s.ID, + AccountID: s.AccountID, + Amount: s.Amount, + AttemptNumber: s.AttemptNumber, + BackendID: s.BackendID, + BillingRunID: s.BillingRunID, + CashReceiptID: s.CashReceiptID, + CreatedByID: s.CreatedByID, + Fee: s.Fee, + Gateway: s.Gateway, + GatewayKey: s.GatewayKey, + GatewayMessage: s.GatewayMessage, + Items: items, + LastModifiedByID: s.LastModifiedByID, + PaymentMethodID: s.PaymentMethodID, + Ref: s.Ref, + Status: s.Status, + TenantID: s.TenantID, + TransactionID: s.TransactionID, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + JournalDate: sql.NullTime{ + Time: journalDate, + Valid: e2 == nil, + }, + Executed: sql.NullTime{ + Time: executed, + Valid: e3 == nil, + }, + } +} + +// MarshalToSwagger encodes a first class object to swagger +func (obj *Eft) MarshalToSwagger() *ops_models.Eft { + items := []*ops_models.EftItem{} + for _, itm := range obj.Items { + items = append(items, itm.MarshalToSwagger()) + } + return &ops_models.Eft{ + ID: obj.ID, + AccountID: obj.AccountID, + Amount: obj.Amount, + AttemptNumber: obj.AttemptNumber, + BackendID: obj.BackendID, + BillingRunID: obj.BillingRunID, + CashReceiptID: obj.CashReceiptID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Executed: obj.Executed.Time.Format(dateTimeFormat), + Fee: obj.Fee, + Gateway: obj.Gateway, + GatewayKey: obj.GatewayKey, + GatewayMessage: obj.GatewayMessage, + Items: items, + JournalDate: obj.JournalDate.Time.Format(dateTimeFormat), + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + PaymentMethodID: obj.PaymentMethodID, + Ref: obj.Ref, + Status: obj.Status, + TenantID: obj.TenantID, + TransactionID: obj.TransactionID, + } +} diff --git a/app/eft.go b/app/eft.go index 416f0de..93a6eee 100644 --- a/app/eft.go +++ b/app/eft.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/ops/ops_models" ) -// EftChannelWrapper wraps the object with the security principal +// EftChannelWrapper wraps the object with workflow params type EftChannelWrapper struct { Obj ops_models.Eft Principal User diff --git a/app/eftitem-helpers.go b/app/eftitem-helpers.go new file mode 100644 index 0000000..6c195c4 --- /dev/null +++ b/app/eftitem-helpers.go @@ -0,0 +1,50 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/ops/ops_models" + "github.com/google/uuid" +) + +// UnMarshalEftItem decodes swagger to a first class object +func UnMarshalEftItem(s *ops_models.EftItem) *EftItem { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + return &EftItem{ + ID: s.ID, + Amount: s.Amount, + CreatedByID: s.CreatedByID, + EftID: s.EftID, + InvoiceID: s.InvoiceID, + LastModifiedByID: s.LastModifiedByID, + TenantID: s.TenantID, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + } +} + +// MarshalToSwagger encodes a first class object to swagger +func (obj *EftItem) MarshalToSwagger() *ops_models.EftItem { + return &ops_models.EftItem{ + ID: obj.ID, + Amount: obj.Amount, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + EftID: obj.EftID, + InvoiceID: obj.InvoiceID, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + TenantID: obj.TenantID, + } +} diff --git a/app/eftitem.go b/app/eftitem.go index affc2f4..a316228 100644 --- a/app/eftitem.go +++ b/app/eftitem.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/ops/ops_models" ) -// EftItemChannelWrapper wraps the object with the security principal +// EftItemChannelWrapper wraps the object with workflow params type EftItemChannelWrapper struct { Obj ops_models.EftItem Principal User diff --git a/app/emailmessage-helpers.go b/app/emailmessage-helpers.go new file mode 100644 index 0000000..6d96c8a --- /dev/null +++ b/app/emailmessage-helpers.go @@ -0,0 +1,55 @@ +package app + +import "code.tnxs.net/taxnexus/lib/api/workflow/workflow_models" + +func (obj *EmailMessage) MarshalToSwagger() *workflow_models.EmailMessage { + headers := &workflow_models.Headers{} + // for _, itm := range obj.Headers { + // val := []string{} + // for _, s := range itm.Values { + // val = append(val, s) + // } + // values := []string{} + // for _, i := range itm.Values { + // values = append(values, i) + // } + // headers = &workflow_models.Headers{ + // Key: itm.Key, + // Values: values, + // } + // } + return &workflow_models.EmailMessage{ + ID: obj.ID, + ActivityID: obj.ActivityID, + BCCAddress: obj.BCCAddress, + CCAddress: obj.CCAddress, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + EmailMessageID: obj.EmailMessageID, + FromAddress: obj.FromAddress, + FromName: obj.FromName, + HasAttachment: obj.HasAttachment, + Headers: headers, + HTML: obj.HTML, + Incoming: obj.Incoming, + IsClientManaged: obj.IsClientManaged, + IsExternallyManaged: obj.IsExternallyManaged, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + MessageDate: obj.MessageDate.Time.Format(dateTimeFormat), + MessageIdentifier: obj.MessageIdentifier, + ParentID: obj.ParentID, + RelatedToID: obj.RelatedToID, + RelationAddress: obj.RelationAddress, + RelationID: obj.RelationID, + RelationObjectType: obj.RelationObjectType, + RelationType: obj.RelationType, + ReplyToEmailMessageID: obj.ReplyToEmailMessageID, + Status: obj.Status, + Subject: obj.Subject, + Text: obj.Text, + ThreadIdentifier: obj.ThreadIdentifier, + ToAddress: obj.ToAddress, + ValidatedFromAddress: obj.ValidatedFromAddress, + } +} diff --git a/app/emailmessage.go b/app/emailmessage.go index 42cfd3c..5f13129 100644 --- a/app/emailmessage.go +++ b/app/emailmessage.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/workflow/workflow_models" ) -// EmailMessageChannelWrapper wraps the object with the security principal +// EmailMessageChannelWrapper wraps the object with workflow params type EmailMessageChannelWrapper struct { Obj workflow_models.EmailMessage Principal User diff --git a/app/emaitemplate.go b/app/emaitemplate.go index 71a4f9f..b533854 100644 --- a/app/emaitemplate.go +++ b/app/emaitemplate.go @@ -4,7 +4,7 @@ import ( "database/sql" ) -// EmailTemplateChannelWrapper wraps the object with the security principal +// EmailTemplateChannelWrapper wraps the object with workflow params type EmailTemplateChannelWrapper struct { // Obj workflow_models.EmailTemplate Principal User diff --git a/app/filing-helpers.go b/app/filing-helpers.go new file mode 100644 index 0000000..61fabac --- /dev/null +++ b/app/filing-helpers.go @@ -0,0 +1,128 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/regs/regs_models" + "github.com/google/uuid" +) + +func unMarshalSwaggerFiling(s *regs_models.Filing) *Filing { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + date, e2 := time.Parse(dateFormat, s.Date) + if e2 != nil { + date, e2 = time.Parse(dateFormatAlt, s.Date) + } + dueDate, e3 := time.Parse(dateFormat, s.DueDate) + if e3 != nil { + dueDate, e3 = time.Parse(dateFormatAlt, s.DueDate) + } + return &Filing{ + ID: s.ID, + AccountName: s.AccountName, + Amount: s.Amount, + ContactID: s.ContactID, + CreatedByID: s.CreatedByID, + FilingNumber: s.FilingNumber, + FilingTypeID: s.FilingTypeID, + Frequency: s.Frequency, + Interest: s.Interest, + InterestRate: s.InterestRate, + LastModifiedByID: s.LastModifiedByID, + MonthNumber: s.MonthNumber, + OwnerID: s.OwnerID, + Penalty: s.Penalty, + PenaltyDays: s.PenaltyDays, + PenaltyRate: s.PenaltyRate, + PeriodID: s.PeriodID, + PreparerID: s.PreparerID, + QuarterNumber: s.QuarterNumber, + Ref: s.Ref, + ReportedAdjustments: s.ReportedAdjustments, + ReportedDeductions: s.ReportedDeductions, + ReportedNetRevenue: s.ReportedNetRevenue, + ReportedRate: s.ReportedRate, + ReportedRevenue: s.ReportedRevenue, + RevenueBase: s.RevenueBase, + RevenueNet: s.RevenueNet, + RevenueNotTaxable: s.RevenueNotTaxable, + SemiannualNumber: s.SemiannualNumber, + Status: s.Status, + SubmissionID: s.SubmissionID, + Subtotal: s.Subtotal, + TaxOnTax: s.TaxOnTax, + TaxTypeAccountID: s.TaxTypeAccountID, + TenantID: s.TenantID, + TotalAmount: s.TotalAmount, + UnitBase: s.UnitBase, + YearNumber: s.YearNumber, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + Date: sql.NullTime{ + Time: date, + Valid: e2 == nil, + }, + DueDate: sql.NullTime{ + Time: dueDate, + Valid: e3 == nil, + }, + } + +} +func (obj *Filing) marshalToSwagger() *regs_models.Filing { + return ®s_models.Filing{ + ID: obj.ID, + AccountName: obj.AccountName, + Amount: obj.Amount, + ContactID: obj.ContactID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Date: obj.Date.Time.Format(dateFormat), + DueDate: obj.DueDate.Time.Format(dateFormat), + FilingNumber: obj.FilingNumber, + FilingTypeID: obj.FilingTypeID, + Frequency: obj.Frequency, + Interest: obj.Interest, + InterestRate: obj.InterestRate, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + MonthNumber: obj.MonthNumber, + OwnerID: obj.OwnerID, + Penalty: obj.Penalty, + PenaltyDays: obj.PenaltyDays, + PenaltyRate: obj.PenaltyRate, + PeriodID: obj.PeriodID, + PreparerID: obj.PreparerID, + QuarterNumber: obj.QuarterNumber, + Ref: obj.Ref, + ReportedAdjustments: obj.ReportedAdjustments, + ReportedDeductions: obj.ReportedDeductions, + ReportedNetRevenue: obj.ReportedNetRevenue, + ReportedRate: obj.ReportedRate, + ReportedRevenue: obj.ReportedRevenue, + RevenueBase: obj.RevenueBase, + RevenueNet: obj.RevenueNet, + RevenueNotTaxable: obj.RevenueNotTaxable, + SemiannualNumber: obj.SemiannualNumber, + Status: obj.Status, + SubmissionID: obj.SubmissionID, + Subtotal: obj.Subtotal, + TaxOnTax: obj.TaxOnTax, + TaxTypeAccountID: obj.TaxTypeAccountID, + TenantID: obj.TenantID, + TotalAmount: obj.TotalAmount, + UnitBase: obj.UnitBase, + YearNumber: obj.YearNumber, + } +} diff --git a/app/filing.go b/app/filing.go index fbb95c2..d0a9ba1 100644 --- a/app/filing.go +++ b/app/filing.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/regs/regs_models" ) -// FilingChannelWrapper wraps the object with the security principal +// FilingChannelWrapper wraps the object with workflow params type FilingChannelWrapper struct { Obj regs_models.Filing Principal User diff --git a/app/filingscheduleitem-helpers.go b/app/filingscheduleitem-helpers.go new file mode 100644 index 0000000..e69de29 diff --git a/app/filingscheduleitem.go b/app/filingscheduleitem.go index 55e0d85..ef9ab78 100644 --- a/app/filingscheduleitem.go +++ b/app/filingscheduleitem.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/regs/regs_models" ) -// FilingScheduleItemChannelWrapper wraps the object with the security principal +// FilingScheduleItemChannelWrapper wraps the object with workflow params type FilingScheduleItemChannelWrapper struct { Obj regs_models.FilingScheduleItem Principal User diff --git a/app/filingtype-helpers.go b/app/filingtype-helpers.go new file mode 100644 index 0000000..e320cde --- /dev/null +++ b/app/filingtype-helpers.go @@ -0,0 +1,133 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/regs/regs_models" + "github.com/google/uuid" +) + +func unMarshalFilingType(s *regs_models.FilingType) *FilingType { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + var instances []*FilingTypeInstance + var dueDates []*FilingScheduleItem + if s.Instances != nil { + instances = []*FilingTypeInstance{} + for _, itm := range s.Instances { + instances = append(instances, &FilingTypeInstance{ + CountryID: itm.CountryID, + CountyID: itm.CountyID, + FilingTypeID: itm.FilingTypeID, + ObjectType: itm.ObjectType, + PlaceID: itm.PlaceID, + StateID: itm.StateID, + }) + } + for _, itm := range s.DueDates { + dueDates = []*FilingScheduleItem{} + dueDate, e0 := time.Parse(dateTimeFormat, itm.DueDate) + if e0 != nil { + dueDate, e0 = time.Parse(dateFormatAlt, itm.DueDate) + } + dueDates = append(dueDates, &FilingScheduleItem{ + Description: itm.Description, + DueDate: sql.NullTime{ + Time: dueDate, + Valid: e0 == nil, + }, + }) + } + } + return &FilingType{ + AccountID: s.AccountID, + ContactID: s.ContactID, + CreatedByID: s.CreatedByID, + DueDates: dueDates, + FilingCity: s.FilingCity, + FilingCountry: s.FilingCountry, + FilingPostalCode: s.FilingPostalCode, + FilingState: s.FilingState, + FilingStreet: s.FilingStreet, + FormName: s.FormName, + FormVersion: s.FormVersion, + Frequency: s.Frequency, + FullName: s.FullName, + ID: s.ID, + Instances: instances, + LastModifiedByID: s.LastModifiedByID, + Level: s.Level, + Name: s.Name, + OwnerID: s.OwnerID, + SagaType: s.SagaType, + SubmissionMethod: s.SubmissionMethod, + TemplateInstructionsID: s.TemplateInstructionsID, + TemplateReturnID: s.TemplateReturnID, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + } +} + +func (obj *FilingType) marshal() *regs_models.FilingType { + var instances []*regs_models.FilingTypeInstance + if obj.Instances != nil { + instances = []*regs_models.FilingTypeInstance{} + for _, itm := range obj.Instances { + instances = append(instances, ®s_models.FilingTypeInstance{ + CountryID: itm.CountryID, + CountyID: itm.CountyID, + FilingTypeID: itm.FilingTypeID, + ObjectType: itm.ObjectType, + PlaceID: itm.PlaceID, + StateID: itm.StateID, + }) + } + } + var dueDates []*regs_models.FilingScheduleItem + if obj.DueDates != nil { + dueDates = []*regs_models.FilingScheduleItem{} + for _, itm := range obj.DueDates { + dueDates = append(dueDates, ®s_models.FilingScheduleItem{ + DueDate: itm.DueDate.Time.Format(dateFormat), + Description: itm.Description, + }) + } + } + return ®s_models.FilingType{ + ID: obj.ID, + AccountID: obj.AccountID, + ContactID: obj.ContactID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + DueDates: dueDates, + FilingCity: obj.FilingCity, + FilingCountry: obj.FilingCountry, + FilingPostalCode: obj.FilingPostalCode, + FilingState: obj.FilingState, + FilingStreet: obj.FilingStreet, + FormName: obj.FormName, + FormVersion: obj.FormVersion, + Frequency: obj.Frequency, + FullName: obj.FullName, + Instances: instances, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + Level: obj.Level, + Name: obj.Name, + OwnerID: obj.OwnerID, + SagaType: obj.SagaType, + SubmissionMethod: obj.SubmissionMethod, + TemplateInstructionsID: obj.TemplateInstructionsID, + TemplateReturnID: obj.TemplateReturnID, + } +} diff --git a/app/filingtype.go b/app/filingtype.go index 154db3c..fb79fb2 100644 --- a/app/filingtype.go +++ b/app/filingtype.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/regs/regs_models" ) -// FilingTypeChannelWrapper wraps the object with the security principal +// FilingTypeChannelWrapper wraps the object with workflow params type FilingTypeChannelWrapper struct { Obj regs_models.FilingType Principal User diff --git a/app/filingtypeinstance-helpers.go b/app/filingtypeinstance-helpers.go new file mode 100644 index 0000000..e69de29 diff --git a/app/filingtypeinstance.go b/app/filingtypeinstance.go index 104b6cb..11565ea 100644 --- a/app/filingtypeinstance.go +++ b/app/filingtypeinstance.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/regs/regs_models" ) -// FilingTypeInstanceChannelWrapper wraps the object with the security principal +// FilingTypeInstanceChannelWrapper wraps the object with workflow params type FilingTypeInstanceChannelWrapper struct { Obj regs_models.FilingTypeInstance Principal User diff --git a/app/folder-helpers.go b/app/folder-helpers.go new file mode 100644 index 0000000..e69de29 diff --git a/app/folder.go b/app/folder.go index 483b021..b5d68a0 100644 --- a/app/folder.go +++ b/app/folder.go @@ -4,7 +4,7 @@ import ( "database/sql" ) -// FolderChannelWrapper wraps the object with the security principal +// FolderChannelWrapper wraps the object with workflow params type FolderChannelWrapper struct { // Obj workflow_models.Folder Principal User diff --git a/app/glaccount-helpers.go b/app/glaccount-helpers.go new file mode 100644 index 0000000..81db6d9 --- /dev/null +++ b/app/glaccount-helpers.go @@ -0,0 +1,73 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/ledger/ledger_models" + "github.com/google/uuid" +) + +func unMarshalGlAccount(s *ledger_models.GlAccount) *GlAccount { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, err1 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModifiedDate, err2 := time.Parse(dateTimeFormat, s.LastModifiedDate) + return &GlAccount{ + ID: s.ID, + AccountID: s.AccountID, + AccountLevel: s.AccountLevel, + AccountName: s.AccountName, + AccountNumber: s.AccountNumber, + AccountSign: s.AccountSign, + AccountType: s.AccountType, + CreatedByID: s.CreatedByID, + Description: s.Description, + IsActive: s.IsActive, + IsBankAccount: s.IsBankAccount, + IsSummary: s.IsSummary, + LastModifiedByID: s.LastModifiedByID, + Name: s.Name, + ParentFK: s.ParentFK, + ParentGlAccountID: s.ParentGLAccountID, + Ref: s.Ref, + Status: s.Status, + TenantID: s.TenantID, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: err1 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModifiedDate, + Valid: err2 == nil, + }, + } +} + +func (obj *GlAccount) MarshalToSwagger() *ledger_models.GlAccount { + return &ledger_models.GlAccount{ + ID: obj.ID, + AccountID: obj.AccountID, + AccountLevel: obj.AccountLevel, + AccountName: obj.AccountName, + AccountNumber: obj.AccountNumber, + AccountSign: obj.AccountSign, + AccountType: obj.AccountType, + Balances: []*ledger_models.GlBalance{}, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Description: obj.Description, + IsActive: obj.IsActive, + IsBankAccount: obj.IsBankAccount, + IsSummary: obj.IsSummary, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + Name: obj.Name, + ParentFK: obj.ParentFK, + ParentGLAccountID: obj.ParentGlAccountID, + Ref: obj.Ref, + Status: obj.Status, + TenantID: obj.TenantID, + } +} diff --git a/app/glaccount.go b/app/glaccount.go index b4e197c..6fd824f 100644 --- a/app/glaccount.go +++ b/app/glaccount.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/ledger/ledger_models" ) -// GlAccountChannelWrapper wraps the object with the security principal +// GlAccountChannelWrapper wraps the object with workflow params type GlAccountChannelWrapper struct { Obj ledger_models.GlAccount Principal User diff --git a/app/glbalance-helpers.go b/app/glbalance-helpers.go new file mode 100644 index 0000000..954d8e7 --- /dev/null +++ b/app/glbalance-helpers.go @@ -0,0 +1,71 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/ledger/ledger_models" + "github.com/google/uuid" +) + +func unMarshalGlBalance(s *ledger_models.GlBalance) *GlBalance { + if s.ID == "" { + s.ID = uuid.New().String() + } + closeDate, err0 := time.Parse(dateTimeFormat, s.CloseDate) + createdDate, err1 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModifiedDate, err2 := time.Parse(dateTimeFormat, s.LastModifiedDate) + return &GlBalance{ + ID: s.ID, + AccountName: s.AccountName, + Amount: s.Amount, + CreatedByID: s.CreatedByID, + Credits: s.Credits, + Debits: s.Debits, + Description: s.Description, + GlAccountDisplay: s.GLAccountDisplay, + GlAccountID: s.GLAccountID, + LastModifiedByID: s.LastModifiedByID, + PeriodID: s.PeriodID, + Ref: s.Ref, + RollupCredits: s.RollupCredits, + RollupDebits: s.RollupDebits, + Status: s.Status, + TenantID: s.TenantID, + CloseDate: sql.NullTime{ + Time: closeDate, + Valid: err0 == nil, + }, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: err1 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModifiedDate, + Valid: err2 == nil, + }, + } +} +func (obj *GlBalance) marshalToSwagger() *ledger_models.GlBalance { + return &ledger_models.GlBalance{ + ID: obj.ID, + AccountName: obj.AccountName, + Amount: obj.Amount, + CloseDate: obj.CloseDate.Time.Format(dateTimeFormat), + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Credits: obj.Credits, + Debits: obj.Debits, + Description: obj.Description, + GLAccountDisplay: obj.GlAccountDisplay, + GLAccountID: obj.GlAccountID, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + PeriodID: obj.PeriodID, + Ref: obj.Ref, + RollupCredits: obj.RollupCredits, + RollupDebits: obj.RollupDebits, + Status: obj.Status, + TenantID: obj.TenantID, + } +} diff --git a/app/glbalance.go b/app/glbalance.go index 217f2f8..7d14c0c 100644 --- a/app/glbalance.go +++ b/app/glbalance.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/ledger/ledger_models" ) -// GlBalanceChannelWrapper wraps the object with the security principal +// GlBalanceChannelWrapper wraps the object with workflow params type GlBalanceChannelWrapper struct { Obj ledger_models.GlBalance Principal User diff --git a/app/ingest-helpers.go b/app/ingest-helpers.go new file mode 100644 index 0000000..d2a4a61 --- /dev/null +++ b/app/ingest-helpers.go @@ -0,0 +1,137 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/devops/devops_models" + "github.com/google/uuid" +) + +// UnmarshalIngest decodes swagger to a first class object +func UnmarshalIngest(s *devops_models.Ingest) *Ingest { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + endDate, e2 := time.Parse(dateTimeFormat, s.EndDate) + startDate, e3 := time.Parse(dateTimeFormat, s.StartDate) + ingestDate, e4 := time.Parse(dateTimeFormat, s.IngestDate) + m1, e5 := time.Parse(dateTimeFormat, s.MetrcLastModifiedEnd) + m2, e6 := time.Parse(dateTimeFormat, s.MetrcLastModifiedStart) + return &Ingest{ + ID: s.ID, + AccountID: *s.AccountID, + Amount: s.Amount, + BackendID: s.BackendID, + CompanyID: s.CompanyID, + CreatedByID: s.CreatedByID, + Description: s.Description, + Filename: s.Filename, + IngestFailureReason: s.IngestFailureReason, + IngestType: s.IngestType, + InvoiceCount: s.InvoiceCount, + JobID: s.JobID, + LastModifiedByID: s.LastModifiedByID, + MetrcLicense: s.MetrcLicense, + MetrcSalesReceiptID: s.MetrcSalesreceiptID, + MetrcState: s.MetrcState, + ObjectType: *s.ObjectType, + ParentFK: s.ParentFK, + PeriodID: s.PeriodID, + PoCount: s.POCount, + PostFailureReason: s.PostFalureReason, + RatingEngineID: s.RatingEngineID, + Ref: s.Ref, + RevenueBase: s.RevenueBase, + RevenueNet: s.RevenueNet, + RevenueNotTaxable: s.RevenueNotTaxable, + SagaID: s.SagaID, + SagaType: s.SagaType, + Source: s.Source, + Status: s.Status, + Tax: s.Tax, + TaxOnTax: s.TaxOnTax, + TaxTransactionCount: s.TaxTransactionCount, + TemplateID: s.TemplateID, + TenantID: s.TenantID, + UnitBase: s.UnitBase, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + EndDate: sql.NullTime{ + Time: endDate, + Valid: e2 == nil, + }, + StartDate: sql.NullTime{ + Time: startDate, + Valid: e3 == nil, + }, + IngestDate: sql.NullTime{ + Time: ingestDate, + Valid: e4 == nil, + }, + MetrcLastModifiedEnd: sql.NullTime{ + Time: m1, + Valid: e5 == nil, + }, + MetrcLastModifiedStart: sql.NullTime{ + Time: m2, + Valid: e6 == nil, + }, + } +} + +// MarshalToSwagger encodes a first class object to swagger +func (obj *Ingest) marshalToSwagger() *devops_models.Ingest { + return &devops_models.Ingest{ + ID: obj.ID, + AccountID: &obj.AccountID, + Amount: obj.Amount, + BackendID: obj.BackendID, + CompanyID: obj.CompanyID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Description: obj.Description, + EndDate: obj.EndDate.Time.Format(dateTimeFormat), + Filename: obj.Filename, + IngestDate: obj.IngestDate.Time.Format(dateTimeFormat), + IngestFailureReason: obj.IngestFailureReason, + IngestType: obj.IngestType, + InvoiceCount: obj.InvoiceCount, + JobID: obj.JobID, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + MetrcLastModifiedEnd: obj.MetrcLastModifiedEnd.Time.Format(dateTimeFormat), + MetrcLastModifiedStart: obj.MetrcLastModifiedStart.Time.Format(dateTimeFormat), + MetrcLicense: obj.MetrcLicense, + MetrcSalesreceiptID: obj.MetrcSalesReceiptID, + MetrcState: obj.MetrcState, + ObjectType: &obj.ObjectType, + ParentFK: obj.ParentFK, + PeriodID: obj.PeriodID, + POCount: obj.PoCount, + PostFalureReason: obj.PostFailureReason, + RatingEngineID: obj.RatingEngineID, + Ref: obj.Ref, + RevenueBase: obj.RevenueBase, + RevenueNet: obj.RevenueNet, + RevenueNotTaxable: obj.RevenueNotTaxable, + SagaID: obj.SagaID, + SagaType: obj.SagaType, + Source: obj.Source, + StartDate: obj.StartDate.Time.Format(dateTimeFormat), + Status: obj.Status, + Tax: obj.Tax, + TaxOnTax: obj.TaxOnTax, + TaxTransactionCount: obj.TaxTransactionCount, + TemplateID: obj.TemplateID, + UnitBase: obj.UnitBase, + } +} diff --git a/app/ingest.go b/app/ingest.go index 729f21d..13d4684 100644 --- a/app/ingest.go +++ b/app/ingest.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/devops/devops_models" ) -// IngestChannelWrapper wraps the object with the security principal +// IngestChannelWrapper wraps the object with workflow params type IngestChannelWrapper struct { Obj devops_models.Ingest Principal User @@ -48,11 +48,15 @@ type Ingest struct { RevenueBase float64 RevenueNet float64 RevenueNotTaxable float64 + SagaID string + SagaType string + Source string StartDate sql.NullTime Status string + Tax float64 TaxOnTax float64 TaxTransactionCount int64 - TenantID string TemplateID string + TenantID string UnitBase int64 } diff --git a/app/invoice-helpers.go b/app/invoice-helpers.go new file mode 100644 index 0000000..6a6766e --- /dev/null +++ b/app/invoice-helpers.go @@ -0,0 +1,115 @@ +package app + +import "code.tnxs.net/taxnexus/lib/api/ops/ops_models" + +// Invoice unMarshal does validation in the Ops microservice only + +func (obj *Invoice) marshalToSwagger() *ops_models.Invoice { //nolint:funlen // big object + var items []*ops_models.InvoiceItem + if obj.Items != nil { + items = []*ops_models.InvoiceItem{} + for _, itm := range obj.Items { + items = append(items, itm.MarshalToSwagger()) + } + } + var taxTransactions []*ops_models.TaxTransaction + if obj.TaxTransactions != nil { + taxTransactions = []*ops_models.TaxTransaction{} + for _, txn := range obj.TaxTransactions { + taxTransactions = append(taxTransactions, txn.MarshalToSwagger()) + } + } + return &ops_models.Invoice{ + ID: obj.ID, + AccountID: obj.AccountID, + Advance: obj.Advance, + Amount: obj.Amount, + AmountAdjustment: obj.AmountAdjustment, + AmountDue: obj.AmountDue, + AmountPaid: obj.AmountPaid, + AuditMessage: obj.AuditMessage, + BillingAddress: obj.BillingAddress.MarshalToOps(), + BillingContactID: obj.BillingContact, + BillingRunID: obj.BillingRunID, + BusinessAddress: obj.BusinessAddress.MarshalToOps(), + BusinessTax: obj.BusinessTax, + CannabisTax: obj.CannabisTax, + ContractID: obj.ContractID, + CoordinateID: obj.CoordinateID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + CustomerID: obj.CustomerID, + DateIssued: obj.DateIssued.Time.Format(dateTimeFormat), + DaysDue: obj.DaysDue, + DepositAmount: obj.DepositAmount, + Description: obj.Description, + Discount: obj.Discount, + EstimatedAmount: obj.EstimatedAmount, + EstimatedBusinessTax: obj.EstimatedBusinessTax, + EstimatedCannabisTax: obj.EstimatedCannabisTax, + EstimatedCOGS: obj.EstimatedCOGS, + EstimatedDiscount: obj.EstimatedDiscount, + EstimatedSalesTax: obj.EstimatedSalesTax, + EstimatedSubtotal: obj.EstimatedSubtotal, + IngestID: obj.IngestID, + InvoiceDate: obj.InvoiceDate.Time.Format(dateFormat), + InvoiceNumber: obj.InvoiceNumber, + IsInternational: obj.IsInternational, + IssuedAccountBalance: obj.IssuedAccountBalance, + IssuedAmountDue: obj.IssuedAmountDue, + IssuedByID: obj.IssuedByID, + IsValid: obj.IsValid, + Items: items, + JobID: obj.JobID, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + MinimumPaymentDue: obj.MinimumPaymentDue, + MonthlyAmount: obj.MonthlyAmount, + OpportunityID: obj.OpportunityID, + OrderID: obj.OrderID, + OverDue0: obj.OverDue0, + OverDue120: obj.OverDue120, + OverDue30: obj.OverDue30, + OverDue45: obj.OverDue45, + OverDue60: obj.OverDue60, + OverDue90: obj.OverDue90, + ParentFK: obj.ParentFK, + PartnerAccountID: obj.PartnerAccountID, + PaymentDue: obj.PaymentDue.Time.Format(dateTimeFormat), + PaymentMethod: obj.PaymentMethodDescription, + PaymentMethodID: obj.PaymentMethodID, + PaymentTerms: obj.PaymentTerms, + PeriodID: obj.PeriodID, + PlaceGeocode: obj.PlaceGeoCode, + Posted: obj.Posted, + PriorAccountBalance: obj.PriorAccountBalance, + PriorAdjustments: obj.PriorAdjustments, + PriorInvoiceAmount: obj.PriorInvoiceAmount, + PriorInvoiceDate: obj.PriorInvoiceDate.Time.Format(dateFormat), + PriorInvoiceID: obj.PriorInvoiceID, + PriorPaymentAmount: obj.PriorPaymentAmount, + PriorPaymentDate: obj.PriorPaymentDate.Time.Format(dateFormat), + PriorPaymentID: obj.PriorPaymentID, + PriorPaymentMemo: obj.PriorPaymentMemo, + Prorated: obj.Prorated, + ProtratedDays: obj.ProratedDays, + PurchaseAmount: obj.PurchaseAmount, + QuoteID: obj.QuoteID, + RatingEngineID: obj.RatingEngineID, + Ref: obj.Ref, + Reference: obj.Reference, + SalesRegulation: obj.SalesRegulation, + SalesTax: obj.SalesTax, + ScheduledPaymentDate: obj.ScheduledPaymentDate.Time.Format(dateFormat), + ServiceTerm: obj.ServiceTerm, + ShippingAddress: obj.ShippingAddress.MarshalToOps(), + ShippingHandling: obj.ShippingHandling, + Status: obj.Status, + Subtotal: obj.Subtotal, + TaxTransactions: taxTransactions, + TelecomTax: obj.TelecomTax, + TemplateID: obj.TemplateID, + Total: obj.Total.MarshalToSwagger(), + Type: obj.Type, + } +} diff --git a/app/invoice.go b/app/invoice.go index 16731c6..7d8aac6 100644 --- a/app/invoice.go +++ b/app/invoice.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/ops/ops_models" ) -// InvoiceChannelWrapper wraps the object with the security principal +// InvoiceChannelWrapper wraps the object with workflow params type InvoiceChannelWrapper struct { Obj ops_models.Invoice Principal User diff --git a/app/invoiceitem-helpers.go b/app/invoiceitem-helpers.go new file mode 100644 index 0000000..f1d6e67 --- /dev/null +++ b/app/invoiceitem-helpers.go @@ -0,0 +1,39 @@ +package app + +import "code.tnxs.net/taxnexus/lib/api/ops/ops_models" + +// Invoice unMarshal does validation in the Ops microservice only + +func (obj *InvoiceItem) MarshalToSwagger() *ops_models.InvoiceItem { + return &ops_models.InvoiceItem{ + ID: obj.ID, + COGS: obj.COGS, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Description: obj.Description, + Family: obj.Family, + InvoiceID: obj.InvoiceID, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + ListPrice: obj.ListPrice, + MRCInterval: obj.MRCInterval, + OrderItemID: obj.OrderItemID, + ParentFK: obj.ParentFK, + ProductCode: obj.ProductCode, + ProductID: obj.ProductID, + Quantity: obj.Quantity, + QuoteItemID: obj.QuoteItemID, + Ref: obj.Ref, + RejectedQuantity: obj.RejectedQuantity, + ShippedQuantity: obj.ShippedQuantity, + ShippingHandling: obj.ShippingHandling, + SKU: obj.SKU, + SubscriptionID: obj.SubscriptionID, + Subtotal: obj.Subtotal, + TaxnexusCode: obj.TaxnexusCodeDisplay, + TenantID: obj.TenantID, + TotalPrice: obj.TotalPrice, + UnitPrice: obj.UnitPrice, + Units: obj.Units, + } +} diff --git a/app/invoiceitem.go b/app/invoiceitem.go index 8345c51..873223e 100644 --- a/app/invoiceitem.go +++ b/app/invoiceitem.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/ops/ops_models" ) -// InvoiceItemChannelWrapper wraps the object with the security principal +// InvoiceItemChannelWrapper wraps the object with workflow params type InvoiceItemChannelWrapper struct { Obj ops_models.InvoiceItem Principal User diff --git a/app/job-helpers.go b/app/job-helpers.go new file mode 100644 index 0000000..0599b48 --- /dev/null +++ b/app/job-helpers.go @@ -0,0 +1,112 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/devops/devops_models" + "github.com/google/uuid" +) + +// UnmarshalJob decodes swagger to a first class object +func UnmarshalJob(s *devops_models.Job) *Job { + if s.ID == "" { + s.ID = uuid.New().String() + } + endDate, e2 := time.Parse(dateFormat, s.EndDate) + startDate, e3 := time.Parse(dateFormat, s.StartDate) + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + jobDate, e4 := time.Parse(dateTimeFormat, s.JobDate) + return &Job{ + ID: s.ID, + AccountID: *s.AccountID, + BackendID: s.BackendID, + CompanyID: s.CompanyID, + CoordinateID: s.CoordinateID, + CreatedByID: s.CreatedByID, + Duration: *s.Duration, + ErrorReason: s.ErrorReason, + Interval: s.Interval, + LastModifiedByID: s.LastModifiedByID, + Month: s.Month, + NextJobID: s.NextJobID, + OwnerID: s.OwnerID, + Parameters: s.Parameters, + PeriodID: s.PeriodID, + Quarter: s.Quarter, + RatingEngineID: s.RatingEngineID, + Ref: s.Ref, + Reschedule: s.Reschedule, + RescheduleInterval: s.RescheduleInterval, + SagaID: s.SagaID, + SagaType: *s.SagaType, + Semiannual: s.Semiannual, + Source: s.Source, + Status: s.Status, + Target: s.Target, + TenantID: s.TenantID, + Type: *s.SagaType, + Year: s.Year, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + EndDate: sql.NullTime{ + Time: endDate, + Valid: e2 == nil, + }, + StartDate: sql.NullTime{ + Time: startDate, + Valid: e3 == nil, + }, + JobDate: sql.NullTime{ + Time: jobDate, + Valid: e4 == nil, + }, + } +} + +// MarshalToSwagger encodes a first class object to swagger +func (obj *Job) MarshalToSwagger() *devops_models.Job { + startDate := obj.StartDate.Time.Format(dateTimeFormat) + return &devops_models.Job{ + ID: obj.ID, + AccountID: &obj.AccountID, + BackendID: obj.BackendID, + CompanyID: obj.CompanyID, + CoordinateID: obj.CoordinateID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Duration: &obj.Duration, + EndDate: obj.EndDate.Time.Format(dateTimeFormat), + ErrorReason: obj.ErrorReason, + Interval: obj.Interval, + JobDate: obj.JobDate.Time.Format(dateTimeFormat), + LastModifiedByID: obj.LastModifiedDate.Time.Format(dateTimeFormat), + LastModifiedDate: obj.LastModifiedByID, + Month: obj.Month, + NextJobID: obj.NextJobID, + OwnerID: obj.OwnerID, + Parameters: obj.Parameters, + PeriodID: obj.PeriodID, + Quarter: obj.Quarter, + RatingEngineID: obj.RatingEngineID, + Ref: obj.Ref, + Reschedule: obj.Reschedule, + RescheduleInterval: obj.RescheduleInterval, + SagaID: obj.SagaID, + SagaType: &obj.SagaType, + Semiannual: obj.Semiannual, + Source: obj.Source, + StartDate: startDate, + Status: obj.Status, + Target: obj.Target, + TenantID: obj.TenantID, + Year: obj.Year, + } +} diff --git a/app/job.go b/app/job.go index 8dfbb88..9888e3f 100644 --- a/app/job.go +++ b/app/job.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/devops/devops_models" ) -// JobChannelWrapper wraps the object with the security principal +// JobChannelWrapper wraps the object with workflow params type JobChannelWrapper struct { Obj devops_models.Job Principal User @@ -32,7 +32,6 @@ type Job struct { LastModifiedDate sql.NullTime Month int64 NextJobID string - ObjectType string OwnerID string Parameters string PeriodID string diff --git a/app/journalentry-helpers.go b/app/journalentry-helpers.go new file mode 100644 index 0000000..79ab73f --- /dev/null +++ b/app/journalentry-helpers.go @@ -0,0 +1,90 @@ +package app + +import ( + "database/sql" + "fmt" + "time" + + "code.tnxs.net/taxnexus/lib/api/ledger/ledger_models" + "github.com/google/uuid" +) + +func UnMarshalJournalEntry(s *ledger_models.JournalEntry) *JournalEntry { + if s.ID == "" { + s.ID = uuid.New().String() + } + journalDate, dateErr := time.Parse(dateFormat, s.JournalDate) + if dateErr != nil { + err := fmt.Errorf("ledger.unMarshalJournalEntry: 💣 â›” journal date error: %w", dateErr) + sugar.Error(err) + return nil + } + createdDate, err1 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModifiedDate, err2 := time.Parse(dateTimeFormat, s.LastModifiedDate) + items := []*JournalItem{} + for _, swagItm := range s.Items { + itm := UnMarshalJournalItem(swagItm) + itm.JournalEntryID = s.ID + items = append(items, itm) + } + return &JournalEntry{ + ID: s.ID, + AccountID: s.AccountID, + Balanced: s.Balanced, + CreatedByID: s.CreatedByID, + Credits: s.Credits, + Debits: s.Debits, + Description: s.Description, + IngestID: s.IngestID, + Items: items, + LastModifiedByID: s.LastModifiedDate, + ParentFK: s.ParentFK, + PeriodID: s.PeriodID, + Posted: s.Posted, + Ref: s.Ref, + SalesRegulation: s.SalesRegulation, + Status: s.Status, + TenantID: s.TenantID, + JournalDate: sql.NullTime{ + Time: journalDate, + Valid: true, + }, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: err1 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModifiedDate, + Valid: err2 == nil, + }, + } +} + +func (obj *JournalEntry) MarshalToSwagger() *ledger_models.JournalEntry { + swag := &ledger_models.JournalEntry{ + ID: obj.ID, + AccountID: obj.AccountID, + Balanced: obj.Balanced, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Credits: obj.Credits, + Debits: obj.Debits, + Description: obj.Description, + IngestID: obj.IngestID, + Items: []*ledger_models.JournalItem{}, + JournalDate: obj.JournalDate.Time.Format(dateTimeFormat), + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + ParentFK: obj.ParentFK, + PeriodID: obj.PeriodID, + Posted: obj.Posted, + Ref: obj.Ref, + SalesRegulation: obj.SalesRegulation, + Status: obj.Status, + TenantID: obj.TenantID, + } + for _, itm := range obj.Items { + swag.Items = append(swag.Items, itm.MarshalToSwgger()) + } + return swag +} diff --git a/app/journalentry.go b/app/journalentry.go index 0839cec..2bd4a82 100644 --- a/app/journalentry.go +++ b/app/journalentry.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/ledger/ledger_models" ) -// JournalEntryChannelWrapper wraps the object with the security principal +// JournalEntryChannelWrapper wraps the object with workflow params type JournalEntryChannelWrapper struct { Obj ledger_models.JournalEntry Principal User diff --git a/app/journalitem-helpers.go b/app/journalitem-helpers.go new file mode 100644 index 0000000..29b0294 --- /dev/null +++ b/app/journalitem-helpers.go @@ -0,0 +1,72 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/ledger/ledger_models" + "github.com/google/uuid" +) + +func UnMarshalJournalItem(s *ledger_models.JournalItem) *JournalItem { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, err1 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModifiedDate, err2 := time.Parse(dateTimeFormat, s.LastModifiedDate) + return &JournalItem{ + ID: s.ID, + CreatedByID: s.CreatedByID, + Credit: s.Credit, + Debit: s.Debit, + GlAccountID: s.GLAccountID, + GlAccountDisplay: s.GLAccountDisplay, + GlBalance: s.GLBalanceID, + InvoiceItemID: s.InvoiceItemID, + JournalEntryID: s.JournalEntryID, + LastModifiedByID: s.LastModifiedByID, + PoItemID: s.POItemID, + ProductCode: s.ProducCode, + ProductID: s.ProductID, + ReferenceType: s.ReferenceType, + SalesRegulation: s.SalesRegulation, + TaxnexusCodeID: s.TaxnexusCodeID, + TaxnexusCodeDisplay: s.TaxnexusCodeDisplay, + TaxTransactionID: s.TaxTransactionID, + TenantID: s.TenantID, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: err1 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModifiedDate, + Valid: err2 == nil, + }, + } +} + +func (obj *JournalItem) MarshalToSwgger() *ledger_models.JournalItem { + return &ledger_models.JournalItem{ + ID: obj.ID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Credit: obj.Credit, + Debit: obj.Debit, + GLAccountDisplay: obj.GlAccountDisplay, + GLAccountID: obj.GlAccountID, + GLBalanceID: obj.GlBalance, + InvoiceItemID: obj.InvoiceItemID, + JournalEntryID: obj.JournalEntryID, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + POItemID: obj.PoItemID, + ProducCode: obj.ProductCode, + ProductID: obj.ProductID, + ReferenceType: obj.ReferenceType, + SalesRegulation: obj.SalesRegulation, + TaxnexusCodeDisplay: obj.TaxnexusCodeDisplay, + TaxnexusCodeID: obj.TaxnexusCodeID, + TaxTransactionID: obj.TaxTransactionID, + TenantID: obj.TenantID, + } +} diff --git a/app/journalitem.go b/app/journalitem.go index 5a48319..0cb773a 100644 --- a/app/journalitem.go +++ b/app/journalitem.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/ledger/ledger_models" ) -// JournalItemChannelWrapper wraps the object with the security principal +// JournalItemChannelWrapper wraps the object with workflow params type JournalItemChannelWrapper struct { Obj ledger_models.JournalItem Principal User diff --git a/app/lead-helpers.go b/app/lead-helpers.go new file mode 100644 index 0000000..c01ce48 --- /dev/null +++ b/app/lead-helpers.go @@ -0,0 +1,86 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/crm/crm_models" + "github.com/google/uuid" +) + +func unMarshalLead(s *crm_models.Lead) *Lead { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + return &Lead{ + ID: s.ID, + Address: UnMarshalCrmAddress(s.Address), + Company: s.Company, + Description: s.Description, + Email: s.Email, + FirstName: s.FirstName, + LastName: s.LastName, + MobilePhone: s.MobilePhone, + Name: s.Name, + OwnerID: s.OwnerID, + PartnerAccountID: s.PartnerAccountID, + Phone: s.Phone, + ProductID: s.ProductID, + RefererURL: s.RefererURL, + Status: s.Status, + Title: s.Title, + Type: s.Type, + UTMCampaign: s.UTMCampaign, + UTMContent: s.UTMContent, + UTMMedium: s.UTMMedium, + UTMSource: s.UTMSource, + UTMTerm: s.UTMTerm, + Website: s.Website, + CreatedByID: s.CreatedByID, + LastModifiedByID: s.LastModifiedByID, + TenantID: s.TenantID, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + } +} + +func (obj *Lead) MarshalToSwagger() *crm_models.Lead { + return &crm_models.Lead{ + ID: obj.ID, + Address: obj.Address.MarshalToCrm(), + Company: obj.Company, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Description: obj.Description, + Email: obj.Email, + FirstName: obj.FirstName, + LastName: obj.LastName, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + MobilePhone: obj.MobilePhone, + Name: obj.Name, + OwnerID: obj.OwnerID, + PartnerAccountID: obj.PartnerAccountID, + Phone: obj.Phone, + ProductID: obj.ProductID, + RefererURL: obj.RefererURL, + Status: obj.Status, + TenantID: obj.TenantID, + Title: obj.Title, + Type: obj.Type, + UTMCampaign: obj.UTMCampaign, + UTMContent: obj.UTMContent, + UTMMedium: obj.UTMMedium, + UTMSource: obj.UTMSource, + UTMTerm: obj.UTMTerm, + Website: obj.Website, + } +} diff --git a/app/lead.go b/app/lead.go index 293fe6e..c4141d0 100644 --- a/app/lead.go +++ b/app/lead.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/crm/crm_models" ) -// LeadChannelWrapper wraps the object with the security principal +// LeadChannelWrapper wraps the object with workflow params type LeadChannelWrapper struct { Obj crm_models.Lead Principal User @@ -17,7 +17,7 @@ type LeadChannelWrapper struct { // Lead is a first-class object type type Lead struct { ID string - Address Address + Address *Address Company string CreatedByID string CreatedDate sql.NullTime diff --git a/app/license-helpers.go b/app/license-helpers.go new file mode 100644 index 0000000..6b8c9f9 --- /dev/null +++ b/app/license-helpers.go @@ -0,0 +1,83 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/regs/regs_models" + "github.com/google/uuid" +) + +func UnMarshalLicense(s *regs_models.License) *License { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + expirationDate, e2 := time.Parse(dateFormat, s.ExpirationDate) + if e2 != nil { + expirationDate, e2 = time.Parse(dateFormatAlt, s.ExpirationDate) + } + dateIssued, e3 := time.Parse(dateFormat, s.DateIssued) + if e3 != nil { + dateIssued, e3 = time.Parse(dateFormatAlt, s.DateIssued) + } + return &License{ + ID: s.ID, + AccountID: s.AccountID, + BackendID: s.BackendID, + ContactID: s.ContactID, + CreatedByID: s.CreatedByID, + Designation: s.Designation, + IsCanceled: s.IsCanceled, + IsRevoked: s.IsRevoked, + LastModifiedByID: s.LastModifiedByID, + LicenseNumber: s.Name, + LicenseTypeID: s.LicenseTypeID, + OwnerID: s.OwnerID, + ParentFK: s.ParentFK, + Ref: s.Ref, + Status: s.Status, + TenantID: s.TenantID, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + ExpirationDate: sql.NullTime{ + Time: expirationDate, + Valid: e2 == nil, + }, + DateIssued: sql.NullTime{ + Time: dateIssued, + Valid: e3 == nil, + }, + } +} +func (obj *License) MarshalToSwagger() *regs_models.License { + return ®s_models.License{ + ID: obj.ID, + AccountID: obj.AccountID, + BackendID: obj.BackendID, + ContactID: obj.ContactID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + DateIssued: obj.DateIssued.Time.Format(dateFormat), + Designation: obj.Designation, + ExpirationDate: obj.ExpirationDate.Time.Format(dateFormat), + IsCanceled: obj.IsCanceled, + IsRevoked: obj.IsRevoked, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + LicenseTypeID: obj.LicenseTypeID, + Name: obj.LicenseNumber, + OwnerID: obj.OwnerID, + ParentFK: obj.ParentFK, + Ref: obj.Ref, + Status: obj.Status, + TenantID: obj.TenantID, + } +} diff --git a/app/license.go b/app/license.go index 3d2ad5d..467c71a 100644 --- a/app/license.go +++ b/app/license.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/regs/regs_models" ) -// LicenseChannelWrapper wraps the object with the security principal +// LicenseChannelWrapper wraps the object with workflow params type LicenseChannelWrapper struct { Obj regs_models.License Principal User diff --git a/app/licensetype-helpers.go b/app/licensetype-helpers.go new file mode 100644 index 0000000..cfc02fe --- /dev/null +++ b/app/licensetype-helpers.go @@ -0,0 +1,96 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/regs/regs_models" + "github.com/google/uuid" +) + +func UnMarshalLicenseType(s *regs_models.LicenseType) *LicenseType { + if s.ID == "" { + s.ID = uuid.New().String() + } + var jurisdictions []*GeoLicenseTypeInstance + if s.Jurisdictions != nil { + jurisdictions = []*GeoLicenseTypeInstance{} + for _, itm := range s.Jurisdictions { + jurisdictions = append(jurisdictions, &GeoLicenseTypeInstance{ + CountryID: itm.CountryID, + CountyID: itm.CountyID, + ObjectType: itm.ObjectType, + PlaceID: itm.PlaceID, + StateID: itm.StateID, + }) + } + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + return &LicenseType{ + ID: s.ID, + AccountID: s.AccountID, + AgentID: s.AgentID, + ContactID: s.ContactID, + Cost: s.Cost, + CreatedByID: s.CreatedByID, + DomainID: s.DomainID, + Domains: s.Domains, + Frequency: s.Frequency, + Jurisdictions: jurisdictions, + LastModifiedByID: s.LastModifiedByID, + Level: s.Level, + MetrcName: s.MetrcName, + Name: s.Name, + PicklistValue: s.PicklistValue, + Ref: s.Ref, + Restriction: s.Restriction, + Tier: s.Tier, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + } +} + +func (obj *LicenseType) MarshalToSwagger() *regs_models.LicenseType { + var jurisdictions []*regs_models.GeoLicenseTypeInstance + if obj.Jurisdictions != nil { + jurisdictions = []*regs_models.GeoLicenseTypeInstance{} + for _, itm := range obj.Jurisdictions { + jurisdictions = append(jurisdictions, ®s_models.GeoLicenseTypeInstance{ + CountryID: itm.CountryID, + CountyID: itm.CountyID, + ObjectType: itm.ObjectType, + PlaceID: itm.PlaceID, + StateID: itm.StateID, + }) + } + } + return ®s_models.LicenseType{ + ID: obj.ID, + AccountID: obj.AccountID, + AgentID: obj.AgentID, + ContactID: obj.ContactID, + Cost: obj.Cost, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + DomainID: obj.DomainID, + Domains: obj.Domains, + Frequency: obj.Frequency, + Jurisdictions: jurisdictions, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + Level: obj.Level, + MetrcName: obj.MetrcName, + Name: obj.Name, + PicklistValue: obj.PicklistValue, + Ref: obj.Ref, + Restriction: obj.Restriction, + Tier: obj.Tier, + } +} diff --git a/app/licensetype.go b/app/licensetype.go index b5b16ca..8a66ecf 100644 --- a/app/licensetype.go +++ b/app/licensetype.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/regs/regs_models" ) -// LicenseTypeChannelWrapper wraps the object with the security principal +// LicenseTypeChannelWrapper wraps the object with workflow params type LicenseTypeChannelWrapper struct { Obj regs_models.LicenseType Principal User @@ -39,7 +39,7 @@ type LicenseType struct { Tier string } -// GeoLicenseTypeInstanceChannelWrapper wraps the object with the security principal +// GeoLicenseTypeInstanceChannelWrapper wraps the object with workflow params type GeoLicenseTypeInstanceChannelWrapper struct { Obj regs_models.GeoLicenseTypeInstance Principal User @@ -64,7 +64,7 @@ type GeoLicenseTypeInstance struct { StateID string } -// DomainLicenseTypeInstanceChannelWrapper wraps the object with the security principal +// DomainLicenseTypeInstanceChannelWrapper wraps the object with workflow params type DomainLicenseTypeInstanceChannelWrapper struct { // Obj regs_models.DomainLicenseTypeInstance Principal User diff --git a/app/log.go b/app/log.go index 905b24e..1702de1 100644 --- a/app/log.go +++ b/app/log.go @@ -2,7 +2,7 @@ package app import "database/sql" -// LogChannelWrapper wraps the object with the security principal +// LogChannelWrapper wraps the object with workflow params type LogChannelWrapper struct { // Obj devops_models.AppLog Principal User diff --git a/app/notebook-helpers.go b/app/notebook-helpers.go new file mode 100644 index 0000000..9f952cb --- /dev/null +++ b/app/notebook-helpers.go @@ -0,0 +1,97 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/regs/regs_models" +) + +func UnMarshalNotebook(s *regs_models.Notebook) *Notebook { + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + date, e2 := time.Parse(dateFormat, s.Date) + datestart, e3 := time.Parse(dateFormat, s.DateStart) + dateend, e4 := time.Parse(dateFormat, s.DateEnd) + var items []*NotebookItem + if s.Items != nil { + items = []*NotebookItem{} + for _, itm := range s.Items { + items = append(items, &NotebookItem{ + ID: itm.ID, + ItemName: itm.ItemName, + Title: itm.Title, + NotebookID: itm.NotebookID, + }) + + } + } + return &Notebook{ + ID: s.ID, + AccountID: s.AccountID, + ContactID: s.ContactID, + CreatedByID: s.CreatedByID, + Description: s.Description, + Items: items, + LastModifiedByID: s.LastModifiedByID, + PeriodEndID: s.PeriodEndID, + PeriodStartID: s.PeriodStartID, + PreparerID: s.PreparerID, + TenantID: s.TenantID, + Title: s.Title, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + Date: sql.NullTime{ + Time: date, + Valid: e2 == nil, + }, + DateStart: sql.NullTime{ + Time: datestart, + Valid: e3 == nil, + }, + DateEnd: sql.NullTime{ + Time: dateend, + Valid: e4 == nil, + }, + } +} +func (obj Notebook) MarshalToSwagger() *regs_models.Notebook { + var items []*regs_models.NotebookItem + if obj.Items != nil { + items = []*regs_models.NotebookItem{} + for _, itm := range obj.Items { + items = append(items, ®s_models.NotebookItem{ + ID: itm.ID, + ItemName: itm.ItemName, + Title: itm.Title, + NotebookID: itm.NotebookID, + }) + + } + } + return ®s_models.Notebook{ + ID: obj.ID, + AccountID: obj.AccountID, + ContactID: obj.ContactID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Date: obj.Date.Time.Format(dateFormat), + DateEnd: obj.DateEnd.Time.Format(dateFormat), + DateStart: obj.DateStart.Time.Format(dateFormat), + Description: obj.Description, + Items: items, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + PeriodEndID: obj.PeriodEndID, + PeriodStartID: obj.PeriodStartID, + PreparerID: obj.PreparerID, + TenantID: obj.TenantID, + Title: obj.Title, + } +} diff --git a/app/notebook.go b/app/notebook.go index 9ae9956..63e28f8 100644 --- a/app/notebook.go +++ b/app/notebook.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/regs/regs_models" ) -// NotebookChannelWrapper wraps the object with the security principal +// NotebookChannelWrapper wraps the object with workflow params type NotebookChannelWrapper struct { Obj regs_models.Notebook Principal User diff --git a/app/notebookitem.go b/app/notebookitem.go index bc4360d..d3c43e9 100644 --- a/app/notebookitem.go +++ b/app/notebookitem.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/regs/regs_models" ) -// NotebookItemChannelWrapper wraps the object with the security principal +// NotebookItemChannelWrapper wraps the object with workflow params type NotebookItemChannelWrapper struct { Obj regs_models.NotebookItem Principal User diff --git a/app/order-helpers.go b/app/order-helpers.go new file mode 100644 index 0000000..cc744b9 --- /dev/null +++ b/app/order-helpers.go @@ -0,0 +1,235 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/ops/ops_models" + "github.com/google/uuid" +) + +func unMarshalOrder(s *ops_models.Order) *Order { //nolint:funlen // big object + if s.ID == "" { + s.ID = uuid.New().String() + } + var items []*OrderItem + if s.Items != nil { + items = make([]*OrderItem, 5) + for _, itm := range s.Items { + items = append(items, unMarshalOrderItem(itm)) + } + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModifiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + poDate, e2 := time.Parse(dateTimeFormat, s.PODate) + activatedDate, e3 := time.Parse(dateTimeFormat, s.ActivatedDate) + effectiveDate, e4 := time.Parse(dateTimeFormat, s.EffectiveDate) + customerAuthorizedDate, e5 := time.Parse(dateTimeFormat, s.CustomerAuthorizedDate) + companyAuthorizedDate, e6 := time.Parse(dateTimeFormat, s.CompanyAuthorizedDate) + endDate, e7 := time.Parse(dateTimeFormat, s.EndDate) + installationDate, e8 := time.Parse(dateTimeFormat, s.InstallationDate) + contractEndDate, e9 := time.Parse(dateTimeFormat, s.ContractEndDate) + return &Order{ + ID: s.ID, + AccountID: s.AccountID, + ActivatedByID: s.ActivatedByID, + Amount: s.Amount, + AmountDue: s.AmountDue, + BillingAddress: UnMarshalOpsAddress(s.BillingAddress), + BillingContactID: s.BillingContactID, + BusinessAddress: UnMarshalOpsAddress(s.BusinessAddress), + BusinessTax: s.BusinessTax, + CannabisTax: s.CannabisTax, + CompanyAuthorizedByID: s.CompanyAuthorizedByID, + Completion: s.Completion, + ContractID: s.ContractID, + CoordinateID: s.CoordinateID, + CreatedByID: s.CreatedByID, + CustomerAuthorizedByID: s.CustomerAuthorizedBy, + CustomerID: s.CustomerID, + Description: s.Description, + Discount: s.Discount, + DiscountAmount: s.DiscountAmount, + EndUserID: s.EndUserID, + EstimatedAmount: s.EstimatedAmount, + EstimatedBusinessTax: s.EstimatedBusinessTax, + EstimatedCannabisTax: s.EstimatedCannabisTax, + EstimatedCOGS: s.EstimatedCOGS, + EstimatedDiscount: s.EstimatedDiscount, + EstimatedSalesTax: s.EstimatedSalesTax, + EstimatedSubtotal: s.EstimatedSubtotal, + IngestID: s.IngestID, + InvoiceID: s.InvoiceID, + IsReductionOrder: s.IsReductionOrder, + Items: items, + JobID: s.JobID, + LastModifiedByID: s.LastModifiedByID, + MonthlyAmount: s.MonthlyAmount, + Open: s.Open, + OpportunityID: s.OpportunityID, + OrderNumber: s.OrderNumber, + OrderReferenceNumber: s.OrderReferenceNumber, + OriginalOrderID: s.OriginalOrderID, + OwnerID: s.OwnerID, + ParentFK: s.ParentFK, + PaymentMethodID: s.PaymentMethodID, + PaymentTerms: s.PaymentTerms, + PeriodID: s.PeriodID, + PlaceGeoCode: s.PlaceGeoCode, + Posted: s.Posted, + ProvisioningStatus: s.ProvisioningStatus, + PurchaseAmount: s.PurchaseAmount, + PurchaseOrderID: s.PurchaseOrderID, + QuoteID: s.QuoteID, + RatingEngineID: s.RatingEngineID, + RecordTypeID: s.RecordTypeID, + Ref: s.Ref, + SalesRegulation: s.SalesRegulation, + SalesTax: s.SalesTax, + ServiceTerm: s.ServiceTerm, + ShippingAddress: UnMarshalOpsAddress(s.ShippingAddress), + ShippingContactID: s.ShippingContactID, + ShippingHandling: s.ShippingHandling, + Status: s.Status, + Subtotal: s.Subtotal, + TelecomTax: s.TelecomTax, + TemplateID: s.TemplateID, + Type: s.Type, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModifiedDate, + Valid: e1 == nil, + }, + PODate: sql.NullTime{ + Time: poDate, + Valid: e2 == nil, + }, + ActivatedDate: sql.NullTime{ + Time: activatedDate, + Valid: e3 == nil, + }, + EffectiveDate: sql.NullTime{ + Time: effectiveDate, + Valid: e4 == nil, + }, + CustomerAuthorizedDate: sql.NullTime{ + Time: customerAuthorizedDate, + Valid: e5 == nil, + }, + CompanyAuthorizedDate: sql.NullTime{ + Time: companyAuthorizedDate, + Valid: e6 == nil, + }, + EndDate: sql.NullTime{ + Time: endDate, + Valid: e7 == nil, + }, + InstallationDate: sql.NullTime{ + Time: installationDate, + Valid: e8 == nil, + }, + ContractEndDate: sql.NullTime{ + Time: contractEndDate, + Valid: e9 == nil, + }, + } +} +func (obj *Order) MarshalToSwagger() *ops_models.Order { + var items []*ops_models.OrderItem + if obj.Items != nil { + items = []*ops_models.OrderItem{} + for _, itm := range obj.Items { + items = append(items, itm.MarshalToSwagger()) + } + } + var taxTransactions []*ops_models.TaxTransaction + if obj.TaxTransactions != nil { + taxTransactions = []*ops_models.TaxTransaction{} + for _, txn := range obj.TaxTransactions { + taxTransactions = append(taxTransactions, txn.MarshalToSwagger()) + } + } + return &ops_models.Order{ + ID: obj.ID, + AccountID: obj.AccountID, + ActivatedByID: obj.ActivatedByID, + ActivatedDate: obj.ActivatedDate.Time.Format(dateTimeFormat), + Amount: obj.Amount, + AmountDue: obj.AmountDue, + BillingAddress: obj.BillingAddress.MarshalToOps(), + BillingContactID: obj.BillingContactID, + BusinessAddress: obj.BusinessAddress.MarshalToOps(), + BusinessTax: obj.BusinessTax, + CannabisTax: obj.CannabisTax, + CompanyAuthorizedByID: obj.CompanyAuthorizedByID, + CompanyAuthorizedDate: obj.CompanyAuthorizedDate.Time.Format(dateTimeFormat), + Completion: obj.Completion, + ContractEndDate: obj.ContractEndDate.Time.Format(dateTimeFormat), + ContractID: obj.ContractID, + CoordinateID: obj.CoordinateID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + CustomerAuthorizedBy: obj.CustomerAuthorizedByID, + CustomerAuthorizedDate: obj.CustomerAuthorizedDate.Time.Format(dateTimeFormat), + CustomerID: obj.CustomerID, + Description: obj.Description, + Discount: obj.Discount, + DiscountAmount: obj.DiscountAmount, + EffectiveDate: obj.EffectiveDate.Time.Format(dateTimeFormat), + EndDate: obj.EndDate.Time.Format(dateTimeFormat), + EndUserID: obj.EndUserID, + EstimatedAmount: obj.EstimatedAmount, + EstimatedBusinessTax: obj.EstimatedBusinessTax, + EstimatedCannabisTax: obj.EstimatedCannabisTax, + EstimatedCOGS: obj.EstimatedCOGS, + EstimatedDiscount: obj.EstimatedDiscount, + EstimatedSalesTax: obj.EstimatedSalesTax, + EstimatedSubtotal: obj.EstimatedSubtotal, + IngestID: obj.IngestID, + InstallationDate: obj.InstallationDate.Time.Format(dateTimeFormat), + InvoiceID: obj.InvoiceID, + IsReductionOrder: obj.IsReductionOrder, + Items: items, + JobID: obj.JobID, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + MonthlyAmount: obj.MonthlyAmount, + Open: obj.Open, + OpportunityID: obj.OpportunityID, + OrderNumber: obj.OrderNumber, + OrderReferenceNumber: obj.OrderReferenceNumber, + OriginalOrderID: obj.OriginalOrderID, + OwnerID: obj.OwnerID, + ParentFK: obj.ParentFK, + PaymentMethodID: obj.PaymentMethodID, + PaymentTerms: obj.PaymentTerms, + PeriodID: obj.PeriodID, + PlaceGeoCode: obj.PlaceGeoCode, + PODate: obj.PODate.Time.Format(dateTimeFormat), + Posted: obj.Posted, + ProvisioningStatus: obj.ProvisioningStatus, + PurchaseAmount: obj.PurchaseAmount, + PurchaseOrderID: obj.PurchaseOrderID, + QuoteID: obj.QuoteID, + RatingEngineID: obj.RatingEngineID, + RecordTypeID: obj.RecordTypeID, + Ref: obj.Ref, + SalesRegulation: obj.SalesRegulation, + SalesTax: obj.SalesTax, + ServiceTerm: obj.ServiceTerm, + ShippingAddress: obj.ShippingAddress.MarshalToOps(), + ShippingContactID: obj.ShippingContactID, + ShippingHandling: obj.ShippingHandling, + Status: obj.Status, + Subtotal: obj.Subtotal, + TaxTransactions: taxTransactions, + TelecomTax: obj.TelecomTax, + TemplateID: obj.TemplateID, + TenantID: obj.TenantID, + Total: obj.Total.MarshalToSwagger(), + Type: obj.Type, + } +} diff --git a/app/order.go b/app/order.go index b5999ff..c2d5722 100644 --- a/app/order.go +++ b/app/order.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/ops/ops_models" ) -// OrderChannelWrapper wraps the object with the security principal +// OrderChannelWrapper wraps the object with workflow params type OrderChannelWrapper struct { Obj ops_models.Order Principal User diff --git a/app/orderitem-helpers.go b/app/orderitem-helpers.go new file mode 100644 index 0000000..61b1fdd --- /dev/null +++ b/app/orderitem-helpers.go @@ -0,0 +1,130 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/ops/ops_models" + "github.com/google/uuid" +) + +func unMarshalOrderItem(s *ops_models.OrderItem) *OrderItem { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModifiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + dateDelivered, e2 := time.Parse(dateTimeFormat, s.DateDelivered) + dateOrdered, e3 := time.Parse(dateTimeFormat, s.DateDelivered) + datePromised, e4 := time.Parse(dateTimeFormat, s.DatePromised) + serviceDate, e5 := time.Parse(dateTimeFormat, s.ServiceDate) + return &OrderItem{ + ID: s.ID, + Activated: s.Activated, + ActiveatedByID: s.ActiveatedByID, + AvailableQuantity: s.AvailableQuantity, + COGS: s.COGS, + CreatedByID: s.CreatedByID, + CreateReservation: s.CreateReservation, + Description: s.Description, + Discount: s.Discount, + Family: s.Family, + InvoiceItemID: s.InvoiceItemID, + LastModifiedByID: s.LastModifiedByID, + ListPrice: s.ListPrice, + LocationID: s.LocationID, + MRCInterval: s.MRCInterval, + OrderID: s.OrderID, + OriginalOrderItemID: s.OriginalOrderItemID, + ParentFK: s.ParentFK, + Posted: s.Posted, + ProductCode: s.ProductCode, + ProductID: s.ProductID, + ProductName: s.ProductName, + Quantity: s.Quantity, + QuantityOnHand: s.QuantityOnHand, + QuoteItemID: s.QuoteItemID, + Ref: s.Ref, + ShippingHandling: s.ShippingHandling, + Status: s.Status, + SubscriptionID: s.SubscriptionID, + Subtotal: s.Subtotal, + TaxnexusCodeDisplay: s.TaxnexusCodeDisplay, + TaxnexusCodeID: s.TaxnexusCodeID, + TenantID: s.TenantID, + TotalPrice: s.TotalPrice, + UnitPrice: s.UnitPrice, + Units: s.Units, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModifiedDate, + Valid: e1 == nil, + }, + DateDelivered: sql.NullTime{ + Time: dateDelivered, + Valid: e2 == nil, + }, + DateOrdered: sql.NullTime{ + Time: dateOrdered, + Valid: e3 == nil, + }, + DatePromised: sql.NullTime{ + Time: datePromised, + Valid: e4 == nil, + }, + ServiceDate: sql.NullTime{ + Time: serviceDate, + Valid: e5 == nil, + }, + } +} + +func (obj *OrderItem) MarshalToSwagger() *ops_models.OrderItem { + return &ops_models.OrderItem{ + ID: obj.ID, + Activated: obj.Activated, + ActiveatedByID: obj.ActiveatedByID, + AvailableQuantity: obj.AvailableQuantity, + COGS: obj.COGS, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + CreateReservation: obj.CreateReservation, + DateDelivered: obj.DateDelivered.Time.Format(dateTimeFormat), + DateOrdered: obj.DateOrdered.Time.Format(dateTimeFormat), + DatePromised: obj.DatePromised.Time.Format(dateTimeFormat), + Description: obj.Description, + Discount: obj.Discount, + Family: obj.Family, + InvoiceItemID: obj.InvoiceItemID, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + ListPrice: obj.ListPrice, + LocationID: obj.LocationID, + MRCInterval: obj.MRCInterval, + OrderID: obj.OrderID, + OriginalOrderItemID: obj.OriginalOrderItemID, + ParentFK: obj.ParentFK, + Posted: obj.Posted, + ProductCode: obj.ProductCode, + ProductID: obj.ProductID, + ProductName: obj.ProductName, + Quantity: obj.Quantity, + QuantityOnHand: obj.QuantityOnHand, + QuoteItemID: obj.QuoteItemID, + Ref: obj.Ref, + ServiceDate: obj.ServiceDate.Time.Format(dateTimeFormat), + ShippingHandling: obj.ShippingHandling, + Status: obj.Status, + SubscriptionID: obj.SubscriptionID, + Subtotal: obj.Subtotal, + TaxnexusCodeDisplay: obj.TaxnexusCodeDisplay, + TaxnexusCodeID: obj.TaxnexusCodeID, + TenantID: obj.TenantID, + TotalPrice: obj.TotalPrice, + UnitPrice: obj.UnitPrice, + Units: obj.Units, + } +} diff --git a/app/orderitem.go b/app/orderitem.go index 1e7e75c..24d07d3 100644 --- a/app/orderitem.go +++ b/app/orderitem.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/ops/ops_models" ) -// OrderItemChannelWrapper wraps the object with the security principal +// OrderItemChannelWrapper wraps the object with workflow params type OrderItemChannelWrapper struct { Obj ops_models.OrderItem Principal User diff --git a/app/outgoingemail-helpers.go b/app/outgoingemail-helpers.go new file mode 100644 index 0000000..b24eaef --- /dev/null +++ b/app/outgoingemail-helpers.go @@ -0,0 +1,22 @@ +package app + +import "code.tnxs.net/taxnexus/lib/api/workflow/workflow_models" + +func unMarshalSwaggerOutgoingEmailMessage(s *workflow_models.OutgoingEmailMessage) *OutgoingEmailMessage { + return &OutgoingEmailMessage{ + ID: s.ID, + BCCAddress: s.BCCAddress, + CCAddress: s.CCAddress, + EmailTemplateID: s.EmailTemplateID, + ExternalID: s.ExternalID, + HTML: []byte(s.HTML), + EmailMessageID: s.EmailMessageID, + FromContactID: s.FromContactID, + FromName: s.FromName, + Subject: s.Subject, + Text: s.Text, + ToAddress: s.ToAddress, + ValidatedFromAddress: s.ValidatedFromAddress, + WhoID: s.WhoID, + } +} diff --git a/app/outgoingemail.go b/app/outgoingemail.go index ce8427c..26248b5 100644 --- a/app/outgoingemail.go +++ b/app/outgoingemail.go @@ -2,7 +2,7 @@ package app import "code.tnxs.net/taxnexus/lib/api/workflow/workflow_models" -// OutgoingEmailMessageChannelWrapper wraps the object with the security principal +// OutgoingEmailMessageChannelWrapper wraps the object with workflow params type OutgoingEmailMessageChannelWrapper struct { Obj workflow_models.OutgoingEmailMessage Principal User diff --git a/app/outgoingemailreceipt-helpers.go b/app/outgoingemailreceipt-helpers.go new file mode 100644 index 0000000..4b43c3a --- /dev/null +++ b/app/outgoingemailreceipt-helpers.go @@ -0,0 +1,14 @@ +package app + +import "code.tnxs.net/taxnexus/lib/api/workflow/workflow_models" + +func (obj *OutgoingEmailMessageReceipt) marshalToSwagger() *workflow_models.EmailMessage { + return &workflow_models.EmailMessage{ + ID: obj.ID, + EmailMessageID: obj.EmailMessageID, + Status: obj.Status, + Subject: obj.Subject, + ToAddress: obj.ToAddress, + ValidatedFromAddress: obj.ValidatedFromAddress, + } +} diff --git a/app/outgoingemailreceipt.go b/app/outgoingemailreceipt.go index 2a9093c..af39a5f 100644 --- a/app/outgoingemailreceipt.go +++ b/app/outgoingemailreceipt.go @@ -1,6 +1,6 @@ package app -// OutgoingEmailMessageReceiptChannelWrapper wraps the object with the security principal +// OutgoingEmailMessageReceiptChannelWrapper wraps the object with workflow params type OutgoingEmailMessageReceiptChannelWrapper struct { // Obj workflow_models.OutgoingEmailMessageReceipt Principal User diff --git a/app/paymentmethod-helpers.go b/app/paymentmethod-helpers.go new file mode 100644 index 0000000..45ea687 --- /dev/null +++ b/app/paymentmethod-helpers.go @@ -0,0 +1,88 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/ops/ops_models" + "github.com/google/uuid" +) + +func unMarshalPaymentMethod(s *ops_models.PaymentMethod) *PaymentMethod { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + expirationDate, e2 := time.Parse(dateTimeFormat, s.ExpirationDate) + return &PaymentMethod{ + ID: s.ID, + AccountID: s.AccountID, + AchAccountType: s.AchAccountType, + AchBankAccount: s.AchBankAccount, + AchRouting: s.AchRouting, + Active: s.Active, + Autopay: s.Autopay, + BankName: s.BankName, + BillingContactID: s.BillingContactID, + CCnumber: s.CCnumber, + CCtype: s.CCtype, + CompanyID: s.CompanyID, + ContractID: s.ContractID, + CreatedByID: s.CreatedByID, + Default: s.Default, + ExpirationMonth: s.ExpirationMonth, + ExpirationYear: s.ExpirationYear, + Gateway: s.Gateway, + GatewayKey: s.GatewayKey, + LastModifiedByID: s.LastModifiedByID, + Nickname: s.Nickname, + RecordType: s.RecordType, + Ref: s.Ref, + TenantID: s.TenantID, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + ExpirationDate: sql.NullTime{ + Time: expirationDate, + Valid: e2 == nil, + }, + } +} + +// MarshalToSwagger encodes a first class object to swagger +func (obj *PaymentMethod) MarshalToSwagger() *ops_models.PaymentMethod { + return &ops_models.PaymentMethod{ + ID: obj.ID, + AccountID: obj.AccountID, + AchAccountType: obj.AchAccountType, + AchBankAccount: obj.AchBankAccount, + AchRouting: obj.AchRouting, + Active: obj.Active, + Autopay: obj.Autopay, + BankName: obj.BankName, + BillingContactID: obj.BillingContactID, + CCnumber: obj.CCnumber, + CCtype: obj.CCtype, + CompanyID: obj.CompanyID, + ContractID: obj.ContractID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Default: obj.Default, + ExpirationDate: obj.ExpirationDate.Time.Format(dateTimeFormat), + ExpirationMonth: obj.ExpirationMonth, + ExpirationYear: obj.ExpirationYear, + Gateway: obj.Gateway, + GatewayKey: obj.GatewayKey, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + Nickname: obj.Nickname, + RecordType: obj.RecordType, + Ref: obj.Ref, + } +} diff --git a/app/paymentmethod.go b/app/paymentmethod.go index 49f7862..4f69cde 100644 --- a/app/paymentmethod.go +++ b/app/paymentmethod.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/ops/ops_models" ) -// PaymentMethodChannelWrapper wraps the object with the security principal +// PaymentMethodChannelWrapper wraps the object with workflow params type PaymentMethodChannelWrapper struct { Obj ops_models.PaymentMethod Principal User diff --git a/app/pdf-helpers.go b/app/pdf-helpers.go new file mode 100644 index 0000000..d533652 --- /dev/null +++ b/app/pdf-helpers.go @@ -0,0 +1,27 @@ +package app + +import "code.tnxs.net/taxnexus/lib/api/stash/stash_models" + +func (obj *PDF) MarshalToDocument() *stash_models.Document { + + return &stash_models.Document{ + ID: obj.ID, + Filename: obj.Filename, + ParentID: obj.ParentID, + Title: obj.Title, + URI: obj.URI, + } +} + +func unMarshalNewPDF(swag *stash_models.NewPDF) *PDF { + return &PDF{ + Description: swag.Description, + Filename: swag.Filename, + HTML: []byte(swag.HTML), + ObjectType: swag.ObjectType, + OwnerID: swag.OwnerID, + ParentID: swag.ParentID, + Ref: swag.Ref, + Title: swag.Title, + } +} diff --git a/app/pdf.go b/app/pdf.go index 18af0c5..48d9932 100644 --- a/app/pdf.go +++ b/app/pdf.go @@ -2,7 +2,7 @@ package app import "database/sql" -// PDFChannelWrapper wraps the object with the security principal +// PDFChannelWrapper wraps the object with workflow params type PDFChannelWrapper struct { // Obj stash_models.Pdf Principal User diff --git a/app/period-helpers.go b/app/period-helpers.go new file mode 100644 index 0000000..cda632d --- /dev/null +++ b/app/period-helpers.go @@ -0,0 +1,75 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/ledger/ledger_models" + "github.com/google/uuid" +) + +func unMarshalPeriod(s *ledger_models.Period) *Period { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, err1 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModifiedDate, err2 := time.Parse(dateTimeFormat, s.LastModifiedDate) + startTime, err3 := time.Parse(dateFormat, s.StartDate) + endTime, err4 := time.Parse(dateFormat, s.EndDate) + return &Period{ + ID: s.ID, + AccountID: s.AccountID, + CompanyID: s.CompanyID, + Ref: s.Ref, + Days: s.Days, + EndDate: s.EndDate, + Month: s.Month, + Name: s.Name, + Quarter: s.Quarter, + Semiannual: s.Semiannual, + StartDate: s.StartDate, + Status: s.Status, + TenantID: s.TenantID, + Year: s.Year, + CreatedByID: s.CreatedByID, + LastModifiedByID: s.LastModifiedByID, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: err1 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModifiedDate, + Valid: err2 == nil, + }, + EndTime: sql.NullTime{ + Time: endTime, + Valid: err3 == nil, + }, + StartTime: sql.NullTime{ + Time: startTime, + Valid: err4 == nil, + }, + } +} +func (obj *Period) marshalToSwagger() *ledger_models.Period { + return &ledger_models.Period{ + ID: obj.ID, + AccountID: obj.AccountID, + CompanyID: obj.CompanyID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Days: obj.Days, + EndDate: obj.EndDate, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + Month: obj.Month, + Name: obj.Name, + Quarter: obj.Quarter, + Ref: obj.Ref, + Semiannual: obj.Semiannual, + StartDate: obj.StartDate, + Status: obj.Status, + TenantID: obj.TenantID, + Year: obj.Year, + } +} diff --git a/app/period.go b/app/period.go index 3038f7d..2eeb883 100644 --- a/app/period.go +++ b/app/period.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/ledger/ledger_models" ) -// PeriodChannelWrapper wraps the object with the security principal +// PeriodChannelWrapper wraps the object with workflow params type PeriodChannelWrapper struct { Obj ledger_models.Period Principal User diff --git a/app/place-helpers.go b/app/place-helpers.go new file mode 100644 index 0000000..49262d8 --- /dev/null +++ b/app/place-helpers.go @@ -0,0 +1,151 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/geo/geo_models" + "github.com/google/uuid" +) + +func UnMarshalPlace(s *geo_models.Place) *Place { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + theInstances := []*TaxInstance{} + for _, itm := range s.TaxInstances { + theInstances = append(theInstances, unMarshalTaxInstance(itm)) + } + return &Place{ + ID: s.ID, + AccountID: s.AccountID, + AccountValidation: s.AccountValidation, + Amount: s.Amount, + AreaDescription: s.AreaDescription, + ContactID: s.ContactID, + CountryID: s.CountryID, + CountyID: s.CountyID, + CreatedByID: s.CreatedByID, + EnrollmentStatus: s.EnrollmentStatus, + FIPS: s.FIPS, + FIPSclass: s.FIPSclass, + FunctionalStatus: s.FunctionalStatus, + Geocode: s.Geocode, + GNIS: s.GNIS, + HasDistrictTaxes: s.HasDistrictTaxes, + Interest: s.Interest, + Landarea: s.LandArea, + LastModifiedByID: s.LastModifiedByID, + Latitude: s.Latitude, + LegalName: s.LegalName, + Longitude: s.Longitude, + Name: s.Name, + Penalty: s.Penalty, + Ref: s.Ref, + ReportedAdjustments: s.ReportedAdjustments, + ReportedDeductions: s.ReportedDeductions, + ReportedNetRevenue: s.ReportedNetRevenue, + ReportedRate: s.ReportedRate, + ReportedRevenue: s.ReportedRevenue, + RevenueBase: s.RevenueBase, + RevenueNet: s.RevenueNet, + RevenueNotTaxable: s.RevenueNotTaxable, + Revneuebase: s.RevenueBase, + StateCode: s.StateCode, + StateID: s.StateID, + Status: s.Status, + Subtotal: s.Subtotal, + TaxInstances: theInstances, + TemplateID: s.TemplateID, + TotalAmount: s.TotalAmount, + TotalArea: s.TotalArea, + UnitBase: s.UnitBase, + WaterArea: s.WaterArea, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + } +} +func (obj *Place) MarshalToSwagger() *geo_models.Place { + if obj == nil { + return nil + } + taxInstances := []*geo_models.TaxInstance{} + for _, itm := range obj.TaxInstances { + taxInstances = append(taxInstances, itm.marshalToSwagger()) + } + var salesTaxRate *geo_models.TaxRate + if obj.SalesTaxRate != nil { + salesTaxRate = &geo_models.TaxRate{ + CombinedRate: obj.SalesTaxRate.CombinedRate, + County: obj.SalesTaxRate.County, + CountyID: obj.SalesTaxRate.CountyID, + CountyRate: obj.SalesTaxRate.CountyRate, + Date: obj.SalesTaxRate.Date, + Focus: obj.SalesTaxRate.Focus, + Geocode: obj.SalesTaxRate.Geocode, + Place: obj.SalesTaxRate.Place, + PlaceID: obj.SalesTaxRate.PlaceID, + PlaceRate: obj.SalesTaxRate.PlaceRate, + State: obj.SalesTaxRate.State, + StateID: obj.SalesTaxRate.StateID, + StateRate: obj.SalesTaxRate.StateRate, + } + } + return &geo_models.Place{ + ID: obj.ID, + AccountID: obj.AccountID, + AccountValidation: obj.AccountValidation, + Amount: obj.Amount, + AreaDescription: obj.AreaDescription, + ContactID: obj.ContactID, + CountryID: obj.CountryID, + CountyID: obj.CountyID, + EnrollmentStatus: obj.EnrollmentStatus, + FIPS: obj.FIPS, + FIPSclass: obj.FIPSclass, + FunctionalStatus: obj.FunctionalStatus, + Geocode: obj.Geocode, + GNIS: obj.GNIS, + HasDistrictTaxes: obj.HasDistrictTaxes, + Interest: obj.Interest, + LandArea: obj.Landarea, + LegalName: obj.LegalName, + Latitude: obj.Latitude, + Longitude: obj.Longitude, + Name: obj.Name, + Penalty: obj.Penalty, + Ref: obj.Ref, + ReportedAdjustments: obj.ReportedAdjustments, + ReportedDeductions: obj.ReportedDeductions, + ReportedNetRevenue: obj.ReportedNetRevenue, + ReportedRate: obj.ReportedRate, + ReportedRevenue: obj.ReportedRevenue, + RevenueBase: obj.RevenueBase, + RevenueNet: obj.RevenueNet, + RevenueNotTaxable: obj.RevenueNotTaxable, + SalesTaxRate: salesTaxRate, + StateID: obj.StateID, + Status: obj.Status, + Subtotal: obj.Subtotal, + TaxInstances: taxInstances, + TemplateID: obj.TemplateID, + TotalAmount: obj.TotalAmount, + TotalArea: obj.TotalArea, + UnitBase: obj.UnitBase, + WaterArea: obj.WaterArea, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + OwnerID: obj.OwnerID, + StateCode: obj.StateCode, + } +} diff --git a/app/place.go b/app/place.go index 395b34d..106d54e 100644 --- a/app/place.go +++ b/app/place.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/geo/geo_models" ) -// PlaceChannelWrapper wraps the object with the security principal +// PlaceChannelWrapper wraps the object with workflow params type PlaceChannelWrapper struct { Obj geo_models.Place Principal User @@ -41,6 +41,7 @@ type Place struct { Latitude float64 LegalName string Name string + OwnerID string Penalty float64 Ref string ReportedAdjustments float64 diff --git a/app/po-helpers.go b/app/po-helpers.go new file mode 100644 index 0000000..cd61c94 --- /dev/null +++ b/app/po-helpers.go @@ -0,0 +1,203 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/ops/ops_models" + "github.com/google/uuid" +) + +func unMarshalPurchaseOrder(s *ops_models.PurchaseOrder) (*PurchaseOrder, error) { //nolint:funlen // big object + if s.ID == "" { + s.ID = uuid.New().String() + } + var items []*PurchaseOrderItem + if s.Items != nil { + items = []*PurchaseOrderItem{} + for _, itm := range s.Items { + items = append(items, UnMarshalPurchaseOrderItem(itm)) + } + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModifiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + poDate, e2 := time.Parse(dateTimeFormat, s.PODate) + dateExpires, e3 := time.Parse(dateTimeFormat, s.DateExpires) + datePromised, e4 := time.Parse(dateTimeFormat, s.DatePromised) + dateRequested, e5 := time.Parse(dateTimeFormat, s.DateRequested) + expirationDate, e6 := time.Parse(dateTimeFormat, s.ExpirationDate) + shipDate, e7 := time.Parse(dateTimeFormat, s.ShipDate) + dueDate, e8 := time.Parse(dateTimeFormat, s.DueDate) + return &PurchaseOrder{ + ID: s.ID, + AccountID: s.AccountID, + Amount: s.Amount, + BillingAddress: UnMarshalOpsAddress(s.BillingAddress), + BillingContactID: s.BillingContactID, + BusinessAddress: UnMarshalOpsAddress(s.BusinessAddress), + BusinessTax: s.BusinessTax, + CannabisTax: s.CannabisTax, + ContractID: s.ContractID, + CoordinateID: s.CoordinateID, + CreatedByID: s.CreatedByID, + CreditCardID: s.CreditCardID, + CustomerID: s.CustomerID, + Description: s.Description, + Discount: s.Discount, + DiscountAmount: s.DiscountAmount, + EndUserID: s.EndUserID, + EstimatedAmount: s.EstimatedAmount, + EstimatedBusinessTax: s.EstimatedBusinessTax, + EstimatedCannabisTax: s.EstimatedCannabisTax, + EstimatedDiscount: s.EstimatedDiscount, + EstimatedSalesTax: s.EstimatedSalesTax, + EstimatedSubtotal: s.EstimatedSubtotal, + IngestID: s.IngestID, + Items: items, + JobID: s.JobID, + LastModifiedByID: s.LastModifiedByID, + OpportunityID: s.OpportunityID, + OrderID: s.OrderID, + ParentFK: s.ParentFK, + PaymentTerms: s.PaymentTerms, + PeriodID: s.PeriodID, + PlaceGeoCode: s.PlaceGeoCode, + PONumber: s.PONumber, + Posted: s.Posted, + QuoteID: s.QuoteID, + Ref: s.Ref, + SalesRegulation: s.SalesRegulation, + SalesTax: s.SalesTax, + ServiceTerm: s.ServiceTerm, + ShippingAddress: UnMarshalOpsAddress(s.ShippingAddress), + ShippingContactID: s.ShippingContactID, + ShippingHandling: s.ShippingHandling, + ShippingSpecialInstructions: s.ShippingSpecialInstructions, + Status: s.Status, + Subtotal: s.Subtotal, + TelecomTax: s.TelecomTax, + TemplateID: s.TemplateID, + TenantID: s.TenantID, + TotalID: s.TotalID, + Type: s.Type, + VendorID: s.VendorID, + VendorQuoteNumber: s.VendorQuoteNumber, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModifiedDate, + Valid: e1 == nil, + }, + PODate: sql.NullTime{ + Time: poDate, + Valid: e2 == nil, + }, + DateExpires: sql.NullTime{ + Time: dateExpires, + Valid: e3 == nil, + }, + DatePromised: sql.NullTime{ + Time: datePromised, + Valid: e4 == nil, + }, + DateRequested: sql.NullTime{ + Time: dateRequested, + Valid: e5 == nil, + }, + ExpirationDate: sql.NullTime{ + Time: expirationDate, + Valid: e6 == nil, + }, + ShipDate: sql.NullTime{ + Time: shipDate, + Valid: e7 == nil, + }, + DueDate: sql.NullTime{ + Time: dueDate, + Valid: e8 == nil, + }, + }, nil +} +func (obj *PurchaseOrder) marshalToSwagger() *ops_models.PurchaseOrder { + var items []*ops_models.PurchaseOrderItem + if obj.Items != nil { + items = []*ops_models.PurchaseOrderItem{} + for _, itm := range obj.Items { + items = append(items, itm.MarshalToSwagger()) + } + } + var taxTransactions []*ops_models.TaxTransaction + if obj.TaxTransactions != nil { + taxTransactions = []*ops_models.TaxTransaction{} + for _, txn := range obj.TaxTransactions { + taxTransactions = append(taxTransactions, txn.MarshalToSwagger()) + } + } + return &ops_models.PurchaseOrder{ + ID: obj.ID, + AccountID: obj.AccountID, + Amount: obj.Amount, + BillingAddress: obj.BillingAddress.MarshalToOps(), + BillingContactID: obj.BillingContactID, + BusinessAddress: obj.BusinessAddress.MarshalToOps(), + BusinessTax: obj.BusinessTax, + CannabisTax: obj.CannabisTax, + ContractID: obj.ContractID, + CoordinateID: obj.CoordinateID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + CreditCardID: obj.CreditCardID, + CustomerID: obj.CustomerID, + DateExpires: obj.DateExpires.Time.Format(dateTimeFormat), + DatePromised: obj.DatePromised.Time.Format(dateTimeFormat), + DateRequested: obj.DateRequested.Time.Format(dateTimeFormat), + Description: obj.Description, + Discount: obj.Discount, + DiscountAmount: obj.DiscountAmount, + DueDate: obj.DueDate.Time.Format(dateTimeFormat), + EndUserID: obj.EndUserID, + EstimatedAmount: obj.EstimatedAmount, + EstimatedBusinessTax: obj.EstimatedBusinessTax, + EstimatedCannabisTax: obj.EstimatedCannabisTax, + EstimatedDiscount: obj.EstimatedDiscount, + EstimatedSalesTax: obj.EstimatedSalesTax, + EstimatedSubtotal: obj.EstimatedSubtotal, + ExpirationDate: obj.ExpirationDate.Time.Format(dateTimeFormat), + IngestID: obj.IngestID, + Items: items, + JobID: obj.JobID, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + OpportunityID: obj.OpportunityID, + OrderID: obj.OrderID, + ParentFK: obj.ParentFK, + PaymentTerms: obj.PaymentTerms, + PeriodID: obj.PeriodID, + PlaceGeoCode: obj.PlaceGeoCode, + PODate: obj.PODate.Time.Format(dateTimeFormat), + PONumber: obj.PONumber, + Posted: obj.Posted, + QuoteID: obj.QuoteID, + Ref: obj.Ref, + SalesRegulation: obj.SalesRegulation, + SalesTax: obj.SalesTax, + ServiceTerm: obj.ServiceTerm, + ShipDate: obj.ShipDate.Time.Format(dateTimeFormat), + ShippingAddress: obj.ShippingAddress.MarshalToOps(), + ShippingContactID: obj.ShippingContactID, + ShippingHandling: obj.ShippingHandling, + ShippingSpecialInstructions: obj.ShippingSpecialInstructions, + Status: obj.Status, + Subtotal: obj.Subtotal, + TaxTransactions: taxTransactions, + TelecomTax: obj.TelecomTax, + TemplateID: obj.TemplateID, + Total: obj.Total.MarshalToSwagger(), + TotalID: obj.TotalID, + Type: obj.Type, + VendorID: obj.VendorID, + VendorQuoteNumber: obj.VendorQuoteNumber, + } +} diff --git a/app/po.go b/app/po.go index ec520ea..afa7164 100644 --- a/app/po.go +++ b/app/po.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/ops/ops_models" ) -// PurchaseOrderChannelWrapper wraps the object with the security principal +// PurchaseOrderChannelWrapper wraps the object with workflow params type PurchaseOrderChannelWrapper struct { Obj ops_models.PurchaseOrder Principal User diff --git a/app/poitem-helpers.go b/app/poitem-helpers.go new file mode 100644 index 0000000..fa8c44c --- /dev/null +++ b/app/poitem-helpers.go @@ -0,0 +1,94 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/ops/ops_models" + "github.com/google/uuid" +) + +func UnMarshalPurchaseOrderItem(s *ops_models.PurchaseOrderItem) *PurchaseOrderItem { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModifiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + dueDate, e8 := time.Parse(dateTimeFormat, s.DueDate) + return &PurchaseOrderItem{ + ID: s.ID, + CreatedByID: s.CreatedByID, + Description: s.Description, + Family: s.Family, + LastModifiedByID: s.LastModifiedByID, + LocationID: s.LocationID, + MRCInterval: s.MRCInterval, + OrderItemID: s.OrderItemID, + ParentFK: s.ParentFK, + PurchaseOrderID: s.PurchaseOrderID, + ProductCode: s.ProductCode, + ProductID: s.ProductID, + ProductName: s.ProductName, + Quantity: s.Quantity, + QuoteItemID: s.QuoteItemID, + ReceivedQuantity: s.ReceivedQuantity, + Ref: s.Ref, + RejectedQuantity: s.RejectedQuantity, + ShippmentItemID: s.ShippmentItemID, + ShippingHandling: s.ShippingHandling, + Status: s.Status, + StockedQuantity: s.StockedQuantity, + Subtotal: s.Subtotal, + TaxnexusCodeDisplay: s.TaxnexusCodeDisplay, + TaxnexusCodeID: s.TaxnexusCodeID, + UnitPrice: s.UnitPrice, + Units: s.Units, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModifiedDate, + Valid: e1 == nil, + }, + DueDate: sql.NullTime{ + Time: dueDate, + Valid: e8 == nil, + }, + } +} +func (obj *PurchaseOrderItem) MarshalToSwagger() *ops_models.PurchaseOrderItem { + return &ops_models.PurchaseOrderItem{ + ID: obj.ID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Description: obj.Description, + DueDate: obj.DueDate.Time.Format(dateTimeFormat), + Family: obj.Family, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + LocationID: obj.LocationID, + MRCInterval: obj.MRCInterval, + OrderItemID: obj.OrderItemID, + ParentFK: obj.ParentFK, + ProductCode: obj.ProductCode, + ProductID: obj.ProductID, + ProductName: obj.ProductName, + PurchaseOrderID: obj.PurchaseOrderID, + Quantity: obj.Quantity, + QuoteItemID: obj.QuoteItemID, + ReceivedQuantity: obj.ReceivedQuantity, + Ref: obj.Ref, + RejectedQuantity: obj.RejectedQuantity, + ShippingHandling: obj.ShippingHandling, + ShippmentItemID: obj.ShippmentItemID, + Status: obj.Status, + StockedQuantity: obj.StockedQuantity, + Subtotal: obj.Subtotal, + TaxnexusCodeDisplay: obj.TaxnexusCodeDisplay, + TaxnexusCodeID: obj.TaxnexusCodeID, + TenantID: obj.TenantID, + UnitPrice: obj.UnitPrice, + Units: obj.Units, + } +} diff --git a/app/poitem.go b/app/poitem.go index 292d77c..4411dd9 100644 --- a/app/poitem.go +++ b/app/poitem.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/ops/ops_models" ) -// PurchaseOrderItemChannelWrapper wraps the object with the security principal +// PurchaseOrderItemChannelWrapper wraps the object with workflow params type PurchaseOrderItemChannelWrapper struct { Obj ops_models.PurchaseOrderItem Principal User diff --git a/app/product-helpers.go b/app/product-helpers.go new file mode 100644 index 0000000..15ed7db --- /dev/null +++ b/app/product-helpers.go @@ -0,0 +1,102 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/ops/ops_models" + "github.com/google/uuid" +) + +func UnMarshalProduct(s *ops_models.Product) *Product { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + return &Product{ + ID: s.ID, + AccountID: s.AccountID, + AgencyType: s.AgencyType, + AssetTracking: s.AssetTracking, + CreatedByID: s.CreatedByID, + Description: s.Description, + DescriptionSKU: s.DescriptionSKU, + DisplayURL: s.DisplayURL, + Family: s.Family, + Image500: s.Image500, + ImageFull: s.ImageFull, + InventoryTracking: s.InventoryTracking, + IsActive: s.IsActive, + IsGeneric: s.IsGeneric, + LastModifiedByID: s.LastModifiedByID, + Manufacturer: s.Manufacturer, + ManufacturerProductCode: s.ManufacturerProductCode, + MRCInterval: s.MRCInterval, + MSRP: s.MSRP, + Name: s.Name, + ProductCode: s.ProductCode, + Prorateable: s.Prorateable, + Publish: s.Publish, + PublishUPC: s.PublishUPC, + QuantityUnitOfMeasure: s.QuantityUnitOfMeasure, + Refundable: s.Refundable, + ShippingWeight: s.ShippingWeight, + SKU: s.SKU, + Specifications: s.Specifications, + TaxnexusCode: s.TaxnexusCode, + TaxnexusCodeID: s.TaxnexusCodeID, + TenantID: s.TenantID, + Units: s.Units, + VendorID: s.VendorID, + VendorName: s.VendorName, + VendorPartNumber: s.VendorPartNumber, + VendorPrice: s.VendorPrice, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + } +} +func (obj *Product) MarshalToSwagger() *ops_models.Product { + return &ops_models.Product{ + ID: obj.ID, + AccountID: obj.AccountID, + AgencyType: obj.AgencyType, + AssetTracking: obj.AssetTracking, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Description: obj.Description, + DescriptionSKU: obj.DescriptionSKU, + DisplayURL: obj.DisplayURL, + Family: obj.Family, + Image500: obj.Image500, + ImageFull: obj.ImageFull, + InventoryTracking: obj.InventoryTracking, + IsActive: obj.IsActive, + IsGeneric: obj.IsGeneric, + LastModifiedByID: obj.LastModifiedByID, + Manufacturer: obj.Manufacturer, + ManufacturerProductCode: obj.ManufacturerProductCode, + MRCInterval: obj.MRCInterval, + MSRP: obj.MSRP, + Name: obj.Name, + ProductCode: obj.ProductCode, + Prorateable: obj.Prorateable, + Publish: obj.Publish, + PublishUPC: obj.PublishUPC, + QuantityUnitOfMeasure: obj.QuantityUnitOfMeasure, + Refundable: obj.Refundable, + ShippingWeight: obj.ShippingWeight, + SKU: obj.SKU, + Specifications: obj.Specifications, + TaxnexusCode: obj.TaxnexusCode, + TaxnexusCodeID: obj.TaxnexusCodeID, + TenantID: obj.TenantID, + Units: obj.Units, + VendorID: obj.VendorID, + VendorName: obj.VendorName, + VendorPartNumber: obj.VendorPartNumber, + VendorPrice: obj.VendorPrice, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + } +} diff --git a/app/product.go b/app/product.go index 6117a91..7552c99 100644 --- a/app/product.go +++ b/app/product.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/ops/ops_models" ) -// ProductChannelWrapper wraps the object with the security principal +// ProductChannelWrapper wraps the object with workflow params type ProductChannelWrapper struct { Obj ops_models.Product Principal User diff --git a/app/quote-helpers.go b/app/quote-helpers.go new file mode 100644 index 0000000..cf6e59b --- /dev/null +++ b/app/quote-helpers.go @@ -0,0 +1,96 @@ +package app + +import ( + "code.tnxs.net/taxnexus/lib/api/ops/ops_models" +) + +func (obj *Quote) marshalToSwagger() *ops_models.Quote { + var items []*ops_models.QuoteItem + if obj.Items != nil { + items = []*ops_models.QuoteItem{} + for _, itm := range obj.Items { + items = append(items, itm.MarshalToSwagger()) + } + } + var taxTransactions []*ops_models.TaxTransaction + if obj.TaxTransactions != nil { + taxTransactions = []*ops_models.TaxTransaction{} + for _, itm := range obj.TaxTransactions { + taxTransactions = append(taxTransactions, itm.MarshalToSwagger()) + } + } + return &ops_models.Quote{ + ID: obj.ID, + AccountID: obj.AccountID, + AdditionalAddress: obj.AdditionalAddress.MarshalToOps(), + AdditionalName: obj.AdditionalName, + Amount: obj.Amount, + BillingAddress: obj.BillingAddress.MarshalToOps(), + BillingContactID: obj.BillingContactID, + BillingName: obj.BillingName, + BusinessAddress: obj.BusinessAddress.MarshalToOps(), + BusinessTax: obj.BusinessTax, + CannabisTax: obj.CannabisTax, + ContactID: obj.ContactID, + ContractID: obj.ContractID, + CoordinateID: obj.CoordinateID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + CreditTerms: obj.CreditTerms, + CustomerID: obj.CustomerID, + QuoteDate: obj.QuoteDate.Time.Format(dateTimeFormat), + Description: obj.Description, + Discount: obj.Discount, + DiscountAmount: obj.DiscountAmount, + Email: obj.Email, + EndUserID: obj.EndUserID, + EstimatedAmount: obj.EstimatedAmount, + EstimatedBusinessTax: obj.EstimatedBusinessTax, + EstimatedCannabisTax: obj.EstimatedCannabisTax, + EstimatedCOGS: obj.EstimatedCOGS, + EstimatedDiscount: obj.EstimatedDiscount, + EstimatedSalesTax: obj.EstimatedSalesTax, + EstimatedSubtotal: obj.EstimatedSubtotal, + ExpirationDate: obj.ExpirationDate.Time.Format(dateTimeFormat), + Fax: obj.Fax, + GrandTotal: obj.GrandTotal, + IngestID: obj.IngestID, + InstallationDate: obj.InstallationDate.Time.Format(dateTimeFormat), + Items: items, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + JobID: obj.JobID, + MonthlyAmount: obj.MonthlyAmount, + Name: obj.Name, + OpportunityID: obj.OpportunityID, + OwnerID: obj.OwnerID, + ParentFK: obj.ParentFK, + PaymentTerms: obj.PaymentTerms, + PeriodID: obj.PeriodID, + Phone: obj.Phone, + PlaceGeoCode: obj.PlaceGeoCode, + PurchaseAmount: obj.PurchaseAmount, + QuoteAmount: obj.QuoteAmount, + QuoteNumber: obj.QuoteNumber, + QuoteToAddress: obj.QuoteToAddress.MarshalToOps(), + QuoteToName: obj.QuoteToName, + Ref: obj.Ref, + SalesRegulation: obj.SalesRegulation, + SalesTax: obj.SalesTax, + ServiceTerm: obj.ServiceTerm, + ShippingAddress: obj.ShippingAddress.MarshalToOps(), + ShippingContactID: obj.ShippingContactID, + ShippingHandling: obj.ShippingHandling, + ShippingName: obj.ShippingName, + Status: obj.Status, + Subtotal: obj.Subtotal, + Tax: obj.Tax, + TaxTransactions: taxTransactions, + TelecomTax: obj.TelecomTax, + TemplateID: obj.TemplateID, + TenantID: obj.TenantID, + Total: obj.Total.MarshalToSwagger(), + TotalPrice: obj.TotalPrice, + Type: obj.Type, + } +} diff --git a/app/quote.go b/app/quote.go index 496f041..1dc14fb 100644 --- a/app/quote.go +++ b/app/quote.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/ops/ops_models" ) -// QuoteChannelWrapper wraps the object with the security principal +// QuoteChannelWrapper wraps the object with workflow params type QuoteChannelWrapper struct { Obj ops_models.Quote Principal User diff --git a/app/quoteitem-helpers.go b/app/quoteitem-helpers.go new file mode 100644 index 0000000..9a24264 --- /dev/null +++ b/app/quoteitem-helpers.go @@ -0,0 +1,34 @@ +package app + +import "code.tnxs.net/taxnexus/lib/api/ops/ops_models" + +func (obj *QuoteItem) MarshalToSwagger() *ops_models.QuoteItem { + return &ops_models.QuoteItem{ + ID: obj.ID, + COGS: obj.COGS, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Description: obj.Description, + Discount: obj.Discount, + DiscountAmount: obj.DiscountAmount, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + ListPrice: obj.ListPrice, + MRCInterval: obj.MRCInterval, + ParentFK: obj.ParentFK, + ProductCode: obj.ProductCode, + ProductID: obj.ProductID, + ProductName: obj.ProductName, + Quantity: obj.Quantity, + QuoteID: obj.QuoteID, + Ref: obj.Ref, + ServiceDate: obj.ServiceDate.Time.Format(dateTimeFormat), + ShippingHandling: obj.ShippingHandling, + Subtotal: obj.Subtotal, + TaxnexusCode: obj.TaxnexusCodeDisplay, + TenantID: obj.TenantID, + TotalPrice: obj.TotalPrice, + UnitPrice: obj.UnitPrice, + Units: obj.Units, + } +} diff --git a/app/quoteitem.go b/app/quoteitem.go index f6fc093..60c9533 100644 --- a/app/quoteitem.go +++ b/app/quoteitem.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/ops/ops_models" ) -// QuoteItemChannelWrapper wraps the object with the security principal +// QuoteItemChannelWrapper wraps the object with workflow params type QuoteItemChannelWrapper struct { Obj ops_models.QuoteItem Principal User diff --git a/app/ratingengine-helpers.go b/app/ratingengine-helpers.go new file mode 100644 index 0000000..e69de29 diff --git a/app/ratingengine.go b/app/ratingengine.go index 0d56257..8726231 100644 --- a/app/ratingengine.go +++ b/app/ratingengine.go @@ -5,7 +5,7 @@ import ( "github.com/go-sql-driver/mysql" ) -// RatingengineChannelWrapper wraps the object with the security principal +// RatingengineChannelWrapper wraps the object with workflow params type RatingengineChannelWrapper struct { Obj regs_models.RatingEngine Principal User diff --git a/app/ratingengineitem-helpers.go b/app/ratingengineitem-helpers.go new file mode 100644 index 0000000..e69de29 diff --git a/app/ratingengineitem.go b/app/ratingengineitem.go index 1fde148..97555c2 100644 --- a/app/ratingengineitem.go +++ b/app/ratingengineitem.go @@ -5,7 +5,7 @@ import ( "github.com/go-sql-driver/mysql" ) -// RatingEngineItemChannelWrapper wraps the object with the security principal +// RatingEngineItemChannelWrapper wraps the object with workflow params type RatingEngineItemChannelWrapper struct { Obj regs_models.RatingEngineItem Principal User diff --git a/app/role-helpers.go b/app/role-helpers.go new file mode 100644 index 0000000..fc2dbac --- /dev/null +++ b/app/role-helpers.go @@ -0,0 +1,50 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/devops/devops_models" + "github.com/google/uuid" +) + +// UnMarshalRole decodes swagger to first class object +func UnMarshalRole(s *devops_models.Role) *Role { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + return &Role{ + ID: s.ID, + Auth0RoleID: s.Auth0RoleID, + CreatedByID: s.CreatedByID, + Description: s.Description, + LastModifiedByID: s.LastModifiedByID, + RoleName: s.RoleName, + TenantID: s.TenantID, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + } +} + +// MarshalToSwagger encodes a first class object to swagger +func (obj *Role) MarshalToSwagger() *devops_models.Role { + return &devops_models.Role{ + ID: obj.ID, + Auth0RoleID: obj.Auth0RoleID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Description: obj.Description, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + RoleName: obj.RoleName, + TenantID: obj.TenantID, + } +} diff --git a/app/role.go b/app/role.go index db7dd09..70c2ef8 100644 --- a/app/role.go +++ b/app/role.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/devops/devops_models" ) -// RoleChannelWrapper wraps the object with the security principal +// RoleChannelWrapper wraps the object with workflow params type RoleChannelWrapper struct { Obj devops_models.Role Principal User diff --git a/app/root.go b/app/root.go index 879a9ad..1008406 100644 --- a/app/root.go +++ b/app/root.go @@ -14,7 +14,10 @@ var sugar *zap.SugaredLogger var config = Configuration{} var appViper = viper.New() -// const dateTimeFormat = "2006-01-02T15:04:05-0800" +const dateFormat = "2006-01-02" +const dateTimeFormat = "2006-01-02T15:04:05-0800" +const dateTimeFormatAlt = "2006-01-02 15:04:05" +const dateFormatAlt = "1/2/2006" var configured = false diff --git a/app/service-helpers.go b/app/service-helpers.go new file mode 100644 index 0000000..e3d2fa4 --- /dev/null +++ b/app/service-helpers.go @@ -0,0 +1,78 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/devops/devops_models" + "github.com/google/uuid" +) + +// UnMarshalService decodes swagger to a first class object +func UnMarshalService(s *devops_models.Service) *Service { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + return &Service{ + ID: s.ID, + Active: s.Active, + ClusterID: s.ClusterID, + ClusterIP: s.ClusterIP, + ClusterURL: s.ClusterURL, + CreatedByID: s.CreatedByID, + Environment: s.Environment, + ExternalURL: s.ExternalURL, + GELFAddress: s.GELFAddress, + LastModifiedByID: s.LastModifiedByID, + NetworkAlias: s.NetworkAlias, + OpenAPIVersion: s.OpenAPIVersion, + OwnerID: s.OwnerID, + PortExternal: s.PortExternal, + PortTest: s.PortTest, + ProxyType: s.ProxyType, + Replicas: s.Replicas, + RepoURL: s.RepoURL, + ServiceName: s.ServiceName, + Version: s.Version, + TenantID: s.TenantID, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + } +} + +// MarshalToSwagger encodes a first class object to swagger +func (obj *Service) MarshalToSwagger() *devops_models.Service { + return &devops_models.Service{ + ID: obj.ID, + Active: obj.Active, + ClusterID: obj.ClusterID, + ClusterIP: obj.ClusterIP, + ClusterURL: obj.ClusterURL, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Environment: obj.Environment, + ExternalURL: obj.ExternalURL, + GELFAddress: obj.GELFAddress, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + NetworkAlias: obj.NetworkAlias, + OpenAPIVersion: obj.OpenAPIVersion, + OwnerID: obj.OwnerID, + PortExternal: obj.PortExternal, + PortTest: obj.PortTest, + ProxyType: obj.ProxyType, + Replicas: obj.Replicas, + RepoURL: obj.RepoURL, + TenantID: obj.TenantID, + ServiceName: obj.ServiceName, + Version: obj.Version, + } +} diff --git a/app/service.go b/app/service.go index 6e81e0b..550a6a8 100644 --- a/app/service.go +++ b/app/service.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/devops/devops_models" ) -// ServiceChannelWrapper wraps the object with the security principal +// ServiceChannelWrapper wraps the object with workflow params type ServiceChannelWrapper struct { Obj devops_models.Service Principal User diff --git a/app/state-helpers.go b/app/state-helpers.go new file mode 100644 index 0000000..3e4700f --- /dev/null +++ b/app/state-helpers.go @@ -0,0 +1,116 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/geo/geo_models" +) + +func UnMarshalSwaggerState(s *geo_models.State) *State { + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + theInstances := []*TaxInstance{} + for _, itm := range s.TaxInstances { + theInstances = append(theInstances, unMarshalTaxInstance(itm)) + } + return &State{ + ID: s.ID, + AccountID: s.AccountID, + Amount: s.Amount, + Code: s.Code, + ContactID: s.ContactID, + CountryID: s.CountryID, + CreatedByID: s.CreatedByID, + Division: s.Division, + EnrollmentStatus: s.EnrollmentStatus, + FIPS: s.FIPS, + Geocode: s.Geocode, + GNIS: s.GNIS, + Interest: s.Interest, + LandArea: s.LandArea, + LastModifiedByID: s.LastModifiedByID, + Latitude: s.Latitude, + Longitude: s.Longitude, + Name: s.Name, + OwnerID: s.OwnerID, + Penalty: s.Penalty, + Ref: s.Ref, + Region: s.Region, + ReportedAdjustments: s.ReportedAdjustments, + ReportedDeductions: s.ReportedDeductions, + ReportedNetRevenue: s.ReportedNetRevenue, + ReportedRate: s.ReportedRate, + ReportedRevenue: s.ReportedRevenue, + RevenueBase: s.RevenueBase, + RevenueNet: s.RevenueNet, + RevenueNotTaxable: s.RevenueNotTaxable, + SGC: s.SGC, + Status: s.Status, + Subtotal: s.Subtotal, + TaxInstances: theInstances, + TemplateID: s.TemplateID, + TotalAmount: s.TotalAmount, + TotalArea: s.TotalArea, + UnitBase: s.UnitBase, + WaterArea: s.WaterArea, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + } +} + +func (obj *State) MarshalToSwagger() *geo_models.State { + taxInstances := []*geo_models.TaxInstance{} + for _, itm := range obj.TaxInstances { + taxInstances = append(taxInstances, itm.marshalToSwagger()) + } + return &geo_models.State{ + ID: obj.ID, + AccountID: obj.AccountID, + Amount: obj.Amount, + Code: obj.Code, + ContactID: obj.ContactID, + CountryID: obj.CountryID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Division: obj.Division, + EnrollmentStatus: obj.EnrollmentStatus, + FIPS: obj.FIPS, + Geocode: obj.Geocode, + GNIS: obj.GNIS, + Interest: obj.Interest, + LandArea: obj.LandArea, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + Latitude: obj.Latitude, + Longitude: obj.Longitude, + Name: obj.Name, + OwnerID: obj.OwnerID, + Penalty: obj.Penalty, + Ref: obj.Ref, + Region: obj.Region, + ReportedAdjustments: obj.ReportedAdjustments, + ReportedDeductions: obj.ReportedDeductions, + ReportedNetRevenue: obj.ReportedNetRevenue, + ReportedRate: obj.ReportedRate, + ReportedRevenue: obj.ReportedRevenue, + RevenueBase: obj.RevenueBase, + RevenueNet: obj.RevenueNet, + RevenueNotTaxable: obj.RevenueNotTaxable, + SGC: obj.SGC, + Status: obj.Status, + Subtotal: obj.Subtotal, + TaxInstances: taxInstances, + TemplateID: obj.TemplateID, + TotalAmount: obj.TotalAmount, + TotalArea: obj.TotalArea, + UnitBase: obj.UnitBase, + WaterArea: obj.WaterArea, + } +} diff --git a/app/state.go b/app/state.go index ba865d5..e832f25 100644 --- a/app/state.go +++ b/app/state.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/geo/geo_models" ) -// StateChannelWrapper wraps the object with the security principal +// StateChannelWrapper wraps the object with workflow params type StateChannelWrapper struct { Obj geo_models.State Principal User diff --git a/app/submission-helpers.go b/app/submission-helpers.go new file mode 100644 index 0000000..e7ada90 --- /dev/null +++ b/app/submission-helpers.go @@ -0,0 +1,89 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/regs/regs_models" + "github.com/google/uuid" +) + +func unMarshalSubmission(s *regs_models.Submission) *Submission { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + submissionDate, e2 := time.Parse(dateFormat, s.SubmissionDate) + if e2 != nil { + submissionDate, e2 = time.Parse(dateFormatAlt, s.SubmissionDate) + } + return &Submission{ + ID: s.ID, + CompanyID: s.CompanyID, + ContactID: s.ContactID, + CreatedByID: s.CreatedByID, + LastModifiedByID: s.LastModifiedByID, + Notes: s.Notes, + Penalty: s.Penalty, + ParentFK: s.ParentFK, + Ref: s.Ref, + ReportedAdjustments: s.ReportedAdjustments, + ReportedDeductions: s.ReportedDeductions, + ReportedNetRevenue: s.ReportedNetRevenue, + ReportedRate: s.ReportedRate, + ReportedRevenue: s.ReportedRevenue, + RevenueBase: s.RevenueBase, + RevenueNet: s.RevenueNet, + RevenueNotTaxable: s.RevenueNotTaxable, + Status: s.Status, + Subtotal: s.Subtotal, + SubmissionNumber: s.SubmissionNumber, + TaxTypeID: s.TaxTypeID, + TenantID: s.TenantID, + TotalAmount: s.TotalAmount, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + SubmissionDate: sql.NullTime{ + Time: submissionDate, + Valid: e2 == nil, + }, + } +} + +func (obj *Submission) marshalToSwagger() *regs_models.Submission { + return ®s_models.Submission{ + ID: obj.ID, + CompanyID: obj.CompanyID, + ContactID: obj.ContactID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + Notes: obj.Notes, + ParentFK: obj.ParentFK, + Penalty: obj.Penalty, + Ref: obj.Ref, + ReportedAdjustments: obj.ReportedAdjustments, + ReportedDeductions: obj.ReportedDeductions, + ReportedNetRevenue: obj.ReportedNetRevenue, + ReportedRate: obj.ReportedRate, + ReportedRevenue: obj.ReportedRevenue, + RevenueBase: obj.RevenueBase, + RevenueNet: obj.RevenueNet, + RevenueNotTaxable: obj.RevenueNotTaxable, + Status: obj.Status, + SubmissionDate: obj.SubmissionDate.Time.Format(dateFormat), + SubmissionNumber: obj.SubmissionNumber, + Subtotal: obj.Subtotal, + TaxTypeID: obj.TaxTypeID, + TenantID: obj.TenantID, + TotalAmount: obj.TotalAmount, + } +} diff --git a/app/submission.go b/app/submission.go index a168a50..2a08b5f 100644 --- a/app/submission.go +++ b/app/submission.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/regs/regs_models" ) -// SubmissionChannelWrapper wraps the object with the security principal +// SubmissionChannelWrapper wraps the object with workflow params type SubmissionChannelWrapper struct { Obj regs_models.Submission Principal User diff --git a/app/task.go b/app/task.go index 8604393..5be81e1 100644 --- a/app/task.go +++ b/app/task.go @@ -4,7 +4,7 @@ import ( "database/sql" ) -// TaskChannelWrapper wraps the object with the security principal +// TaskChannelWrapper wraps the object with workflow params type TaskChannelWrapper struct { // Obj workflow_models.Task Principal User diff --git a/app/taskrelation.go b/app/taskrelation.go index e861791..e6ee134 100644 --- a/app/taskrelation.go +++ b/app/taskrelation.go @@ -4,7 +4,7 @@ import ( "database/sql" ) -// TaskRelationChannelWrapper wraps the object with the security principal +// TaskRelationChannelWrapper wraps the object with workflow params type TaskRelationChannelWrapper struct { // Obj workflow_models.TaskRelation Principal User diff --git a/app/taskwhorelation.go b/app/taskwhorelation.go index 5e8802d..451ff21 100644 --- a/app/taskwhorelation.go +++ b/app/taskwhorelation.go @@ -4,7 +4,7 @@ import ( "database/sql" ) -// TaskWhoRelationChannelWrapper wraps the object with the security principal +// TaskWhoRelationChannelWrapper wraps the object with workflow params type TaskWhoRelationChannelWrapper struct { // Obj workflow_models.TaskWhoRelation Principal User diff --git a/app/taxinstance-helpers.go b/app/taxinstance-helpers.go new file mode 100644 index 0000000..6916727 --- /dev/null +++ b/app/taxinstance-helpers.go @@ -0,0 +1,51 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/geo/geo_models" + "github.com/google/uuid" +) + +func unMarshalTaxInstance(s *geo_models.TaxInstance) *TaxInstance { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + return &TaxInstance{ + ID: s.ID, + CountryID: s.CountryID, + CountyID: s.CountyID, + CreatedByID: s.CreatedByID, + LastModifiedByID: s.LastModifiedByID, + PlaceID: s.PlaceID, + StateID: s.StateID, + TaxTypeID: s.TaxTypeID, + Type: s.Type, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + } +} +func (obj *TaxInstance) marshalToSwagger() *geo_models.TaxInstance { + return &geo_models.TaxInstance{ + ID: obj.ID, + CountryID: obj.CountryID, + CountyID: obj.CountyID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + PlaceID: obj.PlaceID, + StateID: obj.StateID, + TaxTypeID: obj.TaxTypeID, + Type: obj.Type, + } +} diff --git a/app/taxinstance.go b/app/taxinstance.go index 6369262..d14aa78 100644 --- a/app/taxinstance.go +++ b/app/taxinstance.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/geo/geo_models" ) -// TaxInstanceChannelWrapper wraps the object with the security principal +// TaxInstanceChannelWrapper wraps the object with workflow params type TaxInstanceChannelWrapper struct { Obj geo_models.TaxInstance Principal User diff --git a/app/taxnexuscode-helpers.go b/app/taxnexuscode-helpers.go new file mode 100644 index 0000000..1447a8d --- /dev/null +++ b/app/taxnexuscode-helpers.go @@ -0,0 +1,74 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/geo/geo_models" + "github.com/google/uuid" +) + +func unMarshalTaxnexusCode(s *geo_models.TaxnexusCode) *TaxnexusCode { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + return &TaxnexusCode{ + ID: s.ID, + Active: s.Active, + Code: s.Code, + CreatedByID: s.CreatedByID, + Description: s.Description, + DomainID: s.DomainID, + DomainName: s.DomainName, + LastModifiedByID: s.LastModifiedByID, + Level: s.Level, + Part1: s.Part1, + Part2: s.Part2, + Part3: s.Part3, + Part4: s.Part4, + Part5: s.Part5, + PurchasingRulesetCode: s.PurchasingRulesetCode, + PurchasingRulesetID: s.PurchasingRulesetID, + Ref: s.Ref, + RevenueRulesetCode: s.RevenueRulesetCode, + RevenueRulesetID: s.RevenueRulesetID, + OwnerID: s.OwnerID, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + } +} +func (obj *TaxnexusCode) marshalToSwagger() *geo_models.TaxnexusCode { + swag := geo_models.TaxnexusCode{ + ID: obj.ID, + Active: obj.Active, + Code: obj.Code, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Description: obj.Description, + DomainID: obj.DomainID, + DomainName: obj.DomainName, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + Level: obj.Level, + OwnerID: obj.OwnerID, + Part1: obj.Part1, + Part2: obj.Part2, + Part3: obj.Part3, + Part4: obj.Part4, + Part5: obj.Part5, + PurchasingRulesetCode: obj.PurchasingRulesetCode, + PurchasingRulesetID: obj.PurchasingRulesetID, + Ref: obj.Ref, + RevenueRulesetCode: obj.RevenueRulesetCode, + RevenueRulesetID: obj.RevenueRulesetID, + } + return &swag +} diff --git a/app/taxnexuscode.go b/app/taxnexuscode.go index b1631c5..2199303 100644 --- a/app/taxnexuscode.go +++ b/app/taxnexuscode.go @@ -1,8 +1,12 @@ package app -import "code.tnxs.net/taxnexus/lib/api/geo/geo_models" +import ( + "database/sql" -// TaxnexusCodeChannelWrapper wraps the object with the security principal + "code.tnxs.net/taxnexus/lib/api/geo/geo_models" +) + +// TaxnexusCodeChannelWrapper wraps the object with workflow params type TaxnexusCodeChannelWrapper struct { Obj geo_models.TaxnexusCode Principal User @@ -12,26 +16,26 @@ type TaxnexusCodeChannelWrapper struct { // TaxnexusCode is a first class object type type TaxnexusCode struct { - ID string `json:"id,omitempty"` - Active bool `json:"active,omitempty"` - Code string `json:"code,omitempty"` - CreatedByID string `json:"created_by_id,omitempty"` - CreatedDate string `json:"created_date,omitempty"` - Description string `json:"description,omitempty"` - DomainID string `json:"domain_id,omitempty"` - DomainName string `json:"domain_name,omitempty"` - LastModifiedByID string `json:"last_modified_by_id,omitempty"` - LastModifiedDate string `json:"last_modified_date,omitempty"` - Level string `json:"level,omitempty"` - OwnerID string `json:"owner_id,omitempty"` - Part1 string `json:"part_1,omitempty"` - Part2 string `json:"part_2,omitempty"` - Part3 string `json:"part_3,omitempty"` - Part4 string `json:"part_4,omitempty"` - Part5 string `json:"part_5,omitempty"` - PurchasingRulesetID string `json:"purchasing_ruleset_id,omitempty"` - PurchasingRulesetCode string `json:"purchasing_ruleset_code,omitempty"` - Ref string `json:"ref,omitempty"` - RevenueRulesetID string `json:"revenue_ruleset_id,omitempty"` - RevenueRulesetCode string `json:"revenue_ruleset_code,omitempty"` + ID string + Active bool + Code string + CreatedByID string + CreatedDate sql.NullTime + Description string + DomainID string + DomainName string + LastModifiedByID string + LastModifiedDate sql.NullTime + Level string + OwnerID string + Part1 string + Part2 string + Part3 string + Part4 string + Part5 string + PurchasingRulesetID string + PurchasingRulesetCode string + Ref string + RevenueRulesetID string + RevenueRulesetCode string } diff --git a/app/taxrate.go b/app/taxrate.go index f442ce6..f04bb69 100644 --- a/app/taxrate.go +++ b/app/taxrate.go @@ -2,7 +2,7 @@ package app import "code.tnxs.net/taxnexus/lib/api/geo/geo_models" -// TaxRateChannelWrapper wraps the object with the security principal +// TaxRateChannelWrapper wraps the object with workflow params type TaxRateChannelWrapper struct { Obj geo_models.TaxRate Principal User diff --git a/app/taxtransaction-helpers.go b/app/taxtransaction-helpers.go new file mode 100644 index 0000000..e8ced4f --- /dev/null +++ b/app/taxtransaction-helpers.go @@ -0,0 +1,58 @@ +package app + +import ( + "code.tnxs.net/taxnexus/lib/api/ops/ops_models" +) + +// TaxTransaction is not ingested, hence no UnMarshalTaxTransaction + +func (obj *TaxTransaction) MarshalToSwagger() *ops_models.TaxTransaction { + return &ops_models.TaxTransaction{ + ID: obj.ID, + AccountID: obj.AccountID, + AccountingRuleCode: obj.AccountingRuleCode, + Amount: obj.Amount, + CoordinateID: obj.CoordinateID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + CustomerID: obj.CustomerID, + DisplayName: obj.DisplayName, + EffectiveRate: obj.EffectiveRate, + FilingID: obj.FilingID, + IngestID: obj.IngestID, + InvoiceID: obj.InvoiceID, + InvoiceItemID: obj.InvoiceItemID, + IsSummary: obj.IsSummary, + JobID: obj.JobID, + JournalItemID: obj.JournalItemID, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + OrderID: obj.OrderID, + OrderItemID: obj.OrderItemID, + ParentRef: obj.ParentRef, + PercentTaxable: obj.PercentTaxable, + PeriodID: obj.PeriodID, + PlaceGeocode: obj.PlaceGeoCode, + PlaceID: obj.PlaceID, + POID: obj.PoID, + POItemID: obj.PoItemID, + Posted: obj.Posted, + QuoteID: obj.QuoteID, + QuoteItemID: obj.QuoteItemID, + RatingType: obj.RatingType, + Ref: obj.Ref, + RevenueBase: obj.RevenueBase, + RevenueNet: obj.RevenueNet, + RevenueNotTaxable: obj.RevenueNotTaxable, + TaxExemptRevenue: obj.TaxexemptRevenue, + TaxnexusCodeDisplay: obj.TaxnexusCodeDisplay, + TaxnexusCodeID: obj.TaxnexusCodeID, + TaxOnTax: obj.TaxOnTax, + TaxRate: obj.TaxRate, + TaxTypeAccountID: obj.TaxTypeAccountID, + TaxTypeID: obj.TaxTypeID, + TenantID: obj.TenantID, + UnitBase: obj.UnitBase, + UnitFeeRate: obj.UnitFeeRate, + } +} diff --git a/app/taxtransaction.go b/app/taxtransaction.go index 8318839..ca52801 100644 --- a/app/taxtransaction.go +++ b/app/taxtransaction.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/ops/ops_models" ) -// TaxTransactionChannelWrapper wraps the object with the security principal +// TaxTransactionChannelWrapper wraps the object with workflow params type TaxTransactionChannelWrapper struct { Obj ops_models.TaxTransaction Principal User diff --git a/app/taxtype-helpers.go b/app/taxtype-helpers.go new file mode 100644 index 0000000..56b9e72 --- /dev/null +++ b/app/taxtype-helpers.go @@ -0,0 +1,144 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/geo/geo_models" + "github.com/google/uuid" +) + +// UnMarshalTaxType decodes swagger to a first class object +func UnMarshalTaxType(s *geo_models.TaxType) *TaxType { + if s.ID == "" { + s.ID = uuid.New().String() + } + dateTime, dateErr := time.Parse(dateTimeFormat, s.CreatedDate) + createdDate := sql.NullTime{ + Time: dateTime, + Valid: dateErr == nil, + } + dateTime, dateErr = time.Parse(dateTimeFormat, s.LastModifiedDate) + modifiedDate := sql.NullTime{ + Time: dateTime, + Valid: dateErr == nil, + } + date, dateErr := time.Parse(dateFormat, s.EffectiveDate) + effectiveDate := sql.NullTime{ + Time: date, + Valid: dateErr == nil, + } + date, dateErr = time.Parse(dateFormat, s.EndDate) + endDate := sql.NullTime{ + Time: date, + Valid: dateErr == nil, + } + return &TaxType{ + ID: s.ID, + AccountID: s.AccountID, + AccountingRuleCode: s.AccountingRuleCode, + Active: s.Active, + AgencyType: s.AgencyType, + AgentID: s.AgentID, + Amount: s.Amount, + Category: s.Category, + CollectorDomainID: s.CollectorDomainID, + CompanyID: s.CompanyID, + ContactID: s.ContactID, + CreatedByID: s.CreatedByID, + CreatedDate: createdDate, + Description: s.Description, + EffectiveDate: effectiveDate, + EndDate: endDate, + EnrollmentStatus: s.EnrollmentStatus, + FilingCity: s.FilingCity, + FilingCountry: s.FilingCountry, + FilingEmail: s.FilingEmail, + FilingMethod: s.FilingMethod, + FilingPostalcode: s.FilingPostalCode, + FilingState: s.FilingState, + FilingStreet: s.FilingStreet, + Fractional: s.Fractional, + Frequency: s.Frequency, + GeocodeString: s.GeocodeString, + InterestRate: s.InterestRate, + IsMedicinal: s.IsMedicinal, + IsRecreational: s.IsRecreational, + LastModifiedByID: s.LastModifiedByID, + LastModifiedDate: modifiedDate, + MarkupRate: s.MarkupRate, + Name: s.Name, + OwnerID: s.OwnerID, + Passthrough: s.PassThrough, + PenaltyDays: s.PenaltyDays, + PenaltyRate: s.PenaltyRate, + Rate: s.Rate, + Reference: s.Reference, + RevenueBase: s.RevenueBase, + RevenueNet: s.RevenueNet, + RevenueNotTaxable: s.RevenueNotTaxable, + SalesRegulation: s.SalesRegulation, + Status: s.Status, + TaxnexusCodeID: s.TaxnexusCodeID, + TaxnexusNumber: s.TaxnexusNumber, + TemplateID: s.TemplateID, + UnitBase: s.UnitBase, + Units: s.Units, + } +} + +// MarshalToSwagger encodes a first class object to swagger +func (obj *TaxType) MarshalToSwagger() *geo_models.TaxType { + return &geo_models.TaxType{ + ID: obj.ID, + AccountID: obj.AccountID, + AccountingRuleCode: obj.AccountingRuleCode, + Active: obj.Active, + AgencyType: obj.AgencyType, + AgentID: obj.AgentID, + Amount: obj.Amount, + Category: obj.Category, + CollectorDomainID: obj.CollectorDomainID, + CompanyID: obj.CompanyID, + ContactID: obj.ContactID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormatAlt), + Description: obj.Description, + EffectiveDate: obj.EffectiveDate.Time.Format(dateFormat), + EndDate: obj.EndDate.Time.Format(dateFormat), + EnrollmentStatus: obj.EnrollmentStatus, + FilingCity: obj.FilingCity, + FilingCountry: obj.FilingCountry, + FilingEmail: obj.FilingEmail, + FilingMethod: obj.FilingMethod, + FilingPostalCode: obj.FilingPostalcode, + FilingState: obj.FilingState, + FilingStreet: obj.FilingStreet, + Fractional: obj.Fractional, + Frequency: obj.Frequency, + GeocodeString: obj.GeocodeString, + InterestRate: obj.InterestRate, + IsMedicinal: obj.IsMedicinal, + IsRecreational: obj.IsRecreational, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormatAlt), + MarkupRate: obj.MarkupRate, + Name: obj.Name, + OwnerID: obj.OwnerID, + PassThrough: obj.Passthrough, + PenaltyDays: obj.PenaltyDays, + PenaltyRate: obj.PenaltyRate, + Rate: obj.Rate, + Reference: obj.Reference, + RevenueBase: obj.RevenueBase, + RevenueNet: obj.RevenueNet, + RevenueNotTaxable: obj.RevenueNotTaxable, + SalesRegulation: obj.SalesRegulation, + Status: obj.Status, + TaxnexusCodeID: obj.TaxnexusCodeID, + TaxnexusNumber: obj.TaxnexusNumber, + TemplateID: obj.TemplateID, + UnitBase: obj.UnitBase, + Units: obj.Units, + } +} diff --git a/app/taxtype.go b/app/taxtype.go index 08b4572..9e19de3 100644 --- a/app/taxtype.go +++ b/app/taxtype.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/geo/geo_models" ) -// TaxTypeChannelWrapper wraps the object with the security principal +// TaxTypeChannelWrapper wraps the object with workflow params type TaxTypeChannelWrapper struct { Obj geo_models.TaxType Principal User diff --git a/app/taxtypeaccount-helpers.go b/app/taxtypeaccount-helpers.go new file mode 100644 index 0000000..a010ba5 --- /dev/null +++ b/app/taxtypeaccount-helpers.go @@ -0,0 +1,103 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/regs/regs_models" + "github.com/google/uuid" +) + +func unMarshalTaxTypeAccount(s *regs_models.TaxTypeAccount) *TaxTypeAccount { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModfiedDate) + endDate, e2 := time.Parse(dateFormat, s.EndDate) + startDate, e3 := time.Parse(dateFormat, s.StartDate) + return &TaxTypeAccount{ + ID: s.ID, + AccountID: s.AccountID, + AccountNumber: s.AccountNumber, + Active: s.Active, + Amount: s.Amount, + ContactID: s.ContactID, + CreatedByID: s.CreatedByID, + Description: s.Description, + Interest: s.Interest, + LastModifiedByID: s.LastModfiedByID, + Notes: s.Notes, + ParentFK: s.ParentFK, + Penalty: s.Penalty, + Ref: s.Ref, + ReportedAdjustments: s.ReportedAdjustments, + ReportedDeductions: s.ReportedDeductions, + ReportedNetRevenue: s.ReportedNetRevenue, + ReportedRate: s.ReportedRate, + ReportedRevenue: s.ReportedRevenue, + RevenueBase: s.RevenueBase, + RevenueNet: s.RevenueNet, + RevenueNotTaxable: s.RevenueNotTaxable, + Subtotal: s.Subtotal, + Tax: s.Tax, + TaxOnTax: s.TaxOnTax, + TaxTypeID: s.TaxTypeID, + TenantID: s.TenantID, + TotalAmount: s.TotalAmount, + UnitBase: s.UnitBase, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + EndDate: sql.NullTime{ + Time: endDate, + Valid: e2 == nil, + }, + StartDate: sql.NullTime{ + Time: startDate, + Valid: e3 == nil, + }, + } +} +func (obj *TaxTypeAccount) marshalToSwagger() *regs_models.TaxTypeAccount { + return ®s_models.TaxTypeAccount{ + ID: obj.ID, + AccountID: obj.AccountID, + AccountNumber: obj.AccountNumber, + Active: obj.Active, + Amount: obj.Amount, + ContactID: obj.ContactID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Description: obj.Description, + EndDate: obj.EndDate.Time.Format(dateFormat), + Interest: obj.Interest, + LastModfiedByID: obj.LastModifiedByID, + LastModfiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + Notes: obj.Notes, + ParentFK: obj.ParentFK, + Penalty: obj.Penalty, + Ref: obj.Ref, + ReportedAdjustments: obj.ReportedAdjustments, + ReportedDeductions: obj.ReportedDeductions, + ReportedNetRevenue: obj.ReportedNetRevenue, + ReportedRate: obj.ReportedRate, + ReportedRevenue: obj.ReportedRevenue, + RevenueBase: obj.RevenueBase, + RevenueNet: obj.RevenueNet, + RevenueNotTaxable: obj.RevenueNotTaxable, + StartDate: obj.StartDate.Time.Format(dateFormat), + Subtotal: obj.Subtotal, + Tax: obj.Tax, + TaxOnTax: obj.TaxOnTax, + TaxTypeID: obj.TaxTypeID, + TenantID: obj.TenantID, + TotalAmount: obj.TotalAmount, + UnitBase: obj.UnitBase, + } +} diff --git a/app/taxtypeaccount.go b/app/taxtypeaccount.go index 51745aa..c147c0f 100644 --- a/app/taxtypeaccount.go +++ b/app/taxtypeaccount.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/regs/regs_models" ) -// TaxTypeAccountChannelWrapper wraps the object with the security principal +// TaxTypeAccountChannelWrapper wraps the object with workflow params type TaxTypeAccountChannelWrapper struct { Obj regs_models.TaxTypeAccount Principal User diff --git a/app/template-helpers.go b/app/template-helpers.go new file mode 100644 index 0000000..745e57c --- /dev/null +++ b/app/template-helpers.go @@ -0,0 +1,64 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/devops/devops_models" + "github.com/google/uuid" +) + +// UnMarshalTemplateSwagger decodes swagger to a first class object +func UnMarshalTemplateSwagger(s *devops_models.Template) *Template { + if s.ID == "" { + s.ID = uuid.New().String() + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + return &Template{ + ID: s.ID, + CompanyID: s.CompanyID, + CreatedByID: s.CreatedByID, + Description: s.Description, + HTML: string(s.HTML), + IsActive: s.IsActive, + IsMaster: s.IsMaster, + LastModifiedByID: s.LastModifiedByID, + Name: s.Name, + ObjectType: s.ObjectType, + RecordTypeName: s.RecordTypeName, + TenantID: s.TenantID, + Type: s.Type, + URL: s.URL, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + } +} + +// MarshalToSwagger encodes a first class object to swagger +func (obj *Template) MarshalToSwagger() *devops_models.Template { + return &devops_models.Template{ + ID: obj.ID, + CompanyID: obj.CompanyID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Description: obj.Description, + HTML: []byte(obj.HTML), + IsActive: obj.IsActive, + IsMaster: obj.IsMaster, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + Name: obj.Name, + ObjectType: obj.ObjectType, + RecordTypeName: obj.RecordTypeName, + Type: obj.Type, + TenantID: obj.TenantID, + URL: obj.URL, + } +} diff --git a/app/template.go b/app/template.go index 7074e7e..3146291 100644 --- a/app/template.go +++ b/app/template.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/devops/devops_models" ) -// TemplateChannelWrapper wraps the object with the security principal +// TemplateChannelWrapper wraps the object with workflow params type TemplateChannelWrapper struct { Obj devops_models.Template Principal User diff --git a/app/tenant-helpers.go b/app/tenant-helpers.go new file mode 100644 index 0000000..5dd9947 --- /dev/null +++ b/app/tenant-helpers.go @@ -0,0 +1,84 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/devops/devops_models" + "github.com/google/uuid" +) + +// UnMarshalTenant decodes swagger to a first class object +func UnMarshalTenant(s *devops_models.Tenant) *Tenant { + if s.ID == "" { + s.ID = uuid.New().String() + } + databases := []*Database{} + for _, itm := range s.Databases { + databases = append(databases, UnMarshalDatabase(itm)) + } + tenantUsers := []*TenantUser{} + for _, itm := range s.TenantUsers { + tenantUsers = append(tenantUsers, UnMarshalTenantUser(itm)) + } + roles := []*Role{} + for _, itm := range s.Roles { + roles = append(roles, UnMarshalRole(itm)) + } + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + return &Tenant{ + ID: s.ID, + AccountID: s.AccountID, + Active: s.Active, + CreatedByID: s.CreatedByID, + Databases: databases, + LastModifiedByID: s.LastModifiedByID, + Roles: roles, + Status: s.Status, + TenantName: s.TenantName, + TenantUsers: tenantUsers, + Type: s.Type, + Version: s.Version, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + } +} + +// MarshalToSwagger encodes a first class object to swagger +func (obj *Tenant) MarshalToSwagger() *devops_models.Tenant { + databases := []*devops_models.Database{} + for _, itm := range obj.Databases { + databases = append(databases, itm.MarshalToSwagger()) + } + tenantUsers := []*devops_models.TenantUser{} + for _, itm := range obj.TenantUsers { + tenantUsers = append(tenantUsers, itm.MarshalToSwagger()) + } + roles := []*devops_models.Role{} + for _, itm := range obj.Roles { + roles = append(roles, itm.MarshalToSwagger()) + } + return &devops_models.Tenant{ + ID: obj.ID, + AccountID: obj.AccountID, + Active: obj.Active, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + Databases: databases, + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + Status: obj.Status, + TenantName: obj.TenantName, + TenantUsers: tenantUsers, + Roles: roles, + Type: obj.Type, + Version: obj.Version, + } +} diff --git a/app/tenant.go b/app/tenant.go index 52c3a4a..8c3f9b3 100644 --- a/app/tenant.go +++ b/app/tenant.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/devops/devops_models" ) -// TenantChannelWrapper wraps the object with the security principal +// TenantChannelWrapper wraps the object with workflow params type TenantChannelWrapper struct { Obj devops_models.Tenant Principal User diff --git a/app/tenantuser-helpers.go b/app/tenantuser-helpers.go new file mode 100644 index 0000000..57fc348 --- /dev/null +++ b/app/tenantuser-helpers.go @@ -0,0 +1,44 @@ +package app + +import "code.tnxs.net/taxnexus/lib/api/devops/devops_models" + +func UnMarshalTenantUser(s *devops_models.TenantUser) *TenantUser { + return &TenantUser{ + AccessLevel: s.AccessLevel, + AccountID: s.AccountID, + CompanyName: s.CompanyName, + TenantActive: s.TenantActive, + TenantID: s.TenantID, + TenantName: s.TenantName, + TenantStatus: s.TenantStatus, + TenantType: s.TenantType, + TenantVersion: s.TenantVersion, + UserID: s.UserID, + Auth0UserID: s.Auth0UserID, + ContactID: s.ContactID, + TaxnexusAccount: s.TaxnexusAccount, + UserEmail: s.UserEmail, + UserFullName: s.UserFullName, + Username: s.Username, + } +} +func (obj *TenantUser) MarshalToSwagger() *devops_models.TenantUser { + return &devops_models.TenantUser{ + AccessLevel: obj.AccessLevel, + AccountID: obj.AccountID, + Auth0UserID: obj.Auth0UserID, + CompanyName: obj.CompanyName, + ContactID: obj.ContactID, + TaxnexusAccount: obj.TaxnexusAccount, + TenantActive: obj.TenantActive, + TenantID: obj.TenantID, + TenantName: obj.TenantName, + TenantStatus: obj.TenantStatus, + TenantType: obj.TenantType, + TenantVersion: obj.TenantVersion, + UserEmail: obj.UserEmail, + UserFullName: obj.UserFullName, + UserID: obj.UserID, + Username: obj.Username, + } +} diff --git a/app/tenantuser.go b/app/tenantuser.go index 73d6b4b..14897db 100644 --- a/app/tenantuser.go +++ b/app/tenantuser.go @@ -2,7 +2,7 @@ package app import "code.tnxs.net/taxnexus/lib/api/devops/devops_models" -// TenantUserChannelWrapper wraps the object with the security principal +// TenantUserChannelWrapper wraps the object with workflow params type TenantUserChannelWrapper struct { Obj devops_models.TenantUser Principal User diff --git a/app/total-helpers.go b/app/total-helpers.go new file mode 100644 index 0000000..d74c5f2 --- /dev/null +++ b/app/total-helpers.go @@ -0,0 +1,37 @@ +package app + +import "code.tnxs.net/taxnexus/lib/api/ops/ops_models" + +func (obj *Total) MarshalToSwagger() *ops_models.Total { + var items []*ops_models.TotalItem + if obj.TotalItems != nil { + items = []*ops_models.TotalItem{} + for _, itm := range obj.TotalItems { + items = append(items, &ops_models.TotalItem{ + ID: itm.ID, + Amount: itm.Amount, + Count: itm.Count, + DisplayName: itm.DisplayName, + TenantID: itm.TenantID, + }) + } + } + return &ops_models.Total{ + ID: obj.ID, + Amount: obj.Amount, + BusinessTax: obj.BusinessTax, + BusinessTaxRate: obj.BusinessTaxRate, + CannabisTax: obj.CannabisTax, + CannabisTaxRate: obj.CannabisTaxRate, + Items: items, + MonthlyAmount: obj.MonthlyAmount, + ObjectType: obj.ObjectType, + PurchaseAmount: obj.PurchaseAmount, + SalesTaxRate: obj.SalesTaxRate, + SalesTax: obj.SalesTax, + ShippingHandling: obj.ShippingHandling, + Subtotal: obj.Subtotal, + TelecomTax: obj.TelecomTax, + TelecomTaxRate: obj.TelecomTaxRate, + } +} diff --git a/app/total.go b/app/total.go index a532091..c1c5933 100644 --- a/app/total.go +++ b/app/total.go @@ -2,7 +2,7 @@ package app import "code.tnxs.net/taxnexus/lib/api/ops/ops_models" -// TotalChannelWrapper wraps the object with the security principal +// TotalChannelWrapper wraps the object with workflow params type TotalChannelWrapper struct { Obj ops_models.Total Principal User diff --git a/app/totalitem.go b/app/totalitem.go index cd7c6be..b5c824f 100644 --- a/app/totalitem.go +++ b/app/totalitem.go @@ -2,7 +2,7 @@ package app import "code.tnxs.net/taxnexus/lib/api/ops/ops_models" -// TotalItemChannelWrapper wraps the object with the security principal +// TotalItemChannelWrapper wraps the object with workflow params type TotalItemChannelWrapper struct { Obj ops_models.TotalItem Principal User @@ -14,7 +14,7 @@ type TotalItemChannelWrapper struct { type TotalItem struct { ID string TotalTaxItems []*TotalTaxItem - Displayname string + DisplayName string Amount float64 Count int64 TenantID string diff --git a/app/totaltaxitem.go b/app/totaltaxitem.go index be19085..2cc749f 100644 --- a/app/totaltaxitem.go +++ b/app/totaltaxitem.go @@ -2,7 +2,7 @@ package app import "code.tnxs.net/taxnexus/lib/api/ops/ops_models" -// TotalTaxItemChannelWrapper wraps the object with the security principal +// TotalTaxItemChannelWrapper wraps the object with workflow params type TotalTaxItemChannelWrapper struct { Obj ops_models.TotalTaxItem Principal User diff --git a/app/transaction-helpers.go b/app/transaction-helpers.go new file mode 100644 index 0000000..1819324 --- /dev/null +++ b/app/transaction-helpers.go @@ -0,0 +1,45 @@ +package app + +import ( + "database/sql" + "time" + + "code.tnxs.net/taxnexus/lib/api/regs/regs_models" +) + +func UnMarshalTransaction(s *regs_models.Transaction) *Transaction { + createdDate, e0 := time.Parse(dateTimeFormat, s.CreatedDate) + lastModfiedDate, e1 := time.Parse(dateTimeFormat, s.LastModifiedDate) + return &Transaction{ + ID: s.ID, + AccountID: s.AccountID, + CreatedByID: s.CreatedByID, + LastModifiedByID: s.LastModifiedByID, + TaxTransactionID: s.TaxTransactionID, + TaxTypeID: s.TaxTypeID, + TenantID: s.TenantID, + Valid: s.Valid, + CreatedDate: sql.NullTime{ + Time: createdDate, + Valid: e0 == nil, + }, + LastModifiedDate: sql.NullTime{ + Time: lastModfiedDate, + Valid: e1 == nil, + }, + } +} +func (obj *Transaction) MarshalToSwagger() *regs_models.Transaction { + return ®s_models.Transaction{ + ID: obj.ID, + AccountID: obj.AccountID, + CreatedByID: obj.CreatedByID, + CreatedDate: obj.CreatedDate.Time.Format(dateTimeFormat), + LastModifiedByID: obj.LastModifiedByID, + LastModifiedDate: obj.LastModifiedDate.Time.Format(dateTimeFormat), + TaxTransactionID: obj.TaxTransactionID, + TaxTypeID: obj.TaxTypeID, + TenantID: obj.TenantID, + Valid: obj.Valid, + } +} diff --git a/app/transaction.go b/app/transaction.go index db02c51..1f12c02 100644 --- a/app/transaction.go +++ b/app/transaction.go @@ -6,7 +6,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/regs/regs_models" ) -// TransactionItemChannelWrapper wraps the object with the security principal +// TransactionItemChannelWrapper wraps the object with workflow params type TransactionItemChannelWrapper struct { Obj regs_models.Transaction Principal User diff --git a/app/user.go b/app/user.go index eb6afe8..291ffec 100644 --- a/app/user.go +++ b/app/user.go @@ -5,7 +5,7 @@ import ( "github.com/go-openapi/runtime" ) -// UserChannelWrapper wraps the object with the security principal +// UserChannelWrapper wraps the object with workflow params type UserChannelWrapper struct { Obj devops_models.User Principal User diff --git a/app/userrole-helpers.go b/app/userrole-helpers.go new file mode 100644 index 0000000..e69de29 diff --git a/app/userrole.go b/app/userrole.go index e3f1473..3dd40b8 100644 --- a/app/userrole.go +++ b/app/userrole.go @@ -2,7 +2,7 @@ package app import "code.tnxs.net/taxnexus/lib/api/devops/devops_models" -// UserRoleChannelWrapper wraps the object with the security principal +// UserRoleChannelWrapper wraps the object with workflow params type UserRoleChannelWrapper struct { Obj devops_models.UserRole Principal User diff --git a/go.mod b/go.mod index bbcc194..0deb0f3 100644 --- a/go.mod +++ b/go.mod @@ -9,6 +9,7 @@ require ( github.com/go-openapi/swag v0.19.12 github.com/go-openapi/validate v0.20.0 github.com/go-sql-driver/mysql v1.5.0 + github.com/google/uuid v1.1.4 github.com/prometheus/client_golang v1.9.0 github.com/rs/cors v1.7.0 github.com/spf13/viper v1.7.1 diff --git a/rules/new-developer.go b/rules/new-developer.go index 659d882..b429bcd 100644 --- a/rules/new-developer.go +++ b/rules/new-developer.go @@ -11,22 +11,29 @@ import ( // NewDeveloperWrapper wraps a contact, account, payment method and a user identifier (app.User) type NewDeveloperWrapper struct { - contact crm_models.Contact - account crm_models.Account - paymentMethod ops_models.PaymentMethod - principal app.User + Contact crm_models.Contact + Account crm_models.Account + PaymentMethod ops_models.PaymentMethod + Principal app.User + SagaID string + SagaType string } -// NewDeveloperWorkflow is a workflow -func NewDeveloperWorkflow(ctx workflow.Context, payload *NewDeveloperWrapper) error { +// NewDeveloperWorkflow is a Temporal workflow +func NewDeveloperWorkflow( + ctx workflow.Context, + payload *NewDeveloperWrapper, +) error { ctx = workflow.WithActivityOptions(ctx, workflow.ActivityOptions{ StartToCloseTimeout: time.Minute, }) err := workflow.ExecuteActivity(ctx, StoreContactActivity, &app.ContactChannelWrapper{ - Obj: payload.contact, - Principal: payload.principal, + Obj: payload.Contact, + Principal: payload.Principal, + SagaID: payload.SagaID, + SagaType: payload.SagaType, }).Get(ctx, nil) if err != nil { return err @@ -34,8 +41,10 @@ func NewDeveloperWorkflow(ctx workflow.Context, payload *NewDeveloperWrapper) er err = workflow.ExecuteActivity(ctx, StoreAccountActivity, &app.AccountChannelWrapper{ - Obj: payload.account, - Principal: payload.principal, + Obj: payload.Account, + Principal: payload.Principal, + SagaID: payload.SagaID, + SagaType: payload.SagaType, }).Get(ctx, nil) if err != nil { return err @@ -43,8 +52,10 @@ func NewDeveloperWorkflow(ctx workflow.Context, payload *NewDeveloperWrapper) er err = workflow.ExecuteActivity(ctx, StorePaymentMethodActivity, &app.PaymentMethodChannelWrapper{ - Obj: payload.paymentMethod, - Principal: payload.principal, + Obj: payload.PaymentMethod, + Principal: payload.Principal, + SagaID: payload.SagaID, + SagaType: payload.SagaType, }).Get(ctx, nil) if err != nil { return err @@ -52,8 +63,10 @@ func NewDeveloperWorkflow(ctx workflow.Context, payload *NewDeveloperWrapper) er err = workflow.ExecuteActivity(ctx, NotifyContactActivity, &app.ContactChannelWrapper{ - Obj: payload.contact, - Principal: payload.principal, + Obj: payload.Contact, + Principal: payload.Principal, + SagaID: payload.SagaID, + SagaType: payload.SagaType, }).Get(ctx, nil) if err != nil { return err diff --git a/rules/new-lead.go b/rules/new-lead.go index 8178002..9b07850 100644 --- a/rules/new-lead.go +++ b/rules/new-lead.go @@ -5,7 +5,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/crm/crm_models" "code.tnxs.net/taxnexus/lib/app" - "go.temporal.io/sdk/workflow" + temporal_workflow "go.temporal.io/sdk/workflow" ) // NewLeadWrapper wraps a Lead and a user identifier (app.User) @@ -16,26 +16,33 @@ type NewLeadWrapper struct { SagaType string } -// NewLeadWorkflow is a workflow -func NewLeadWorkflow(ctx workflow.Context, payload *NewLeadWrapper) error { - ctx = workflow.WithActivityOptions(ctx, workflow.ActivityOptions{ - StartToCloseTimeout: time.Minute, - }) - err := workflow.ExecuteActivity(ctx, - StoreLeadActivity, - &app.LeadChannelWrapper{ - Obj: payload.Lead, - Principal: payload.Principal, - }).Get(ctx, nil) +// NewLeadWorkflow is a Temporal workflow +func NewLeadWorkflow(ctx temporal_workflow.Context, payload *NewLeadWrapper) error { + ctx = temporal_workflow. + WithActivityOptions( + ctx, + temporal_workflow.ActivityOptions{ + StartToCloseTimeout: time.Minute, + }) + err := temporal_workflow. + ExecuteActivity( + ctx, + StoreLeadActivity, + &app.LeadChannelWrapper{ + Obj: payload.Lead, + Principal: payload.Principal, + }).Get(ctx, nil) if err != nil { return err } - err = workflow.ExecuteActivity(ctx, - NotifyLeadActivity, - &app.LeadChannelWrapper{ - Obj: payload.Lead, - Principal: payload.Principal, - }).Get(ctx, nil) + err = temporal_workflow. + ExecuteActivity( + ctx, + NotifyLeadActivity, + &app.LeadChannelWrapper{ + Obj: payload.Lead, + Principal: payload.Principal, + }).Get(ctx, nil) if err != nil { return err } diff --git a/swagger/apex-taxnexus.yaml b/swagger/apex-taxnexus.yaml new file mode 100644 index 0000000..463faa4 --- /dev/null +++ b/swagger/apex-taxnexus.yaml @@ -0,0 +1,4605 @@ +swagger: "2.0" +info: + title: "apex" + version: 1.2.7 + description: "Salesforce Gateway Apex Client" + termsOfService: "http://taxnexus.net/terms/" + contact: + email: "noc@taxnexus.net" + license: + name: "Proprietary - Copyright (c) 2018-2020 by Taxnexus, Inc." +schemes: + - "http" +basePath: "/v1" +host: "localhost" +securityDefinitions: + ApiKeyAuth: + type: apiKey + in: header + name: X-API-Key +security: + - ApiKeyAuth: [] +consumes: + - application/json +produces: + - application/json +parameters: + accountIdQuery: + description: Taxnexus Record Id of an Account + in: query + name: accountId + required: false + type: string + accountIdQueryRequired: + description: Taxnexus Record Id of an Account + in: query + name: accountId + required: true + type: string + accountNumberQuery: + description: + The Taxnexus Account Number of the Account to be used a record + retrieval + in: query + name: accountNumber + required: false + type: string + accountRequest: + description: An array of new Account records + in: body + name: accountsRequest + required: true + schema: + $ref: "#/definitions/AccountRequest" + accountTypeQuery: + description: The Type of this Object + in: query + name: type + required: false + type: string + activeQuery: + description: Retrieve only active records? + in: query + name: active + required: false + type: boolean + addressQuery: + description: Postal Address URL encoded; partial addresses allowed + in: query + name: address + required: false + type: string + authorityIdQuery: + description: Taxnexus Id of the Authority to be retrieved + in: query + name: authorityId + required: false + type: string + authorityRequestBody: + description: A request with an array of Authority Objects + in: body + name: authorityRequest + required: true + schema: + $ref: "#/definitions/AuthorityRequest" + backendIdQuery: + description: Taxnexus Id of the Backend to be retrieved + in: query + name: backendId + required: false + type: string + companyIdQuery: + description: Taxnexus Id of the Company to be retrieved + in: query + name: companyId + required: false + type: string + contactIdQuery: + description: Taxnexus Record Id of a Contact + in: query + name: contactId + required: false + type: string + contactRequest: + description: An array of new Contact records + in: body + name: contactRequest + required: true + schema: + $ref: "#/definitions/ContactRequest" + countryIdQuery: + description: The Country Taxnexus ID + in: query + name: countryId + required: false + type: string + countryQuery: + description: The Country abbreviation (2 char) + in: query + name: country + required: false + type: string + countyIdQuery: + description: The ID of this Object + in: query + name: id + required: false + type: string + countyQuery: + description: The County Name + in: query + name: county + required: false + type: string + dateFromQuery: + description: The Starting Date for an object retrieval + in: query + name: dateFrom + required: false + type: string + dateToQuery: + description: The Ending Date for an object retrieval + in: query + name: dateTo + required: false + type: string + domainIdQuery: + description: Taxnexus Id of the Domain to be retrieved + in: query + name: domainId + required: false + type: string + domainQuery: + description: "The Tax Domain to rate (cannabis, sales or telecom)" + in: query + name: domain + required: false + type: string + filingIdQuery: + description: Taxnexus Id of the Filing to be retrieved + in: query + name: filingId + required: false + type: string + filingRequest: + description: A request with an array of Filing Objects + in: body + name: filingRequest + required: true + schema: + $ref: "#/definitions/FilingRequest" + filingTypeIdQuery: + description: Taxnexus Record Id of a Filing + in: query + name: filingTypeId + required: false + type: string + filingTypeRequest: + description: A request with an array of FilingType Objects + in: body + name: FilingTypeRequest + required: true + schema: + $ref: "#/definitions/FilingTypeRequest" + ingestIdQuery: + description: Taxnexus Record Id of an Ingest + in: query + name: ingestId + required: false + type: string + ingestRequest: + description: An array of new Ingest records + in: body + name: ingestRequest + required: true + schema: + $ref: "#/definitions/IngestRequest" + jobIdQuery: + description: Taxnexus Record Id of a Job record + in: query + name: jobId + required: false + type: string + jobRequest: + description: An array of new Job records + in: body + name: JobtRequest + required: true + schema: + $ref: "#/definitions/JobRequest" + limitQuery: + default: 100 + description: "How many objects to return at one time" + format: int64 + in: query + name: limit + required: false + type: integer + nameQuery: + description: The Name of this Object + in: query + name: name + required: false + type: string + licenseIdQuery: + description: Taxnexus Id of the License to be retrieved + in: query + name: licenseId + required: false + type: string + licenseTypeIdQuery: + description: Taxnexus Id of the License Type to be retrieved + in: query + name: licensetypeId + required: false + type: string + offsetQuery: + default: 0 + description: How many objects to skip? (default 0) + format: int64 + in: query + name: offset + required: false + type: integer + periodIdQuery: + description: Taxnexus Record Id of a Period + in: query + name: periodId + required: false + type: string + placeIdQuery: + description: The City name (must be accompanied by State) + in: query + name: placeId + required: false + type: string + placeQuery: + description: The City name (must be accompanied by State) + in: query + name: place + required: false + type: string + stateIdQuery: + description: The State or Province abbreviation (2 char) + in: query + name: stateId + required: false + type: string + stateQuery: + description: The State or Province abbreviation (2 char) + in: query + name: state + required: false + type: string + taxTypeAccountIdQuery: + description: Taxnexus Id of the Tax Type Account to be retrieved + in: query + name: taxtypeaccountId + required: false + type: string + taxTypeIdQuery: + description: Taxnexus Id of the Tax Type to be retrieved + in: query + name: taxtypeId + required: false + type: string + submissionIdQuery: + description: Taxnexus Id of the Submisssion to be retrieved + in: query + name: submissionId + required: false + type: string + submissionRequestBody: + description: An array of new Submission records + in: body + name: submisssionsRequest + required: true + schema: + $ref: "#/definitions/SubmissionRequest" + taxnexuscodeIdQuery: + description: Taxnexus Id of the Taxnexus Code to be retrieved + in: query + name: taxnexuscodeId + required: false + type: string + templateIdQuery: + description: Taxnexus Id of the Template to be retrieved + in: query + name: templateId + required: false + type: string + typeQuery: + description: The Type of this Object + in: query + name: type + required: false + type: string + notebookIdQuery: + description: Template ID + in: query + name: notebookId + type: string + notebookRequest: + description: An array of Notebook records + in: body + name: NotebookRequest + required: true + schema: + $ref: "#/definitions/NotebookRequest" +responses: + AccessForbidden: + description: "Access forbidden, account lacks access" + schema: + $ref: "#/definitions/Error" + AccountResponse: + description: Taxnexus Response with Account objects + schema: + $ref: "#/definitions/AccountResponse" + AccountingRuleResponse: + description: Taxnexus Response with Accounting Rule objects + schema: + $ref: "#/definitions/AccountingRuleResponse" + AccountingRulesetResponse: + description: Taxnexus Response with Accounting Ruleset objects + schema: + $ref: "#/definitions/AccountingRulesetResponse" + AuthorityResponse: + description: An array of Authority objects + schema: + $ref: "#/definitions/AuthorityResponse" + BackendResponse: + description: Taxnexus Response with an array of Backend Objects + schema: + $ref: "#/definitions/BackendResponse" + CompanyResponse: + description: Taxnexus Response with Company objects + schema: + $ref: "#/definitions/CompanyResponse" + Conflict: + description: Conflict + schema: + $ref: "#/definitions/Error" + ContactResponse: + description: Taxnexus Response with Contact objects + schema: + $ref: "#/definitions/ContactResponse" + CountryResponse: + description: Taxnexus Response with an array of Country objects + schema: + $ref: "#/definitions/CountryResponse" + CountyResponse: + description: Taxnexus Response with an array of County objects + schema: + $ref: "#/definitions/CountyResponse" + DomainResponse: + description: Taxnexus Response with an array of Domain objects + schema: + $ref: "#/definitions/DomainResponse" + FilingResponse: + description: Taxnexus Response with an array of Filing objects + schema: + $ref: "#/definitions/FilingResponse" + FilingTypeResponse: + description: Taxnexus Response with an array of FilingType objects + schema: + $ref: "#/definitions/FilingTypeResponse" + GlAccountResponse: + description: An array of GL Account Objects + schema: + $ref: "#/definitions/GlAccountResponse" + GlBalanceResponse: + description: An array of GL Balance Objects + schema: + $ref: "#/definitions/GlBalanceResponse" + IngestResponse: + description: Taxnexus Response with Ingest objects + schema: + $ref: "#/definitions/IngestResponse" + InvalidDataError: + description: Invalid data was sent + schema: + $ref: "#/definitions/InvalidError" + JobResponse: + description: Taxnexus Response with Job objects + schema: + $ref: "#/definitions/JobResponse" + NotFound: + description: Resource was not found + schema: + $ref: "#/definitions/Error" + PeriodResponse: + description: Taxnexus Response with Job objects + schema: + $ref: "#/definitions/PeriodResponse" + PlaceResponse: + description: Taxnexus Response with an array of Place objects + schema: + $ref: "#/definitions/PlaceResponse" + ServerError: + description: Server Internal Error + schema: + $ref: "#/definitions/Error" + StateResponse: + description: Taxnexus Response with an array of State objects + schema: + $ref: "#/definitions/StateResponse" + TaxTypeResponse: + description: Taxnexus Response with an array of Tax Type objects + schema: + $ref: "#/definitions/TaxTypeResponse" + TaxTypeAccountResponse: + description: An array of TaxTypeAccount objects + schema: + $ref: "#/definitions/TaxTypeAccountResponse" + SubmissionResponse: + description: Taxnexus Response with Submission objects + schema: + $ref: "#/definitions/SubmissionResponse" + TaxnexusCodeResponse: + description: + Taxnexus Response with an array of Taxnexus Code objects + schema: + $ref: "#/definitions/TaxnexusCodeResponse" + TemplateResponse: + description: Taxnexus Response with an array of Template objects + schema: + $ref: "#/definitions/TemplateResponse" + Unauthorized: + description: "Access unauthorized, invalid API-KEY was used" + schema: + $ref: "#/definitions/Error" + UnprocessableEntity: + description: "Unprocessable Entity, likely a bad parameter" + schema: + $ref: "#/definitions/Error" + NotebookResponse: + description: Taxnexus Response with Notebook objects + schema: + $ref: "#/definitions/NotebookResponse" + LicenseResponse: + description: An array of License Objects + schema: + $ref: "#/definitions/LicenseResponse" + LicenseTypeResponse: + description: An array of License Type Objects + schema: + $ref: "#/definitions/LicenseTypeResponse" +paths: + /accountingrules: + get: + description: Return a list of Periods for an Account + operationId: getAccountingRules + parameters: + - $ref: "#/parameters/accountIdQuery" + responses: + "200": + $ref: "#/responses/AccountingRulesetResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Accounting Rulesets + tags: + - AccountingRules + /accountingrulesets: + get: + description: Return a list of Periods for an Account + operationId: getAccountingRulesets + parameters: + - $ref: "#/parameters/accountIdQuery" + responses: + "200": + $ref: "#/responses/AccountingRulesetResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Accounting Rulesets + tags: + - AccountingRulesets + /accounts: + get: + description: Return a list of all available Accounts + operationId: getAccounts + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/activeQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/accountNumberQuery" + - $ref: "#/parameters/nameQuery" + - $ref: "#/parameters/accountTypeQuery" + responses: + "200": + $ref: "#/responses/AccountResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of accounts + tags: + - Accounts + post: + description: Account record to be added + operationId: postAccounts + parameters: + - $ref: "#/parameters/accountRequest" + responses: + "200": + $ref: "#/responses/AccountResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Add a new account to Taxnexus + tags: + - Accounts + put: + description: Update a single account specified by accountId + operationId: putAccount + parameters: + - $ref: "#/parameters/accountRequest" + responses: + "200": + $ref: "#/responses/AccountResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Update a single account + tags: + - Accounts + /authorities: + get: + description: Return a list of available Authorities + operationId: getAuthorities + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/authorityIdQuery" + - $ref: "#/parameters/activeQuery" + responses: + "200": + $ref: "#/responses/AuthorityResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Authorities + tags: + - Authorities + /backends: + get: + description: Return a list of Backends + operationId: getBackends + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/accountNumberQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/backendIdQuery" + - $ref: "#/parameters/nameQuery" + responses: + "200": + $ref: "#/responses/BackendResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Backends + tags: + - Backends + /companies: + get: + description: Retrieve a Company record from the datastore + operationId: getCompanies + parameters: + - $ref: "#/parameters/companyIdQuery" + responses: + "200": + $ref: "#/responses/CompanyResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a Company record + tags: + - Companies + /contacts: + get: + description: Retrieve Contact records from the datastore + operationId: getContacts + parameters: + - $ref: "#/parameters/contactIdQuery" + responses: + "200": + $ref: "#/responses/ContactResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a Contact record + tags: + - Contacts + post: + description: Contacts record to be added + operationId: postContacts + parameters: + - $ref: "#/parameters/contactRequest" + responses: + "200": + $ref: "#/responses/ContactResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Add a new Contacts to Taxnexus + tags: + - Contacts + /counties: + get: + description: "Retrieve Counties, filter with parameters" + operationId: getCounties + parameters: + - $ref: "#/parameters/stateQuery" + - $ref: "#/parameters/countyQuery" + - $ref: "#/parameters/countyIdQuery" + responses: + "200": + $ref: "#/responses/CountyResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Retrieve Counties + tags: + - Counties + /countries: + get: + description: "Retrieve Countries, filter with parameters" + operationId: getCountries + parameters: + - $ref: "#/parameters/countryIdQuery" + responses: + "200": + $ref: "#/responses/CountryResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Retrieve Countries + tags: + - Countries + /domains: + get: + operationId: getDomains + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/domainQuery" + - $ref: "#/parameters/domainIdQuery" + - $ref: "#/parameters/activeQuery" + responses: + "200": + $ref: "#/responses/DomainResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get Domain records + tags: + - Domains + /filings: + get: + description: Return a list of available Regulatory Filings + operationId: getFilings + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/domainQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/filingIdQuery" + - $ref: "#/parameters/activeQuery" + responses: + "200": + $ref: "#/responses/FilingResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Filings + tags: + - Filings + post: + description: Create new Filings + operationId: postFilings + parameters: + - $ref: "#/parameters/filingRequest" + responses: + "200": + $ref: "#/responses/FilingResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Create new Filings + tags: + - Filings + put: + description: + Update all the fields in a Filing record identified by Taxnexus + ID + operationId: putFilings + parameters: + - $ref: "#/parameters/filingRequest" + responses: + "200": + $ref: "#/responses/FilingResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Update a Filing + tags: + - Filings + /filingtypes: + get: + description: Return a list of available Regulatory FilingTypes + operationId: getFilingTypes + parameters: + - $ref: "#/parameters/filingTypeIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/FilingTypeResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of FilingTypes + tags: + - FilingTypes + post: + description: Create new FilingTypes + operationId: postFilingTypes + parameters: + - $ref: "#/parameters/filingTypeRequest" + responses: + "200": + $ref: "#/responses/FilingTypeResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Create new FilingTypes + tags: + - FilingTypes + put: + description: + Update all the fields in a FilingType record identified by + Taxnexus ID + operationId: putFilingTypes + parameters: + - $ref: "#/parameters/filingTypeRequest" + responses: + "200": + $ref: "#/responses/FilingTypeResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Update a FilingType + tags: + - FilingTypes + /glaccounts: + get: + description: Return a list of available General Ledger Accounts + operationId: getGlAccounts + parameters: + - $ref: "#/parameters/accountIdQueryRequired" + responses: + "200": + $ref: "#/responses/GlAccountResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of General Ledger Accounts + tags: + - GlAccounts + /glbalances: + get: + description: + Return a list of General Ledger Account Balances for a Taxnexus + Account + operationId: getGlBalances + parameters: + - $ref: "#/parameters/accountIdQueryRequired" + responses: + "200": + $ref: "#/responses/GlBalanceResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of General Ledger Account Balances + tags: + - GlBalances + /ingests: + get: + description: Return a list of Ingest records + operationId: getIngests + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/ingestIdQuery" + responses: + "200": + $ref: "#/responses/IngestResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list Ingests + tags: + - Ingests + post: + description: Create a new Ingest + operationId: postIngests + parameters: + - $ref: "#/parameters/ingestRequest" + responses: + "200": + $ref: "#/responses/IngestResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Create new Ingests + tags: + - Ingests + put: + description: Update Ingests + operationId: putIngests + parameters: + - $ref: "#/parameters/ingestRequest" + responses: + "200": + $ref: "#/responses/IngestResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Update Ingests + tags: + - Ingests + /jobs: + get: + description: Return a list of Job records from the datastore + operationId: getJobs + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/accountNumberQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/jobIdQuery" + responses: + "200": + $ref: "#/responses/JobResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list Jobs + tags: + - Jobs + post: + description: Create and enqueue Jobs in Taxnexus + operationId: postJobs + parameters: + - $ref: "#/parameters/jobRequest" + responses: + "200": + $ref: "#/responses/JobResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Create new Jobs + tags: + - Jobs + put: + description: Update Jobs in Taxnexus + operationId: putJobs + parameters: + - $ref: "#/parameters/jobRequest" + responses: + "200": + $ref: "#/responses/JobResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Update Jobs + tags: + - Jobs + /licenses: + get: + description: "Retrieve all licenses, filter with parameters" + operationId: getLicenses + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/licenseIdQuery" + - $ref: "#/parameters/activeQuery" + responses: + "200": + $ref: "#/responses/LicenseResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Retrieve licenses + tags: + - Licenses + post: + description: Create new Licenses + operationId: postLicenses + parameters: + - description: The new licenses + in: body + name: licenseRequest + schema: + $ref: "#/definitions/LicenseRequest" + responses: + "200": + $ref: "#/responses/LicenseResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Create new Licenses + tags: + - Licenses + put: + description: Add or update licenses + operationId: putLicenses + parameters: + - description: The updated licenses + in: body + name: licenseRequest + schema: + $ref: "#/definitions/LicenseRequest" + responses: + "200": + $ref: "#/responses/LicenseResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Upsert a License + tags: + - Licenses + /licensetypes: + get: + description: Retrieve LicenseType records + operationId: getLicenseTypes + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/licenseTypeIdQuery" + - $ref: "#/parameters/activeQuery" + responses: + "200": + $ref: "#/responses/LicenseTypeResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Retrieve LicenseType records + tags: + - LicenseTypes + /periods: + get: + description: Return a list of Periods for an Account + operationId: getPeriods + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/periodIdQuery" + responses: + "200": + $ref: "#/responses/PeriodResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Periods + tags: + - Periods + /places: + get: + description: "Retrieve Places, filter with parameters" + operationId: getPlaces + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/stateQuery" + - $ref: "#/parameters/placeIdQuery" + responses: + "200": + $ref: "#/responses/PlaceResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Retrieve Places + tags: + - Places + /states: + get: + description: "Retrieve States, filter with parameters" + operationId: getStates + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/countryQuery" + - $ref: "#/parameters/stateIdQuery" + responses: + "200": + $ref: "#/responses/StateResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Retrieve States + tags: + - States + /submissions: + get: + description: Return a list of available Submissions + operationId: getSubmissions + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/companyIdQuery" + - $ref: "#/parameters/submissionIdQuery" + - $ref: "#/parameters/activeQuery" + responses: + "200": + $ref: "#/responses/SubmissionResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Submissions + tags: + - Submissions + post: + description: Create new Sumissions + operationId: postSubmissions + parameters: + - $ref: "#/parameters/submissionRequestBody" + responses: + "200": + $ref: "#/responses/SubmissionResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Add new Submissions + tags: + - Submissions + put: + description: + Update all the fields in a Submission record identified by + Taxnexus Id + operationId: putSubmissions + parameters: + - $ref: "#/parameters/submissionRequestBody" + responses: + "200": + $ref: "#/responses/SubmissionResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Update a Submission + tags: + - Submissions + /taxnexuscodes: + get: + description: Return a list of TaxnexusCodes + operationId: getTaxnexusCodes + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/taxnexuscodeIdQuery" + responses: + "200": + $ref: "#/responses/TaxnexusCodeResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of TaxnexusCodes + tags: + - TaxnexusCodes + /taxtypeaccounts: + get: + description: Return a list of Tax Type Accounts + operationId: getTaxTypeAccounts + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/accountIdQuery" + - $ref: "#/parameters/placeQuery" + - $ref: "#/parameters/stateQuery" + - $ref: "#/parameters/countyQuery" + - $ref: "#/parameters/countryQuery" + - $ref: "#/parameters/activeQuery" + - $ref: "#/parameters/taxTypeAccountIdQuery" + responses: + "200": + $ref: "#/responses/TaxTypeAccountResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Tax Type Accounts + tags: + - TaxTypeAccounts + post: + description: Create a new Tax Type Account + operationId: postTaxTypeAccounts + parameters: + - description: The new Tax Type Account + in: body + name: taxtypeaccount + schema: + $ref: "#/definitions/TaxTypeAccountRequest" + responses: + "200": + $ref: "#/responses/TaxTypeAccountResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Create new Tax Type Accounts + tags: + - TaxTypeAccounts + put: + description: Update a TaxTypeAccount + operationId: putTaxTypeAccounts + parameters: + - in: body + name: taxtypeaccount + schema: + $ref: "#/definitions/TaxTypeAccountRequest" + responses: + "200": + $ref: "#/responses/TaxTypeAccountResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + summary: Update TaxTypeAccounts + tags: + - TaxTypeAccounts + /taxtypes: + get: + operationId: getTaxTypes + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/addressQuery" + - $ref: "#/parameters/placeQuery" + - $ref: "#/parameters/stateQuery" + - $ref: "#/parameters/countyQuery" + - $ref: "#/parameters/countryQuery" + - $ref: "#/parameters/activeQuery" + - $ref: "#/parameters/taxTypeIdQuery" + responses: + "200": + $ref: "#/responses/TaxTypeResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Tax Types + tags: + - TaxTypes + /templates: + get: + description: "Retrieve Templates, filter with parameters" + operationId: getTemplates + parameters: + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + - $ref: "#/parameters/templateIdQuery" + responses: + "200": + $ref: "#/responses/TemplateResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Retrieve Templates + tags: + - Templates + /notebooks: + get: + description: Return a list of Notebook records from the datastore + operationId: getNotebooks + parameters: + - $ref: "#/parameters/notebookIdQuery" + - $ref: "#/parameters/limitQuery" + - $ref: "#/parameters/offsetQuery" + responses: + "200": + $ref: "#/responses/NotebookResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Get a list of Notebooks + tags: + - Notebooks + post: + description: Create Notebooks in Taxnexus + operationId: postNotebooks + parameters: + - $ref: "#/parameters/notebookRequest" + responses: + "200": + $ref: "#/responses/NotebookResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Create new Notebooks + tags: + - Notebooks + put: + description: Update Notebooks in Taxnexus + operationId: putNotebooks + parameters: + - $ref: "#/parameters/notebookRequest" + responses: + "200": + $ref: "#/responses/NotebookResponse" + "401": + $ref: "#/responses/Unauthorized" + "403": + $ref: "#/responses/AccessForbidden" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + summary: Update Notebooks + tags: + - Notebooks +definitions: + Account: + properties: + tenantid: + description: tenant identifier + type: string + accountnumber: + type: string + accountsource: + type: string + active: + type: string + activecustomer: + type: boolean + administrativelevel: + type: string + amount: + format: double + type: number + amountinvoiced: + format: double + type: number + amountpaid: + format: double + type: number + annualrevenue: + format: double + type: number + balance: + format: double + type: number + billingaddress: + $ref: "#/definitions/Address" + billingcontactid: + type: string + billingpreference: + description: Billing Preference + type: string + businessaddress: + $ref: "#/definitions/Address" + cannabiscustomer: + type: boolean + channelprogramlevelname: + type: string + channelprogramname: + type: string + clientenddate: + type: string + clientstartdate: + type: string + companyid: + type: string + coordinateid: + description: The Id of the geo coordinates of this account + type: string + createdbyid: + description: Created By User ID + type: string + createddate: + description: Created Date + type: string + customerid: + description: Customer ID from source system + type: string + customerpriority: + description: Customer Priority + type: string + dandbcompanyid: + description: D-n-B Company + type: string + dba: + description: This Account's 'Doing Business As' name + type: string + defaultaddress: + $ref: "#/definitions/Address" + defaultbackendid: + description: Default Backend ID + type: string + defaultdeliverycontactid: + description: Default Delivery Address Contact ID + type: string + defaultenduserid: + type: string + description: + description: Description + type: string + dunsnumber: + description: D-U-N-S Number + type: string + ein: + type: string + email: + description: Main Account Email + type: string + enrollmentstatus: + description: Enrollment Status + type: string + fax: + description: Fax + type: string + id: + description: Taxnexus Account Id + type: string + industry: + description: Industry + type: string + iscustomerportal: + description: Customer Portal Account + type: boolean + ispartner: + description: Partner Account + type: boolean + ispcustomer: + type: boolean + jigsaw: + description: Data.com Key + type: string + lastmodifiedbyid: + description: Last Modified By User ID + type: string + lastmodifieddate: + description: Last Modified Date + type: string + mspcustomer: + description: MSP Customer? + type: boolean + naicscode: + description: NAICS Code + type: string + naicsdesc: + description: NAICS Description + type: string + name: + description: Account Name + type: string + numberofemployees: + format: int64 + type: number + numberoflocations: + format: int64 + type: number + opencharges: + format: double + type: number + ordercontactid: + type: string + orderemail: + type: string + ownerid: + type: string + ownership: + description: Ownership + type: string + parentfk: + description: Parent Foreign Key + type: string + parentid: + type: string + phone: + description: Phone + type: string + placeid: + description: + The ID of the Place situs record that applies to this Account + type: string + preparerid: + type: string + rating: + description: Rating + type: string + ratingengineid: + description: Rating Engine identifier + type: string + ref: + type: string + revenuebase: + format: double + type: number + revenuenet: + format: double + type: number + revenuenottaxable: + format: double + type: number + shippingaddress: + $ref: "#/definitions/Address" + shippingcensustract: + description: Shipping Census Tract + type: string + shippingcontactid: + type: string + shippingcounty: + description: Shipping County + type: string + sic: + type: string + sicdesc: + type: string + site: + description: Account Site + type: string + status: + description: Account Status + type: string + taxexemption: + type: string + taxontax: + format: double + type: number + telecomcustomer: + type: boolean + tickersymbol: + description: Ticker Symbol + type: string + tradestyle: + description: Tradestyle + type: string + type: + type: string + unappliedpayments: + format: double + type: number + unitbase: + format: double + type: number + upsellopportunity: + type: string + uuid: + type: string + website: + type: string + whmcsclientid: + format: int64 + type: number + xerocontactid: + description: Xero Contact ID + type: string + yearstarted: + description: Year Started + type: string + type: object + AccountRequest: + properties: + data: + items: + $ref: "#/definitions/Account" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + AccountResponse: + description: An array of Account objects + properties: + data: + items: + $ref: "#/definitions/Account" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + AccountingRule: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + description: The Account for whom this Account Rule exists + type: string + code: + description: The Code used for Accounting Rule Lookups + type: string + cogsaccountid: + description: + The Cost of Goods Sold account to be used for this Accounting + Rule + type: string + cogsaccountname: + description: COGS Account Name + type: string + createdbyid: + description: Created By + type: string + createddate: + description: Created Date + type: string + creditaccountid: + description: + The GL Account that is the Credit Account to be used in this + Accounting Rule + type: string + creditaccountname: + description: Credit Account Name + type: string + debitaccountid: + description: + The GL Account that is the Debit Account to be used in this + Accounting Rule + type: string + debitaccountname: + description: Debit Account Name + type: string + description: + description: Description + type: string + id: + description: Taxnexus Record Id + type: string + inventoryaccountid: + description: + The GL Account that is the Inventory Account to be used in + this Accounting Rule + type: string + inventoryaccountname: + description: Inventory Account Name + type: string + isdeferred: + description: + "Is this a deferred tax, not to be charged on the invoice?" + type: boolean + lastmodifiedbyid: + description: Last Modified By + type: string + lastmodifieddate: + description: Last Modified Date + type: string + parentfk: + description: Parent Foreign Key + type: string + proportion: + description: + The Proportion of Revenue which is governed by this Accounting + Rule; used for proportional taxing of products and services + type: number + AccountingRuleRequest: + properties: + data: + items: + $ref: "#/definitions/AccountingRule" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + AccountingRuleResponse: + properties: + data: + items: + $ref: "#/definitions/AccountingRule" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + AccountingRuleset: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + description: Taxnexus Account ID + type: string + code: + description: Accounting Ruleset Code + type: string + createdbyid: + description: Created By + type: string + createddate: + description: Created Date + type: string + description: + description: Ruleset Description + type: string + id: + description: Taxnexus Record Id + type: string + items: + items: + $ref: "#/definitions/AccountingRulesetItem" + type: array + lastmodifiedbyid: + description: Last Modified By + type: string + lastmodifieddate: + description: Last Modified Date + type: string + type: object + AccountingRulesetItem: + properties: + tenantid: + description: tenant identifier + type: string + accountingrulecode: + type: string + accountingruleid: + type: string + accountingrulesetid: + type: string + id: + type: string + type: object + AccountingRulesetRequest: + properties: + data: + items: + $ref: "#/definitions/AccountingRuleset" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + AccountingRulesetResponse: + properties: + data: + items: + $ref: "#/definitions/AccountingRuleset" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Address: + properties: + city: + description: City + type: string + country: + description: Country full name + type: string + countrycode: + description: Country Code + type: string + postalcode: + description: Postal Code + type: string + state: + description: State full name + type: string + statecode: + description: State Code + type: string + street: + description: Street number and name + type: string + type: object + Authority: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + description: Account + type: string + addressline1: + description: Address Line 1 + type: string + addressline2: + description: Address Line 2 + type: string + authoritydate: + type: string + btn: + description: Billing Telephone Number + type: string + city: + description: City + type: string + contactid: + description: Contact ID + type: string + country: + type: string + createdbyid: + description: Created By User ID + type: string + createddate: + description: Created Date + type: string + dateapproved: + description: Date Approved + type: string + id: + description: Taxnexus Record Identifier + type: string + lastmodifiedbyid: + description: Last Modified By User ID + type: string + lastmodifieddate: + description: Last Modified Date + type: string + losingcarrier: + description: Losing Carrier + type: string + name: + description: Authority Number + type: string + nameline1: + description: Name Line 1 + type: string + nameline2: + description: Name Line 2 + type: string + opportunityid: + description: Opportunity ID + type: string + orderid: + description: Order ID + type: string + parentfk: + description: + UUID Reference the master record that owns this item + type: string + postalcode: + description: Zip Code + type: string + quoteid: + description: Quote ID + type: string + ref: + description: "Source System identifier for this record, if any" + type: string + state: + description: State + type: string + status: + description: Status + type: string + transferdate: + description: Transfer Date + type: string + type: + description: Authority Type + type: string + type: object + AuthorityRequest: + properties: + data: + items: + $ref: "#/definitions/Authority" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + AuthorityResponse: + properties: + data: + items: + $ref: "#/definitions/Authority" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Backend: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + type: string + active: + type: boolean + apikey: + type: string + applicationname: + type: string + authtype: + type: string + backendname: + type: string + baseurl: + type: string + callbackurl: + type: string + clientid: + type: string + clientsecret: + type: string + companyid: + type: string + createdbyid: + type: string + description: Created By + createddate: + type: string + description: Created Date + description: + description: Description + type: string + id: + description: Taxnexus Record Id Only; not used in POST + type: string + lastmodifiedbyid: + type: string + description: Last Modified By + lastmodifieddate: + type: string + description: Last Modified Date + loginurl: + type: string + managementpassword: + type: string + managementurl: + type: string + managementusername: + type: string + metrcstate: + type: string + metrclicense: + type: string + ownerid: + type: string + password: + type: string + production: + type: boolean + projectid: + type: string + providercredentials: + type: string + realm: + type: string + ref: + type: string + resellerbackend: + type: string + resellerbackendid: + type: string + securitytoken: + type: string + timeout: + format: int64 + type: number + tokenuri: + type: string + type: + type: string + username: + type: string + vendor: + type: string + type: object + BackendResponse: + description: An array of Backend Objects + properties: + data: + items: + $ref: "#/definitions/Backend" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Company: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + type: string + accountnumberprefix: + type: string + advanceperiodid: + type: string + billingaddress: + $ref: "#/definitions/Address" + billingadvice: + type: string + billingcontactid: + type: string + billingemail: + type: string + billingphone: + type: string + billingwebsite: + type: string + closedperiodid: + type: string + coatemplateid: + type: string + coloraccent1: + type: string + coloraccent2: + type: string + colorprimary: + type: string + createdbyid: + type: string + createddate: + type: string + currentperiodid: + type: string + currentperiodstatus: + type: string + customersuccessid: + type: string + dateclosed: + type: string + defaultaddress: + $ref: "#/definitions/Address" + defaultcompany: + type: boolean + fontbody: + type: string + fontheading: + type: string + fontheadingnarrow: + type: string + fontlink: + type: string + fontmono: + type: string + id: + type: string + international: + type: boolean + lastaccountnumber: + format: int64 + type: number + lastmodifiedbyid: + type: string + lastmodifieddate: + type: string + lasttaxtypenumber: + format: int64 + type: number + logo: + type: string + name: + type: string + ownerid: + type: string + preparerid: + type: string + pricebookid: + type: string + usertechleadid: + type: string + type: object + CompanyResponse: + description: An array of Company objects + properties: + data: + items: + $ref: "#/definitions/Company" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Contact: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + description: The primary account ID of this contact + type: string + assistantname: + description: Assistant Name + type: string + assistantphone: + description: Asst. Phone + type: string + birthdate: + description: Birthdate + type: string + createdbyid: + description: Created By User ID + type: string + createddate: + description: Created Date + type: string + department: + description: Department + type: string + description: + description: Description + type: string + donotcall: + description: Do Not Call? + type: boolean + email: + description: Email address + type: string + emailbounceddate: + description: Email Bounce Date + type: string + emailbouncedreason: + description: Email Bounce Reason + type: string + enrollmentstatus: + description: Taxnexus Enrollment Status + type: string + fax: + description: Fax Number + type: string + firstname: + description: First Name + type: string + hasoptedoutofemail: + description: Email Opt Out + type: boolean + hasoptedoutoffax: + description: Fax Opt Out + type: boolean + homephone: + description: Home Phone + type: string + id: + description: Taxnexus Record Id + type: string + isemailbounced: + description: Does this contact have bounced emails? + type: boolean + isprovisioned: + description: Is Provisioned? + type: boolean + lastmodifiedbyid: + description: Last Modified By User ID + type: string + lastmodifieddate: + description: Last Modified Date + type: string + lastname: + description: Last Name + type: string + leadsource: + description: Lead Source + type: string + level: + description: Level + type: string + linkedin: + description: LinkedIn Page + type: string + mailingaddress: + $ref: "#/definitions/Address" + mailinglists: + description: Mailing Lists + type: string + mobilephone: + description: Mobile Phone + type: string + name: + description: Full Name + type: string + otheraddress: + $ref: "#/definitions/Address" + otherphone: + description: Other Phone + type: string + ownerid: + description: The User ID of the user who owns this Contact + type: string + personalemail: + description: Personal Email Address for this Contact + type: string + phone: + description: Phone Number + type: string + photourl: + description: URL of a photograph of this User + type: string + recruitingstatus: + description: Recruiting Status + type: string + ref: + description: "External reference to this contact, if any" + type: string + reportstoid: + description: Reports To Contact ID + type: string + salutation: + description: Contact Salutation + type: string + status: + description: The Contact Status + type: string + title: + description: Contact Title + type: string + type: + description: Contact Type + type: string + type: object + ContactRequest: + properties: + data: + items: + $ref: "#/definitions/Contact" + type: array + meta: + $ref: "#/definitions/RequestMeta" + required: + - meta + - data + type: object + ContactResponse: + properties: + data: + items: + $ref: "#/definitions/Contact" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Country: + properties: + accountid: + type: string + ref: + type: string + templateid: + type: string + totalamount: + type: number + format: double + amount: + type: number + format: double + code: + type: string + contactid: + type: string + enrollmentstatus: + type: string + id: + type: string + interest: + type: number + format: double + latitude: + type: number + format: double + longitude: + type: number + format: double + name: + type: string + penalty: + format: double + type: number + reportedadjustments: + description: Reported Adjustments + type: number + format: double + reporteddeductions: + description: Reported Deductions + type: number + format: double + reportednetrevenue: + description: Reported Net Revenue + type: number + format: double + reportedrate: + description: Reported Rate + type: number + format: double + reportedrevenue: + description: Reported Revenue + type: number + format: double + revenuebase: + description: Rollup Revenue Base + type: number + format: double + revenuenet: + description: Rollup Revenue Net + type: number + format: double + revenuenottaxable: + description: Rollup Revenue Not Taxable + type: number + format: double + stateid: + type: string + status: + type: string + subtotal: + type: number + format: double + taxinstances: + items: + $ref: "#/definitions/TaxInstance" + type: array + unitbase: + type: number + type: object + CountryResponse: + description: An array of Country objects + properties: + data: + items: + $ref: "#/definitions/Country" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + County: + properties: + accountid: + type: string + templateid: + type: string + ref: + type: string + amount: + type: number + areadescription: + type: string + contactid: + type: string + countryid: + type: string + enrollmentstatus: + type: string + fips: + type: string + fipsclass: + type: string + functionalstatus: + type: string + geocode: + type: string + latitude: + type: number + format: double + longitude: + type: number + format: double + gnis: + format: int64 + type: number + totalarea: + format: int64 + type: number + landarea: + format: int64 + type: number + waterarea: + format: int64 + type: number + id: + type: string + hasdistricttaxes: + type: boolean + interest: + type: number + format: double + legalname: + type: string + name: + type: string + penalty: + type: number + format: double + reportedadjustments: + type: number + format: double + reporteddeductions: + type: number + format: double + reportednetrevenue: + type: number + format: double + reportedrate: + type: number + format: double + reportedrevenue: + type: number + format: double + revenuebase: + type: number + format: double + revenuenet: + type: number + format: double + revenuenottaxable: + type: number + format: double + totalamount: + type: number + format: double + stateId: + type: string + statefips: + type: string + status: + type: string + subtotal: + type: number + taxinstances: + items: + $ref: "#/definitions/TaxInstance" + type: array + taxontax: + type: boolean + unitbase: + type: number + type: object + CountyResponse: + description: An array of County objects + properties: + data: + items: + $ref: "#/definitions/County" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Domain: + properties: + active: + description: Active + type: boolean + description: + description: Description + type: string + id: + description: Taxnexus Record Id Only; not used in POST + type: string + name: + description: Name + type: string + type: object + DomainResponse: + description: An array of Domain objects + properties: + data: + items: + $ref: "#/definitions/Domain" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Error: + properties: + code: + format: int64 + type: integer + message: + type: string + type: object + Filing: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + type: string + authorityid: + type: string + accountname: + description: Account Name on Filing + type: string + amount: + description: The amount of tax to be paid with this filing + format: double + type: number + contactid: + description: Billing Contact + type: string + createdbyid: + description: Created By User ID + type: string + createddate: + description: Created Date + type: string + filingdate: + description: Filing Date + type: string + duedate: + description: Due Date + format: string + filingnumber: + description: Due Date + format: string + filingtypeid: + description: The ID of the Filing Type for this Filing + format: string + frequency: + description: Due Date + format: string + id: + description: Record Id + type: string + interest: + description: Interest + format: double + type: number + interestrate: + description: Interest + format: double + type: number + lastmodifiedbyid: + description: Last Modified By User ID + type: string + lastmodifieddate: + description: Last Modified Date + type: string + monthnumber: + description: The number of the Month of the filing + format: int64 + type: number + ownerid: + description: Taxneuxs ID of the User who owns this record + type: string + penalty: + description: Penalty + format: double + type: number + penaltydays: + description: Penalty Days + format: double + type: number + penaltyrate: + description: Penalty Days + format: double + type: number + periodid: + description: Period + type: string + preparerid: + description: Taxnexus ID of the Contact who prepared this filing + type: string + quarternumber: + description: The number of the Month of the filing + format: int64 + type: number + ref: + description: "Source System identifier for this record, if any" + type: string + reportedadjustments: + description: Reported Adjustments + format: double + type: number + reporteddeductions: + description: Reported Deductions + format: double + type: number + reportednetrevenue: + description: Reported Net Revenue + format: double + type: number + reportedrate: + description: Reported Rate + format: double + type: number + reportedrevenue: + description: Reported Revenue + format: double + type: number + revenuebase: + description: Revenue Base + format: double + type: number + revenuenet: + description: Revenue Net + format: double + type: number + revenuenottaxable: + description: Revenue Not Taxable + format: double + type: number + semiannualnumber: + description: The number of the Month of the filing + format: int64 + type: number + status: + description: Status + type: string + submissionid: + description: Taxnexus ID of the Submission that owns this Filing + type: string + subtotal: + description: Reported Tax + format: double + type: number + taxontax: + description: Tax On Tax + format: double + type: number + taxtypeaccountid: + description: + The TaxType Account for which this Filing is paying remittance + type: string + totalamount: + description: Total Amount + format: double + type: number + unitbase: + description: Unit Base + format: double + type: number + yearnumber: + description: The number of the Month of the filing + format: int64 + type: number + type: object + FilingRequest: + properties: + data: + items: + $ref: "#/definitions/Filing" + type: array + meta: + $ref: "#/definitions/RequestMeta" + required: + - meta + - data + type: object + FilingResponse: + description: An array of Filing Objects + properties: + data: + items: + $ref: "#/definitions/Filing" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + FilingDueDate: + type: object + description: Dates when this FilingType is due for filing + properties: + duedate: + type: string + description: + type: string + FilingTypeInstance: + type: object + description: A list of jurisdictions that use this Filing Type + properties: + countryid: + type: string + description: Country Id + countyid: + type: string + description: County ID + objecttype: + type: string + description: + The type of object that owns this FilingType instance + filingtypeid: + description: The ID of the Filing Type for this Filing + format: string + placeid: + type: string + description: Place ID + stateid: + type: string + description: StateID + FilingType: + type: object + description: An array of FilingType Objects + properties: + accountid: + description: Tax Authority + type: string + contactid: + description: Contact + type: string + createdbyid: + description: Created By + type: string + createddate: + description: Created Date + type: string + duedates: + items: + $ref: "#/definitions/FilingDueDate" + type: array + filingcity: + description: Filing City + type: string + filingcountry: + description: Filing Country + type: string + filingpostalcode: + description: Filing Postal Code + type: string + filingstate: + description: Filing State + type: string + filingstreet: + description: Filing Street + type: string + formname: + description: Form Name + type: string + formversion: + description: Form Version + type: string + frequency: + description: Frequency + type: string + fullname: + description: Filing Full Name + type: string + id: + description: Record Id + type: string + instances: + items: + $ref: "#/definitions/FilingTypeInstance" + type: array + lastmodifiedbyid: + description: Last Modified By + type: string + lastmodifieddate: + description: Last Modifed Date + type: string + level: + description: Jurisdictional Level + type: string + name: + description: Name + type: string + ownerid: + description: Owner + type: string + sagatype: + description: Saga Type + type: string + submissionmethod: + description: Submission Method + type: string + templateinstructionsid: + description: Instructions Template + type: string + templatereturnid: + description: Return Template + type: string + FilingTypeRequest: + properties: + data: + items: + $ref: "#/definitions/FilingType" + type: array + meta: + $ref: "#/definitions/RequestMeta" + required: + - meta + - data + type: object + FilingTypeResponse: + description: An array of Filing Objects + properties: + data: + items: + $ref: "#/definitions/FilingType" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + GlAccount: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + description: Account + type: string + accountlevel: + description: Account Level + type: number + accountname: + description: Account Name + type: string + accountnumber: + description: Account Number + type: number + accountsign: + description: Account Sign + type: string + accounttype: + description: Account Type + type: string + description: + description: Description + type: string + glaccountid: + description: + Parent GL Account -- renamed to parentglaccountid in fabric + metadata + type: string + id: + description: Taxnexus Record Id + type: string + isactive: + description: Is Active? + type: boolean + isbankaccount: + description: Is Bank Account ? + type: boolean + issummary: + description: Is Summary? + type: boolean + name: + type: string + parentfk: + description: Parent Foreign Key + type: string + status: + description: Status + type: string + type: object + GlAccountRequest: + properties: + data: + items: + $ref: "#/definitions/GlAccount" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + GlAccountResponse: + properties: + data: + items: + $ref: "#/definitions/GlAccount" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + GlBalance: + properties: + tenantid: + description: tenant identifier + type: string + accountname: + description: Account Name + type: string + amount: + description: Amount + type: number + closedate: + description: Close Date + type: string + createdbyid: + description: Created By User ID + type: string + createddate: + description: Created Date + type: string + credits: + description: Credits + type: number + debits: + description: Debits + type: number + description: + description: Description + type: string + glaccountdisplay: + description: GL Account Display Value + type: string + glaccountid: + description: GL Account + type: string + id: + description: Taxnexus Record Id + type: string + lastmodifiedbyid: + description: Last Modified By User ID + type: string + lastmodifieddate: + description: Last Modified Date + type: string + periodid: + description: Period ID + type: string + ref: + description: "Source System identifier for this record, if any" + type: string + rollupcredits: + description: Rollup Credits + type: number + rollupdebits: + description: Rollup Debits + type: number + status: + description: Status + type: string + type: object + GlBalanceResponse: + properties: + data: + items: + $ref: "#/definitions/GlBalance" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Ingest: + description: A record of the Ingest of information into Taxnexus + properties: + tenantid: + description: tenant identifier + type: string + accountid: + description: Account ID + type: string + amount: + description: Rollup Tax Amount + type: number + backendid: + description: Backend ID + type: string + companyid: + description: Company ID + type: string + createdbyid: + description: Taxnexus User ID + type: string + createddate: + description: Date of Job Creation + type: string + description: + description: Ingest Description + type: string + enddate: + description: End Date + type: string + filename: + description: Filename + type: string + formatted: + description: Numeric and Date Values Pre-formatted as Text + properties: + amount: + type: string + ingestdate: + type: string + invoicecount: + type: string + pocount: + type: string + revenuebase: + type: string + revenuenottaxable: + type: string + tax: + type: string + taxontax: + type: string + unitbase: + type: string + type: object + id: + description: Record Id + type: string + ingestdate: + description: Ingest Date + type: string + ingestfailurereason: + description: Ingest Failure Reason + type: string + ingesttype: + description: Ingest Type + type: string + invoicecount: + description: Invoice Count + format: int64 + type: number + jobid: + description: Job ID + type: string + lastmodifiedbyid: + description: Taxnexus User ID + type: string + lastmodifieddate: + description: Last Modified Date + type: string + metrclicense: + description: License + type: string + metrcstate: + description: State Code + type: string + objecttype: + description: Ingest Object Type + type: string + parentfk: + description: Parent Foreign Key + type: string + periodid: + description: Period ID + type: string + pocount: + description: PO Count + format: int64 + type: number + postfailurereason: + description: Post Failure Reason + type: string + ratingengineid: + description: Rating Engine ID + type: string + ref: + description: Source System Reference + type: string + revenuebase: + description: Rollup Revenue Base + type: number + revenuenet: + description: Rollup Revenue Net + type: number + revenuenottaxable: + description: Rollup Revenue Not Taxable + type: number + sagaid: + description: + The Saga ID used to link log entries and transactions + type: string + sagatype: + description: The type of Saga transaction being performed + type: string + source: + description: The source system that generated this job + type: string + startdate: + description: Start Date + type: string + status: + description: Ingest Status + type: string + tax: + description: Rollup Tax + type: number + taxontax: + description: Rollup Tax On Tax + type: number + taxtransactioncount: + description: Tax Transaction Count + format: int64 + type: number + templateid: + description: Template + type: string + unitbase: + description: Rollup Unit Base + format: int64 + type: number + required: + - accountid + - objecttype + type: object + IngestRequest: + properties: + data: + items: + $ref: "#/definitions/Ingest" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + IngestResponse: + properties: + data: + items: + $ref: "#/definitions/Ingest" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + InvalidError: + allOf: + - $ref: "#/definitions/Error" + - properties: + details: + items: + type: string + type: array + type: object + Job: + properties: + accountid: + description: Taxnexus Account Id + type: string + backendid: + description: Taxnexus Backend ID + type: string + companyid: + description: Taxnexus Company ID + type: string + coordinateid: + description: Taxnexus Coordinate ID + type: string + createdbyid: + description: Taxnexus User ID + type: string + createddate: + description: Date of Job Creation + type: string + month: + type: number + format: int64 + quarter: + type: number + format: int64 + semiannual: + type: number + format: int64 + year: + type: number + format: int64 + duration: + description: + The amount of time after the Start Time to perform one or more + jobs + enum: + - day + - document + - hour + - minute + - month + - quarter + - second + - week + - year + type: string + enddate: + description: End Date/Time + type: string + errorreason: + description: Error Reason + type: string + id: + description: Taxnexus Record Id of the Job record + type: string + interval: + description: + The time interval by which multiple jobs are executed within + the Duration + enum: + - day + - each + - hour + - minute + - month + - quarter + - second + - week + - year + type: string + jobdate: + description: Job Date + type: string + lastmodifiedbyid: + description: Last Modified By + type: string + lastmodifieddate: + description: Last Modified Date + type: string + nextjobid: + description: Next Job + type: string + objecttype: + description: Object Type + enum: + - invoice + - order + - po + - quote + type: string + ownerid: + description: The user ID that owns this job + type: string + parameters: + description: Any parameters needed to process the job + type: string + periodid: + description: Period + type: string + ratingengineid: + description: Rating Engine + type: string + ref: + description: External Reference + type: string + reschedule: + description: Reschedule? + type: boolean + rescheduleinterval: + description: Reschedule Interval + format: int64 + type: number + sagaid: + description: + The Saga ID used to link log entries and transactions + type: string + sagatype: + description: The type of Saga transaction being performed + enum: + - newGLPostInvoices + - newIngestInvoice + - newIngestPO + type: string + source: + description: The source system that generated this job + enum: + - api + - fabric + - taxnexus + - telnexus + type: string + startdate: + description: Start Date/Time + type: string + status: + description: Status + enum: + - active + - complete + - error + - new + - queued + type: string + target: + description: The target system that executes this job + enum: + - api + - fabric + - taxnexus + - telnexus + type: string + type: + description: Type + enum: + - coordinate + - email + - ingest + - tax + type: string + type: object + JobRequest: + properties: + data: + items: + $ref: "#/definitions/Job" + type: array + meta: + $ref: "#/definitions/RequestMeta" + required: + - meta + - data + type: object + JobResponse: + description: An array of Print-Ready ingest Objects + properties: + data: + items: + $ref: "#/definitions/Job" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + License: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + type: string + backendid: + type: string + contactid: + type: string + createdbyid: + type: string + createddate: + type: string + dateissued: + type: string + expirationdate: + type: string + id: + type: string + iscanceled: + type: boolean + isrevoked: + type: boolean + lastmodifiedbyid: + type: string + lastmodifieddate: + type: string + licensetypeid: + type: string + name: + type: string + ref: + type: string + status: + type: string + type: object + LicenseRequest: + properties: + data: + items: + $ref: "#/definitions/License" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + LicenseResponse: + properties: + data: + items: + $ref: "#/definitions/License" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + LicenseType: + properties: + accountid: + type: string + agentid: + type: string + contactid: + type: string + cost: + description: Cost + type: number + format: double + createdbyid: + type: string + createddate: + type: string + domainid: + type: string + frequency: + description: Frequency + type: string + id: + description: Taxnexus Record Id + type: string + lastmodifiedbyid: + type: string + lastmodifieddate: + type: string + level: + description: Level + type: string + name: + description: License Type Name + type: string + picklistvalue: + description: Picklist Value + type: string + ref: + description: "Source System identifier for this record, if any" + type: string + restriction: + description: Restriction + type: string + tier: + description: Tier + type: string + domains: + type: array + items: + type: string + jurisdictions: + type: array + items: + $ref: "#/definitions/GeoLicenseTypeInstance" + type: object + GeoLicenseTypeInstance: + description: Links a license type to a geography + type: object + properties: + objecttype: + type: string + placeid: + type: string + countyid: + type: string + stateid: + type: string + countryid: + type: string + LicenseTypeResponse: + properties: + data: + items: + $ref: "#/definitions/LicenseType" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Pagination: + properties: + nextlink: + type: string + plimit: + format: int64 + type: integer + poffset: + format: int64 + type: integer + pagesize: + format: int64 + type: integer + setsize: + format: int64 + type: integer + type: object + Period: + properties: + tenantid: + description: tenant identifier + type: string + accountid: + description: Account that owns this Period + type: string + companyid: + description: Company + type: string + days: + description: Days + format: int64 + type: number + enddate: + description: End Date + type: string + id: + description: Taxnexus Record Id + type: string + month: + description: Month in numeric format + format: int64 + type: number + name: + description: Period Name + type: string + quarter: + description: The Quarter of this period in numeric format + format: int64 + type: number + ref: + description: "Source System identifier for this record, if any" + type: string + semiannual: + description: The Semiannual period in numeric format + format: int64 + type: number + startdate: + description: Start Date + type: string + status: + description: Status + type: string + year: + description: Year in numeric format + format: int64 + type: number + type: object + PeriodRequest: + properties: + data: + items: + $ref: "#/definitions/Period" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + PeriodResponse: + description: An array of Period objects + properties: + data: + items: + $ref: "#/definitions/Period" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Place: + properties: + accountid: + type: string + latitude: + type: number + format: double + longitude: + type: number + format: double + accountvalidation: + type: string + templateid: + type: string + ref: + type: string + amount: + type: number + format: double + totalamount: + type: number + format: double + areadescription: + type: string + companyid: + type: string + contactid: + type: string + countryid: + type: string + countyid: + type: string + enrollmentstatus: + type: string + fips: + type: string + fipsclass: + type: string + functionalstatus: + type: string + geocode: + type: string + gnis: + format: int64 + type: number + landarea: + format: int64 + type: number + waterarea: + format: int64 + type: number + totalarea: + format: int64 + type: number + hasdistricttaxes: + type: boolean + id: + type: string + interest: + type: number + legalname: + type: string + name: + type: string + penalty: + type: number + reportedadjustments: + description: Reported Adjustments + type: number + format: double + reporteddeductions: + description: Reported Deductions + type: number + format: double + reportednetrevenue: + description: Reported Net Revenue + type: number + format: double + reportedrate: + description: Reported Rate + type: number + format: double + reportedrevenue: + description: Reported Revenue + type: number + format: double + revenuebase: + description: Rollup Revenue Base + type: number + format: double + revenuenet: + description: Rollup Revenue Net + type: number + format: double + revenuenottaxable: + description: Rollup Revenue Not Taxable + type: number + format: double + stateId: + type: string + status: + type: string + subtotal: + type: number + tax: + type: number + taxinstances: + items: + $ref: "#/definitions/TaxInstance" + type: array + taxontax: + type: boolean + unitbase: + type: number + type: object + PlaceResponse: + description: An array of Place objects + properties: + data: + items: + $ref: "#/definitions/Place" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + RequestMeta: + properties: + password: + description: Salesforce Password + type: string + taxnexusaccount: + description: Taxnexus Account Number of the Reseller or OEM + type: string + token: + description: Salesforce Security Token + type: string + username: + description: Salesforce 'API User' User Name + type: string + type: object + ResponseMeta: + properties: + contact: + type: string + copyright: + type: string + info: + type: string + license: + type: string + operationid: + type: string + pagination: + $ref: "#/definitions/Pagination" + requestip: + type: string + requesttype: + type: string + requesturl: + type: string + serverinfo: + type: string + serverresponsetime: + type: string + servertimestamp: + type: string + starttime: + type: number + taxnexusaccount: + type: string + userid: + type: string + type: object + State: + properties: + templateid: + type: string + ref: + type: string + landarea: + format: int64 + type: number + waterarea: + format: int64 + type: number + totalarea: + format: int64 + type: number + latitude: + type: number + format: double + longitude: + type: number + format: double + accountid: + type: string + amount: + type: number + format: double + totalamount: + type: number + format: double + code: + type: string + companyid: + type: string + contactid: + type: string + countryid: + type: string + division: + type: string + enrollmentstatus: + type: string + fips: + type: string + geocode: + type: string + gnis: + format: int64 + type: number + id: + type: string + interest: + format: double + type: number + name: + type: string + penalty: + format: double + type: number + region: + type: string + reportedadjustments: + description: Reported Adjustments + type: number + format: double + reporteddeductions: + description: Reported Deductions + type: number + format: double + reportednetrevenue: + description: Reported Net Revenue + type: number + format: double + reportedrate: + description: Reported Rate + type: number + format: double + reportedrevenue: + description: Reported Revenue + type: number + format: double + revenuebase: + description: Rollup Revenue Base + type: number + format: double + revenuenet: + description: Rollup Revenue Net + type: number + format: double + revenuenottaxable: + description: Rollup Revenue Not Taxable + type: number + format: double + sgc: + type: string + status: + type: string + subtotal: + format: double + type: number + taxinstances: + items: + $ref: "#/definitions/TaxInstance" + type: array + taxontax: + type: boolean + unitbase: + format: double + type: number + type: object + StateResponse: + description: An array of State objects + properties: + data: + items: + $ref: "#/definitions/State" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Submission: + properties: + tenantid: + description: tenant identifier + type: string + companyid: + description: The Company that did the submission (Taxnexus) + type: string + contactid: + description: Submission Contact + type: string + createdbyid: + description: Created By User ID + type: string + createddate: + description: Created Date + type: string + id: + description: Taxnexus Record Id Only; not used in POST + type: string + lastmodifiedbyid: + description: Last Modified By User ID + type: string + lastmodifieddate: + description: Last Modified Date + type: string + notes: + description: Cover Letter + type: string + parentfk: + description: + UUID Reference the master record that owns this item + type: string + penalty: + description: Penalty paid + format: double + type: number + ref: + description: "Source System identifier for this record, if any" + type: string + reportedadjustments: + description: Reported Adjustments + format: double + type: number + reporteddeductions: + description: Reported Deductions + format: double + type: number + reportednetrevenue: + description: Reported Net Revenue + format: double + type: number + reportedrate: + description: Reported Rate + format: double + type: number + reportedrevenue: + description: Reported Revenue + format: double + type: number + revenuebase: + description: Revenue Base + format: double + type: number + revenuenet: + description: Revenue Net + format: double + type: number + revenuenottaxable: + description: Revenue Not Taxable + format: double + type: number + status: + description: Status + type: string + submissiondate: + description: Submission Date + type: string + submissionnumber: + description: Submission Number + type: string + subtotal: + description: Amount of remittance before penalty + format: double + type: number + taxtypeid: + description: + Taxnexus ID of the TaxType for which this submssion is being + made + type: string + totalamount: + description: Total Amount of remittance + format: double + type: number + type: object + SubmissionRequest: + properties: + data: + items: + $ref: "#/definitions/Submission" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + SubmissionResponse: + description: An array of Submission objects + properties: + data: + items: + $ref: "#/definitions/Submission" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + TaxInstance: + properties: + countryid: + type: string + countyid: + type: string + createdbyid: + type: string + createddate: + type: string + lastmodifiedbyid: + type: string + lastmodifieddate: + type: string + placeid: + type: string + stateid: + type: string + taxtypeid: + type: string + type: + type: string + type: object + TaxType: + properties: + accountid: + type: string + accountingrulecode: + type: string + active: + type: boolean + agencytype: + type: string + agentid: + type: string + amount: + type: number + category: + type: string + collectordomainid: + type: string + companyid: + type: string + contactid: + type: string + createdbyid: + type: string + createddate: + type: string + description: + type: string + domainname: + type: string + effectivedate: + type: string + enddate: + type: string + enrollmentstatus: + type: string + filingcity: + type: string + filingcountry: + type: string + filingemail: + type: string + filingmethod: + type: string + filingpostalcode: + type: string + filingstate: + type: string + filingstreet: + type: string + fractional: + type: boolean + frequency: + type: string + geocodestring: + type: string + id: + type: string + interestrate: + type: number + ismedicinal: + type: boolean + isrecreational: + type: boolean + itemamount: + type: number + itemcount: + type: number + lastmodifiedbyid: + type: string + lastmodifieddate: + type: string + markuprate: + type: number + name: + type: string + passthrough: + type: boolean + penaltydays: + format: int64 + type: number + penaltyrate: + type: number + rate: + type: number + reference: + type: string + revenuebase: + type: number + revenuenet: + type: number + revenuenottaxable: + type: number + salesregulation: + type: string + status: + type: string + taxauthority: + type: string + taxcategory: + type: string + taxcategorycode: + type: string + taxcodename: + type: string + taxnexuscodeid: + type: string + taxnexusnumber: + type: string + taxontax: + type: boolean + taxontaxrollup: + type: number + taxtypecode: + type: string + templateid: + type: string + unitbase: + type: number + units: + type: string + type: object + TaxTypeResponse: + description: An array of Tax Type objects + properties: + data: + items: + $ref: "#/definitions/TaxType" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + TaxTypeAccount: + properties: + tenantid: + type: string + accountid: + description: Account + type: string + accountnumber: + description: Account Number + type: string + active: + description: Active + type: boolean + amount: + description: Rollup Amount + format: double + type: number + contactid: + description: Contact ID + type: string + createdbyid: + type: string + createddate: + type: string + description: + description: Description + type: string + enddate: + description: End Date + type: string + id: + description: Taxnexus Record Id Only; not used in POST + type: string + interest: + description: Interest + type: number + lastmodifiedbyid: + type: string + lastmodifieddate: + type: string + notes: + description: Notes + type: string + parentfk: + description: + UUID Reference the master record that owns this item + type: string + penalty: + description: Penalty + format: double + type: number + ref: + description: "Source System identifier for this record, if any" + type: string + reportedadjustments: + description: Reported Adjustments + format: double + type: number + reporteddeductions: + description: Reported Deductions + format: double + type: number + reportednetrevenue: + description: Reported Net Revenue + format: double + type: number + reportedrate: + description: Reported Rate + format: double + type: number + reportedrevenue: + description: Reported Revenue + format: double + type: number + revenuebase: + description: Rollup Revenue Base + format: double + type: number + revenuenet: + description: Rollup Revenue Net + format: double + type: number + revenuenottaxable: + description: Rollup Revenue Not Taxable + format: double + type: number + startdate: + description: Start Date + type: string + subtotal: + description: Reported Tax + format: double + type: number + tax: + description: Rollup Tax + format: double + type: number + taxontax: + description: Rollup Tax on Tax + format: double + type: number + taxtypeid: + description: Tax Type + type: string + totalamount: + description: Total Amount + format: double + type: number + unitbase: + description: Rollup Unit Base + format: double + type: number + type: object + TaxTypeAccountRequest: + properties: + data: + items: + $ref: "#/definitions/TaxTypeAccount" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + TaxTypeAccountResponse: + description: An array of TaxType Account objects with Contacts + properties: + data: + items: + $ref: "#/definitions/TaxTypeAccount" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + TaxnexusCode: + properties: + active: + type: boolean + code: + type: string + createdbyid: + type: string + createddate: + type: string + description: + type: string + domainid: + type: string + domainname: + type: string + id: + type: string + lastmodifiedbyid: + type: string + lastmodifieddate: + type: string + level: + type: string + part1: + type: string + part2: + type: string + part3: + type: string + part4: + type: string + part5: + type: string + purchasingRulesetCode: + type: string + purchasingRulesetID: + type: string + ref: + type: string + revenueRulesetCode: + type: string + revenueRulesetID: + type: string + type: object + TaxnexusCodeResponse: + properties: + data: + items: + $ref: "#/definitions/TaxnexusCode" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Template: + properties: + tenantid: + description: tenant identifier + type: string + companyid: + description: Company + type: string + createdbyid: + type: string + createddate: + type: string + description: + description: Description + type: string + htmlbody: + description: HTML Body + type: string + id: + description: Taxnexus Record Id + type: string + isactive: + description: Active? + type: boolean + ismaster: + description: Master Template? + type: boolean + lastmodifiedbyid: + type: string + lastmodifieddate: + type: string + name: + description: Template Name + type: string + objecttype: + description: Object + type: string + recordtypename: + description: Record Type Name + type: string + type: + description: Type + type: string + url: + description: URL + type: string + type: object + TemplateResponse: + properties: + data: + items: + $ref: "#/definitions/Template" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + Notebook: + description: Defines a Taxnexus Notebook + type: object + properties: + id: + type: string + description: Record Id + accountid: + type: string + description: Account + contactid: + type: string + description: Contact + createdbyid: + type: string + description: Created By + createddate: + type: string + description: Created Date + date: + type: string + description: Analysis Date + dateend: + type: string + description: End Date + datestart: + type: string + description: Start Date + description: + type: string + description: Description + lastmodifiedbyid: + type: string + description: Last Modified By + lastmodifieddate: + type: string + description: Last Modifed Date + periodendid: + type: string + description: Ending Period + periodstartid: + type: string + description: Starting Period + preparerid: + type: string + description: Preparer + title: + type: string + description: Title + items: + type: array + items: + $ref: "#/definitions/NotebookItem" + NotebookRequest: + description: An array of Notebook objects + properties: + data: + items: + $ref: "#/definitions/Notebook" + type: array + meta: + $ref: "#/definitions/RequestMeta" + type: object + NotebookResponse: + description: An array of Notebook objects + properties: + data: + items: + $ref: "#/definitions/Notebook" + type: array + meta: + $ref: "#/definitions/ResponseMeta" + type: object + NotebookItem: + type: object + description: An analysis item associated with a Notebook + properties: + id: + type: string + description: Record Id + itemname: + type: string + description: Developer name of component + title: + type: string + description: Display title + notebookid: + type: string + description: The notebook that owns this Item diff --git a/swagger/geo-taxnexus.yaml b/swagger/geo-taxnexus.yaml index 6b49076..ae95e6e 100644 --- a/swagger/geo-taxnexus.yaml +++ b/swagger/geo-taxnexus.yaml @@ -1392,6 +1392,22 @@ definitions: type: object Coordinate: properties: + OwnerID: + description: The Taxnexus ID of the user who owns this record + type: string + CreatedByID: + description: The Taxnexus ID of the user who created this record + type: string + CreatedDate: + description: The creation date of this database record + type: string + LastModifiedByID: + description: + The Taxnexus ID of the user last modified this record + type: string + LastModifiedDate: + description: The last modification date of this database record + type: string Country: description: Geocoder Country type: string @@ -1555,6 +1571,22 @@ definitions: type: object Country: properties: + OwnerID: + description: The Taxnexus ID of the user who owns this record + type: string + CreatedByID: + description: The Taxnexus ID of the user who created this record + type: string + CreatedDate: + description: The creation date of this database record + type: string + LastModifiedByID: + description: + The Taxnexus ID of the user last modified this record + type: string + LastModifiedDate: + description: The last modification date of this database record + type: string AccountID: description: Account type: string @@ -1671,6 +1703,22 @@ definitions: type: object County: properties: + OwnerID: + description: The Taxnexus ID of the user who owns this record + type: string + CreatedByID: + description: The Taxnexus ID of the user who created this record + type: string + CreatedDate: + description: The creation date of this database record + type: string + LastModifiedByID: + description: + The Taxnexus ID of the user last modified this record + type: string + LastModifiedDate: + description: The last modification date of this database record + type: string AccountID: description: Account type: string @@ -1917,6 +1965,22 @@ definitions: type: object Place: properties: + OwnerID: + description: The Taxnexus ID of the user who owns this record + type: string + CreatedByID: + description: The Taxnexus ID of the user who created this record + type: string + CreatedDate: + description: The creation date of this database record + type: string + LastModifiedByID: + description: + The Taxnexus ID of the user last modified this record + type: string + LastModifiedDate: + description: The last modification date of this database record + type: string AccountID: description: Account type: string @@ -2032,6 +2096,9 @@ definitions: StateID: description: State type: string + StateCode: + description: State Code + type: string Status: description: Document Status type: string @@ -2130,9 +2197,25 @@ definitions: type: object State: properties: + OwnerID: + description: The Taxnexus ID of the user who owns this record + type: string AccountID: description: Account type: string + CreatedByID: + description: The Taxnexus ID of the user who created this record + type: string + CreatedDate: + description: The creation date of this database record + type: string + LastModifiedByID: + description: + The Taxnexus ID of the user last modified this record + type: string + LastModifiedDate: + description: The last modification date of this database record + type: string Amount: description: Rollup Amount format: double @@ -2280,6 +2363,9 @@ definitions: type: object TaxInstance: properties: + ID: + description: Taxnexus Record ID + type: string CountryID: description: The Taxnexus ID of the Country that owns this instance @@ -2376,6 +2462,33 @@ definitions: type: object TaxType: properties: + Active: + description: + Is this tax type currently active? (not used for tax ratings) + type: boolean + Amount: + description: Total tax amount + type: number + format: double + OwnerID: + description: User ID of the owner of this TaxType + format: string + RevenueBase: + description: Revenue Base for this Tax Type + type: number + format: double + RevenueNet: + description: Revenue Net + type: number + format: double + RevenueNotTaxable: + description: Revenue Not Taxable + format: double + type: number + UnitBase: + description: Unit Base + format: double + type: number AccountID: description: Taxing Authority Account Id type: string diff --git a/swagger/ops-taxnexus.yaml b/swagger/ops-taxnexus.yaml index ef8307e..3ab6ffb 100644 --- a/swagger/ops-taxnexus.yaml +++ b/swagger/ops-taxnexus.yaml @@ -928,7 +928,7 @@ paths: put: consumes: - application/json - description: Create new Orders + description: Update orders operationId: putOrders parameters: - $ref: "#/parameters/orderRequest" @@ -947,7 +947,7 @@ paths: $ref: "#/responses/ServerError" security: - ApiKeyAuth: [] - summary: Create new Orders + summary: Update Orders tags: - Order /paymentmethods: @@ -1351,7 +1351,7 @@ paths: $ref: "#/responses/ServerError" security: - ApiKeyAuth: [] - summary: Get a list of Invoices + summary: Get a list of Quotes tags: - Quote options: @@ -1567,6 +1567,9 @@ definitions: type: object CashReceipt: properties: + ID: + description: Taxnexus Record Id + type: string AccountID: description: Account Name type: string @@ -1576,18 +1579,13 @@ definitions: AppliedAmount: description: Applied Amount type: number - AttemptNumber: - description: Attempt Number - type: number - AuditMessage: - description: Audit Trail Message - type: string - AutoPay: - description: Autopay? - type: boolean BillingContactID: description: Billing Contact type: string + BillingRunID: + description: + The ID of the Billing Run that generated this Cash Receipt + type: string CashReceiptDate: description: Journal Date type: string @@ -1615,8 +1613,8 @@ definitions: GatewayTransaction: description: GatewayTxn? type: boolean - ID: - description: Salesforce Record Id + InvoiceID: + description: Invoice paid by this cash receipt type: string IsValid: description: Is Valid? @@ -1631,35 +1629,20 @@ definitions: description: Partner Account type: string PaymentMethodID: - description: Payment Method + description: ID of the Payment Method used for this Cash Receipt type: string - PaymentNumber: - description: Payment Number - type: string - Pending: - description: Pending? - type: boolean PeriodID: description: Period type: string Posted: description: Posted to external system? type: boolean - Processed: - description: Processed - type: boolean - Processing: - description: Processing - type: boolean - RecordTypeID: + RecordType: description: Record Type type: string Ref: description: Reference type: string - ReferenceNumber: - description: Reference Number - type: string Rejected: description: Rejected? type: boolean @@ -1672,6 +1655,10 @@ definitions: TenantID: description: ID of the Tenant that owns this object type: string + TemplateID: + description: + ID of the Template to be used for rendering this cashreceipt + type: string Type: description: Type type: string @@ -1704,15 +1691,31 @@ definitions: type: object Charge: properties: + ID: + description: Taxnexus Record Id + type: string AccountID: description: Account type: string + AccountingRulesetCode: + description: The Accounting Ruleset Code + type: string Amount: description: Amount type: number BillingContactID: description: Billing Contact ID type: string + BillingEmail: + description: The Email Address to send this charge notification + type: string + BillingRunID: + description: The ID of the BillingRun that generated this Charge + type: string + ContractHourlyRate: + description: The Contract Hourly Rate + format: double + type: number ContractID: description: Contract type: string @@ -1728,12 +1731,6 @@ definitions: EmailMessage: description: Email Message type: string - ExternalMessage: - description: External Message - type: string - ID: - description: Salesforce Record Id - type: string JournalDate: description: Journal Date type: string @@ -1761,12 +1758,23 @@ definitions: Quantity: description: Quantity type: number + format: double + Ref: + description: "external reference, if any" + type: string TenantID: description: ID of the Tenant that owns this object type: string + TemplateID: + description: The ID of the Template used to render this object + type: string + Type: + description: Charge Type + type: string UnitPrice: description: Unit Price type: number + format: double type: object ChargeRequest: properties: @@ -3081,6 +3089,9 @@ definitions: Describes the EFT or other payment information for an account and billing contact properties: + ID: + description: Telnexus Record Id + type: string AccountID: description: Account type: string @@ -3141,9 +3152,6 @@ definitions: GatewayKey: description: Gateway Key type: string - ID: - description: Telnexus Record Id - type: string LastModifiedByID: description: Last Modified By type: string @@ -3301,7 +3309,7 @@ definitions: IsGeneric: description: isGeneric type: boolean - LastModifiedByDate: + LastModifiedDate: description: Last Modified Date type: string LastModifiedByID: @@ -3651,6 +3659,9 @@ definitions: ProductID: description: Product ID type: string + ProductName: + description: Product Name + type: string PurchaseOrderID: description: Purchase Order type: string diff --git a/swagger/wordpress.yaml b/swagger/wordpress.yaml new file mode 100644 index 0000000..1fd3322 --- /dev/null +++ b/swagger/wordpress.yaml @@ -0,0 +1,1035 @@ +swagger: "2.0" +info: + title: taxnexus.net WordPress API + description: The Cannabis Tax Compliance Company + version: 5.2.3 + contact: + email: info@taxnexus.net +host: taxnexus.net +basePath: /wp-json +tags: + - name: wordpress +schemes: + - https +paths: + /wp/v2/posts: + get: + operationId: wpGetPosts + tags: + - wordpress + consumes: + - application/x-www-form-urlencoded + - multipart/form-data + - application/json + produces: + - application/json + parameters: + - name: context + in: query + description: >- + Scope under which the request is made; determines fields present in + response. + required: false + type: array + items: + type: string + enum: + - view + - embed + - edit + default: view + collectionFormat: multi + - name: page + in: query + description: Current page of the collection. + required: false + type: integer + minimum: 1 + format: int64 + - name: per_page + in: query + description: Maximum number of items to be returned in result set. + required: false + type: integer + maximum: 100 + minimum: 1 + format: int64 + - name: search + in: query + description: Limit results to those matching a string. + required: false + type: string + - name: after + in: query + description: >- + Limit response to posts published after a given ISO8601 compliant + date. + required: false + type: string + format: date-time + - name: author + in: query + description: Limit result set to posts assigned to specific authors. + required: false + type: array + items: + type: integer + - name: author_exclude + in: query + description: Ensure result set excludes posts assigned to specific authors. + required: false + type: array + items: + type: integer + - name: before + in: query + description: >- + Limit response to posts published before a given ISO8601 compliant + date. + required: false + type: string + format: date-time + - name: exclude + in: query + description: Ensure result set excludes specific IDs. + required: false + type: array + items: + type: integer + - name: include + in: query + description: Limit result set to specific IDs. + required: false + type: array + items: + type: integer + - name: offset + in: query + description: Offset the result set by a specific number of items. + required: false + type: integer + format: int64 + - name: order + in: query + description: Order sort attribute ascending or descending. + required: false + type: array + items: + type: string + enum: + - asc + - desc + default: desc + collectionFormat: multi + - name: orderby + in: query + description: Sort collection by object attribute. + required: false + type: array + items: + type: string + enum: + - author + - date + - id + - include + - modified + - parent + - relevance + - slug + - include_slugs + - title + default: date + collectionFormat: multi + - name: slug + in: query + description: Limit result set to posts with one or more specific slugs. + required: false + type: array + items: + type: string + - name: status + in: query + description: Limit result set to posts assigned one or more statuses. + required: false + type: array + items: + type: string + - name: categories + in: query + description: >- + Limit result set to all items that have the specified term assigned + in the categories taxonomy. + required: false + type: array + items: + type: integer + - name: categories_exclude + in: query + description: >- + Limit result set to all items except those that have the specified + term assigned in the categories taxonomy. + required: false + type: array + items: + type: integer + - name: tags + in: query + description: >- + Limit result set to all items that have the specified term assigned + in the tags taxonomy. + required: false + type: array + items: + type: integer + - name: tags_exclude + in: query + description: >- + Limit result set to all items except those that have the specified + term assigned in the tags taxonomy. + required: false + type: array + items: + type: integer + - name: sticky + in: query + description: Limit result set to items that are sticky. + required: false + type: boolean + security: + - basic: [] + responses: + "200": + $ref: "#/responses/wpPostResponse" + "400": + description: Bad Request + "404": + description: Not Found + "/wp/v2/posts/{id}": + get: + operationId: wpGetPost + tags: + - wordpress + consumes: + - application/x-www-form-urlencoded + - multipart/form-data + - application/json + produces: + - application/json + parameters: + - name: id + in: path + description: Unique identifier for the object. + required: true + type: integer + format: int64 + - name: context + in: query + description: >- + Scope under which the request is made; determines fields present in + response. + required: false + type: array + items: + type: string + enum: + - view + - embed + - edit + default: view + collectionFormat: multi + - name: password + in: query + description: The password for the post if it is password protected. + required: false + type: string + security: + - basic: [] + responses: + "200": + $ref: "#/responses/wpPostResponse" + "400": + description: Bad Request + "404": + description: Not Found + /wp/v2/pages: + get: + operationId: wpGetPages + tags: + - wordpress + consumes: + - application/x-www-form-urlencoded + - multipart/form-data + - application/json + produces: + - application/json + parameters: + - name: context + in: query + description: >- + Scope under which the request is made; determines fields present in + response. + required: false + type: array + items: + type: string + enum: + - view + - embed + - edit + default: view + collectionFormat: multi + - name: page + in: query + description: Current page of the collection. + required: false + type: integer + minimum: 1 + format: int64 + - name: per_page + in: query + description: Maximum number of items to be returned in result set. + required: false + type: integer + maximum: 100 + minimum: 1 + format: int64 + - name: search + in: query + description: Limit results to those matching a string. + required: false + type: string + - name: after + in: query + description: >- + Limit response to posts published after a given ISO8601 compliant + date. + required: false + type: string + format: date-time + - name: author + in: query + description: Limit result set to posts assigned to specific authors. + required: false + type: array + items: + type: integer + - name: author_exclude + in: query + description: Ensure result set excludes posts assigned to specific authors. + required: false + type: array + items: + type: integer + - name: before + in: query + description: >- + Limit response to posts published before a given ISO8601 compliant + date. + required: false + type: string + format: date-time + - name: exclude + in: query + description: Ensure result set excludes specific IDs. + required: false + type: array + items: + type: integer + - name: include + in: query + description: Limit result set to specific IDs. + required: false + type: array + items: + type: integer + - name: menu_order + in: query + description: Limit result set to posts with a specific menu_order value. + required: false + type: integer + format: int64 + - name: offset + in: query + description: Offset the result set by a specific number of items. + required: false + type: integer + format: int64 + - name: order + in: query + description: Order sort attribute ascending or descending. + required: false + type: array + items: + type: string + enum: + - asc + - desc + default: desc + collectionFormat: multi + - name: orderby + in: query + description: Sort collection by object attribute. + required: false + type: array + items: + type: string + enum: + - author + - date + - id + - include + - modified + - parent + - relevance + - slug + - include_slugs + - title + - menu_order + default: date + collectionFormat: multi + - name: parent + in: query + description: Limit result set to items with particular parent IDs. + required: false + type: array + items: + type: integer + - name: parent_exclude + in: query + description: >- + Limit result set to all items except those of a particular parent + ID. + required: false + type: array + items: + type: integer + - name: slug + in: query + description: Limit result set to posts with one or more specific slugs. + required: false + type: array + items: + type: string + - name: status + in: query + description: Limit result set to posts assigned one or more statuses. + required: false + type: array + items: + type: string + security: + - basic: [] + responses: + "200": + $ref: "#/responses/wpPageResponse" + "400": + description: Bad Request + "404": + description: Not Found + "/wp/v2/pages/{id}": + get: + operationId: wpGetPage + tags: + - wordpress + consumes: + - application/x-www-form-urlencoded + - multipart/form-data + - application/json + produces: + - application/json + parameters: + - name: id + in: path + description: Unique identifier for the object. + required: true + type: integer + format: int64 + - name: context + in: query + description: >- + Scope under which the request is made; determines fields present in + response. + required: false + type: array + items: + type: string + enum: + - view + - embed + - edit + default: view + collectionFormat: multi + - name: password + in: query + description: The password for the post if it is password protected. + required: false + type: string + security: + - basic: [] + responses: + "200": + $ref: "#/responses/wpPageResponse" + "400": + description: Bad Request + "404": + description: Not Found + /wp/v2/media: + get: + operationId: wpGetMedias + tags: + - wordpress + consumes: + - application/x-www-form-urlencoded + - multipart/form-data + - application/json + produces: + - application/json + parameters: + - name: context + in: query + description: >- + Scope under which the request is made; determines fields present in + response. + required: false + type: array + items: + type: string + enum: + - view + - embed + - edit + default: view + collectionFormat: multi + - name: page + in: query + description: Current page of the collection. + required: false + type: integer + minimum: 1 + format: int64 + - name: per_page + in: query + description: Maximum number of items to be returned in result set. + required: false + type: integer + maximum: 100 + minimum: 1 + format: int64 + - name: search + in: query + description: Limit results to those matching a string. + required: false + type: string + - name: after + in: query + description: >- + Limit response to posts published after a given ISO8601 compliant + date. + required: false + type: string + format: date-time + - name: author + in: query + description: Limit result set to posts assigned to specific authors. + required: false + type: array + items: + type: integer + - name: author_exclude + in: query + description: Ensure result set excludes posts assigned to specific authors. + required: false + type: array + items: + type: integer + - name: before + in: query + description: >- + Limit response to posts published before a given ISO8601 compliant + date. + required: false + type: string + format: date-time + - name: exclude + in: query + description: Ensure result set excludes specific IDs. + required: false + type: array + items: + type: integer + - name: include + in: query + description: Limit result set to specific IDs. + required: false + type: array + items: + type: integer + - name: offset + in: query + description: Offset the result set by a specific number of items. + required: false + type: integer + format: int64 + - name: order + in: query + description: Order sort attribute ascending or descending. + required: false + type: array + items: + type: string + enum: + - asc + - desc + default: desc + collectionFormat: multi + - name: orderby + in: query + description: Sort collection by object attribute. + required: false + type: array + items: + type: string + enum: + - author + - date + - id + - include + - modified + - parent + - relevance + - slug + - include_slugs + - title + default: date + collectionFormat: multi + - name: parent + in: query + description: Limit result set to items with particular parent IDs. + required: false + type: array + items: + type: integer + - name: parent_exclude + in: query + description: >- + Limit result set to all items except those of a particular parent + ID. + required: false + type: array + items: + type: integer + - name: slug + in: query + description: Limit result set to posts with one or more specific slugs. + required: false + type: array + items: + type: string + - name: status + in: query + description: Limit result set to posts assigned one or more statuses. + required: false + type: array + items: + type: string + - name: media_type + in: query + description: Limit result set to attachments of a particular media type. + required: false + type: array + items: + type: string + enum: + - image + - video + - text + - application + - audio + collectionFormat: multi + - name: mime_type + in: query + description: Limit result set to attachments of a particular MIME type. + required: false + type: string + security: + - basic: [] + responses: + "200": + $ref: "#/responses/wpMediaResponse" + "400": + description: Bad Request + "404": + description: Not Found + "/wp/v2/media/{id}": + get: + operationId: wpGetMedia + tags: + - wordpress + consumes: + - application/x-www-form-urlencoded + - multipart/form-data + - application/json + produces: + - application/json + parameters: + - name: id + in: path + description: Unique identifier for the object. + required: true + type: integer + format: int64 + - name: context + in: query + description: >- + Scope under which the request is made; determines fields present in + response. + required: false + type: array + items: + type: string + enum: + - view + - embed + - edit + default: view + collectionFormat: multi + security: + - basic: [] + responses: + "200": + $ref: "#/responses/wpMediaResponse" + "400": + description: Bad Request + "404": + description: Not Found +responses: + wpPostResponse: + description: "Wordpress Post Response" + schema: + $ref: "#/definitions/wpPostResponse" + wpPageResponse: + description: "Wordpress Page Response" + schema: + $ref: "#/definitions/wpPageResponse" + wpMediaResponse: + description: "Wordpress Media Response" + schema: + $ref: "#/definitions/wpMediaResponse" +definitions: + wpPostResponse: + description: "WP Post Response Array" + type: "array" + items: + $ref: "#/definitions/wpPage" + wpPageResponse: + description: "WP Page Response Array" + type: "array" + items: + $ref: "#/definitions/wpPost" + wpMediaResponse: + description: "WP Media Response Array" + type: "array" + items: + $ref: "#/definitions/wpMedia" + wpMedia: + properties: + id: + type: "number" + date: + type: "string" + date_gmt: + type: "string" + guid: + required: + - "rendered" + properties: + rendered: + type: "string" + type: "object" + modified: + type: "string" + modified_gmt: + type: "string" + slug: + type: "string" + status: + type: "string" + type: + type: "string" + link: + type: "string" + title: + required: + - "rendered" + properties: + rendered: + type: "string" + type: "object" + author: + type: "number" + comment_status: + type: "string" + ping_status: + type: "string" + template: + type: "string" + meta: + required: + - "amp_status" + - "spay_email" + properties: + amp_status: + type: "string" + spay_email: + type: "string" + type: "object" + jetpack_sharing_enabled: + type: "boolean" + jetpack_shortlink: + type: "string" + jetpack_likes_enabled: + type: "boolean" + description: + required: + - "rendered" + properties: + rendered: + type: "string" + type: "object" + caption: + required: + - "rendered" + properties: + rendered: + type: "string" + type: "object" + alt_text: + type: "string" + media_type: + type: "string" + mime_type: + type: "string" + media_details: + required: + - "width" + - "height" + - "file" + - "sizes" + - "image_meta" + properties: + width: + type: "number" + height: + type: "number" + file: + type: "string" + image_meta: + properties: + aperture: + type: "string" + credit: + type: "string" + camera: + type: "string" + caption: + type: "string" + created_timestamp: + type: "string" + copyright: + type: "string" + focal_length: + type: "string" + iso: + type: "string" + shutter_speed: + type: "string" + title: + type: "string" + orientation: + type: "string" + keywords: + type: "array" + items: + type: "string" + type: "object" + type: "object" + post: + type: "number" + source_url: + type: "string" + _links: + properties: + self: + type: "array" + items: + type: "object" + properties: + href: + type: "string" + collection: + type: "array" + items: + type: "object" + properties: + href: + type: "string" + about: + type: "array" + items: + type: "object" + properties: + href: + type: "string" + author: + type: "array" + items: + type: "object" + properties: + embeddable: + type: "boolean" + href: + type: "string" + replies: + type: "array" + items: + type: "object" + properties: + embeddable: + type: "boolean" + href: + type: "string" + type: "object" + type: "object" + wpPage: + properties: + id: + type: "number" + date: + type: "string" + date_gmt: + type: "string" + guid: + properties: + rendered: + type: "string" + type: "object" + modified: + type: "string" + modified_gmt: + type: "string" + slug: + type: "string" + status: + type: "string" + type: + type: "string" + link: + type: "string" + title: + properties: + rendered: + type: "string" + type: "object" + content: + properties: + rendered: + type: "string" + protected: + type: "boolean" + type: "object" + excerpt: + properties: + rendered: + type: "string" + protected: + type: "boolean" + type: "object" + author: + type: "number" + featured_media: + type: "number" + parent: + type: "number" + menu_order: + type: "number" + comment_status: + type: "string" + ping_status: + type: "string" + template: + type: "string" + meta: + properties: + amp_status: + type: "string" + spay_email: + type: "string" + type: "object" + type: "object" + wpPost: + properties: + id: + type: "number" + date: + type: "string" + date_gmt: + type: "string" + guid: + properties: + rendered: + type: "string" + type: "object" + modified: + type: "string" + modified_gmt: + type: "string" + slug: + type: "string" + status: + type: "string" + type: + type: "string" + link: + type: "string" + title: + properties: + rendered: + type: "string" + type: "object" + content: + properties: + rendered: + type: "string" + protected: + type: "boolean" + type: "object" + excerpt: + properties: + rendered: + type: "string" + protected: + type: "boolean" + type: "object" + author: + type: "number" + featured_media: + type: "number" + parent: + type: "number" + menu_order: + type: "number" + comment_status: + type: "string" + ping_status: + type: "string" + template: + type: "string" + meta: + properties: + amp_status: + type: "string" + spay_email: + type: "string" + type: "object" + type: "object"