From a1899a8ac94a208e3faf6e089aef93256dd07eaf Mon Sep 17 00:00:00 2001 From: Vernon Keenan Date: Fri, 5 Feb 2021 14:04:17 -0800 Subject: [PATCH] chain --- api/geo/geo_models/tax_type.go | 3 + api/plex/plex_models/tax_return_panel.go | 36 +++++++ app/accountingruleset-services.go | 1 + app/address-services.go | 2 + app/root.go | 2 +- app/taxtype-helpers.go | 2 + app/taxtype.go | 1 + swagger/geo-taxnexus.yaml | 3 + swagger/plex-taxnexus.yaml | 128 ++++++++++++++++------- 9 files changed, 137 insertions(+), 41 deletions(-) diff --git a/api/geo/geo_models/tax_type.go b/api/geo/geo_models/tax_type.go index c286a94..0ef2dd4 100644 --- a/api/geo/geo_models/tax_type.go +++ b/api/geo/geo_models/tax_type.go @@ -40,6 +40,9 @@ type TaxType struct { // Category Category string `json:"Category,omitempty"` + // Type of tax chaining + ChainType string `json:"ChainType,omitempty"` + // Collector Domain Id CollectorDomainID string `json:"CollectorDomainID,omitempty"` diff --git a/api/plex/plex_models/tax_return_panel.go b/api/plex/plex_models/tax_return_panel.go index ceb2c18..c84a268 100644 --- a/api/plex/plex_models/tax_return_panel.go +++ b/api/plex/plex_models/tax_return_panel.go @@ -31,6 +31,18 @@ type TaxReturnPanel struct { // cannabis c o g s total CannabisCOGSTotal float64 `json:"CannabisCOGSTotal,omitempty"` + // cannabis gross margin + CannabisGrossMargin []float64 `json:"CannabisGrossMargin"` + + // cannabis gross margin percentage average + CannabisGrossMarginPercentageAverage float64 `json:"CannabisGrossMarginPercentageAverage,omitempty"` + + // cannabis gross margin perentage + CannabisGrossMarginPerentage []float64 `json:"CannabisGrossMarginPerentage"` + + // cannabis gross margin total + CannabisGrossMarginTotal float64 `json:"CannabisGrossMarginTotal,omitempty"` + // cannabis revenue CannabisRevenue []float64 `json:"CannabisRevenue"` @@ -106,6 +118,18 @@ type TaxReturnPanel struct { // estimated discounts total EstimatedDiscountsTotal float64 `json:"EstimatedDiscountsTotal,omitempty"` + // estimated gross margin + EstimatedGrossMargin []float64 `json:"EstimatedGrossMargin"` + + // estimated gross margin percentage average + EstimatedGrossMarginPercentageAverage float64 `json:"EstimatedGrossMarginPercentageAverage,omitempty"` + + // estimated gross margin perentage + EstimatedGrossMarginPerentage []float64 `json:"EstimatedGrossMarginPerentage"` + + // estimated gross margin total + EstimatedGrossMarginTotal float64 `json:"EstimatedGrossMarginTotal,omitempty"` + // estimated sales taxes EstimatedSalesTaxes []float64 `json:"EstimatedSalesTaxes"` @@ -142,6 +166,18 @@ type TaxReturnPanel struct { // merch c o g s total MerchCOGSTotal float64 `json:"MerchCOGSTotal,omitempty"` + // merch gross margin + MerchGrossMargin []float64 `json:"MerchGrossMargin"` + + // merch gross margin percentage + MerchGrossMarginPercentage []float64 `json:"MerchGrossMarginPercentage"` + + // merch gross margin percentage average + MerchGrossMarginPercentageAverage float64 `json:"MerchGrossMarginPercentageAverage,omitempty"` + + // merch gross margin total + MerchGrossMarginTotal float64 `json:"MerchGrossMarginTotal,omitempty"` + // merch revenue MerchRevenue []float64 `json:"MerchRevenue"` diff --git a/app/accountingruleset-services.go b/app/accountingruleset-services.go index 29d7c46..deece7d 100644 --- a/app/accountingruleset-services.go +++ b/app/accountingruleset-services.go @@ -7,6 +7,7 @@ import ( "code.tnxs.net/taxnexus/lib/api/ledger/ledger_models" ) +// GetAccountingRulesetsByAccountID is an accounting ruleset helper function func GetAccountingRulesetsByAccountID( accountID string, principal *User, diff --git a/app/address-services.go b/app/address-services.go index 6c4536d..d46ade1 100644 --- a/app/address-services.go +++ b/app/address-services.go @@ -6,12 +6,14 @@ import ( "code.tnxs.net/taxnexus/lib/api/geo/geo_models" ) +// GeocodeAddressParams is a params type type GeocodeAddressParams struct { BusinessAddress *Address Account *Account Ref string } +// GeocodeAddress returns a full Coordinate object in response to Business Address func GeocodeAddress(params GeocodeAddressParams, principal *User) (*geo_models.CoordinateBasic, error) { if params.BusinessAddress == nil { sugar.Infof("ops.geocodeAddress: ❗ Business Address is null, ref = %s", params.Ref) diff --git a/app/root.go b/app/root.go index 9aed395..0a0597f 100644 --- a/app/root.go +++ b/app/root.go @@ -45,7 +45,7 @@ const dateTimeFormatAlt = "2006-01-02 15:04:05" const dateFormatAlt = "1/2/2006" const countyGeocodeLength = 7 -var maxTaxTypes = int64(2000) +var maxTaxTypes = int64(2000) //nolint:gomnd // it's a var const // const cityGeocodeLength = 12 diff --git a/app/taxtype-helpers.go b/app/taxtype-helpers.go index ef2e8b9..feb069a 100644 --- a/app/taxtype-helpers.go +++ b/app/taxtype-helpers.go @@ -66,6 +66,7 @@ func UnMarshalTaxType(s *geo_models.TaxType) *TaxType { AgentID: s.AgentID, Amount: s.Amount, Category: s.Category, + ChainType: s.ChainType, CollectorDomainID: s.CollectorDomainID, CompanyID: s.CompanyID, ContactID: s.ContactID, @@ -123,6 +124,7 @@ func (obj *TaxType) MarshalToSwagger() *geo_models.TaxType { AgentID: obj.AgentID, Amount: obj.Amount, Category: obj.Category, + ChainType: obj.ChainType, CollectorDomainID: obj.CollectorDomainID, CompanyID: obj.CompanyID, ContactID: obj.ContactID, diff --git a/app/taxtype.go b/app/taxtype.go index 20e51f0..a4e2f0c 100644 --- a/app/taxtype.go +++ b/app/taxtype.go @@ -25,6 +25,7 @@ type TaxType struct { AgentID string Amount float64 Category string + ChainType string CollectorDomainID string CompanyID string Contact Contact diff --git a/swagger/geo-taxnexus.yaml b/swagger/geo-taxnexus.yaml index 26d203e..9f55424 100644 --- a/swagger/geo-taxnexus.yaml +++ b/swagger/geo-taxnexus.yaml @@ -2504,6 +2504,9 @@ definitions: Category: description: Category type: string + ChainType: + description: Type of tax chaining + type: string CollectorDomainID: description: Collector Domain Id type: string diff --git a/swagger/plex-taxnexus.yaml b/swagger/plex-taxnexus.yaml index 8f7760e..5d74cc9 100644 --- a/swagger/plex-taxnexus.yaml +++ b/swagger/plex-taxnexus.yaml @@ -432,6 +432,22 @@ definitions: CannabisCOGSTotal: format: double type: number + CannabisGrossMargin: + items: + format: double + type: number + type: array + CannabisGrossMarginPercentageAverage: + format: double + type: number + CannabisGrossMarginPerentage: + items: + format: double + type: number + type: array + CannabisGrossMarginTotal: + format: double + type: number CannabisRevenue: items: format: double @@ -457,12 +473,6 @@ definitions: CountySalesTaxesTotal: format: double type: number - DistrictCombinedRate: - format: double - type: number - DistrictSalesTaxRate: - format: double - type: number DistrictCannabisBusinessTaxes: items: format: double @@ -479,6 +489,14 @@ definitions: DistrictCannabisDeliveryTaxesTotal: format: double type: number + DistrictCombinedRate: + format: double + type: number + DistrictName: + type: string + DistrictSalesTaxRate: + format: double + type: number DistrictSalesTaxes: items: format: double @@ -487,26 +505,8 @@ definitions: DistrictSalesTaxesTotal: format: double type: number - DistrictName: - type: string DistrictType: type: string - EstimatedSalesTaxes: - items: - format: double - type: number - type: array - EstimatedSalesTaxesTotal: - format: double - type: number - EstimatedTotals: - items: - format: double - type: number - type: array - EstimatedTotalsTotal: - format: double - type: number EstimatedBusinessTaxes: items: format: double @@ -515,14 +515,6 @@ definitions: EstimatedBusinessTaxesTotal: format: double type: number - EstimatedCannabisTaxes: - items: - format: double - type: number - type: array - EstimatedCannabisTaxesTotal: - format: double - type: number EstimatedCOGS: items: format: double @@ -531,6 +523,14 @@ definitions: EstimatedCOGSTotal: format: double type: number + EstimatedCannabisTaxes: + items: + format: double + type: number + type: array + EstimatedCannabisTaxesTotal: + format: double + type: number EstimatedDiscounts: items: format: double @@ -539,6 +539,30 @@ definitions: EstimatedDiscountsTotal: format: double type: number + EstimatedGrossMargin: + items: + format: double + type: number + type: array + EstimatedGrossMarginPercentageAverage: + format: double + type: number + EstimatedGrossMarginPerentage: + items: + format: double + type: number + type: array + EstimatedGrossMarginTotal: + format: double + type: number + EstimatedSalesTaxes: + items: + format: double + type: number + type: array + EstimatedSalesTaxesTotal: + format: double + type: number EstimatedSubtotals: items: format: double @@ -547,6 +571,14 @@ definitions: EstimatedSubtotalsTotal: format: double type: number + EstimatedTotals: + items: + format: double + type: number + type: array + EstimatedTotalsTotal: + format: double + type: number ExciseTaxes: items: format: double @@ -567,6 +599,22 @@ definitions: MerchCOGSTotal: format: double type: number + MerchGrossMargin: + items: + format: double + type: number + type: array + MerchGrossMarginPercentage: + items: + format: double + type: number + type: array + MerchGrossMarginPercentageAverage: + format: double + type: number + MerchGrossMarginTotal: + format: double + type: number MerchRevenue: items: format: double @@ -599,6 +647,14 @@ definitions: SalesTaxesTotal: format: double type: number + StateCannabisTaxes: + items: + format: double + type: number + type: array + StateCannabisTaxesTotal: + format: double + type: number StateSalesTaxRate: format: double type: number @@ -610,14 +666,6 @@ definitions: StateSalesTaxesTotal: format: double type: number - StateCannabisTaxes: - items: - format: double - type: number - type: array - StateCannabisTaxesTotal: - format: double - type: number TaxExemptRevenue: items: format: double