From d0c2f898e2ad29fc864eb3545b0cd0eb86caaec3 Mon Sep 17 00:00:00 2001 From: maxwelbm Date: Thu, 14 Nov 2024 07:32:54 -0300 Subject: [PATCH] feat: added command product in root --- components/mdz/pkg/cmd/product/product.go | 10 +++++----- components/mdz/pkg/cmd/root/root.go | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/components/mdz/pkg/cmd/product/product.go b/components/mdz/pkg/cmd/product/product.go index d39eb0a8..9acdb7f8 100644 --- a/components/mdz/pkg/cmd/product/product.go +++ b/components/mdz/pkg/cmd/product/product.go @@ -6,20 +6,20 @@ import ( "github.com/spf13/cobra" ) -type factoryPortfolio struct { +type factoryProduct struct { factory *factory.Factory } -func (f *factoryPortfolio) setCmds(cmd *cobra.Command) { +func (f *factoryProduct) setCmds(cmd *cobra.Command) { cmd.AddCommand(newCmdProductCreate(newInjectFacCreate(f.factory))) } -func NewCmdPortfolio(f *factory.Factory) *cobra.Command { - fOrg := factoryPortfolio{ +func NewCmdProduct(f *factory.Factory) *cobra.Command { + fOrg := factoryProduct{ factory: f, } cmd := &cobra.Command{ - Use: "portfolio", + Use: "product", Short: "Manages the creation and maintenance of products for customer clustering.", Long: utils.Format( "The product command allows you to create and manage products, which", diff --git a/components/mdz/pkg/cmd/root/root.go b/components/mdz/pkg/cmd/root/root.go index 73623225..fb421088 100644 --- a/components/mdz/pkg/cmd/root/root.go +++ b/components/mdz/pkg/cmd/root/root.go @@ -8,6 +8,7 @@ import ( "github.com/LerianStudio/midaz/components/mdz/pkg/cmd/login" "github.com/LerianStudio/midaz/components/mdz/pkg/cmd/organization" "github.com/LerianStudio/midaz/components/mdz/pkg/cmd/portfolio" + "github.com/LerianStudio/midaz/components/mdz/pkg/cmd/product" "github.com/LerianStudio/midaz/components/mdz/pkg/cmd/utils" "github.com/LerianStudio/midaz/components/mdz/pkg/cmd/version" "github.com/LerianStudio/midaz/components/mdz/pkg/factory" @@ -23,11 +24,11 @@ type factoryRoot struct { func (f *factoryRoot) setCmds(cmd *cobra.Command) { cmd.AddCommand(version.NewCmdVersion(f.factory)) cmd.AddCommand(login.NewCmdLogin(f.factory)) - cmd.AddCommand(organization.NewCmdOrganization(f.factory)) cmd.AddCommand(ledger.NewCmdLedger(f.factory)) cmd.AddCommand(asset.NewCmdAsset(f.factory)) cmd.AddCommand(portfolio.NewCmdPortfolio(f.factory)) + cmd.AddCommand(product.NewCmdProduct(f.factory)) } func (f *factoryRoot) setFlags(cmd *cobra.Command) {