diff --git a/cmd/cli/Taskfile.yaml b/cmd/cli/Taskfile.yaml index 5cddc0f5..8f8d4776 100644 --- a/cmd/cli/Taskfile.yaml +++ b/cmd/cli/Taskfile.yaml @@ -50,6 +50,12 @@ tasks: cmds: - go run main.go organization-setting get + orgsub:get: + desc: gets the org subscription + aliases: [getorgsub] + cmds: + - go run main.go org-subscription get + token:create: desc: creates an api token against a running local instance of the server aliases: [tokencreate] @@ -96,7 +102,7 @@ tasks: - task: program:create - task: token:create - task: pat:create - - task: getorgsetting + - task: orgsub:get user:all:another: diff --git a/cmd/cli/cmd/organization/root.go b/cmd/cli/cmd/organization/root.go index 832d2e7d..4142f39d 100644 --- a/cmd/cli/cmd/organization/root.go +++ b/cmd/cli/cmd/organization/root.go @@ -39,6 +39,15 @@ func consoleOutput(e any) error { nodes = append(nodes, i.Node) } + e = nodes + e = nodes + case *openlaneclient.GetOrganizations: + var nodes []*openlaneclient.GetOrganizations_Organizations_Edges_Node + + for _, i := range v.Organizations.Edges { + nodes = append(nodes, i.Node) + } + e = nodes case *openlaneclient.GetOrganizationByID: e = v.Organization diff --git a/cmd/cli/cmd/organizationsetting/root.go b/cmd/cli/cmd/organizationsetting/root.go index ceacb71f..77c30a5c 100644 --- a/cmd/cli/cmd/organizationsetting/root.go +++ b/cmd/cli/cmd/organizationsetting/root.go @@ -94,20 +94,18 @@ func tableOutput(out []openlaneclient.OrganizationSetting) { "TaxIdentifier", "Tags", "Domains", - "StripeID", ) for _, i := range out { writer.AddRow(i.ID, i.Organization.Name, *i.BillingContact, - *i.BillingAddress, + i.BillingAddress.String(), *i.BillingEmail, *i.BillingPhone, *i.GeoLocation, *i.TaxIdentifier, strings.Join(i.Tags, ", "), - strings.Join(i.Domains, ", "), - *i.StripeID) + strings.Join(i.Domains, ", ")) } writer.Render() diff --git a/cmd/cli/cmd/organizationsetting/update.go b/cmd/cli/cmd/organizationsetting/update.go index 5d517a10..7a13a8f8 100644 --- a/cmd/cli/cmd/organizationsetting/update.go +++ b/cmd/cli/cmd/organizationsetting/update.go @@ -26,7 +26,6 @@ func init() { updateCmd.Flags().StringP("billing-contact", "c", "", "billing contact for the org") updateCmd.Flags().StringP("billing-email", "e", "", "billing email for the org") updateCmd.Flags().StringP("billing-phone", "p", "", "billing phone for the org") - updateCmd.Flags().StringP("billing-address", "a", "", "billing address for the org") updateCmd.Flags().StringP("tax-identifier", "x", "", "tax identifier for the org") updateCmd.Flags().StringSliceP("tags", "t", []string{}, "tags associated with the org") } @@ -53,11 +52,6 @@ func updateValidation() (id string, input openlaneclient.UpdateOrganizationSetti input.BillingPhone = &billingPhone } - billingAddress := cmd.Config.String("billing-address") - if billingAddress != "" { - input.BillingAddress = &billingAddress - } - taxIdentifier := cmd.Config.String("tax-identifier") if taxIdentifier != "" { input.TaxIdentifier = &taxIdentifier diff --git a/cmd/cli/cmd/orgsubscription/doc.go b/cmd/cli/cmd/orgsubscription/doc.go new file mode 100644 index 00000000..75f200c3 --- /dev/null +++ b/cmd/cli/cmd/orgsubscription/doc.go @@ -0,0 +1,2 @@ +// Package orgsubscription is our cobra cli for orgSubscription endpoints +package orgsubscription diff --git a/cmd/cli/cmd/orgsubscription/get.go b/cmd/cli/cmd/orgsubscription/get.go new file mode 100644 index 00000000..56d627a6 --- /dev/null +++ b/cmd/cli/cmd/orgsubscription/get.go @@ -0,0 +1,52 @@ +package orgsubscription + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" +) + +var getCmd = &cobra.Command{ + Use: "get", + Short: "get an existing orgSubscription", + Run: func(cmd *cobra.Command, args []string) { + err := get(cmd.Context()) + cobra.CheckErr(err) + }, +} + +func init() { + command.AddCommand(getCmd) + getCmd.Flags().StringP("id", "i", "", "orgSubscription id to query") + +} + +// get an existing orgSubscription in the platform +func get(ctx context.Context) error { + // attempt to setup with token, otherwise fall back to JWT with session + client, err := cmd.TokenAuth(ctx, cmd.Config) + if err != nil || client == nil { + // setup http client + client, err = cmd.SetupClientWithAuth(ctx) + cobra.CheckErr(err) + defer cmd.StoreSessionCookies(client) + } + // filter options + id := cmd.Config.String("id") + + // if an orgSubscription ID is provided, filter on that orgSubscription, otherwise get all + if id != "" { + o, err := client.GetOrgSubscriptionByID(ctx, id) + cobra.CheckErr(err) + + return consoleOutput(o) + } + + // get all will be filtered for the authorized organization(s) + o, err := client.GetAllOrgSubscriptions(ctx) + cobra.CheckErr(err) + + return consoleOutput(o) +} diff --git a/cmd/cli/cmd/orgsubscription/root.go b/cmd/cli/cmd/orgsubscription/root.go new file mode 100644 index 00000000..af9419f8 --- /dev/null +++ b/cmd/cli/cmd/orgsubscription/root.go @@ -0,0 +1,107 @@ +package orgsubscription + +import ( + "encoding/json" + "strings" + + "github.com/spf13/cobra" + + "github.com/theopenlane/core/cmd/cli/cmd" + "github.com/theopenlane/core/pkg/openlaneclient" + "github.com/theopenlane/utils/cli/tables" +) + +// command represents the base orgSubscription command when called without any subcommands +var command = &cobra.Command{ + Use: "org-subscription", + Aliases: []string{"organization-subscription"}, + Short: "the subcommands for working with orgSubscriptions", +} + +func init() { + cmd.RootCmd.AddCommand(command) +} + +// consoleOutput prints the output in the console +func consoleOutput(e any) error { + // check if the output format is JSON and print the orgSubscriptions in JSON format + if strings.EqualFold(cmd.OutputFormat, cmd.JSONOutput) { + return jsonOutput(e) + } + + // check the type of the orgSubscriptions and print them in a table format + switch v := e.(type) { + case *openlaneclient.GetAllOrgSubscriptions: + var nodes []*openlaneclient.GetAllOrgSubscriptions_OrgSubscriptions_Edges_Node + + for _, i := range v.OrgSubscriptions.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetOrgSubscriptions: + var nodes []*openlaneclient.GetOrgSubscriptions_OrgSubscriptions_Edges_Node + + for _, i := range v.OrgSubscriptions.Edges { + nodes = append(nodes, i.Node) + } + + e = nodes + case *openlaneclient.GetOrgSubscriptionByID: + e = v.OrgSubscription + } + + s, err := json.Marshal(e) + cobra.CheckErr(err) + + var list []openlaneclient.OrgSubscription + + err = json.Unmarshal(s, &list) + if err != nil { + var in openlaneclient.OrgSubscription + err = json.Unmarshal(s, &in) + cobra.CheckErr(err) + + list = append(list, in) + } + + tableOutput(list) + + return nil +} + +// jsonOutput prints the output in a JSON format +func jsonOutput(out any) error { + s, err := json.Marshal(out) + cobra.CheckErr(err) + + return cmd.JSONPrint(s) +} + +// tableOutput prints the output in a table format +func tableOutput(out []openlaneclient.OrgSubscription) { + // create a table writer + // TODO: add additional columns to the table writer + writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "StripeCustomerID", "StripeSubscriptionStatus", "ProductTier", "Features", "ExpiresAt") + for _, i := range out { + features := []string{} + if i.Features != nil { + features = i.Features + } + + exp := "" + if i.ExpiresAt != nil { + exp = i.ExpiresAt.String() + } + + writer.AddRow(i.ID, + *i.StripeCustomerID, + *i.StripeSubscriptionStatus, + *i.ProductTier, + strings.Join(features, ", "), + exp, + ) + } + + writer.Render() +} diff --git a/cmd/cli/main.go b/cmd/cli/main.go index 777893fb..c93058ce 100644 --- a/cmd/cli/main.go +++ b/cmd/cli/main.go @@ -24,6 +24,7 @@ import ( _ "github.com/theopenlane/core/cmd/cli/cmd/organization" _ "github.com/theopenlane/core/cmd/cli/cmd/organizationsetting" _ "github.com/theopenlane/core/cmd/cli/cmd/orgmembers" + _ "github.com/theopenlane/core/cmd/cli/cmd/orgsubscription" _ "github.com/theopenlane/core/cmd/cli/cmd/personalaccesstokens" _ "github.com/theopenlane/core/cmd/cli/cmd/procedure" _ "github.com/theopenlane/core/cmd/cli/cmd/program" diff --git a/cmd/serve.go b/cmd/serve.go index 23d0bd10..fbcd21d4 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -114,7 +114,7 @@ func serve(ctx context.Context) error { ) // Setup DB connection - log.Info().Interface("db", so.Config.Settings.DB).Msg("connecting to database") + log.Info().Interface("db", so.Config.Settings.DB.DatabaseName).Msg("connecting to database") jobOpts := []riverqueue.Option{ riverqueue.WithConnectionURI(so.Config.Settings.JobQueue.ConnectionURI), diff --git a/db/migrations-goose-postgres/20250109002850_billing_address.sql b/db/migrations-goose-postgres/20250109002850_billing_address.sql new file mode 100644 index 00000000..a602d4f0 --- /dev/null +++ b/db/migrations-goose-postgres/20250109002850_billing_address.sql @@ -0,0 +1,15 @@ +-- +goose Up +-- modify "organization_setting_history" table +ALTER TABLE "organization_setting_history" DROP COLUMN "billing_address"; +ALTER TABLE "organization_setting_history" ADD COLUMN "billing_address" jsonb; +-- modify "organization_settings" table +ALTER TABLE "organization_settings" DROP COLUMN "billing_address"; +ALTER TABLE "organization_settings" ADD COLUMN "billing_address" jsonb; + +-- +goose Down +-- reverse: modify "organization_settings" table +ALTER TABLE "organization_settings" DROP COLUMN "billing_address"; +ALTER TABLE "organization_settings" ADD COLUMN "billing_address" character varying; +-- reverse: modify "organization_setting_history" table +ALTER TABLE "organization_setting_history" DROP COLUMN "billing_address"; +ALTER TABLE "organization_setting_history" ADD COLUMN "billing_address" character varying; diff --git a/db/migrations-goose-postgres/20250109054654_remove_stripe_id.sql b/db/migrations-goose-postgres/20250109054654_remove_stripe_id.sql new file mode 100644 index 00000000..11855e18 --- /dev/null +++ b/db/migrations-goose-postgres/20250109054654_remove_stripe_id.sql @@ -0,0 +1,11 @@ +-- +goose Up +-- modify "organization_setting_history" table +ALTER TABLE "organization_setting_history" DROP COLUMN "stripe_id"; +-- modify "organization_settings" table +ALTER TABLE "organization_settings" DROP COLUMN "stripe_id"; + +-- +goose Down +-- reverse: modify "organization_settings" table +ALTER TABLE "organization_settings" ADD COLUMN "stripe_id" character varying NULL; +-- reverse: modify "organization_setting_history" table +ALTER TABLE "organization_setting_history" ADD COLUMN "stripe_id" character varying NULL; diff --git a/db/migrations-goose-postgres/atlas.sum b/db/migrations-goose-postgres/atlas.sum index 99a2bb69..17dd63fb 100644 --- a/db/migrations-goose-postgres/atlas.sum +++ b/db/migrations-goose-postgres/atlas.sum @@ -1,3 +1,5 @@ -h1:c4zR9ykTAtjU7Ms/SL9uYn+FgwKpfShruweuWapIs/g= +h1:QXCrkYR4vxggy2Kk14xhgOkCom8B/+rl+I7Rgzroh0k= 20241211231032_init.sql h1:Cj6GduEDECy6Y+8DfI6767WosqG2AKWybIyJJ6AgKqA= 20241212223714_consistent_naming.sql h1:RvnNmsStlHkmAdSCnX1fFh/KYgfj1RMYYEc4iCN9JcQ= +20250109002850_billing_address.sql h1:m0ek3WXqRgS3+ZbSa/DcIMB16vb8Tjm2MgNqyRll3rU= +20250109054654_remove_stripe_id.sql h1:OfeshKT2+ydfx+36e4uBrdQ31tuurcJsKXyYDp1ZiZg= diff --git a/db/migrations/20250109002849_billing_address.sql b/db/migrations/20250109002849_billing_address.sql new file mode 100644 index 00000000..0dcc2284 --- /dev/null +++ b/db/migrations/20250109002849_billing_address.sql @@ -0,0 +1,6 @@ +-- Modify "organization_setting_history" table +ALTER TABLE "organization_setting_history" DROP COLUMN "billing_address"; +ALTER TABLE "organization_setting_history" ADD COLUMN "billing_address" jsonb; +-- Modify "organization_settings" table +ALTER TABLE "organization_settings" DROP COLUMN "billing_address"; +ALTER TABLE "organization_settings" ADD COLUMN "billing_address" jsonb; diff --git a/db/migrations/20250109054653_remove_stripe_id.sql b/db/migrations/20250109054653_remove_stripe_id.sql new file mode 100644 index 00000000..a2404b1e --- /dev/null +++ b/db/migrations/20250109054653_remove_stripe_id.sql @@ -0,0 +1,4 @@ +-- Modify "organization_setting_history" table +ALTER TABLE "organization_setting_history" DROP COLUMN "stripe_id"; +-- Modify "organization_settings" table +ALTER TABLE "organization_settings" DROP COLUMN "stripe_id"; diff --git a/db/migrations/atlas.sum b/db/migrations/atlas.sum index 17f826e1..8790c929 100644 --- a/db/migrations/atlas.sum +++ b/db/migrations/atlas.sum @@ -1,3 +1,5 @@ -h1:uIO0pS4MB2pqWUtAVoMnIGAJJGQ1PeXIo1UEOdi1z6g= +h1:8AGIgzcKy+aGOwhLSJk/xgL6kfmXBArWQGmrkTdVur4= 20241211231032_init.sql h1:TxjpHzKPB/5L2i7V2JfO1y+Cep/AyQN5wGjhY7saCeE= 20241212223712_consistent_naming.sql h1:tbdYOtixhW66Jmvy3aCm+X6neI/SRVvItKM0Bdn26TA= +20250109002849_billing_address.sql h1:mspCGbJ6HVmx3r4j+d/WvruzirJdJ8u5x18WF9R9ESE= +20250109054653_remove_stripe_id.sql h1:dB086/w/Ws7ZK8OvbRWX7ejN4HfizCKxcE3q/+Jv4U8= diff --git a/internal/ent/generated/auditing.go b/internal/ent/generated/auditing.go index 03264091..f1435aa1 100644 --- a/internal/ent/generated/auditing.go +++ b/internal/ent/generated/auditing.go @@ -1507,9 +1507,6 @@ func (osh *OrganizationSettingHistory) changes(new *OrganizationSettingHistory) if !reflect.DeepEqual(osh.OrganizationID, new.OrganizationID) { changes = append(changes, NewChange(organizationsettinghistory.FieldOrganizationID, osh.OrganizationID, new.OrganizationID)) } - if !reflect.DeepEqual(osh.StripeID, new.StripeID) { - changes = append(changes, NewChange(organizationsettinghistory.FieldStripeID, osh.StripeID, new.StripeID)) - } return changes } diff --git a/internal/ent/generated/entql.go b/internal/ent/generated/entql.go index c33a0c93..4466190a 100644 --- a/internal/ent/generated/entql.go +++ b/internal/ent/generated/entql.go @@ -1335,11 +1335,10 @@ var schemaGraph = func() *sqlgraph.Schema { organizationsetting.FieldBillingContact: {Type: field.TypeString, Column: organizationsetting.FieldBillingContact}, organizationsetting.FieldBillingEmail: {Type: field.TypeString, Column: organizationsetting.FieldBillingEmail}, organizationsetting.FieldBillingPhone: {Type: field.TypeString, Column: organizationsetting.FieldBillingPhone}, - organizationsetting.FieldBillingAddress: {Type: field.TypeString, Column: organizationsetting.FieldBillingAddress}, + organizationsetting.FieldBillingAddress: {Type: field.TypeJSON, Column: organizationsetting.FieldBillingAddress}, organizationsetting.FieldTaxIdentifier: {Type: field.TypeString, Column: organizationsetting.FieldTaxIdentifier}, organizationsetting.FieldGeoLocation: {Type: field.TypeEnum, Column: organizationsetting.FieldGeoLocation}, organizationsetting.FieldOrganizationID: {Type: field.TypeString, Column: organizationsetting.FieldOrganizationID}, - organizationsetting.FieldStripeID: {Type: field.TypeString, Column: organizationsetting.FieldStripeID}, }, } graph.Nodes[44] = &sqlgraph.Node{ @@ -1368,11 +1367,10 @@ var schemaGraph = func() *sqlgraph.Schema { organizationsettinghistory.FieldBillingContact: {Type: field.TypeString, Column: organizationsettinghistory.FieldBillingContact}, organizationsettinghistory.FieldBillingEmail: {Type: field.TypeString, Column: organizationsettinghistory.FieldBillingEmail}, organizationsettinghistory.FieldBillingPhone: {Type: field.TypeString, Column: organizationsettinghistory.FieldBillingPhone}, - organizationsettinghistory.FieldBillingAddress: {Type: field.TypeString, Column: organizationsettinghistory.FieldBillingAddress}, + organizationsettinghistory.FieldBillingAddress: {Type: field.TypeJSON, Column: organizationsettinghistory.FieldBillingAddress}, organizationsettinghistory.FieldTaxIdentifier: {Type: field.TypeString, Column: organizationsettinghistory.FieldTaxIdentifier}, organizationsettinghistory.FieldGeoLocation: {Type: field.TypeEnum, Column: organizationsettinghistory.FieldGeoLocation}, organizationsettinghistory.FieldOrganizationID: {Type: field.TypeString, Column: organizationsettinghistory.FieldOrganizationID}, - organizationsettinghistory.FieldStripeID: {Type: field.TypeString, Column: organizationsettinghistory.FieldStripeID}, }, } graph.Nodes[45] = &sqlgraph.Node{ @@ -13200,8 +13198,8 @@ func (f *OrganizationSettingFilter) WhereBillingPhone(p entql.StringP) { f.Where(p.Field(organizationsetting.FieldBillingPhone)) } -// WhereBillingAddress applies the entql string predicate on the billing_address field. -func (f *OrganizationSettingFilter) WhereBillingAddress(p entql.StringP) { +// WhereBillingAddress applies the entql json.RawMessage predicate on the billing_address field. +func (f *OrganizationSettingFilter) WhereBillingAddress(p entql.BytesP) { f.Where(p.Field(organizationsetting.FieldBillingAddress)) } @@ -13220,11 +13218,6 @@ func (f *OrganizationSettingFilter) WhereOrganizationID(p entql.StringP) { f.Where(p.Field(organizationsetting.FieldOrganizationID)) } -// WhereStripeID applies the entql string predicate on the stripe_id field. -func (f *OrganizationSettingFilter) WhereStripeID(p entql.StringP) { - f.Where(p.Field(organizationsetting.FieldStripeID)) -} - // WhereHasOrganization applies a predicate to check if query has an edge organization. func (f *OrganizationSettingFilter) WhereHasOrganization() { f.Where(entql.HasEdge("organization")) @@ -13368,8 +13361,8 @@ func (f *OrganizationSettingHistoryFilter) WhereBillingPhone(p entql.StringP) { f.Where(p.Field(organizationsettinghistory.FieldBillingPhone)) } -// WhereBillingAddress applies the entql string predicate on the billing_address field. -func (f *OrganizationSettingHistoryFilter) WhereBillingAddress(p entql.StringP) { +// WhereBillingAddress applies the entql json.RawMessage predicate on the billing_address field. +func (f *OrganizationSettingHistoryFilter) WhereBillingAddress(p entql.BytesP) { f.Where(p.Field(organizationsettinghistory.FieldBillingAddress)) } @@ -13388,11 +13381,6 @@ func (f *OrganizationSettingHistoryFilter) WhereOrganizationID(p entql.StringP) f.Where(p.Field(organizationsettinghistory.FieldOrganizationID)) } -// WhereStripeID applies the entql string predicate on the stripe_id field. -func (f *OrganizationSettingHistoryFilter) WhereStripeID(p entql.StringP) { - f.Where(p.Field(organizationsettinghistory.FieldStripeID)) -} - // addPredicate implements the predicateAdder interface. func (prtq *PasswordResetTokenQuery) addPredicate(pred func(s *sql.Selector)) { prtq.predicates = append(prtq.predicates, pred) diff --git a/internal/ent/generated/gql_collection.go b/internal/ent/generated/gql_collection.go index 1fbb50f9..f6d21d3e 100644 --- a/internal/ent/generated/gql_collection.go +++ b/internal/ent/generated/gql_collection.go @@ -8586,11 +8586,6 @@ func (os *OrganizationSettingQuery) collectField(ctx context.Context, oneNode bo selectedFields = append(selectedFields, organizationsetting.FieldOrganizationID) fieldSeen[organizationsetting.FieldOrganizationID] = struct{}{} } - case "stripeID": - if _, ok := fieldSeen[organizationsetting.FieldStripeID]; !ok { - selectedFields = append(selectedFields, organizationsetting.FieldStripeID) - fieldSeen[organizationsetting.FieldStripeID] = struct{}{} - } case "id": case "__typename": default: @@ -8743,11 +8738,6 @@ func (osh *OrganizationSettingHistoryQuery) collectField(ctx context.Context, on selectedFields = append(selectedFields, organizationsettinghistory.FieldOrganizationID) fieldSeen[organizationsettinghistory.FieldOrganizationID] = struct{}{} } - case "stripeID": - if _, ok := fieldSeen[organizationsettinghistory.FieldStripeID]; !ok { - selectedFields = append(selectedFields, organizationsettinghistory.FieldStripeID) - fieldSeen[organizationsettinghistory.FieldStripeID] = struct{}{} - } case "id": case "__typename": default: diff --git a/internal/ent/generated/gql_mutation_input.go b/internal/ent/generated/gql_mutation_input.go index 3fc2a85d..78a1c018 100644 --- a/internal/ent/generated/gql_mutation_input.go +++ b/internal/ent/generated/gql_mutation_input.go @@ -7,6 +7,7 @@ import ( "github.com/theopenlane/core/internal/ent/customtypes" "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/models" ) // CreateAPITokenInput represents a mutation input for creating apitokens. @@ -4089,164 +4090,6 @@ func (c *OrgMembershipUpdateOne) SetInput(i UpdateOrgMembershipInput) *OrgMember return c } -// CreateOrgSubscriptionInput represents a mutation input for creating orgsubscriptions. -type CreateOrgSubscriptionInput struct { - Tags []string - StripeSubscriptionID *string - ProductTier *string - StripeProductTierID *string - StripeSubscriptionStatus *string - Active *bool - StripeCustomerID *string - ExpiresAt *time.Time - Features []string - OwnerID *string -} - -// Mutate applies the CreateOrgSubscriptionInput on the OrgSubscriptionMutation builder. -func (i *CreateOrgSubscriptionInput) Mutate(m *OrgSubscriptionMutation) { - if v := i.Tags; v != nil { - m.SetTags(v) - } - if v := i.StripeSubscriptionID; v != nil { - m.SetStripeSubscriptionID(*v) - } - if v := i.ProductTier; v != nil { - m.SetProductTier(*v) - } - if v := i.StripeProductTierID; v != nil { - m.SetStripeProductTierID(*v) - } - if v := i.StripeSubscriptionStatus; v != nil { - m.SetStripeSubscriptionStatus(*v) - } - if v := i.Active; v != nil { - m.SetActive(*v) - } - if v := i.StripeCustomerID; v != nil { - m.SetStripeCustomerID(*v) - } - if v := i.ExpiresAt; v != nil { - m.SetExpiresAt(*v) - } - if v := i.Features; v != nil { - m.SetFeatures(v) - } - if v := i.OwnerID; v != nil { - m.SetOwnerID(*v) - } -} - -// SetInput applies the change-set in the CreateOrgSubscriptionInput on the OrgSubscriptionCreate builder. -func (c *OrgSubscriptionCreate) SetInput(i CreateOrgSubscriptionInput) *OrgSubscriptionCreate { - i.Mutate(c.Mutation()) - return c -} - -// UpdateOrgSubscriptionInput represents a mutation input for updating orgsubscriptions. -type UpdateOrgSubscriptionInput struct { - ClearTags bool - Tags []string - AppendTags []string - ClearStripeSubscriptionID bool - StripeSubscriptionID *string - ClearProductTier bool - ProductTier *string - ClearStripeProductTierID bool - StripeProductTierID *string - ClearStripeSubscriptionStatus bool - StripeSubscriptionStatus *string - Active *bool - ClearStripeCustomerID bool - StripeCustomerID *string - ClearExpiresAt bool - ExpiresAt *time.Time - ClearFeatures bool - Features []string - AppendFeatures []string - ClearOwner bool - OwnerID *string -} - -// Mutate applies the UpdateOrgSubscriptionInput on the OrgSubscriptionMutation builder. -func (i *UpdateOrgSubscriptionInput) Mutate(m *OrgSubscriptionMutation) { - if i.ClearTags { - m.ClearTags() - } - if v := i.Tags; v != nil { - m.SetTags(v) - } - if i.AppendTags != nil { - m.AppendTags(i.Tags) - } - if i.ClearStripeSubscriptionID { - m.ClearStripeSubscriptionID() - } - if v := i.StripeSubscriptionID; v != nil { - m.SetStripeSubscriptionID(*v) - } - if i.ClearProductTier { - m.ClearProductTier() - } - if v := i.ProductTier; v != nil { - m.SetProductTier(*v) - } - if i.ClearStripeProductTierID { - m.ClearStripeProductTierID() - } - if v := i.StripeProductTierID; v != nil { - m.SetStripeProductTierID(*v) - } - if i.ClearStripeSubscriptionStatus { - m.ClearStripeSubscriptionStatus() - } - if v := i.StripeSubscriptionStatus; v != nil { - m.SetStripeSubscriptionStatus(*v) - } - if v := i.Active; v != nil { - m.SetActive(*v) - } - if i.ClearStripeCustomerID { - m.ClearStripeCustomerID() - } - if v := i.StripeCustomerID; v != nil { - m.SetStripeCustomerID(*v) - } - if i.ClearExpiresAt { - m.ClearExpiresAt() - } - if v := i.ExpiresAt; v != nil { - m.SetExpiresAt(*v) - } - if i.ClearFeatures { - m.ClearFeatures() - } - if v := i.Features; v != nil { - m.SetFeatures(v) - } - if i.AppendFeatures != nil { - m.AppendFeatures(i.Features) - } - if i.ClearOwner { - m.ClearOwner() - } - if v := i.OwnerID; v != nil { - m.SetOwnerID(*v) - } -} - -// SetInput applies the change-set in the UpdateOrgSubscriptionInput on the OrgSubscriptionUpdate builder. -func (c *OrgSubscriptionUpdate) SetInput(i UpdateOrgSubscriptionInput) *OrgSubscriptionUpdate { - i.Mutate(c.Mutation()) - return c -} - -// SetInput applies the change-set in the UpdateOrgSubscriptionInput on the OrgSubscriptionUpdateOne builder. -func (c *OrgSubscriptionUpdateOne) SetInput(i UpdateOrgSubscriptionInput) *OrgSubscriptionUpdateOne { - i.Mutate(c.Mutation()) - return c -} - // CreateOrganizationInput represents a mutation input for creating organizations. type CreateOrganizationInput struct { Tags []string @@ -4926,10 +4769,9 @@ type CreateOrganizationSettingInput struct { BillingContact *string BillingEmail *string BillingPhone *string - BillingAddress *string + BillingAddress *models.Address TaxIdentifier *string GeoLocation *enums.Region - StripeID *string OrganizationID *string FileIDs []string } @@ -4960,9 +4802,6 @@ func (i *CreateOrganizationSettingInput) Mutate(m *OrganizationSettingMutation) if v := i.GeoLocation; v != nil { m.SetGeoLocation(*v) } - if v := i.StripeID; v != nil { - m.SetStripeID(*v) - } if v := i.OrganizationID; v != nil { m.SetOrganizationID(*v) } @@ -4992,13 +4831,11 @@ type UpdateOrganizationSettingInput struct { ClearBillingPhone bool BillingPhone *string ClearBillingAddress bool - BillingAddress *string + BillingAddress *models.Address ClearTaxIdentifier bool TaxIdentifier *string ClearGeoLocation bool GeoLocation *enums.Region - ClearStripeID bool - StripeID *string ClearOrganization bool OrganizationID *string ClearFiles bool @@ -5062,12 +4899,6 @@ func (i *UpdateOrganizationSettingInput) Mutate(m *OrganizationSettingMutation) if v := i.GeoLocation; v != nil { m.SetGeoLocation(*v) } - if i.ClearStripeID { - m.ClearStripeID() - } - if v := i.StripeID; v != nil { - m.SetStripeID(*v) - } if i.ClearOrganization { m.ClearOrganization() } diff --git a/internal/ent/generated/gql_where_input.go b/internal/ent/generated/gql_where_input.go index 22dc2946..45c945a2 100644 --- a/internal/ent/generated/gql_where_input.go +++ b/internal/ent/generated/gql_where_input.go @@ -37474,23 +37474,6 @@ type OrganizationSettingWhereInput struct { BillingPhoneEqualFold *string `json:"billingPhoneEqualFold,omitempty"` BillingPhoneContainsFold *string `json:"billingPhoneContainsFold,omitempty"` - // "billing_address" field predicates. - BillingAddress *string `json:"billingAddress,omitempty"` - BillingAddressNEQ *string `json:"billingAddressNEQ,omitempty"` - BillingAddressIn []string `json:"billingAddressIn,omitempty"` - BillingAddressNotIn []string `json:"billingAddressNotIn,omitempty"` - BillingAddressGT *string `json:"billingAddressGT,omitempty"` - BillingAddressGTE *string `json:"billingAddressGTE,omitempty"` - BillingAddressLT *string `json:"billingAddressLT,omitempty"` - BillingAddressLTE *string `json:"billingAddressLTE,omitempty"` - BillingAddressContains *string `json:"billingAddressContains,omitempty"` - BillingAddressHasPrefix *string `json:"billingAddressHasPrefix,omitempty"` - BillingAddressHasSuffix *string `json:"billingAddressHasSuffix,omitempty"` - BillingAddressIsNil bool `json:"billingAddressIsNil,omitempty"` - BillingAddressNotNil bool `json:"billingAddressNotNil,omitempty"` - BillingAddressEqualFold *string `json:"billingAddressEqualFold,omitempty"` - BillingAddressContainsFold *string `json:"billingAddressContainsFold,omitempty"` - // "tax_identifier" field predicates. TaxIdentifier *string `json:"taxIdentifier,omitempty"` TaxIdentifierNEQ *string `json:"taxIdentifierNEQ,omitempty"` @@ -37533,23 +37516,6 @@ type OrganizationSettingWhereInput struct { OrganizationIDEqualFold *string `json:"organizationIDEqualFold,omitempty"` OrganizationIDContainsFold *string `json:"organizationIDContainsFold,omitempty"` - // "stripe_id" field predicates. - StripeID *string `json:"stripeID,omitempty"` - StripeIDNEQ *string `json:"stripeIDNEQ,omitempty"` - StripeIDIn []string `json:"stripeIDIn,omitempty"` - StripeIDNotIn []string `json:"stripeIDNotIn,omitempty"` - StripeIDGT *string `json:"stripeIDGT,omitempty"` - StripeIDGTE *string `json:"stripeIDGTE,omitempty"` - StripeIDLT *string `json:"stripeIDLT,omitempty"` - StripeIDLTE *string `json:"stripeIDLTE,omitempty"` - StripeIDContains *string `json:"stripeIDContains,omitempty"` - StripeIDHasPrefix *string `json:"stripeIDHasPrefix,omitempty"` - StripeIDHasSuffix *string `json:"stripeIDHasSuffix,omitempty"` - StripeIDIsNil bool `json:"stripeIDIsNil,omitempty"` - StripeIDNotNil bool `json:"stripeIDNotNil,omitempty"` - StripeIDEqualFold *string `json:"stripeIDEqualFold,omitempty"` - StripeIDContainsFold *string `json:"stripeIDContainsFold,omitempty"` - // "organization" edge predicates. HasOrganization *bool `json:"hasOrganization,omitempty"` HasOrganizationWith []*OrganizationWhereInput `json:"hasOrganizationWith,omitempty"` @@ -38020,51 +37986,6 @@ func (i *OrganizationSettingWhereInput) P() (predicate.OrganizationSetting, erro if i.BillingPhoneContainsFold != nil { predicates = append(predicates, organizationsetting.BillingPhoneContainsFold(*i.BillingPhoneContainsFold)) } - if i.BillingAddress != nil { - predicates = append(predicates, organizationsetting.BillingAddressEQ(*i.BillingAddress)) - } - if i.BillingAddressNEQ != nil { - predicates = append(predicates, organizationsetting.BillingAddressNEQ(*i.BillingAddressNEQ)) - } - if len(i.BillingAddressIn) > 0 { - predicates = append(predicates, organizationsetting.BillingAddressIn(i.BillingAddressIn...)) - } - if len(i.BillingAddressNotIn) > 0 { - predicates = append(predicates, organizationsetting.BillingAddressNotIn(i.BillingAddressNotIn...)) - } - if i.BillingAddressGT != nil { - predicates = append(predicates, organizationsetting.BillingAddressGT(*i.BillingAddressGT)) - } - if i.BillingAddressGTE != nil { - predicates = append(predicates, organizationsetting.BillingAddressGTE(*i.BillingAddressGTE)) - } - if i.BillingAddressLT != nil { - predicates = append(predicates, organizationsetting.BillingAddressLT(*i.BillingAddressLT)) - } - if i.BillingAddressLTE != nil { - predicates = append(predicates, organizationsetting.BillingAddressLTE(*i.BillingAddressLTE)) - } - if i.BillingAddressContains != nil { - predicates = append(predicates, organizationsetting.BillingAddressContains(*i.BillingAddressContains)) - } - if i.BillingAddressHasPrefix != nil { - predicates = append(predicates, organizationsetting.BillingAddressHasPrefix(*i.BillingAddressHasPrefix)) - } - if i.BillingAddressHasSuffix != nil { - predicates = append(predicates, organizationsetting.BillingAddressHasSuffix(*i.BillingAddressHasSuffix)) - } - if i.BillingAddressIsNil { - predicates = append(predicates, organizationsetting.BillingAddressIsNil()) - } - if i.BillingAddressNotNil { - predicates = append(predicates, organizationsetting.BillingAddressNotNil()) - } - if i.BillingAddressEqualFold != nil { - predicates = append(predicates, organizationsetting.BillingAddressEqualFold(*i.BillingAddressEqualFold)) - } - if i.BillingAddressContainsFold != nil { - predicates = append(predicates, organizationsetting.BillingAddressContainsFold(*i.BillingAddressContainsFold)) - } if i.TaxIdentifier != nil { predicates = append(predicates, organizationsetting.TaxIdentifierEQ(*i.TaxIdentifier)) } @@ -38173,51 +38094,6 @@ func (i *OrganizationSettingWhereInput) P() (predicate.OrganizationSetting, erro if i.OrganizationIDContainsFold != nil { predicates = append(predicates, organizationsetting.OrganizationIDContainsFold(*i.OrganizationIDContainsFold)) } - if i.StripeID != nil { - predicates = append(predicates, organizationsetting.StripeIDEQ(*i.StripeID)) - } - if i.StripeIDNEQ != nil { - predicates = append(predicates, organizationsetting.StripeIDNEQ(*i.StripeIDNEQ)) - } - if len(i.StripeIDIn) > 0 { - predicates = append(predicates, organizationsetting.StripeIDIn(i.StripeIDIn...)) - } - if len(i.StripeIDNotIn) > 0 { - predicates = append(predicates, organizationsetting.StripeIDNotIn(i.StripeIDNotIn...)) - } - if i.StripeIDGT != nil { - predicates = append(predicates, organizationsetting.StripeIDGT(*i.StripeIDGT)) - } - if i.StripeIDGTE != nil { - predicates = append(predicates, organizationsetting.StripeIDGTE(*i.StripeIDGTE)) - } - if i.StripeIDLT != nil { - predicates = append(predicates, organizationsetting.StripeIDLT(*i.StripeIDLT)) - } - if i.StripeIDLTE != nil { - predicates = append(predicates, organizationsetting.StripeIDLTE(*i.StripeIDLTE)) - } - if i.StripeIDContains != nil { - predicates = append(predicates, organizationsetting.StripeIDContains(*i.StripeIDContains)) - } - if i.StripeIDHasPrefix != nil { - predicates = append(predicates, organizationsetting.StripeIDHasPrefix(*i.StripeIDHasPrefix)) - } - if i.StripeIDHasSuffix != nil { - predicates = append(predicates, organizationsetting.StripeIDHasSuffix(*i.StripeIDHasSuffix)) - } - if i.StripeIDIsNil { - predicates = append(predicates, organizationsetting.StripeIDIsNil()) - } - if i.StripeIDNotNil { - predicates = append(predicates, organizationsetting.StripeIDNotNil()) - } - if i.StripeIDEqualFold != nil { - predicates = append(predicates, organizationsetting.StripeIDEqualFold(*i.StripeIDEqualFold)) - } - if i.StripeIDContainsFold != nil { - predicates = append(predicates, organizationsetting.StripeIDContainsFold(*i.StripeIDContainsFold)) - } if i.HasOrganization != nil { p := organizationsetting.HasOrganization() @@ -38455,23 +38331,6 @@ type OrganizationSettingHistoryWhereInput struct { BillingPhoneEqualFold *string `json:"billingPhoneEqualFold,omitempty"` BillingPhoneContainsFold *string `json:"billingPhoneContainsFold,omitempty"` - // "billing_address" field predicates. - BillingAddress *string `json:"billingAddress,omitempty"` - BillingAddressNEQ *string `json:"billingAddressNEQ,omitempty"` - BillingAddressIn []string `json:"billingAddressIn,omitempty"` - BillingAddressNotIn []string `json:"billingAddressNotIn,omitempty"` - BillingAddressGT *string `json:"billingAddressGT,omitempty"` - BillingAddressGTE *string `json:"billingAddressGTE,omitempty"` - BillingAddressLT *string `json:"billingAddressLT,omitempty"` - BillingAddressLTE *string `json:"billingAddressLTE,omitempty"` - BillingAddressContains *string `json:"billingAddressContains,omitempty"` - BillingAddressHasPrefix *string `json:"billingAddressHasPrefix,omitempty"` - BillingAddressHasSuffix *string `json:"billingAddressHasSuffix,omitempty"` - BillingAddressIsNil bool `json:"billingAddressIsNil,omitempty"` - BillingAddressNotNil bool `json:"billingAddressNotNil,omitempty"` - BillingAddressEqualFold *string `json:"billingAddressEqualFold,omitempty"` - BillingAddressContainsFold *string `json:"billingAddressContainsFold,omitempty"` - // "tax_identifier" field predicates. TaxIdentifier *string `json:"taxIdentifier,omitempty"` TaxIdentifierNEQ *string `json:"taxIdentifierNEQ,omitempty"` @@ -38513,23 +38372,6 @@ type OrganizationSettingHistoryWhereInput struct { OrganizationIDNotNil bool `json:"organizationIDNotNil,omitempty"` OrganizationIDEqualFold *string `json:"organizationIDEqualFold,omitempty"` OrganizationIDContainsFold *string `json:"organizationIDContainsFold,omitempty"` - - // "stripe_id" field predicates. - StripeID *string `json:"stripeID,omitempty"` - StripeIDNEQ *string `json:"stripeIDNEQ,omitempty"` - StripeIDIn []string `json:"stripeIDIn,omitempty"` - StripeIDNotIn []string `json:"stripeIDNotIn,omitempty"` - StripeIDGT *string `json:"stripeIDGT,omitempty"` - StripeIDGTE *string `json:"stripeIDGTE,omitempty"` - StripeIDLT *string `json:"stripeIDLT,omitempty"` - StripeIDLTE *string `json:"stripeIDLTE,omitempty"` - StripeIDContains *string `json:"stripeIDContains,omitempty"` - StripeIDHasPrefix *string `json:"stripeIDHasPrefix,omitempty"` - StripeIDHasSuffix *string `json:"stripeIDHasSuffix,omitempty"` - StripeIDIsNil bool `json:"stripeIDIsNil,omitempty"` - StripeIDNotNil bool `json:"stripeIDNotNil,omitempty"` - StripeIDEqualFold *string `json:"stripeIDEqualFold,omitempty"` - StripeIDContainsFold *string `json:"stripeIDContainsFold,omitempty"` } // AddPredicates adds custom predicates to the where input to be used during the filtering phase. @@ -39074,51 +38916,6 @@ func (i *OrganizationSettingHistoryWhereInput) P() (predicate.OrganizationSettin if i.BillingPhoneContainsFold != nil { predicates = append(predicates, organizationsettinghistory.BillingPhoneContainsFold(*i.BillingPhoneContainsFold)) } - if i.BillingAddress != nil { - predicates = append(predicates, organizationsettinghistory.BillingAddressEQ(*i.BillingAddress)) - } - if i.BillingAddressNEQ != nil { - predicates = append(predicates, organizationsettinghistory.BillingAddressNEQ(*i.BillingAddressNEQ)) - } - if len(i.BillingAddressIn) > 0 { - predicates = append(predicates, organizationsettinghistory.BillingAddressIn(i.BillingAddressIn...)) - } - if len(i.BillingAddressNotIn) > 0 { - predicates = append(predicates, organizationsettinghistory.BillingAddressNotIn(i.BillingAddressNotIn...)) - } - if i.BillingAddressGT != nil { - predicates = append(predicates, organizationsettinghistory.BillingAddressGT(*i.BillingAddressGT)) - } - if i.BillingAddressGTE != nil { - predicates = append(predicates, organizationsettinghistory.BillingAddressGTE(*i.BillingAddressGTE)) - } - if i.BillingAddressLT != nil { - predicates = append(predicates, organizationsettinghistory.BillingAddressLT(*i.BillingAddressLT)) - } - if i.BillingAddressLTE != nil { - predicates = append(predicates, organizationsettinghistory.BillingAddressLTE(*i.BillingAddressLTE)) - } - if i.BillingAddressContains != nil { - predicates = append(predicates, organizationsettinghistory.BillingAddressContains(*i.BillingAddressContains)) - } - if i.BillingAddressHasPrefix != nil { - predicates = append(predicates, organizationsettinghistory.BillingAddressHasPrefix(*i.BillingAddressHasPrefix)) - } - if i.BillingAddressHasSuffix != nil { - predicates = append(predicates, organizationsettinghistory.BillingAddressHasSuffix(*i.BillingAddressHasSuffix)) - } - if i.BillingAddressIsNil { - predicates = append(predicates, organizationsettinghistory.BillingAddressIsNil()) - } - if i.BillingAddressNotNil { - predicates = append(predicates, organizationsettinghistory.BillingAddressNotNil()) - } - if i.BillingAddressEqualFold != nil { - predicates = append(predicates, organizationsettinghistory.BillingAddressEqualFold(*i.BillingAddressEqualFold)) - } - if i.BillingAddressContainsFold != nil { - predicates = append(predicates, organizationsettinghistory.BillingAddressContainsFold(*i.BillingAddressContainsFold)) - } if i.TaxIdentifier != nil { predicates = append(predicates, organizationsettinghistory.TaxIdentifierEQ(*i.TaxIdentifier)) } @@ -39227,51 +39024,6 @@ func (i *OrganizationSettingHistoryWhereInput) P() (predicate.OrganizationSettin if i.OrganizationIDContainsFold != nil { predicates = append(predicates, organizationsettinghistory.OrganizationIDContainsFold(*i.OrganizationIDContainsFold)) } - if i.StripeID != nil { - predicates = append(predicates, organizationsettinghistory.StripeIDEQ(*i.StripeID)) - } - if i.StripeIDNEQ != nil { - predicates = append(predicates, organizationsettinghistory.StripeIDNEQ(*i.StripeIDNEQ)) - } - if len(i.StripeIDIn) > 0 { - predicates = append(predicates, organizationsettinghistory.StripeIDIn(i.StripeIDIn...)) - } - if len(i.StripeIDNotIn) > 0 { - predicates = append(predicates, organizationsettinghistory.StripeIDNotIn(i.StripeIDNotIn...)) - } - if i.StripeIDGT != nil { - predicates = append(predicates, organizationsettinghistory.StripeIDGT(*i.StripeIDGT)) - } - if i.StripeIDGTE != nil { - predicates = append(predicates, organizationsettinghistory.StripeIDGTE(*i.StripeIDGTE)) - } - if i.StripeIDLT != nil { - predicates = append(predicates, organizationsettinghistory.StripeIDLT(*i.StripeIDLT)) - } - if i.StripeIDLTE != nil { - predicates = append(predicates, organizationsettinghistory.StripeIDLTE(*i.StripeIDLTE)) - } - if i.StripeIDContains != nil { - predicates = append(predicates, organizationsettinghistory.StripeIDContains(*i.StripeIDContains)) - } - if i.StripeIDHasPrefix != nil { - predicates = append(predicates, organizationsettinghistory.StripeIDHasPrefix(*i.StripeIDHasPrefix)) - } - if i.StripeIDHasSuffix != nil { - predicates = append(predicates, organizationsettinghistory.StripeIDHasSuffix(*i.StripeIDHasSuffix)) - } - if i.StripeIDIsNil { - predicates = append(predicates, organizationsettinghistory.StripeIDIsNil()) - } - if i.StripeIDNotNil { - predicates = append(predicates, organizationsettinghistory.StripeIDNotNil()) - } - if i.StripeIDEqualFold != nil { - predicates = append(predicates, organizationsettinghistory.StripeIDEqualFold(*i.StripeIDEqualFold)) - } - if i.StripeIDContainsFold != nil { - predicates = append(predicates, organizationsettinghistory.StripeIDContainsFold(*i.StripeIDContainsFold)) - } switch len(predicates) { case 0: diff --git a/internal/ent/generated/history_from_mutation.go b/internal/ent/generated/history_from_mutation.go index 593a3bd5..84cc85a5 100644 --- a/internal/ent/generated/history_from_mutation.go +++ b/internal/ent/generated/history_from_mutation.go @@ -4942,10 +4942,6 @@ func (m *OrganizationSettingMutation) CreateHistoryFromCreate(ctx context.Contex create = create.SetOrganizationID(organizationID) } - if stripeID, exists := m.StripeID(); exists { - create = create.SetStripeID(stripeID) - } - _, err := create.Save(ctx) return err @@ -5072,12 +5068,6 @@ func (m *OrganizationSettingMutation) CreateHistoryFromUpdate(ctx context.Contex create = create.SetOrganizationID(organizationsetting.OrganizationID) } - if stripeID, exists := m.StripeID(); exists { - create = create.SetStripeID(stripeID) - } else { - create = create.SetStripeID(organizationsetting.StripeID) - } - if _, err := create.Save(ctx); err != nil { return err } @@ -5126,7 +5116,6 @@ func (m *OrganizationSettingMutation) CreateHistoryFromDelete(ctx context.Contex SetTaxIdentifier(organizationsetting.TaxIdentifier). SetGeoLocation(organizationsetting.GeoLocation). SetOrganizationID(organizationsetting.OrganizationID). - SetStripeID(organizationsetting.StripeID). Save(ctx) if err != nil { return err diff --git a/internal/ent/generated/migrate/schema.go b/internal/ent/generated/migrate/schema.go index 61561c29..6353558d 100644 --- a/internal/ent/generated/migrate/schema.go +++ b/internal/ent/generated/migrate/schema.go @@ -1568,10 +1568,9 @@ var ( {Name: "billing_contact", Type: field.TypeString, Nullable: true}, {Name: "billing_email", Type: field.TypeString, Nullable: true}, {Name: "billing_phone", Type: field.TypeString, Nullable: true}, - {Name: "billing_address", Type: field.TypeString, Nullable: true}, + {Name: "billing_address", Type: field.TypeJSON, Nullable: true}, {Name: "tax_identifier", Type: field.TypeString, Nullable: true}, {Name: "geo_location", Type: field.TypeEnum, Nullable: true, Enums: []string{"AMER", "EMEA", "APAC"}, Default: "AMER"}, - {Name: "stripe_id", Type: field.TypeString, Nullable: true}, {Name: "organization_id", Type: field.TypeString, Unique: true, Nullable: true}, } // OrganizationSettingsTable holds the schema information for the "organization_settings" table. @@ -1582,7 +1581,7 @@ var ( ForeignKeys: []*schema.ForeignKey{ { Symbol: "organization_settings_organizations_setting", - Columns: []*schema.Column{OrganizationSettingsColumns[17]}, + Columns: []*schema.Column{OrganizationSettingsColumns[16]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.SetNull, }, @@ -1606,11 +1605,10 @@ var ( {Name: "billing_contact", Type: field.TypeString, Nullable: true}, {Name: "billing_email", Type: field.TypeString, Nullable: true}, {Name: "billing_phone", Type: field.TypeString, Nullable: true}, - {Name: "billing_address", Type: field.TypeString, Nullable: true}, + {Name: "billing_address", Type: field.TypeJSON, Nullable: true}, {Name: "tax_identifier", Type: field.TypeString, Nullable: true}, {Name: "geo_location", Type: field.TypeEnum, Nullable: true, Enums: []string{"AMER", "EMEA", "APAC"}, Default: "AMER"}, {Name: "organization_id", Type: field.TypeString, Nullable: true}, - {Name: "stripe_id", Type: field.TypeString, Nullable: true}, } // OrganizationSettingHistoryTable holds the schema information for the "organization_setting_history" table. OrganizationSettingHistoryTable = &schema.Table{ diff --git a/internal/ent/generated/mutation.go b/internal/ent/generated/mutation.go index 98180597..333f0818 100644 --- a/internal/ent/generated/mutation.go +++ b/internal/ent/generated/mutation.go @@ -84,6 +84,7 @@ import ( "github.com/theopenlane/core/internal/ent/generated/usersettinghistory" "github.com/theopenlane/core/internal/ent/generated/webauthn" "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/models" "github.com/theopenlane/entx/history" ) @@ -73351,10 +73352,9 @@ type OrganizationSettingMutation struct { billing_contact *string billing_email *string billing_phone *string - billing_address *string + billing_address *models.Address tax_identifier *string geo_location *enums.Region - stripe_id *string clearedFields map[string]struct{} organization *string clearedorganization bool @@ -74078,12 +74078,12 @@ func (m *OrganizationSettingMutation) ResetBillingPhone() { } // SetBillingAddress sets the "billing_address" field. -func (m *OrganizationSettingMutation) SetBillingAddress(s string) { - m.billing_address = &s +func (m *OrganizationSettingMutation) SetBillingAddress(value models.Address) { + m.billing_address = &value } // BillingAddress returns the value of the "billing_address" field in the mutation. -func (m *OrganizationSettingMutation) BillingAddress() (r string, exists bool) { +func (m *OrganizationSettingMutation) BillingAddress() (r models.Address, exists bool) { v := m.billing_address if v == nil { return @@ -74094,7 +74094,7 @@ func (m *OrganizationSettingMutation) BillingAddress() (r string, exists bool) { // OldBillingAddress returns the old "billing_address" field's value of the OrganizationSetting entity. // If the OrganizationSetting object wasn't provided to the builder, the object is fetched from the database. // An error is returned if the mutation operation is not UpdateOne, or the database query fails. -func (m *OrganizationSettingMutation) OldBillingAddress(ctx context.Context) (v string, err error) { +func (m *OrganizationSettingMutation) OldBillingAddress(ctx context.Context) (v models.Address, err error) { if !m.op.Is(OpUpdateOne) { return v, errors.New("OldBillingAddress is only allowed on UpdateOne operations") } @@ -74273,55 +74273,6 @@ func (m *OrganizationSettingMutation) ResetOrganizationID() { delete(m.clearedFields, organizationsetting.FieldOrganizationID) } -// SetStripeID sets the "stripe_id" field. -func (m *OrganizationSettingMutation) SetStripeID(s string) { - m.stripe_id = &s -} - -// StripeID returns the value of the "stripe_id" field in the mutation. -func (m *OrganizationSettingMutation) StripeID() (r string, exists bool) { - v := m.stripe_id - if v == nil { - return - } - return *v, true -} - -// OldStripeID returns the old "stripe_id" field's value of the OrganizationSetting entity. -// If the OrganizationSetting object wasn't provided to the builder, the object is fetched from the database. -// An error is returned if the mutation operation is not UpdateOne, or the database query fails. -func (m *OrganizationSettingMutation) OldStripeID(ctx context.Context) (v string, err error) { - if !m.op.Is(OpUpdateOne) { - return v, errors.New("OldStripeID is only allowed on UpdateOne operations") - } - if m.id == nil || m.oldValue == nil { - return v, errors.New("OldStripeID requires an ID field in the mutation") - } - oldValue, err := m.oldValue(ctx) - if err != nil { - return v, fmt.Errorf("querying old value for OldStripeID: %w", err) - } - return oldValue.StripeID, nil -} - -// ClearStripeID clears the value of the "stripe_id" field. -func (m *OrganizationSettingMutation) ClearStripeID() { - m.stripe_id = nil - m.clearedFields[organizationsetting.FieldStripeID] = struct{}{} -} - -// StripeIDCleared returns if the "stripe_id" field was cleared in this mutation. -func (m *OrganizationSettingMutation) StripeIDCleared() bool { - _, ok := m.clearedFields[organizationsetting.FieldStripeID] - return ok -} - -// ResetStripeID resets all changes to the "stripe_id" field. -func (m *OrganizationSettingMutation) ResetStripeID() { - m.stripe_id = nil - delete(m.clearedFields, organizationsetting.FieldStripeID) -} - // ClearOrganization clears the "organization" edge to the Organization entity. func (m *OrganizationSettingMutation) ClearOrganization() { m.clearedorganization = true @@ -74437,7 +74388,7 @@ func (m *OrganizationSettingMutation) Type() string { // order to get all numeric fields that were incremented/decremented, call // AddedFields(). func (m *OrganizationSettingMutation) Fields() []string { - fields := make([]string, 0, 17) + fields := make([]string, 0, 16) if m.created_at != nil { fields = append(fields, organizationsetting.FieldCreatedAt) } @@ -74486,9 +74437,6 @@ func (m *OrganizationSettingMutation) Fields() []string { if m.organization != nil { fields = append(fields, organizationsetting.FieldOrganizationID) } - if m.stripe_id != nil { - fields = append(fields, organizationsetting.FieldStripeID) - } return fields } @@ -74529,8 +74477,6 @@ func (m *OrganizationSettingMutation) Field(name string) (ent.Value, bool) { return m.GeoLocation() case organizationsetting.FieldOrganizationID: return m.OrganizationID() - case organizationsetting.FieldStripeID: - return m.StripeID() } return nil, false } @@ -74572,8 +74518,6 @@ func (m *OrganizationSettingMutation) OldField(ctx context.Context, name string) return m.OldGeoLocation(ctx) case organizationsetting.FieldOrganizationID: return m.OldOrganizationID(ctx) - case organizationsetting.FieldStripeID: - return m.OldStripeID(ctx) } return nil, fmt.Errorf("unknown OrganizationSetting field %s", name) } @@ -74668,7 +74612,7 @@ func (m *OrganizationSettingMutation) SetField(name string, value ent.Value) err m.SetBillingPhone(v) return nil case organizationsetting.FieldBillingAddress: - v, ok := value.(string) + v, ok := value.(models.Address) if !ok { return fmt.Errorf("unexpected type %T for field %s", value, name) } @@ -74695,13 +74639,6 @@ func (m *OrganizationSettingMutation) SetField(name string, value ent.Value) err } m.SetOrganizationID(v) return nil - case organizationsetting.FieldStripeID: - v, ok := value.(string) - if !ok { - return fmt.Errorf("unexpected type %T for field %s", value, name) - } - m.SetStripeID(v) - return nil } return fmt.Errorf("unknown OrganizationSetting field %s", name) } @@ -74777,9 +74714,6 @@ func (m *OrganizationSettingMutation) ClearedFields() []string { if m.FieldCleared(organizationsetting.FieldOrganizationID) { fields = append(fields, organizationsetting.FieldOrganizationID) } - if m.FieldCleared(organizationsetting.FieldStripeID) { - fields = append(fields, organizationsetting.FieldStripeID) - } return fields } @@ -74839,9 +74773,6 @@ func (m *OrganizationSettingMutation) ClearField(name string) error { case organizationsetting.FieldOrganizationID: m.ClearOrganizationID() return nil - case organizationsetting.FieldStripeID: - m.ClearStripeID() - return nil } return fmt.Errorf("unknown OrganizationSetting nullable field %s", name) } @@ -74898,9 +74829,6 @@ func (m *OrganizationSettingMutation) ResetField(name string) error { case organizationsetting.FieldOrganizationID: m.ResetOrganizationID() return nil - case organizationsetting.FieldStripeID: - m.ResetStripeID() - return nil } return fmt.Errorf("unknown OrganizationSetting field %s", name) } @@ -75030,11 +74958,10 @@ type OrganizationSettingHistoryMutation struct { billing_contact *string billing_email *string billing_phone *string - billing_address *string + billing_address *models.Address tax_identifier *string geo_location *enums.Region organization_id *string - stripe_id *string clearedFields map[string]struct{} done bool oldValue func(context.Context) (*OrganizationSettingHistory, error) @@ -75874,12 +75801,12 @@ func (m *OrganizationSettingHistoryMutation) ResetBillingPhone() { } // SetBillingAddress sets the "billing_address" field. -func (m *OrganizationSettingHistoryMutation) SetBillingAddress(s string) { - m.billing_address = &s +func (m *OrganizationSettingHistoryMutation) SetBillingAddress(value models.Address) { + m.billing_address = &value } // BillingAddress returns the value of the "billing_address" field in the mutation. -func (m *OrganizationSettingHistoryMutation) BillingAddress() (r string, exists bool) { +func (m *OrganizationSettingHistoryMutation) BillingAddress() (r models.Address, exists bool) { v := m.billing_address if v == nil { return @@ -75890,7 +75817,7 @@ func (m *OrganizationSettingHistoryMutation) BillingAddress() (r string, exists // OldBillingAddress returns the old "billing_address" field's value of the OrganizationSettingHistory entity. // If the OrganizationSettingHistory object wasn't provided to the builder, the object is fetched from the database. // An error is returned if the mutation operation is not UpdateOne, or the database query fails. -func (m *OrganizationSettingHistoryMutation) OldBillingAddress(ctx context.Context) (v string, err error) { +func (m *OrganizationSettingHistoryMutation) OldBillingAddress(ctx context.Context) (v models.Address, err error) { if !m.op.Is(OpUpdateOne) { return v, errors.New("OldBillingAddress is only allowed on UpdateOne operations") } @@ -76069,55 +75996,6 @@ func (m *OrganizationSettingHistoryMutation) ResetOrganizationID() { delete(m.clearedFields, organizationsettinghistory.FieldOrganizationID) } -// SetStripeID sets the "stripe_id" field. -func (m *OrganizationSettingHistoryMutation) SetStripeID(s string) { - m.stripe_id = &s -} - -// StripeID returns the value of the "stripe_id" field in the mutation. -func (m *OrganizationSettingHistoryMutation) StripeID() (r string, exists bool) { - v := m.stripe_id - if v == nil { - return - } - return *v, true -} - -// OldStripeID returns the old "stripe_id" field's value of the OrganizationSettingHistory entity. -// If the OrganizationSettingHistory object wasn't provided to the builder, the object is fetched from the database. -// An error is returned if the mutation operation is not UpdateOne, or the database query fails. -func (m *OrganizationSettingHistoryMutation) OldStripeID(ctx context.Context) (v string, err error) { - if !m.op.Is(OpUpdateOne) { - return v, errors.New("OldStripeID is only allowed on UpdateOne operations") - } - if m.id == nil || m.oldValue == nil { - return v, errors.New("OldStripeID requires an ID field in the mutation") - } - oldValue, err := m.oldValue(ctx) - if err != nil { - return v, fmt.Errorf("querying old value for OldStripeID: %w", err) - } - return oldValue.StripeID, nil -} - -// ClearStripeID clears the value of the "stripe_id" field. -func (m *OrganizationSettingHistoryMutation) ClearStripeID() { - m.stripe_id = nil - m.clearedFields[organizationsettinghistory.FieldStripeID] = struct{}{} -} - -// StripeIDCleared returns if the "stripe_id" field was cleared in this mutation. -func (m *OrganizationSettingHistoryMutation) StripeIDCleared() bool { - _, ok := m.clearedFields[organizationsettinghistory.FieldStripeID] - return ok -} - -// ResetStripeID resets all changes to the "stripe_id" field. -func (m *OrganizationSettingHistoryMutation) ResetStripeID() { - m.stripe_id = nil - delete(m.clearedFields, organizationsettinghistory.FieldStripeID) -} - // Where appends a list predicates to the OrganizationSettingHistoryMutation builder. func (m *OrganizationSettingHistoryMutation) Where(ps ...predicate.OrganizationSettingHistory) { m.predicates = append(m.predicates, ps...) @@ -76152,7 +76030,7 @@ func (m *OrganizationSettingHistoryMutation) Type() string { // order to get all numeric fields that were incremented/decremented, call // AddedFields(). func (m *OrganizationSettingHistoryMutation) Fields() []string { - fields := make([]string, 0, 20) + fields := make([]string, 0, 19) if m.history_time != nil { fields = append(fields, organizationsettinghistory.FieldHistoryTime) } @@ -76210,9 +76088,6 @@ func (m *OrganizationSettingHistoryMutation) Fields() []string { if m.organization_id != nil { fields = append(fields, organizationsettinghistory.FieldOrganizationID) } - if m.stripe_id != nil { - fields = append(fields, organizationsettinghistory.FieldStripeID) - } return fields } @@ -76259,8 +76134,6 @@ func (m *OrganizationSettingHistoryMutation) Field(name string) (ent.Value, bool return m.GeoLocation() case organizationsettinghistory.FieldOrganizationID: return m.OrganizationID() - case organizationsettinghistory.FieldStripeID: - return m.StripeID() } return nil, false } @@ -76308,8 +76181,6 @@ func (m *OrganizationSettingHistoryMutation) OldField(ctx context.Context, name return m.OldGeoLocation(ctx) case organizationsettinghistory.FieldOrganizationID: return m.OldOrganizationID(ctx) - case organizationsettinghistory.FieldStripeID: - return m.OldStripeID(ctx) } return nil, fmt.Errorf("unknown OrganizationSettingHistory field %s", name) } @@ -76425,7 +76296,7 @@ func (m *OrganizationSettingHistoryMutation) SetField(name string, value ent.Val m.SetBillingPhone(v) return nil case organizationsettinghistory.FieldBillingAddress: - v, ok := value.(string) + v, ok := value.(models.Address) if !ok { return fmt.Errorf("unexpected type %T for field %s", value, name) } @@ -76452,13 +76323,6 @@ func (m *OrganizationSettingHistoryMutation) SetField(name string, value ent.Val } m.SetOrganizationID(v) return nil - case organizationsettinghistory.FieldStripeID: - v, ok := value.(string) - if !ok { - return fmt.Errorf("unexpected type %T for field %s", value, name) - } - m.SetStripeID(v) - return nil } return fmt.Errorf("unknown OrganizationSettingHistory field %s", name) } @@ -76537,9 +76401,6 @@ func (m *OrganizationSettingHistoryMutation) ClearedFields() []string { if m.FieldCleared(organizationsettinghistory.FieldOrganizationID) { fields = append(fields, organizationsettinghistory.FieldOrganizationID) } - if m.FieldCleared(organizationsettinghistory.FieldStripeID) { - fields = append(fields, organizationsettinghistory.FieldStripeID) - } return fields } @@ -76602,9 +76463,6 @@ func (m *OrganizationSettingHistoryMutation) ClearField(name string) error { case organizationsettinghistory.FieldOrganizationID: m.ClearOrganizationID() return nil - case organizationsettinghistory.FieldStripeID: - m.ClearStripeID() - return nil } return fmt.Errorf("unknown OrganizationSettingHistory nullable field %s", name) } @@ -76670,9 +76528,6 @@ func (m *OrganizationSettingHistoryMutation) ResetField(name string) error { case organizationsettinghistory.FieldOrganizationID: m.ResetOrganizationID() return nil - case organizationsettinghistory.FieldStripeID: - m.ResetStripeID() - return nil } return fmt.Errorf("unknown OrganizationSettingHistory field %s", name) } diff --git a/internal/ent/generated/organizationsetting.go b/internal/ent/generated/organizationsetting.go index 81982d20..2b9b497c 100644 --- a/internal/ent/generated/organizationsetting.go +++ b/internal/ent/generated/organizationsetting.go @@ -13,6 +13,7 @@ import ( "github.com/theopenlane/core/internal/ent/generated/organization" "github.com/theopenlane/core/internal/ent/generated/organizationsetting" "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/models" ) // OrganizationSetting is the model entity for the OrganizationSetting schema. @@ -44,16 +45,14 @@ type OrganizationSetting struct { BillingEmail string `json:"billing_email,omitempty"` // Phone number to contact for billing BillingPhone string `json:"billing_phone,omitempty"` - // Address to send billing information to - BillingAddress string `json:"billing_address,omitempty"` + // the billing address to send billing information to + BillingAddress models.Address `json:"billing_address,omitempty"` // Usually government-issued tax ID or business ID such as ABN in Australia TaxIdentifier string `json:"tax_identifier,omitempty"` // geographical location of the organization GeoLocation enums.Region `json:"geo_location,omitempty"` // the ID of the organization the settings belong to OrganizationID string `json:"organization_id,omitempty"` - // the ID of the stripe customer associated with the organization - StripeID string `json:"stripe_id,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the OrganizationSettingQuery when eager-loading is set. Edges OrganizationSettingEdges `json:"edges"` @@ -100,9 +99,9 @@ func (*OrganizationSetting) scanValues(columns []string) ([]any, error) { values := make([]any, len(columns)) for i := range columns { switch columns[i] { - case organizationsetting.FieldTags, organizationsetting.FieldDomains: + case organizationsetting.FieldTags, organizationsetting.FieldDomains, organizationsetting.FieldBillingAddress: values[i] = new([]byte) - case organizationsetting.FieldID, organizationsetting.FieldCreatedBy, organizationsetting.FieldUpdatedBy, organizationsetting.FieldMappingID, organizationsetting.FieldDeletedBy, organizationsetting.FieldBillingContact, organizationsetting.FieldBillingEmail, organizationsetting.FieldBillingPhone, organizationsetting.FieldBillingAddress, organizationsetting.FieldTaxIdentifier, organizationsetting.FieldGeoLocation, organizationsetting.FieldOrganizationID, organizationsetting.FieldStripeID: + case organizationsetting.FieldID, organizationsetting.FieldCreatedBy, organizationsetting.FieldUpdatedBy, organizationsetting.FieldMappingID, organizationsetting.FieldDeletedBy, organizationsetting.FieldBillingContact, organizationsetting.FieldBillingEmail, organizationsetting.FieldBillingPhone, organizationsetting.FieldTaxIdentifier, organizationsetting.FieldGeoLocation, organizationsetting.FieldOrganizationID: values[i] = new(sql.NullString) case organizationsetting.FieldCreatedAt, organizationsetting.FieldUpdatedAt, organizationsetting.FieldDeletedAt: values[i] = new(sql.NullTime) @@ -204,10 +203,12 @@ func (os *OrganizationSetting) assignValues(columns []string, values []any) erro os.BillingPhone = value.String } case organizationsetting.FieldBillingAddress: - if value, ok := values[i].(*sql.NullString); !ok { + if value, ok := values[i].(*[]byte); !ok { return fmt.Errorf("unexpected type %T for field billing_address", values[i]) - } else if value.Valid { - os.BillingAddress = value.String + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &os.BillingAddress); err != nil { + return fmt.Errorf("unmarshal field billing_address: %w", err) + } } case organizationsetting.FieldTaxIdentifier: if value, ok := values[i].(*sql.NullString); !ok { @@ -227,12 +228,6 @@ func (os *OrganizationSetting) assignValues(columns []string, values []any) erro } else if value.Valid { os.OrganizationID = value.String } - case organizationsetting.FieldStripeID: - if value, ok := values[i].(*sql.NullString); !ok { - return fmt.Errorf("unexpected type %T for field stripe_id", values[i]) - } else if value.Valid { - os.StripeID = value.String - } default: os.selectValues.Set(columns[i], values[i]) } @@ -316,7 +311,7 @@ func (os *OrganizationSetting) String() string { builder.WriteString(os.BillingPhone) builder.WriteString(", ") builder.WriteString("billing_address=") - builder.WriteString(os.BillingAddress) + builder.WriteString(fmt.Sprintf("%v", os.BillingAddress)) builder.WriteString(", ") builder.WriteString("tax_identifier=") builder.WriteString(os.TaxIdentifier) @@ -326,9 +321,6 @@ func (os *OrganizationSetting) String() string { builder.WriteString(", ") builder.WriteString("organization_id=") builder.WriteString(os.OrganizationID) - builder.WriteString(", ") - builder.WriteString("stripe_id=") - builder.WriteString(os.StripeID) builder.WriteByte(')') return builder.String() } diff --git a/internal/ent/generated/organizationsetting/organizationsetting.go b/internal/ent/generated/organizationsetting/organizationsetting.go index 88c0ecc9..801d2022 100644 --- a/internal/ent/generated/organizationsetting/organizationsetting.go +++ b/internal/ent/generated/organizationsetting/organizationsetting.go @@ -50,8 +50,6 @@ const ( FieldGeoLocation = "geo_location" // FieldOrganizationID holds the string denoting the organization_id field in the database. FieldOrganizationID = "organization_id" - // FieldStripeID holds the string denoting the stripe_id field in the database. - FieldStripeID = "stripe_id" // EdgeOrganization holds the string denoting the organization edge name in mutations. EdgeOrganization = "organization" // EdgeFiles holds the string denoting the files edge name in mutations. @@ -91,7 +89,6 @@ var Columns = []string{ FieldTaxIdentifier, FieldGeoLocation, FieldOrganizationID, - FieldStripeID, } var ( @@ -209,11 +206,6 @@ func ByBillingPhone(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldBillingPhone, opts...).ToFunc() } -// ByBillingAddress orders the results by the billing_address field. -func ByBillingAddress(opts ...sql.OrderTermOption) OrderOption { - return sql.OrderByField(FieldBillingAddress, opts...).ToFunc() -} - // ByTaxIdentifier orders the results by the tax_identifier field. func ByTaxIdentifier(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldTaxIdentifier, opts...).ToFunc() @@ -229,11 +221,6 @@ func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldOrganizationID, opts...).ToFunc() } -// ByStripeID orders the results by the stripe_id field. -func ByStripeID(opts ...sql.OrderTermOption) OrderOption { - return sql.OrderByField(FieldStripeID, opts...).ToFunc() -} - // ByOrganizationField orders the results by organization field. func ByOrganizationField(field string, opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { diff --git a/internal/ent/generated/organizationsetting/where.go b/internal/ent/generated/organizationsetting/where.go index 496e55bf..f913b54b 100644 --- a/internal/ent/generated/organizationsetting/where.go +++ b/internal/ent/generated/organizationsetting/where.go @@ -118,11 +118,6 @@ func BillingPhone(v string) predicate.OrganizationSetting { return predicate.OrganizationSetting(sql.FieldEQ(FieldBillingPhone, v)) } -// BillingAddress applies equality check predicate on the "billing_address" field. It's identical to BillingAddressEQ. -func BillingAddress(v string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldEQ(FieldBillingAddress, v)) -} - // TaxIdentifier applies equality check predicate on the "tax_identifier" field. It's identical to TaxIdentifierEQ. func TaxIdentifier(v string) predicate.OrganizationSetting { return predicate.OrganizationSetting(sql.FieldEQ(FieldTaxIdentifier, v)) @@ -133,11 +128,6 @@ func OrganizationID(v string) predicate.OrganizationSetting { return predicate.OrganizationSetting(sql.FieldEQ(FieldOrganizationID, v)) } -// StripeID applies equality check predicate on the "stripe_id" field. It's identical to StripeIDEQ. -func StripeID(v string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldEQ(FieldStripeID, v)) -} - // CreatedAtEQ applies the EQ predicate on the "created_at" field. func CreatedAtEQ(v time.Time) predicate.OrganizationSetting { return predicate.OrganizationSetting(sql.FieldEQ(FieldCreatedAt, v)) @@ -823,61 +813,6 @@ func BillingPhoneContainsFold(v string) predicate.OrganizationSetting { return predicate.OrganizationSetting(sql.FieldContainsFold(FieldBillingPhone, v)) } -// BillingAddressEQ applies the EQ predicate on the "billing_address" field. -func BillingAddressEQ(v string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldEQ(FieldBillingAddress, v)) -} - -// BillingAddressNEQ applies the NEQ predicate on the "billing_address" field. -func BillingAddressNEQ(v string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldNEQ(FieldBillingAddress, v)) -} - -// BillingAddressIn applies the In predicate on the "billing_address" field. -func BillingAddressIn(vs ...string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldIn(FieldBillingAddress, vs...)) -} - -// BillingAddressNotIn applies the NotIn predicate on the "billing_address" field. -func BillingAddressNotIn(vs ...string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldNotIn(FieldBillingAddress, vs...)) -} - -// BillingAddressGT applies the GT predicate on the "billing_address" field. -func BillingAddressGT(v string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldGT(FieldBillingAddress, v)) -} - -// BillingAddressGTE applies the GTE predicate on the "billing_address" field. -func BillingAddressGTE(v string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldGTE(FieldBillingAddress, v)) -} - -// BillingAddressLT applies the LT predicate on the "billing_address" field. -func BillingAddressLT(v string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldLT(FieldBillingAddress, v)) -} - -// BillingAddressLTE applies the LTE predicate on the "billing_address" field. -func BillingAddressLTE(v string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldLTE(FieldBillingAddress, v)) -} - -// BillingAddressContains applies the Contains predicate on the "billing_address" field. -func BillingAddressContains(v string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldContains(FieldBillingAddress, v)) -} - -// BillingAddressHasPrefix applies the HasPrefix predicate on the "billing_address" field. -func BillingAddressHasPrefix(v string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldHasPrefix(FieldBillingAddress, v)) -} - -// BillingAddressHasSuffix applies the HasSuffix predicate on the "billing_address" field. -func BillingAddressHasSuffix(v string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldHasSuffix(FieldBillingAddress, v)) -} - // BillingAddressIsNil applies the IsNil predicate on the "billing_address" field. func BillingAddressIsNil() predicate.OrganizationSetting { return predicate.OrganizationSetting(sql.FieldIsNull(FieldBillingAddress)) @@ -888,16 +823,6 @@ func BillingAddressNotNil() predicate.OrganizationSetting { return predicate.OrganizationSetting(sql.FieldNotNull(FieldBillingAddress)) } -// BillingAddressEqualFold applies the EqualFold predicate on the "billing_address" field. -func BillingAddressEqualFold(v string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldEqualFold(FieldBillingAddress, v)) -} - -// BillingAddressContainsFold applies the ContainsFold predicate on the "billing_address" field. -func BillingAddressContainsFold(v string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldContainsFold(FieldBillingAddress, v)) -} - // TaxIdentifierEQ applies the EQ predicate on the "tax_identifier" field. func TaxIdentifierEQ(v string) predicate.OrganizationSetting { return predicate.OrganizationSetting(sql.FieldEQ(FieldTaxIdentifier, v)) @@ -1088,81 +1013,6 @@ func OrganizationIDContainsFold(v string) predicate.OrganizationSetting { return predicate.OrganizationSetting(sql.FieldContainsFold(FieldOrganizationID, v)) } -// StripeIDEQ applies the EQ predicate on the "stripe_id" field. -func StripeIDEQ(v string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldEQ(FieldStripeID, v)) -} - -// StripeIDNEQ applies the NEQ predicate on the "stripe_id" field. -func StripeIDNEQ(v string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldNEQ(FieldStripeID, v)) -} - -// StripeIDIn applies the In predicate on the "stripe_id" field. -func StripeIDIn(vs ...string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldIn(FieldStripeID, vs...)) -} - -// StripeIDNotIn applies the NotIn predicate on the "stripe_id" field. -func StripeIDNotIn(vs ...string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldNotIn(FieldStripeID, vs...)) -} - -// StripeIDGT applies the GT predicate on the "stripe_id" field. -func StripeIDGT(v string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldGT(FieldStripeID, v)) -} - -// StripeIDGTE applies the GTE predicate on the "stripe_id" field. -func StripeIDGTE(v string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldGTE(FieldStripeID, v)) -} - -// StripeIDLT applies the LT predicate on the "stripe_id" field. -func StripeIDLT(v string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldLT(FieldStripeID, v)) -} - -// StripeIDLTE applies the LTE predicate on the "stripe_id" field. -func StripeIDLTE(v string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldLTE(FieldStripeID, v)) -} - -// StripeIDContains applies the Contains predicate on the "stripe_id" field. -func StripeIDContains(v string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldContains(FieldStripeID, v)) -} - -// StripeIDHasPrefix applies the HasPrefix predicate on the "stripe_id" field. -func StripeIDHasPrefix(v string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldHasPrefix(FieldStripeID, v)) -} - -// StripeIDHasSuffix applies the HasSuffix predicate on the "stripe_id" field. -func StripeIDHasSuffix(v string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldHasSuffix(FieldStripeID, v)) -} - -// StripeIDIsNil applies the IsNil predicate on the "stripe_id" field. -func StripeIDIsNil() predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldIsNull(FieldStripeID)) -} - -// StripeIDNotNil applies the NotNil predicate on the "stripe_id" field. -func StripeIDNotNil() predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldNotNull(FieldStripeID)) -} - -// StripeIDEqualFold applies the EqualFold predicate on the "stripe_id" field. -func StripeIDEqualFold(v string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldEqualFold(FieldStripeID, v)) -} - -// StripeIDContainsFold applies the ContainsFold predicate on the "stripe_id" field. -func StripeIDContainsFold(v string) predicate.OrganizationSetting { - return predicate.OrganizationSetting(sql.FieldContainsFold(FieldStripeID, v)) -} - // HasOrganization applies the HasEdge predicate on the "organization" edge. func HasOrganization() predicate.OrganizationSetting { return predicate.OrganizationSetting(func(s *sql.Selector) { diff --git a/internal/ent/generated/organizationsetting_create.go b/internal/ent/generated/organizationsetting_create.go index 9bba6268..8756a9e7 100644 --- a/internal/ent/generated/organizationsetting_create.go +++ b/internal/ent/generated/organizationsetting_create.go @@ -14,6 +14,7 @@ import ( "github.com/theopenlane/core/internal/ent/generated/organization" "github.com/theopenlane/core/internal/ent/generated/organizationsetting" "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/models" ) // OrganizationSettingCreate is the builder for creating a OrganizationSetting entity. @@ -176,15 +177,15 @@ func (osc *OrganizationSettingCreate) SetNillableBillingPhone(s *string) *Organi } // SetBillingAddress sets the "billing_address" field. -func (osc *OrganizationSettingCreate) SetBillingAddress(s string) *OrganizationSettingCreate { - osc.mutation.SetBillingAddress(s) +func (osc *OrganizationSettingCreate) SetBillingAddress(m models.Address) *OrganizationSettingCreate { + osc.mutation.SetBillingAddress(m) return osc } // SetNillableBillingAddress sets the "billing_address" field if the given value is not nil. -func (osc *OrganizationSettingCreate) SetNillableBillingAddress(s *string) *OrganizationSettingCreate { - if s != nil { - osc.SetBillingAddress(*s) +func (osc *OrganizationSettingCreate) SetNillableBillingAddress(m *models.Address) *OrganizationSettingCreate { + if m != nil { + osc.SetBillingAddress(*m) } return osc } @@ -231,20 +232,6 @@ func (osc *OrganizationSettingCreate) SetNillableOrganizationID(s *string) *Orga return osc } -// SetStripeID sets the "stripe_id" field. -func (osc *OrganizationSettingCreate) SetStripeID(s string) *OrganizationSettingCreate { - osc.mutation.SetStripeID(s) - return osc -} - -// SetNillableStripeID sets the "stripe_id" field if the given value is not nil. -func (osc *OrganizationSettingCreate) SetNillableStripeID(s *string) *OrganizationSettingCreate { - if s != nil { - osc.SetStripeID(*s) - } - return osc -} - // SetID sets the "id" field. func (osc *OrganizationSettingCreate) SetID(s string) *OrganizationSettingCreate { osc.mutation.SetID(s) @@ -465,7 +452,7 @@ func (osc *OrganizationSettingCreate) createSpec() (*OrganizationSetting, *sqlgr _node.BillingPhone = value } if value, ok := osc.mutation.BillingAddress(); ok { - _spec.SetField(organizationsetting.FieldBillingAddress, field.TypeString, value) + _spec.SetField(organizationsetting.FieldBillingAddress, field.TypeJSON, value) _node.BillingAddress = value } if value, ok := osc.mutation.TaxIdentifier(); ok { @@ -476,10 +463,6 @@ func (osc *OrganizationSettingCreate) createSpec() (*OrganizationSetting, *sqlgr _spec.SetField(organizationsetting.FieldGeoLocation, field.TypeEnum, value) _node.GeoLocation = value } - if value, ok := osc.mutation.StripeID(); ok { - _spec.SetField(organizationsetting.FieldStripeID, field.TypeString, value) - _node.StripeID = value - } if nodes := osc.mutation.OrganizationIDs(); len(nodes) > 0 { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.O2O, diff --git a/internal/ent/generated/organizationsetting_update.go b/internal/ent/generated/organizationsetting_update.go index 5fbef084..ae396476 100644 --- a/internal/ent/generated/organizationsetting_update.go +++ b/internal/ent/generated/organizationsetting_update.go @@ -17,6 +17,7 @@ import ( "github.com/theopenlane/core/internal/ent/generated/organizationsetting" "github.com/theopenlane/core/internal/ent/generated/predicate" "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/models" "github.com/theopenlane/core/internal/ent/generated/internal" ) @@ -204,15 +205,15 @@ func (osu *OrganizationSettingUpdate) ClearBillingPhone() *OrganizationSettingUp } // SetBillingAddress sets the "billing_address" field. -func (osu *OrganizationSettingUpdate) SetBillingAddress(s string) *OrganizationSettingUpdate { - osu.mutation.SetBillingAddress(s) +func (osu *OrganizationSettingUpdate) SetBillingAddress(m models.Address) *OrganizationSettingUpdate { + osu.mutation.SetBillingAddress(m) return osu } // SetNillableBillingAddress sets the "billing_address" field if the given value is not nil. -func (osu *OrganizationSettingUpdate) SetNillableBillingAddress(s *string) *OrganizationSettingUpdate { - if s != nil { - osu.SetBillingAddress(*s) +func (osu *OrganizationSettingUpdate) SetNillableBillingAddress(m *models.Address) *OrganizationSettingUpdate { + if m != nil { + osu.SetBillingAddress(*m) } return osu } @@ -283,26 +284,6 @@ func (osu *OrganizationSettingUpdate) ClearOrganizationID() *OrganizationSetting return osu } -// SetStripeID sets the "stripe_id" field. -func (osu *OrganizationSettingUpdate) SetStripeID(s string) *OrganizationSettingUpdate { - osu.mutation.SetStripeID(s) - return osu -} - -// SetNillableStripeID sets the "stripe_id" field if the given value is not nil. -func (osu *OrganizationSettingUpdate) SetNillableStripeID(s *string) *OrganizationSettingUpdate { - if s != nil { - osu.SetStripeID(*s) - } - return osu -} - -// ClearStripeID clears the value of the "stripe_id" field. -func (osu *OrganizationSettingUpdate) ClearStripeID() *OrganizationSettingUpdate { - osu.mutation.ClearStripeID() - return osu -} - // SetOrganization sets the "organization" edge to the Organization entity. func (osu *OrganizationSettingUpdate) SetOrganization(o *Organization) *OrganizationSettingUpdate { return osu.SetOrganizationID(o.ID) @@ -511,10 +492,10 @@ func (osu *OrganizationSettingUpdate) sqlSave(ctx context.Context) (n int, err e _spec.ClearField(organizationsetting.FieldBillingPhone, field.TypeString) } if value, ok := osu.mutation.BillingAddress(); ok { - _spec.SetField(organizationsetting.FieldBillingAddress, field.TypeString, value) + _spec.SetField(organizationsetting.FieldBillingAddress, field.TypeJSON, value) } if osu.mutation.BillingAddressCleared() { - _spec.ClearField(organizationsetting.FieldBillingAddress, field.TypeString) + _spec.ClearField(organizationsetting.FieldBillingAddress, field.TypeJSON) } if value, ok := osu.mutation.TaxIdentifier(); ok { _spec.SetField(organizationsetting.FieldTaxIdentifier, field.TypeString, value) @@ -528,12 +509,6 @@ func (osu *OrganizationSettingUpdate) sqlSave(ctx context.Context) (n int, err e if osu.mutation.GeoLocationCleared() { _spec.ClearField(organizationsetting.FieldGeoLocation, field.TypeEnum) } - if value, ok := osu.mutation.StripeID(); ok { - _spec.SetField(organizationsetting.FieldStripeID, field.TypeString, value) - } - if osu.mutation.StripeIDCleared() { - _spec.ClearField(organizationsetting.FieldStripeID, field.TypeString) - } if osu.mutation.OrganizationCleared() { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.O2O, @@ -806,15 +781,15 @@ func (osuo *OrganizationSettingUpdateOne) ClearBillingPhone() *OrganizationSetti } // SetBillingAddress sets the "billing_address" field. -func (osuo *OrganizationSettingUpdateOne) SetBillingAddress(s string) *OrganizationSettingUpdateOne { - osuo.mutation.SetBillingAddress(s) +func (osuo *OrganizationSettingUpdateOne) SetBillingAddress(m models.Address) *OrganizationSettingUpdateOne { + osuo.mutation.SetBillingAddress(m) return osuo } // SetNillableBillingAddress sets the "billing_address" field if the given value is not nil. -func (osuo *OrganizationSettingUpdateOne) SetNillableBillingAddress(s *string) *OrganizationSettingUpdateOne { - if s != nil { - osuo.SetBillingAddress(*s) +func (osuo *OrganizationSettingUpdateOne) SetNillableBillingAddress(m *models.Address) *OrganizationSettingUpdateOne { + if m != nil { + osuo.SetBillingAddress(*m) } return osuo } @@ -885,26 +860,6 @@ func (osuo *OrganizationSettingUpdateOne) ClearOrganizationID() *OrganizationSet return osuo } -// SetStripeID sets the "stripe_id" field. -func (osuo *OrganizationSettingUpdateOne) SetStripeID(s string) *OrganizationSettingUpdateOne { - osuo.mutation.SetStripeID(s) - return osuo -} - -// SetNillableStripeID sets the "stripe_id" field if the given value is not nil. -func (osuo *OrganizationSettingUpdateOne) SetNillableStripeID(s *string) *OrganizationSettingUpdateOne { - if s != nil { - osuo.SetStripeID(*s) - } - return osuo -} - -// ClearStripeID clears the value of the "stripe_id" field. -func (osuo *OrganizationSettingUpdateOne) ClearStripeID() *OrganizationSettingUpdateOne { - osuo.mutation.ClearStripeID() - return osuo -} - // SetOrganization sets the "organization" edge to the Organization entity. func (osuo *OrganizationSettingUpdateOne) SetOrganization(o *Organization) *OrganizationSettingUpdateOne { return osuo.SetOrganizationID(o.ID) @@ -1143,10 +1098,10 @@ func (osuo *OrganizationSettingUpdateOne) sqlSave(ctx context.Context) (_node *O _spec.ClearField(organizationsetting.FieldBillingPhone, field.TypeString) } if value, ok := osuo.mutation.BillingAddress(); ok { - _spec.SetField(organizationsetting.FieldBillingAddress, field.TypeString, value) + _spec.SetField(organizationsetting.FieldBillingAddress, field.TypeJSON, value) } if osuo.mutation.BillingAddressCleared() { - _spec.ClearField(organizationsetting.FieldBillingAddress, field.TypeString) + _spec.ClearField(organizationsetting.FieldBillingAddress, field.TypeJSON) } if value, ok := osuo.mutation.TaxIdentifier(); ok { _spec.SetField(organizationsetting.FieldTaxIdentifier, field.TypeString, value) @@ -1160,12 +1115,6 @@ func (osuo *OrganizationSettingUpdateOne) sqlSave(ctx context.Context) (_node *O if osuo.mutation.GeoLocationCleared() { _spec.ClearField(organizationsetting.FieldGeoLocation, field.TypeEnum) } - if value, ok := osuo.mutation.StripeID(); ok { - _spec.SetField(organizationsetting.FieldStripeID, field.TypeString, value) - } - if osuo.mutation.StripeIDCleared() { - _spec.ClearField(organizationsetting.FieldStripeID, field.TypeString) - } if osuo.mutation.OrganizationCleared() { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.O2O, diff --git a/internal/ent/generated/organizationsettinghistory.go b/internal/ent/generated/organizationsettinghistory.go index 500a6797..c7ba2ec4 100644 --- a/internal/ent/generated/organizationsettinghistory.go +++ b/internal/ent/generated/organizationsettinghistory.go @@ -12,6 +12,7 @@ import ( "entgo.io/ent/dialect/sql" "github.com/theopenlane/core/internal/ent/generated/organizationsettinghistory" "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/models" "github.com/theopenlane/entx/history" ) @@ -50,17 +51,15 @@ type OrganizationSettingHistory struct { BillingEmail string `json:"billing_email,omitempty"` // Phone number to contact for billing BillingPhone string `json:"billing_phone,omitempty"` - // Address to send billing information to - BillingAddress string `json:"billing_address,omitempty"` + // the billing address to send billing information to + BillingAddress models.Address `json:"billing_address,omitempty"` // Usually government-issued tax ID or business ID such as ABN in Australia TaxIdentifier string `json:"tax_identifier,omitempty"` // geographical location of the organization GeoLocation enums.Region `json:"geo_location,omitempty"` // the ID of the organization the settings belong to OrganizationID string `json:"organization_id,omitempty"` - // the ID of the stripe customer associated with the organization - StripeID string `json:"stripe_id,omitempty"` - selectValues sql.SelectValues + selectValues sql.SelectValues } // scanValues returns the types for scanning values from sql.Rows. @@ -68,11 +67,11 @@ func (*OrganizationSettingHistory) scanValues(columns []string) ([]any, error) { values := make([]any, len(columns)) for i := range columns { switch columns[i] { - case organizationsettinghistory.FieldTags, organizationsettinghistory.FieldDomains: + case organizationsettinghistory.FieldTags, organizationsettinghistory.FieldDomains, organizationsettinghistory.FieldBillingAddress: values[i] = new([]byte) case organizationsettinghistory.FieldOperation: values[i] = new(history.OpType) - case organizationsettinghistory.FieldID, organizationsettinghistory.FieldRef, organizationsettinghistory.FieldCreatedBy, organizationsettinghistory.FieldUpdatedBy, organizationsettinghistory.FieldMappingID, organizationsettinghistory.FieldDeletedBy, organizationsettinghistory.FieldBillingContact, organizationsettinghistory.FieldBillingEmail, organizationsettinghistory.FieldBillingPhone, organizationsettinghistory.FieldBillingAddress, organizationsettinghistory.FieldTaxIdentifier, organizationsettinghistory.FieldGeoLocation, organizationsettinghistory.FieldOrganizationID, organizationsettinghistory.FieldStripeID: + case organizationsettinghistory.FieldID, organizationsettinghistory.FieldRef, organizationsettinghistory.FieldCreatedBy, organizationsettinghistory.FieldUpdatedBy, organizationsettinghistory.FieldMappingID, organizationsettinghistory.FieldDeletedBy, organizationsettinghistory.FieldBillingContact, organizationsettinghistory.FieldBillingEmail, organizationsettinghistory.FieldBillingPhone, organizationsettinghistory.FieldTaxIdentifier, organizationsettinghistory.FieldGeoLocation, organizationsettinghistory.FieldOrganizationID: values[i] = new(sql.NullString) case organizationsettinghistory.FieldHistoryTime, organizationsettinghistory.FieldCreatedAt, organizationsettinghistory.FieldUpdatedAt, organizationsettinghistory.FieldDeletedAt: values[i] = new(sql.NullTime) @@ -192,10 +191,12 @@ func (osh *OrganizationSettingHistory) assignValues(columns []string, values []a osh.BillingPhone = value.String } case organizationsettinghistory.FieldBillingAddress: - if value, ok := values[i].(*sql.NullString); !ok { + if value, ok := values[i].(*[]byte); !ok { return fmt.Errorf("unexpected type %T for field billing_address", values[i]) - } else if value.Valid { - osh.BillingAddress = value.String + } else if value != nil && len(*value) > 0 { + if err := json.Unmarshal(*value, &osh.BillingAddress); err != nil { + return fmt.Errorf("unmarshal field billing_address: %w", err) + } } case organizationsettinghistory.FieldTaxIdentifier: if value, ok := values[i].(*sql.NullString); !ok { @@ -215,12 +216,6 @@ func (osh *OrganizationSettingHistory) assignValues(columns []string, values []a } else if value.Valid { osh.OrganizationID = value.String } - case organizationsettinghistory.FieldStripeID: - if value, ok := values[i].(*sql.NullString); !ok { - return fmt.Errorf("unexpected type %T for field stripe_id", values[i]) - } else if value.Valid { - osh.StripeID = value.String - } default: osh.selectValues.Set(columns[i], values[i]) } @@ -303,7 +298,7 @@ func (osh *OrganizationSettingHistory) String() string { builder.WriteString(osh.BillingPhone) builder.WriteString(", ") builder.WriteString("billing_address=") - builder.WriteString(osh.BillingAddress) + builder.WriteString(fmt.Sprintf("%v", osh.BillingAddress)) builder.WriteString(", ") builder.WriteString("tax_identifier=") builder.WriteString(osh.TaxIdentifier) @@ -313,9 +308,6 @@ func (osh *OrganizationSettingHistory) String() string { builder.WriteString(", ") builder.WriteString("organization_id=") builder.WriteString(osh.OrganizationID) - builder.WriteString(", ") - builder.WriteString("stripe_id=") - builder.WriteString(osh.StripeID) builder.WriteByte(')') return builder.String() } diff --git a/internal/ent/generated/organizationsettinghistory/organizationsettinghistory.go b/internal/ent/generated/organizationsettinghistory/organizationsettinghistory.go index d109c49f..9ba99134 100644 --- a/internal/ent/generated/organizationsettinghistory/organizationsettinghistory.go +++ b/internal/ent/generated/organizationsettinghistory/organizationsettinghistory.go @@ -56,8 +56,6 @@ const ( FieldGeoLocation = "geo_location" // FieldOrganizationID holds the string denoting the organization_id field in the database. FieldOrganizationID = "organization_id" - // FieldStripeID holds the string denoting the stripe_id field in the database. - FieldStripeID = "stripe_id" // Table holds the table name of the organizationsettinghistory in the database. Table = "organization_setting_history" ) @@ -84,7 +82,6 @@ var Columns = []string{ FieldTaxIdentifier, FieldGeoLocation, FieldOrganizationID, - FieldStripeID, } // ValidColumn reports if the column name is valid (part of the table columns). @@ -217,11 +214,6 @@ func ByBillingPhone(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldBillingPhone, opts...).ToFunc() } -// ByBillingAddress orders the results by the billing_address field. -func ByBillingAddress(opts ...sql.OrderTermOption) OrderOption { - return sql.OrderByField(FieldBillingAddress, opts...).ToFunc() -} - // ByTaxIdentifier orders the results by the tax_identifier field. func ByTaxIdentifier(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldTaxIdentifier, opts...).ToFunc() @@ -237,11 +229,6 @@ func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldOrganizationID, opts...).ToFunc() } -// ByStripeID orders the results by the stripe_id field. -func ByStripeID(opts ...sql.OrderTermOption) OrderOption { - return sql.OrderByField(FieldStripeID, opts...).ToFunc() -} - var ( // history.OpType must implement graphql.Marshaler. _ graphql.Marshaler = (*history.OpType)(nil) diff --git a/internal/ent/generated/organizationsettinghistory/where.go b/internal/ent/generated/organizationsettinghistory/where.go index 8ebe3b86..86220904 100644 --- a/internal/ent/generated/organizationsettinghistory/where.go +++ b/internal/ent/generated/organizationsettinghistory/where.go @@ -126,11 +126,6 @@ func BillingPhone(v string) predicate.OrganizationSettingHistory { return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldBillingPhone, v)) } -// BillingAddress applies equality check predicate on the "billing_address" field. It's identical to BillingAddressEQ. -func BillingAddress(v string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldBillingAddress, v)) -} - // TaxIdentifier applies equality check predicate on the "tax_identifier" field. It's identical to TaxIdentifierEQ. func TaxIdentifier(v string) predicate.OrganizationSettingHistory { return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldTaxIdentifier, v)) @@ -141,11 +136,6 @@ func OrganizationID(v string) predicate.OrganizationSettingHistory { return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldOrganizationID, v)) } -// StripeID applies equality check predicate on the "stripe_id" field. It's identical to StripeIDEQ. -func StripeID(v string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldStripeID, v)) -} - // HistoryTimeEQ applies the EQ predicate on the "history_time" field. func HistoryTimeEQ(v time.Time) predicate.OrganizationSettingHistory { return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldHistoryTime, v)) @@ -966,61 +956,6 @@ func BillingPhoneContainsFold(v string) predicate.OrganizationSettingHistory { return predicate.OrganizationSettingHistory(sql.FieldContainsFold(FieldBillingPhone, v)) } -// BillingAddressEQ applies the EQ predicate on the "billing_address" field. -func BillingAddressEQ(v string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldBillingAddress, v)) -} - -// BillingAddressNEQ applies the NEQ predicate on the "billing_address" field. -func BillingAddressNEQ(v string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldNEQ(FieldBillingAddress, v)) -} - -// BillingAddressIn applies the In predicate on the "billing_address" field. -func BillingAddressIn(vs ...string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldIn(FieldBillingAddress, vs...)) -} - -// BillingAddressNotIn applies the NotIn predicate on the "billing_address" field. -func BillingAddressNotIn(vs ...string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldNotIn(FieldBillingAddress, vs...)) -} - -// BillingAddressGT applies the GT predicate on the "billing_address" field. -func BillingAddressGT(v string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldGT(FieldBillingAddress, v)) -} - -// BillingAddressGTE applies the GTE predicate on the "billing_address" field. -func BillingAddressGTE(v string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldGTE(FieldBillingAddress, v)) -} - -// BillingAddressLT applies the LT predicate on the "billing_address" field. -func BillingAddressLT(v string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldLT(FieldBillingAddress, v)) -} - -// BillingAddressLTE applies the LTE predicate on the "billing_address" field. -func BillingAddressLTE(v string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldLTE(FieldBillingAddress, v)) -} - -// BillingAddressContains applies the Contains predicate on the "billing_address" field. -func BillingAddressContains(v string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldContains(FieldBillingAddress, v)) -} - -// BillingAddressHasPrefix applies the HasPrefix predicate on the "billing_address" field. -func BillingAddressHasPrefix(v string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldHasPrefix(FieldBillingAddress, v)) -} - -// BillingAddressHasSuffix applies the HasSuffix predicate on the "billing_address" field. -func BillingAddressHasSuffix(v string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldHasSuffix(FieldBillingAddress, v)) -} - // BillingAddressIsNil applies the IsNil predicate on the "billing_address" field. func BillingAddressIsNil() predicate.OrganizationSettingHistory { return predicate.OrganizationSettingHistory(sql.FieldIsNull(FieldBillingAddress)) @@ -1031,16 +966,6 @@ func BillingAddressNotNil() predicate.OrganizationSettingHistory { return predicate.OrganizationSettingHistory(sql.FieldNotNull(FieldBillingAddress)) } -// BillingAddressEqualFold applies the EqualFold predicate on the "billing_address" field. -func BillingAddressEqualFold(v string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldEqualFold(FieldBillingAddress, v)) -} - -// BillingAddressContainsFold applies the ContainsFold predicate on the "billing_address" field. -func BillingAddressContainsFold(v string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldContainsFold(FieldBillingAddress, v)) -} - // TaxIdentifierEQ applies the EQ predicate on the "tax_identifier" field. func TaxIdentifierEQ(v string) predicate.OrganizationSettingHistory { return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldTaxIdentifier, v)) @@ -1231,81 +1156,6 @@ func OrganizationIDContainsFold(v string) predicate.OrganizationSettingHistory { return predicate.OrganizationSettingHistory(sql.FieldContainsFold(FieldOrganizationID, v)) } -// StripeIDEQ applies the EQ predicate on the "stripe_id" field. -func StripeIDEQ(v string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldEQ(FieldStripeID, v)) -} - -// StripeIDNEQ applies the NEQ predicate on the "stripe_id" field. -func StripeIDNEQ(v string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldNEQ(FieldStripeID, v)) -} - -// StripeIDIn applies the In predicate on the "stripe_id" field. -func StripeIDIn(vs ...string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldIn(FieldStripeID, vs...)) -} - -// StripeIDNotIn applies the NotIn predicate on the "stripe_id" field. -func StripeIDNotIn(vs ...string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldNotIn(FieldStripeID, vs...)) -} - -// StripeIDGT applies the GT predicate on the "stripe_id" field. -func StripeIDGT(v string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldGT(FieldStripeID, v)) -} - -// StripeIDGTE applies the GTE predicate on the "stripe_id" field. -func StripeIDGTE(v string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldGTE(FieldStripeID, v)) -} - -// StripeIDLT applies the LT predicate on the "stripe_id" field. -func StripeIDLT(v string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldLT(FieldStripeID, v)) -} - -// StripeIDLTE applies the LTE predicate on the "stripe_id" field. -func StripeIDLTE(v string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldLTE(FieldStripeID, v)) -} - -// StripeIDContains applies the Contains predicate on the "stripe_id" field. -func StripeIDContains(v string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldContains(FieldStripeID, v)) -} - -// StripeIDHasPrefix applies the HasPrefix predicate on the "stripe_id" field. -func StripeIDHasPrefix(v string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldHasPrefix(FieldStripeID, v)) -} - -// StripeIDHasSuffix applies the HasSuffix predicate on the "stripe_id" field. -func StripeIDHasSuffix(v string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldHasSuffix(FieldStripeID, v)) -} - -// StripeIDIsNil applies the IsNil predicate on the "stripe_id" field. -func StripeIDIsNil() predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldIsNull(FieldStripeID)) -} - -// StripeIDNotNil applies the NotNil predicate on the "stripe_id" field. -func StripeIDNotNil() predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldNotNull(FieldStripeID)) -} - -// StripeIDEqualFold applies the EqualFold predicate on the "stripe_id" field. -func StripeIDEqualFold(v string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldEqualFold(FieldStripeID, v)) -} - -// StripeIDContainsFold applies the ContainsFold predicate on the "stripe_id" field. -func StripeIDContainsFold(v string) predicate.OrganizationSettingHistory { - return predicate.OrganizationSettingHistory(sql.FieldContainsFold(FieldStripeID, v)) -} - // And groups predicates with the AND operator between them. func And(predicates ...predicate.OrganizationSettingHistory) predicate.OrganizationSettingHistory { return predicate.OrganizationSettingHistory(sql.AndPredicates(predicates...)) diff --git a/internal/ent/generated/organizationsettinghistory_create.go b/internal/ent/generated/organizationsettinghistory_create.go index 58444d77..3bf4ff39 100644 --- a/internal/ent/generated/organizationsettinghistory_create.go +++ b/internal/ent/generated/organizationsettinghistory_create.go @@ -12,6 +12,7 @@ import ( "entgo.io/ent/schema/field" "github.com/theopenlane/core/internal/ent/generated/organizationsettinghistory" "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/models" "github.com/theopenlane/entx/history" ) @@ -209,15 +210,15 @@ func (oshc *OrganizationSettingHistoryCreate) SetNillableBillingPhone(s *string) } // SetBillingAddress sets the "billing_address" field. -func (oshc *OrganizationSettingHistoryCreate) SetBillingAddress(s string) *OrganizationSettingHistoryCreate { - oshc.mutation.SetBillingAddress(s) +func (oshc *OrganizationSettingHistoryCreate) SetBillingAddress(m models.Address) *OrganizationSettingHistoryCreate { + oshc.mutation.SetBillingAddress(m) return oshc } // SetNillableBillingAddress sets the "billing_address" field if the given value is not nil. -func (oshc *OrganizationSettingHistoryCreate) SetNillableBillingAddress(s *string) *OrganizationSettingHistoryCreate { - if s != nil { - oshc.SetBillingAddress(*s) +func (oshc *OrganizationSettingHistoryCreate) SetNillableBillingAddress(m *models.Address) *OrganizationSettingHistoryCreate { + if m != nil { + oshc.SetBillingAddress(*m) } return oshc } @@ -264,20 +265,6 @@ func (oshc *OrganizationSettingHistoryCreate) SetNillableOrganizationID(s *strin return oshc } -// SetStripeID sets the "stripe_id" field. -func (oshc *OrganizationSettingHistoryCreate) SetStripeID(s string) *OrganizationSettingHistoryCreate { - oshc.mutation.SetStripeID(s) - return oshc -} - -// SetNillableStripeID sets the "stripe_id" field if the given value is not nil. -func (oshc *OrganizationSettingHistoryCreate) SetNillableStripeID(s *string) *OrganizationSettingHistoryCreate { - if s != nil { - oshc.SetStripeID(*s) - } - return oshc -} - // SetID sets the "id" field. func (oshc *OrganizationSettingHistoryCreate) SetID(s string) *OrganizationSettingHistoryCreate { oshc.mutation.SetID(s) @@ -493,7 +480,7 @@ func (oshc *OrganizationSettingHistoryCreate) createSpec() (*OrganizationSetting _node.BillingPhone = value } if value, ok := oshc.mutation.BillingAddress(); ok { - _spec.SetField(organizationsettinghistory.FieldBillingAddress, field.TypeString, value) + _spec.SetField(organizationsettinghistory.FieldBillingAddress, field.TypeJSON, value) _node.BillingAddress = value } if value, ok := oshc.mutation.TaxIdentifier(); ok { @@ -508,10 +495,6 @@ func (oshc *OrganizationSettingHistoryCreate) createSpec() (*OrganizationSetting _spec.SetField(organizationsettinghistory.FieldOrganizationID, field.TypeString, value) _node.OrganizationID = value } - if value, ok := oshc.mutation.StripeID(); ok { - _spec.SetField(organizationsettinghistory.FieldStripeID, field.TypeString, value) - _node.StripeID = value - } return _node, _spec } diff --git a/internal/ent/generated/organizationsettinghistory_update.go b/internal/ent/generated/organizationsettinghistory_update.go index b0cfc11c..e62f7688 100644 --- a/internal/ent/generated/organizationsettinghistory_update.go +++ b/internal/ent/generated/organizationsettinghistory_update.go @@ -15,6 +15,7 @@ import ( "github.com/theopenlane/core/internal/ent/generated/organizationsettinghistory" "github.com/theopenlane/core/internal/ent/generated/predicate" "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/models" "github.com/theopenlane/core/internal/ent/generated/internal" ) @@ -202,15 +203,15 @@ func (oshu *OrganizationSettingHistoryUpdate) ClearBillingPhone() *OrganizationS } // SetBillingAddress sets the "billing_address" field. -func (oshu *OrganizationSettingHistoryUpdate) SetBillingAddress(s string) *OrganizationSettingHistoryUpdate { - oshu.mutation.SetBillingAddress(s) +func (oshu *OrganizationSettingHistoryUpdate) SetBillingAddress(m models.Address) *OrganizationSettingHistoryUpdate { + oshu.mutation.SetBillingAddress(m) return oshu } // SetNillableBillingAddress sets the "billing_address" field if the given value is not nil. -func (oshu *OrganizationSettingHistoryUpdate) SetNillableBillingAddress(s *string) *OrganizationSettingHistoryUpdate { - if s != nil { - oshu.SetBillingAddress(*s) +func (oshu *OrganizationSettingHistoryUpdate) SetNillableBillingAddress(m *models.Address) *OrganizationSettingHistoryUpdate { + if m != nil { + oshu.SetBillingAddress(*m) } return oshu } @@ -281,26 +282,6 @@ func (oshu *OrganizationSettingHistoryUpdate) ClearOrganizationID() *Organizatio return oshu } -// SetStripeID sets the "stripe_id" field. -func (oshu *OrganizationSettingHistoryUpdate) SetStripeID(s string) *OrganizationSettingHistoryUpdate { - oshu.mutation.SetStripeID(s) - return oshu -} - -// SetNillableStripeID sets the "stripe_id" field if the given value is not nil. -func (oshu *OrganizationSettingHistoryUpdate) SetNillableStripeID(s *string) *OrganizationSettingHistoryUpdate { - if s != nil { - oshu.SetStripeID(*s) - } - return oshu -} - -// ClearStripeID clears the value of the "stripe_id" field. -func (oshu *OrganizationSettingHistoryUpdate) ClearStripeID() *OrganizationSettingHistoryUpdate { - oshu.mutation.ClearStripeID() - return oshu -} - // Mutation returns the OrganizationSettingHistoryMutation object of the builder. func (oshu *OrganizationSettingHistoryUpdate) Mutation() *OrganizationSettingHistoryMutation { return oshu.mutation @@ -450,10 +431,10 @@ func (oshu *OrganizationSettingHistoryUpdate) sqlSave(ctx context.Context) (n in _spec.ClearField(organizationsettinghistory.FieldBillingPhone, field.TypeString) } if value, ok := oshu.mutation.BillingAddress(); ok { - _spec.SetField(organizationsettinghistory.FieldBillingAddress, field.TypeString, value) + _spec.SetField(organizationsettinghistory.FieldBillingAddress, field.TypeJSON, value) } if oshu.mutation.BillingAddressCleared() { - _spec.ClearField(organizationsettinghistory.FieldBillingAddress, field.TypeString) + _spec.ClearField(organizationsettinghistory.FieldBillingAddress, field.TypeJSON) } if value, ok := oshu.mutation.TaxIdentifier(); ok { _spec.SetField(organizationsettinghistory.FieldTaxIdentifier, field.TypeString, value) @@ -473,12 +454,6 @@ func (oshu *OrganizationSettingHistoryUpdate) sqlSave(ctx context.Context) (n in if oshu.mutation.OrganizationIDCleared() { _spec.ClearField(organizationsettinghistory.FieldOrganizationID, field.TypeString) } - if value, ok := oshu.mutation.StripeID(); ok { - _spec.SetField(organizationsettinghistory.FieldStripeID, field.TypeString, value) - } - if oshu.mutation.StripeIDCleared() { - _spec.ClearField(organizationsettinghistory.FieldStripeID, field.TypeString) - } _spec.Node.Schema = oshu.schemaConfig.OrganizationSettingHistory ctx = internal.NewSchemaConfigContext(ctx, oshu.schemaConfig) _spec.AddModifiers(oshu.modifiers...) @@ -672,15 +647,15 @@ func (oshuo *OrganizationSettingHistoryUpdateOne) ClearBillingPhone() *Organizat } // SetBillingAddress sets the "billing_address" field. -func (oshuo *OrganizationSettingHistoryUpdateOne) SetBillingAddress(s string) *OrganizationSettingHistoryUpdateOne { - oshuo.mutation.SetBillingAddress(s) +func (oshuo *OrganizationSettingHistoryUpdateOne) SetBillingAddress(m models.Address) *OrganizationSettingHistoryUpdateOne { + oshuo.mutation.SetBillingAddress(m) return oshuo } // SetNillableBillingAddress sets the "billing_address" field if the given value is not nil. -func (oshuo *OrganizationSettingHistoryUpdateOne) SetNillableBillingAddress(s *string) *OrganizationSettingHistoryUpdateOne { - if s != nil { - oshuo.SetBillingAddress(*s) +func (oshuo *OrganizationSettingHistoryUpdateOne) SetNillableBillingAddress(m *models.Address) *OrganizationSettingHistoryUpdateOne { + if m != nil { + oshuo.SetBillingAddress(*m) } return oshuo } @@ -751,26 +726,6 @@ func (oshuo *OrganizationSettingHistoryUpdateOne) ClearOrganizationID() *Organiz return oshuo } -// SetStripeID sets the "stripe_id" field. -func (oshuo *OrganizationSettingHistoryUpdateOne) SetStripeID(s string) *OrganizationSettingHistoryUpdateOne { - oshuo.mutation.SetStripeID(s) - return oshuo -} - -// SetNillableStripeID sets the "stripe_id" field if the given value is not nil. -func (oshuo *OrganizationSettingHistoryUpdateOne) SetNillableStripeID(s *string) *OrganizationSettingHistoryUpdateOne { - if s != nil { - oshuo.SetStripeID(*s) - } - return oshuo -} - -// ClearStripeID clears the value of the "stripe_id" field. -func (oshuo *OrganizationSettingHistoryUpdateOne) ClearStripeID() *OrganizationSettingHistoryUpdateOne { - oshuo.mutation.ClearStripeID() - return oshuo -} - // Mutation returns the OrganizationSettingHistoryMutation object of the builder. func (oshuo *OrganizationSettingHistoryUpdateOne) Mutation() *OrganizationSettingHistoryMutation { return oshuo.mutation @@ -950,10 +905,10 @@ func (oshuo *OrganizationSettingHistoryUpdateOne) sqlSave(ctx context.Context) ( _spec.ClearField(organizationsettinghistory.FieldBillingPhone, field.TypeString) } if value, ok := oshuo.mutation.BillingAddress(); ok { - _spec.SetField(organizationsettinghistory.FieldBillingAddress, field.TypeString, value) + _spec.SetField(organizationsettinghistory.FieldBillingAddress, field.TypeJSON, value) } if oshuo.mutation.BillingAddressCleared() { - _spec.ClearField(organizationsettinghistory.FieldBillingAddress, field.TypeString) + _spec.ClearField(organizationsettinghistory.FieldBillingAddress, field.TypeJSON) } if value, ok := oshuo.mutation.TaxIdentifier(); ok { _spec.SetField(organizationsettinghistory.FieldTaxIdentifier, field.TypeString, value) @@ -973,12 +928,6 @@ func (oshuo *OrganizationSettingHistoryUpdateOne) sqlSave(ctx context.Context) ( if oshuo.mutation.OrganizationIDCleared() { _spec.ClearField(organizationsettinghistory.FieldOrganizationID, field.TypeString) } - if value, ok := oshuo.mutation.StripeID(); ok { - _spec.SetField(organizationsettinghistory.FieldStripeID, field.TypeString, value) - } - if oshuo.mutation.StripeIDCleared() { - _spec.ClearField(organizationsettinghistory.FieldStripeID, field.TypeString) - } _spec.Node.Schema = oshuo.schemaConfig.OrganizationSettingHistory ctx = internal.NewSchemaConfigContext(ctx, oshuo.schemaConfig) _spec.AddModifiers(oshuo.modifiers...) diff --git a/internal/ent/generated/orgsubscription.go b/internal/ent/generated/orgsubscription.go index 13147fe9..a0e31f98 100644 --- a/internal/ent/generated/orgsubscription.go +++ b/internal/ent/generated/orgsubscription.go @@ -57,6 +57,8 @@ type OrgSubscription struct { // The values are being populated by the OrgSubscriptionQuery when eager-loading is set. Edges OrgSubscriptionEdges `json:"edges"` selectValues sql.SelectValues + + SubscriptionURL string `json:"subscriptionURL,omitempty"` } // OrgSubscriptionEdges holds the relations/edges for other nodes in the graph. diff --git a/internal/ent/generated/orgsubscription/orgsubscription.go b/internal/ent/generated/orgsubscription/orgsubscription.go index cedeeb8a..2bcb07f8 100644 --- a/internal/ent/generated/orgsubscription/orgsubscription.go +++ b/internal/ent/generated/orgsubscription/orgsubscription.go @@ -101,7 +101,7 @@ func ValidColumn(column string) bool { // import _ "github.com/theopenlane/core/internal/ent/generated/runtime" var ( Hooks [3]ent.Hook - Interceptors [2]ent.Interceptor + Interceptors [3]ent.Interceptor // DefaultCreatedAt holds the default value on creation for the "created_at" field. DefaultCreatedAt func() time.Time // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. diff --git a/internal/ent/generated/runtime/runtime.go b/internal/ent/generated/runtime/runtime.go index 7cf30b13..c935337f 100644 --- a/internal/ent/generated/runtime/runtime.go +++ b/internal/ent/generated/runtime/runtime.go @@ -2154,8 +2154,10 @@ func init() { orgsubscription.Hooks[2] = orgsubscriptionMixinHooks4[0] orgsubscriptionMixinInters3 := orgsubscriptionMixin[3].Interceptors() orgsubscriptionMixinInters4 := orgsubscriptionMixin[4].Interceptors() + orgsubscriptionInters := schema.OrgSubscription{}.Interceptors() orgsubscription.Interceptors[0] = orgsubscriptionMixinInters3[0] orgsubscription.Interceptors[1] = orgsubscriptionMixinInters4[0] + orgsubscription.Interceptors[2] = orgsubscriptionInters[0] orgsubscriptionMixinFields0 := orgsubscriptionMixin[0].Fields() _ = orgsubscriptionMixinFields0 orgsubscriptionMixinFields1 := orgsubscriptionMixin[1].Fields() diff --git a/internal/ent/hooks/errors.go b/internal/ent/hooks/errors.go index 1fc6df8f..ddcc85a4 100644 --- a/internal/ent/hooks/errors.go +++ b/internal/ent/hooks/errors.go @@ -42,6 +42,8 @@ var ( ErrNoControls = errors.New("subcontrol must have at least one control assigned") // ErrUnableToCast is returned when a type assertion fails ErrUnableToCast = errors.New("unable to cast") + // ErrTooManySubscriptions is returned when an organization has too many subscriptions + ErrTooManySubscriptions = errors.New("organization has too many subscriptions") ) // IsUniqueConstraintError reports if the error resulted from a DB uniqueness constraint violation. diff --git a/internal/ent/hooks/event.go b/internal/ent/hooks/event.go index 3e176979..65a73f21 100644 --- a/internal/ent/hooks/event.go +++ b/internal/ent/hooks/event.go @@ -275,21 +275,42 @@ func fetchOrganizationIDbyOrgSettingID(ctx context.Context, orgsettingID string, orgSetting, err := client.(*entgen.Client).OrganizationSetting.Get(ctx, orgsettingID) if err != nil { log.Err(err).Msgf("Failed to fetch organization setting ID %s", orgsettingID) + return nil, err } - org, err := client.(*entgen.Client).Organization.Query().Where(organization.ID(orgSetting.OrganizationID)).Only(ctx) + org, err := client.(*entgen.Client).Organization.Query().Where(organization.ID(orgSetting.OrganizationID)).WithOrgSubscriptions().Only(ctx) if err != nil { log.Err(err).Msgf("Failed to fetch organization by organization setting ID %s after 3 attempts", orgsettingID) + return nil, err } + if len(org.Edges.OrgSubscriptions) > 1 { + log.Warn().Str("organization_id", org.ID).Msg("organization has multiple subscriptions") + + return nil, ErrTooManySubscriptions + } + + stripeCustomerID := "" + if len(org.Edges.OrgSubscriptions) > 0 { + stripeCustomerID = org.Edges.OrgSubscriptions[0].StripeCustomerID + } + return &entitlements.OrganizationCustomer{ OrganizationID: org.ID, - StripeCustomerID: orgSetting.StripeID, - BillingEmail: orgSetting.BillingEmail, - BillingPhone: orgSetting.BillingPhone, OrganizationName: org.Name, + StripeCustomerID: stripeCustomerID, OrganizationSettingsID: orgSetting.ID, + ContactInfo: entitlements.ContactInfo{ + Email: orgSetting.BillingEmail, + Phone: orgSetting.BillingPhone, + Line1: &orgSetting.BillingAddress.Line1, + Line2: &orgSetting.BillingAddress.Line2, + City: &orgSetting.BillingAddress.City, + State: &orgSetting.BillingAddress.State, + Country: &orgSetting.BillingAddress.Country, + PostalCode: &orgSetting.BillingAddress.PostalCode, + }, }, nil } diff --git a/internal/ent/hooks/organization.go b/internal/ent/hooks/organization.go index 5b359de5..2e88cd9d 100644 --- a/internal/ent/hooks/organization.go +++ b/internal/ent/hooks/organization.go @@ -10,6 +10,7 @@ import ( "github.com/theopenlane/entx" "github.com/theopenlane/iam/auth" "github.com/theopenlane/iam/fgax" + "github.com/theopenlane/utils/contextx" "github.com/theopenlane/utils/gravatar" "github.com/theopenlane/riverboat/pkg/jobs" @@ -21,6 +22,9 @@ import ( "github.com/theopenlane/core/pkg/enums" ) +// OrganizationCreationContextKey is the context key name for the organization creation context +type OrganizationCreationContextKey struct{} + // HookOrganization runs on org mutations to set default values that are not provided func HookOrganization() ent.Hook { return hook.On(func(next ent.Mutator) ent.Mutator { @@ -31,6 +35,11 @@ func HookOrganization() ent.Hook { } if m.Op().Is(ent.OpCreate) { + // set the context value to indicate this is an organization creation + // this is useful for skipping the hooks on the owner field if its part of the + // initial creation of the organization + ctx = contextx.With(ctx, OrganizationCreationContextKey{}) + // generate a default org setting schema if not provided if err := createOrgSettings(ctx, m); err != nil { return nil, err diff --git a/internal/ent/interceptors/orgsubscription.go b/internal/ent/interceptors/orgsubscription.go new file mode 100644 index 00000000..b38fd7ae --- /dev/null +++ b/internal/ent/interceptors/orgsubscription.go @@ -0,0 +1,72 @@ +package interceptors + +import ( + "context" + + "entgo.io/ent" + "github.com/99designs/gqlgen/graphql" + "github.com/rs/zerolog/log" + + "github.com/theopenlane/core/internal/ent/generated" + "github.com/theopenlane/core/internal/ent/generated/intercept" +) + +func InterceptorSubscriptionURL() ent.Interceptor { + return ent.InterceptFunc(func(next ent.Querier) ent.Querier { + return intercept.OrgSubscriptionFunc(func(ctx context.Context, q *generated.OrgSubscriptionQuery) (generated.Value, error) { + v, err := next.Query(ctx, q) + if err != nil { + return nil, err + } + + // get the fields that were queried and check for the SubscriptionURL field + fields := graphql.CollectFieldsCtx(ctx, []string{"SubscriptionURL"}) + + // if the SubscriptionURL field wasn't queried, return the result as is + if len(fields) == 0 { + return v, nil + } + + // cast to the expected output format + orgSubResult, ok := v.([]*generated.OrgSubscription) + if ok { + for _, orgSub := range orgSubResult { + setSubscriptionURL(orgSub, q) // nolint:errcheck + } + } + + // if its not a list, check the single entry + orgSub, ok := v.(*generated.OrgSubscription) + if ok { + setSubscriptionURL(orgSub, q) // nolint:errcheck + } + + return v, nil + }) + }) +} + +// setSubscriptionURL sets the subscription URL for the org subscription response +func setSubscriptionURL(orgSub *generated.OrgSubscription, q *generated.OrgSubscriptionQuery) error { + if orgSub == nil { + return nil + } + + // if the subscription doesn't have a stripe ID or customer ID, skip + if orgSub.StripeSubscriptionID == "" || orgSub.StripeCustomerID == "" { + return nil + } + + // create a billing portal session + portalSession, err := q.EntitlementManager.CreateBillingPortalUpdateSession(orgSub.StripeSubscriptionID, orgSub.StripeCustomerID) + if err != nil { + log.Err(err).Msg("failed to create billing portal session") + + return err + } + + // add the subscription URL to the result + orgSub.SubscriptionURL = portalSession.URL + + return nil +} diff --git a/internal/ent/schema/mixin_orgowned.go b/internal/ent/schema/mixin_orgowned.go index 9ab6859d..8630c9a3 100644 --- a/internal/ent/schema/mixin_orgowned.go +++ b/internal/ent/schema/mixin_orgowned.go @@ -8,9 +8,11 @@ import ( "entgo.io/ent/dialect/sql" "github.com/theopenlane/iam/auth" + "github.com/theopenlane/utils/contextx" "github.com/theopenlane/core/internal/ent/generated" "github.com/theopenlane/core/internal/ent/generated/intercept" + "github.com/theopenlane/core/internal/ent/hooks" "github.com/theopenlane/core/internal/ent/interceptors" "github.com/theopenlane/core/internal/ent/privacy/rule" ) @@ -59,13 +61,7 @@ var defaultOrgHookFunc HookFunc = func(o ObjectOwnedMixin) ent.Hook { // set owner on create mutation if m.Op() == ent.OpCreate { - orgID, err := auth.GetOrganizationIDFromContext(ctx) - if err != nil { - return nil, fmt.Errorf("failed to get organization id from context: %w", err) - } - - // set owner on mutation - if err := m.SetField(ownerFieldName, orgID); err != nil { + if err := setOwnerIDField(ctx, m); err != nil { return nil, err } } else { @@ -98,13 +94,7 @@ var orgHookCreateFunc HookFunc = func(o ObjectOwnedMixin) ent.Hook { return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) { // set owner on create mutation if m.Op() == ent.OpCreate { - orgID, err := auth.GetOrganizationIDFromContext(ctx) - if err != nil { - return nil, fmt.Errorf("failed to get organization id from context: %w", err) - } - - // set owner on mutation - if err := m.SetField(ownerFieldName, orgID); err != nil { + if err := setOwnerIDField(ctx, m); err != nil { return nil, err } } @@ -114,6 +104,27 @@ var orgHookCreateFunc HookFunc = func(o ObjectOwnedMixin) ent.Hook { } } +// setOwnerIDField sets the owner id field on the mutation based on the current organization +func setOwnerIDField(ctx context.Context, m ent.Mutation) error { + // if the context has the organization creation context key, skip the hook + // because we don't want the owner to be based on the current organization + if _, ok := contextx.From[hooks.OrganizationCreationContextKey](ctx); ok { + return nil + } + + orgID, err := auth.GetOrganizationIDFromContext(ctx) + if err != nil { + return fmt.Errorf("failed to get organization id from context: %w", err) + } + + // set owner on mutation + if err := m.SetField(ownerFieldName, orgID); err != nil { + return err + } + + return nil +} + var defaultOrgInterceptorFunc InterceptorFunc = func(o ObjectOwnedMixin) ent.Interceptor { return intercept.TraverseFunc(func(ctx context.Context, q intercept.Query) error { // skip the interceptor if the context has the token type diff --git a/internal/ent/schema/organizationsetting.go b/internal/ent/schema/organizationsetting.go index dc13af92..fb1a4afb 100644 --- a/internal/ent/schema/organizationsetting.go +++ b/internal/ent/schema/organizationsetting.go @@ -19,6 +19,7 @@ import ( "github.com/theopenlane/core/internal/ent/privacy/policy" "github.com/theopenlane/core/internal/ent/validator" "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/models" ) // OrganizationSetting holds the schema definition for the OrganizationSetting entity @@ -51,8 +52,8 @@ func (OrganizationSetting) Fields() []ent.Field { return err }). Optional(), - field.String("billing_address"). - Comment("Address to send billing information to"). + field.JSON("billing_address", models.Address{}). + Comment("the billing address to send billing information to"). Optional(), field.String("tax_identifier"). Comment("Usually government-issued tax ID or business ID such as ABN in Australia"). @@ -65,9 +66,6 @@ func (OrganizationSetting) Fields() []ent.Field { field.String("organization_id"). Comment("the ID of the organization the settings belong to"). Optional(), - field.String("stripe_id"). - Comment("the ID of the stripe customer associated with the organization"). - Optional(), } } diff --git a/internal/ent/schema/orgsubscription.go b/internal/ent/schema/orgsubscription.go index 7df0da17..34216484 100644 --- a/internal/ent/schema/orgsubscription.go +++ b/internal/ent/schema/orgsubscription.go @@ -8,6 +8,7 @@ import ( emixin "github.com/theopenlane/entx/mixin" + "github.com/theopenlane/core/internal/ent/interceptors" "github.com/theopenlane/core/internal/ent/mixin" ) @@ -74,7 +75,8 @@ func (OrgSubscription) Annotations() []schema.Annotation { return []schema.Annotation{ entgql.QueryField(), entgql.RelayConnection(), - entgql.Mutations(entgql.MutationCreate(), (entgql.MutationUpdate())), + // since we only have queries, we can just use the interceptors for queries and can skip the fga generated checks + // entfga.MembershipChecks("organization"), } } @@ -85,18 +87,7 @@ func (OrgSubscription) Hooks() []ent.Hook { // Interceptors of the OrgSubscription func (OrgSubscription) Interceptors() []ent.Interceptor { - return []ent.Interceptor{} + return []ent.Interceptor{ + interceptors.InterceptorSubscriptionURL(), + } } - -// Policy of the OrgSubscription -//func (OrgSubscription) Policy() ent.Policy { -// return policy.NewPolicy( -// policy.WithQueryRules( -// entfga.CheckReadAccess[*generated.Subscriptio](), -// ), -// policy.WithMutationRules( -// entfga.CheckEditAccess[*generated.ContactMutation](), -// ), -// ) -//} -// diff --git a/internal/ent/templates/subscriptions.tmpl b/internal/ent/templates/subscriptions.tmpl new file mode 100644 index 00000000..e1bfe834 --- /dev/null +++ b/internal/ent/templates/subscriptions.tmpl @@ -0,0 +1,5 @@ +{{ define "model/fields/additional" }} + {{- if eq $.Name "OrgSubscription" }} + SubscriptionURL string `json:"subscriptionURL,omitempty"` + {{- end }} +{{ end }} \ No newline at end of file diff --git a/internal/graphapi/bulk.go b/internal/graphapi/bulk.go index c8a17d72..1cda6275 100644 --- a/internal/graphapi/bulk.go +++ b/internal/graphapi/bulk.go @@ -389,25 +389,6 @@ func (r *mutationResolver) bulkCreateOrgMembership(ctx context.Context, input [] }, nil } -// bulkCreateOrgSubscription uses the CreateBulk function to create multiple OrgSubscription entities -func (r *mutationResolver) bulkCreateOrgSubscription(ctx context.Context, input []*generated.CreateOrgSubscriptionInput) (*model.OrgSubscriptionBulkCreatePayload, error) { - c := withTransactionalMutation(ctx) - builders := make([]*generated.OrgSubscriptionCreate, len(input)) - for i, data := range input { - builders[i] = c.OrgSubscription.Create().SetInput(*data) - } - - res, err := c.OrgSubscription.CreateBulk(builders...).Save(ctx) - if err != nil { - return nil, parseRequestError(err, action{action: ActionCreate, object: "orgsubscription"}) - } - - // return response - return &model.OrgSubscriptionBulkCreatePayload{ - OrgSubscriptions: res, - }, nil -} - // bulkCreatePersonalAccessToken uses the CreateBulk function to create multiple PersonalAccessToken entities func (r *mutationResolver) bulkCreatePersonalAccessToken(ctx context.Context, input []*generated.CreatePersonalAccessTokenInput) (*model.PersonalAccessTokenBulkCreatePayload, error) { c := withTransactionalMutation(ctx) diff --git a/internal/graphapi/clientschema/schema.graphql b/internal/graphapi/clientschema/schema.graphql index 8367b18f..64219843 100644 --- a/internal/graphapi/clientschema/schema.graphql +++ b/internal/graphapi/clientschema/schema.graphql @@ -972,6 +972,7 @@ input ActionPlanWhereInput { hasProgram: Boolean hasProgramWith: [ProgramWhereInput!] } +scalar Address type AuditLog implements Node { table: String time: Time @@ -4500,49 +4501,6 @@ input CreateOrgMembershipInput { eventIDs: [ID!] } """ -CreateOrgSubscriptionInput is used for create OrgSubscription object. -Input was generated by ent. -""" -input CreateOrgSubscriptionInput { - """ - tags associated with the object - """ - tags: [String!] - """ - the stripe subscription id - """ - stripeSubscriptionID: String - """ - the common name of the product tier the subscription is associated with, e.g. starter tier - """ - productTier: String - """ - the product id that represents the tier in stripe - """ - stripeProductTierID: String - """ - the status of the subscription in stripe -- see https://docs.stripe.com/api/subscriptions/object#subscription_object-status - """ - stripeSubscriptionStatus: String - """ - indicates if the subscription is active - """ - active: Boolean - """ - the customer ID the subscription is associated to - """ - stripeCustomerID: String - """ - the time the subscription is set to expire; only populated if subscription is cancelled - """ - expiresAt: Time - """ - the features associated with the subscription - """ - features: [String!] - ownerID: ID -} -""" CreateOrganizationInput is used for create Organization object. Input was generated by ent. """ @@ -4640,9 +4598,9 @@ input CreateOrganizationSettingInput { """ billingPhone: String """ - Address to send billing information to + the billing address to send billing information to """ - billingAddress: String + billingAddress: Address """ Usually government-issued tax ID or business ID such as ABN in Australia """ @@ -4651,10 +4609,6 @@ input CreateOrganizationSettingInput { geographical location of the organization """ geoLocation: OrganizationSettingRegion - """ - the ID of the stripe customer associated with the organization - """ - stripeID: String organizationID: ID fileIDs: [ID!] } @@ -13676,56 +13630,6 @@ type Mutation { id: ID! ): OrgMembershipDeletePayload! """ - Create a new orgSubscription - """ - createOrgSubscription( - """ - values of the orgSubscription - """ - input: CreateOrgSubscriptionInput! - ): OrgSubscriptionCreatePayload! - """ - Create multiple new orgSubscriptions - """ - createBulkOrgSubscription( - """ - values of the orgSubscription - """ - input: [CreateOrgSubscriptionInput!] - ): OrgSubscriptionBulkCreatePayload! - """ - Create multiple new orgSubscriptions via file upload - """ - createBulkCSVOrgSubscription( - """ - csv file containing values of the orgSubscription - """ - input: Upload! - ): OrgSubscriptionBulkCreatePayload! - """ - Update an existing orgSubscription - """ - updateOrgSubscription( - """ - ID of the orgSubscription - """ - id: ID! - - """ - New values for the orgSubscription - """ - input: UpdateOrgSubscriptionInput! - ): OrgSubscriptionUpdatePayload! - """ - Delete an existing orgSubscription - """ - deleteOrgSubscription( - """ - ID of the orgSubscription - """ - id: ID! - ): OrgSubscriptionDeletePayload! - """ Create a new personalAccessToken """ createPersonalAccessToken( @@ -15997,15 +15901,7 @@ type OrgSubscription implements Node { """ features: [String!] owner: Organization -} -""" -Return response for createBulkOrgSubscription mutation -""" -type OrgSubscriptionBulkCreatePayload { - """ - Created orgSubscriptions - """ - orgSubscriptions: [OrgSubscription!] + subscriptionURL: String } """ A connection to a list of items. @@ -16025,24 +15921,6 @@ type OrgSubscriptionConnection { totalCount: Int! } """ -Return response for createOrgSubscription mutation -""" -type OrgSubscriptionCreatePayload { - """ - Created orgSubscription - """ - orgSubscription: OrgSubscription! -} -""" -Return response for deleteOrgSubscription mutation -""" -type OrgSubscriptionDeletePayload { - """ - Deleted orgSubscription ID - """ - deletedID: ID! -} -""" An edge in a connection. """ type OrgSubscriptionEdge { @@ -16426,15 +16304,6 @@ type OrgSubscriptionSearchResult { orgSubscriptions: [OrgSubscription!] } """ -Return response for updateOrgSubscription mutation -""" -type OrgSubscriptionUpdatePayload { - """ - Updated orgSubscription - """ - orgSubscription: OrgSubscription! -} -""" OrgSubscriptionWhereInput is used for filtering OrgSubscription objects. Input was generated by ent. """ @@ -17230,9 +17099,9 @@ type OrganizationSetting implements Node { """ billingPhone: String """ - Address to send billing information to + the billing address to send billing information to """ - billingAddress: String + billingAddress: Address """ Usually government-issued tax ID or business ID such as ABN in Australia """ @@ -17245,10 +17114,6 @@ type OrganizationSetting implements Node { the ID of the organization the settings belong to """ organizationID: ID - """ - the ID of the stripe customer associated with the organization - """ - stripeID: String organization: Organization files: [File!] } @@ -17341,9 +17206,9 @@ type OrganizationSettingHistory implements Node { """ billingPhone: String """ - Address to send billing information to + the billing address to send billing information to """ - billingAddress: String + billingAddress: Address """ Usually government-issued tax ID or business ID such as ABN in Australia """ @@ -17356,10 +17221,6 @@ type OrganizationSettingHistory implements Node { the ID of the organization the settings belong to """ organizationID: String - """ - the ID of the stripe customer associated with the organization - """ - stripeID: String } """ A connection to a list of items. @@ -17612,24 +17473,6 @@ input OrganizationSettingHistoryWhereInput { billingPhoneEqualFold: String billingPhoneContainsFold: String """ - billing_address field predicates - """ - billingAddress: String - billingAddressNEQ: String - billingAddressIn: [String!] - billingAddressNotIn: [String!] - billingAddressGT: String - billingAddressGTE: String - billingAddressLT: String - billingAddressLTE: String - billingAddressContains: String - billingAddressHasPrefix: String - billingAddressHasSuffix: String - billingAddressIsNil: Boolean - billingAddressNotNil: Boolean - billingAddressEqualFold: String - billingAddressContainsFold: String - """ tax_identifier field predicates """ taxIdentifier: String @@ -17674,24 +17517,6 @@ input OrganizationSettingHistoryWhereInput { organizationIDNotNil: Boolean organizationIDEqualFold: String organizationIDContainsFold: String - """ - stripe_id field predicates - """ - stripeID: String - stripeIDNEQ: String - stripeIDIn: [String!] - stripeIDNotIn: [String!] - stripeIDGT: String - stripeIDGTE: String - stripeIDLT: String - stripeIDLTE: String - stripeIDContains: String - stripeIDHasPrefix: String - stripeIDHasSuffix: String - stripeIDIsNil: Boolean - stripeIDNotNil: Boolean - stripeIDEqualFold: String - stripeIDContainsFold: String } """ OrganizationSettingRegion is enum for the field geo_location @@ -17882,24 +17707,6 @@ input OrganizationSettingWhereInput { billingPhoneEqualFold: String billingPhoneContainsFold: String """ - billing_address field predicates - """ - billingAddress: String - billingAddressNEQ: String - billingAddressIn: [String!] - billingAddressNotIn: [String!] - billingAddressGT: String - billingAddressGTE: String - billingAddressLT: String - billingAddressLTE: String - billingAddressContains: String - billingAddressHasPrefix: String - billingAddressHasSuffix: String - billingAddressIsNil: Boolean - billingAddressNotNil: Boolean - billingAddressEqualFold: String - billingAddressContainsFold: String - """ tax_identifier field predicates """ taxIdentifier: String @@ -17945,24 +17752,6 @@ input OrganizationSettingWhereInput { organizationIDEqualFold: ID organizationIDContainsFold: ID """ - stripe_id field predicates - """ - stripeID: String - stripeIDNEQ: String - stripeIDIn: [String!] - stripeIDNotIn: [String!] - stripeIDGT: String - stripeIDGTE: String - stripeIDLT: String - stripeIDLTE: String - stripeIDContains: String - stripeIDHasPrefix: String - stripeIDHasSuffix: String - stripeIDIsNil: Boolean - stripeIDNotNil: Boolean - stripeIDEqualFold: String - stripeIDContainsFold: String - """ organization edge predicates """ hasOrganization: Boolean @@ -29267,60 +29056,6 @@ input UpdateOrgMembershipInput { clearEvents: Boolean } """ -UpdateOrgSubscriptionInput is used for update OrgSubscription object. -Input was generated by ent. -""" -input UpdateOrgSubscriptionInput { - """ - tags associated with the object - """ - tags: [String!] - appendTags: [String!] - clearTags: Boolean - """ - the stripe subscription id - """ - stripeSubscriptionID: String - clearStripeSubscriptionID: Boolean - """ - the common name of the product tier the subscription is associated with, e.g. starter tier - """ - productTier: String - clearProductTier: Boolean - """ - the product id that represents the tier in stripe - """ - stripeProductTierID: String - clearStripeProductTierID: Boolean - """ - the status of the subscription in stripe -- see https://docs.stripe.com/api/subscriptions/object#subscription_object-status - """ - stripeSubscriptionStatus: String - clearStripeSubscriptionStatus: Boolean - """ - indicates if the subscription is active - """ - active: Boolean - """ - the customer ID the subscription is associated to - """ - stripeCustomerID: String - clearStripeCustomerID: Boolean - """ - the time the subscription is set to expire; only populated if subscription is cancelled - """ - expiresAt: Time - clearExpiresAt: Boolean - """ - the features associated with the subscription - """ - features: [String!] - appendFeatures: [String!] - clearFeatures: Boolean - ownerID: ID - clearOwner: Boolean -} -""" UpdateOrganizationInput is used for update Organization object. Input was generated by ent. """ @@ -29492,9 +29227,9 @@ input UpdateOrganizationSettingInput { billingPhone: String clearBillingPhone: Boolean """ - Address to send billing information to + the billing address to send billing information to """ - billingAddress: String + billingAddress: Address clearBillingAddress: Boolean """ Usually government-issued tax ID or business ID such as ABN in Australia @@ -29506,11 +29241,6 @@ input UpdateOrganizationSettingInput { """ geoLocation: OrganizationSettingRegion clearGeoLocation: Boolean - """ - the ID of the stripe customer associated with the organization - """ - stripeID: String - clearStripeID: Boolean organizationID: ID clearOrganization: Boolean addFileIDs: [ID!] diff --git a/internal/graphapi/generate/.gqlgen.yml b/internal/graphapi/generate/.gqlgen.yml index 848f3856..b180f0f0 100644 --- a/internal/graphapi/generate/.gqlgen.yml +++ b/internal/graphapi/generate/.gqlgen.yml @@ -84,3 +84,6 @@ models: Any: model: - github.com/99designs/gqlgen/graphql.Any + Address: + model: + - github.com/theopenlane/core/pkg/models.Address diff --git a/internal/graphapi/generate/.gqlgenc.yml b/internal/graphapi/generate/.gqlgenc.yml index 508a0ac4..5df00755 100644 --- a/internal/graphapi/generate/.gqlgenc.yml +++ b/internal/graphapi/generate/.gqlgenc.yml @@ -14,6 +14,9 @@ models: model: - github.com/theopenlane/entx.RawMessage - github.com/theopenlane/core/internal/ent/customtypes.JSONObject + Address: + model: + - github.com/theopenlane/core/pkg/models.Address schema: ["internal/graphapi/clientschema/schema.graphql"] query: ["internal/graphapi/query/*.graphql"] generate: diff --git a/internal/graphapi/generated/actionplan.generated.go b/internal/graphapi/generated/actionplan.generated.go index 461ccf37..3ad1246e 100644 --- a/internal/graphapi/generated/actionplan.generated.go +++ b/internal/graphapi/generated/actionplan.generated.go @@ -119,11 +119,6 @@ type MutationResolver interface { CreateBulkCSVOrgMembership(ctx context.Context, input graphql.Upload) (*model.OrgMembershipBulkCreatePayload, error) UpdateOrgMembership(ctx context.Context, id string, input generated.UpdateOrgMembershipInput) (*model.OrgMembershipUpdatePayload, error) DeleteOrgMembership(ctx context.Context, id string) (*model.OrgMembershipDeletePayload, error) - CreateOrgSubscription(ctx context.Context, input generated.CreateOrgSubscriptionInput) (*model.OrgSubscriptionCreatePayload, error) - CreateBulkOrgSubscription(ctx context.Context, input []*generated.CreateOrgSubscriptionInput) (*model.OrgSubscriptionBulkCreatePayload, error) - CreateBulkCSVOrgSubscription(ctx context.Context, input graphql.Upload) (*model.OrgSubscriptionBulkCreatePayload, error) - UpdateOrgSubscription(ctx context.Context, id string, input generated.UpdateOrgSubscriptionInput) (*model.OrgSubscriptionUpdatePayload, error) - DeleteOrgSubscription(ctx context.Context, id string) (*model.OrgSubscriptionDeletePayload, error) CreatePersonalAccessToken(ctx context.Context, input generated.CreatePersonalAccessTokenInput) (*model.PersonalAccessTokenCreatePayload, error) CreateBulkPersonalAccessToken(ctx context.Context, input []*generated.CreatePersonalAccessTokenInput) (*model.PersonalAccessTokenBulkCreatePayload, error) CreateBulkCSVPersonalAccessToken(ctx context.Context, input graphql.Upload) (*model.PersonalAccessTokenBulkCreatePayload, error) @@ -808,34 +803,6 @@ func (ec *executionContext) field_Mutation_createBulkCSVOrgMembership_argsInput( return zeroVal, nil } -func (ec *executionContext) field_Mutation_createBulkCSVOrgSubscription_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { - var err error - args := map[string]any{} - arg0, err := ec.field_Mutation_createBulkCSVOrgSubscription_argsInput(ctx, rawArgs) - if err != nil { - return nil, err - } - args["input"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_createBulkCSVOrgSubscription_argsInput( - ctx context.Context, - rawArgs map[string]any, -) (graphql.Upload, error) { - if _, ok := rawArgs["input"]; !ok { - var zeroVal graphql.Upload - return zeroVal, nil - } - - ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - if tmp, ok := rawArgs["input"]; ok { - return ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) - } - - var zeroVal graphql.Upload - return zeroVal, nil -} - func (ec *executionContext) field_Mutation_createBulkCSVOrganizationSetting_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} @@ -1648,34 +1615,6 @@ func (ec *executionContext) field_Mutation_createBulkOrgMembership_argsInput( return zeroVal, nil } -func (ec *executionContext) field_Mutation_createBulkOrgSubscription_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { - var err error - args := map[string]any{} - arg0, err := ec.field_Mutation_createBulkOrgSubscription_argsInput(ctx, rawArgs) - if err != nil { - return nil, err - } - args["input"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_createBulkOrgSubscription_argsInput( - ctx context.Context, - rawArgs map[string]any, -) ([]*generated.CreateOrgSubscriptionInput, error) { - if _, ok := rawArgs["input"]; !ok { - var zeroVal []*generated.CreateOrgSubscriptionInput - return zeroVal, nil - } - - ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - if tmp, ok := rawArgs["input"]; ok { - return ec.unmarshalOCreateOrgSubscriptionInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrgSubscriptionInputᚄ(ctx, tmp) - } - - var zeroVal []*generated.CreateOrgSubscriptionInput - return zeroVal, nil -} - func (ec *executionContext) field_Mutation_createBulkOrganizationSetting_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} @@ -2544,34 +2483,6 @@ func (ec *executionContext) field_Mutation_createOrgMembership_argsInput( return zeroVal, nil } -func (ec *executionContext) field_Mutation_createOrgSubscription_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { - var err error - args := map[string]any{} - arg0, err := ec.field_Mutation_createOrgSubscription_argsInput(ctx, rawArgs) - if err != nil { - return nil, err - } - args["input"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_createOrgSubscription_argsInput( - ctx context.Context, - rawArgs map[string]any, -) (generated.CreateOrgSubscriptionInput, error) { - if _, ok := rawArgs["input"]; !ok { - var zeroVal generated.CreateOrgSubscriptionInput - return zeroVal, nil - } - - ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - if tmp, ok := rawArgs["input"]; ok { - return ec.unmarshalNCreateOrgSubscriptionInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrgSubscriptionInput(ctx, tmp) - } - - var zeroVal generated.CreateOrgSubscriptionInput - return zeroVal, nil -} - func (ec *executionContext) field_Mutation_createOrganizationSetting_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} @@ -3575,34 +3486,6 @@ func (ec *executionContext) field_Mutation_deleteOrgMembership_argsID( return zeroVal, nil } -func (ec *executionContext) field_Mutation_deleteOrgSubscription_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { - var err error - args := map[string]any{} - arg0, err := ec.field_Mutation_deleteOrgSubscription_argsID(ctx, rawArgs) - if err != nil { - return nil, err - } - args["id"] = arg0 - return args, nil -} -func (ec *executionContext) field_Mutation_deleteOrgSubscription_argsID( - ctx context.Context, - rawArgs map[string]any, -) (string, error) { - if _, ok := rawArgs["id"]; !ok { - var zeroVal string - return zeroVal, nil - } - - ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - if tmp, ok := rawArgs["id"]; ok { - return ec.unmarshalNID2string(ctx, tmp) - } - - var zeroVal string - return zeroVal, nil -} - func (ec *executionContext) field_Mutation_deleteOrganizationSetting_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} @@ -4908,57 +4791,6 @@ func (ec *executionContext) field_Mutation_updateOrgMembership_argsInput( return zeroVal, nil } -func (ec *executionContext) field_Mutation_updateOrgSubscription_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { - var err error - args := map[string]any{} - arg0, err := ec.field_Mutation_updateOrgSubscription_argsID(ctx, rawArgs) - if err != nil { - return nil, err - } - args["id"] = arg0 - arg1, err := ec.field_Mutation_updateOrgSubscription_argsInput(ctx, rawArgs) - if err != nil { - return nil, err - } - args["input"] = arg1 - return args, nil -} -func (ec *executionContext) field_Mutation_updateOrgSubscription_argsID( - ctx context.Context, - rawArgs map[string]any, -) (string, error) { - if _, ok := rawArgs["id"]; !ok { - var zeroVal string - return zeroVal, nil - } - - ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - if tmp, ok := rawArgs["id"]; ok { - return ec.unmarshalNID2string(ctx, tmp) - } - - var zeroVal string - return zeroVal, nil -} - -func (ec *executionContext) field_Mutation_updateOrgSubscription_argsInput( - ctx context.Context, - rawArgs map[string]any, -) (generated.UpdateOrgSubscriptionInput, error) { - if _, ok := rawArgs["input"]; !ok { - var zeroVal generated.UpdateOrgSubscriptionInput - return zeroVal, nil - } - - ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - if tmp, ok := rawArgs["input"]; ok { - return ec.unmarshalNUpdateOrgSubscriptionInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateOrgSubscriptionInput(ctx, tmp) - } - - var zeroVal generated.UpdateOrgSubscriptionInput - return zeroVal, nil -} - func (ec *executionContext) field_Mutation_updateOrganizationSetting_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} @@ -11990,301 +11822,6 @@ func (ec *executionContext) fieldContext_Mutation_deleteOrgMembership(ctx contex return fc, nil } -func (ec *executionContext) _Mutation_createOrgSubscription(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_createOrgSubscription(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CreateOrgSubscription(rctx, fc.Args["input"].(generated.CreateOrgSubscriptionInput)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.OrgSubscriptionCreatePayload) - fc.Result = res - return ec.marshalNOrgSubscriptionCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚋmodelᚐOrgSubscriptionCreatePayload(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Mutation_createOrgSubscription(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Mutation", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "orgSubscription": - return ec.fieldContext_OrgSubscriptionCreatePayload_orgSubscription(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type OrgSubscriptionCreatePayload", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_createOrgSubscription_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Mutation_createBulkOrgSubscription(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_createBulkOrgSubscription(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CreateBulkOrgSubscription(rctx, fc.Args["input"].([]*generated.CreateOrgSubscriptionInput)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.OrgSubscriptionBulkCreatePayload) - fc.Result = res - return ec.marshalNOrgSubscriptionBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚋmodelᚐOrgSubscriptionBulkCreatePayload(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Mutation_createBulkOrgSubscription(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Mutation", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "orgSubscriptions": - return ec.fieldContext_OrgSubscriptionBulkCreatePayload_orgSubscriptions(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type OrgSubscriptionBulkCreatePayload", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_createBulkOrgSubscription_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Mutation_createBulkCSVOrgSubscription(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_createBulkCSVOrgSubscription(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CreateBulkCSVOrgSubscription(rctx, fc.Args["input"].(graphql.Upload)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.OrgSubscriptionBulkCreatePayload) - fc.Result = res - return ec.marshalNOrgSubscriptionBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚋmodelᚐOrgSubscriptionBulkCreatePayload(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Mutation_createBulkCSVOrgSubscription(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Mutation", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "orgSubscriptions": - return ec.fieldContext_OrgSubscriptionBulkCreatePayload_orgSubscriptions(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type OrgSubscriptionBulkCreatePayload", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_createBulkCSVOrgSubscription_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Mutation_updateOrgSubscription(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_updateOrgSubscription(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().UpdateOrgSubscription(rctx, fc.Args["id"].(string), fc.Args["input"].(generated.UpdateOrgSubscriptionInput)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.OrgSubscriptionUpdatePayload) - fc.Result = res - return ec.marshalNOrgSubscriptionUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚋmodelᚐOrgSubscriptionUpdatePayload(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Mutation_updateOrgSubscription(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Mutation", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "orgSubscription": - return ec.fieldContext_OrgSubscriptionUpdatePayload_orgSubscription(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type OrgSubscriptionUpdatePayload", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_updateOrgSubscription_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Mutation_deleteOrgSubscription(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_deleteOrgSubscription(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().DeleteOrgSubscription(rctx, fc.Args["id"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.OrgSubscriptionDeletePayload) - fc.Result = res - return ec.marshalNOrgSubscriptionDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚋmodelᚐOrgSubscriptionDeletePayload(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Mutation_deleteOrgSubscription(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Mutation", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "deletedID": - return ec.fieldContext_OrgSubscriptionDeletePayload_deletedID(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type OrgSubscriptionDeletePayload", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_deleteOrgSubscription_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - func (ec *executionContext) _Mutation_createPersonalAccessToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Mutation_createPersonalAccessToken(ctx, field) if err != nil { @@ -16834,41 +16371,6 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) if out.Values[i] == graphql.Null { out.Invalids++ } - case "createOrgSubscription": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_createOrgSubscription(ctx, field) - }) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "createBulkOrgSubscription": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_createBulkOrgSubscription(ctx, field) - }) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "createBulkCSVOrgSubscription": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_createBulkCSVOrgSubscription(ctx, field) - }) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "updateOrgSubscription": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_updateOrgSubscription(ctx, field) - }) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "deleteOrgSubscription": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_deleteOrgSubscription(ctx, field) - }) - if out.Values[i] == graphql.Null { - out.Invalids++ - } case "createPersonalAccessToken": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_createPersonalAccessToken(ctx, field) diff --git a/internal/graphapi/generated/ent.generated.go b/internal/graphapi/generated/ent.generated.go index d041819c..f67f60d8 100644 --- a/internal/graphapi/generated/ent.generated.go +++ b/internal/graphapi/generated/ent.generated.go @@ -18,6 +18,7 @@ import ( "github.com/theopenlane/core/internal/ent/generated" "github.com/theopenlane/core/internal/graphapi/model" "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/models" "github.com/theopenlane/entx/history" "github.com/vektah/gqlparser/v2/ast" ) @@ -35514,8 +35515,6 @@ func (ec *executionContext) fieldContext_File_organizationSetting(_ context.Cont return ec.fieldContext_OrganizationSetting_geoLocation(ctx, field) case "organizationID": return ec.fieldContext_OrganizationSetting_organizationID(ctx, field) - case "stripeID": - return ec.fieldContext_OrganizationSetting_stripeID(ctx, field) case "organization": return ec.fieldContext_OrganizationSetting_organization(ctx, field) case "files": @@ -62634,6 +62633,47 @@ func (ec *executionContext) fieldContext_OrgSubscription_owner(_ context.Context return fc, nil } +func (ec *executionContext) _OrgSubscription_subscriptionURL(ctx context.Context, field graphql.CollectedField, obj *generated.OrgSubscription) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OrgSubscription_subscriptionURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SubscriptionURL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OrgSubscription_subscriptionURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OrgSubscription", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _OrgSubscriptionConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.OrgSubscriptionConnection) (ret graphql.Marshaler) { fc, err := ec.fieldContext_OrgSubscriptionConnection_edges(ctx, field) if err != nil { @@ -62851,6 +62891,8 @@ func (ec *executionContext) fieldContext_OrgSubscriptionEdge_node(_ context.Cont return ec.fieldContext_OrgSubscription_features(ctx, field) case "owner": return ec.fieldContext_OrgSubscription_owner(ctx, field) + case "subscriptionURL": + return ec.fieldContext_OrgSubscription_subscriptionURL(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type OrgSubscription", field.Name) }, @@ -66452,8 +66494,6 @@ func (ec *executionContext) fieldContext_Organization_setting(_ context.Context, return ec.fieldContext_OrganizationSetting_geoLocation(ctx, field) case "organizationID": return ec.fieldContext_OrganizationSetting_organizationID(ctx, field) - case "stripeID": - return ec.fieldContext_OrganizationSetting_stripeID(ctx, field) case "organization": return ec.fieldContext_OrganizationSetting_organization(ctx, field) case "files": @@ -66610,6 +66650,8 @@ func (ec *executionContext) fieldContext_Organization_orgSubscriptions(_ context return ec.fieldContext_OrgSubscription_features(ctx, field) case "owner": return ec.fieldContext_OrgSubscription_owner(ctx, field) + case "subscriptionURL": + return ec.fieldContext_OrgSubscription_subscriptionURL(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type OrgSubscription", field.Name) }, @@ -70412,9 +70454,9 @@ func (ec *executionContext) _OrganizationSetting_billingAddress(ctx context.Cont if resTmp == nil { return graphql.Null } - res := resTmp.(string) + res := resTmp.(models.Address) fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + return ec.marshalOAddress2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋmodelsᚐAddress(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_OrganizationSetting_billingAddress(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -70424,7 +70466,7 @@ func (ec *executionContext) fieldContext_OrganizationSetting_billingAddress(_ co IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Address does not have child fields") }, } return fc, nil @@ -70553,47 +70595,6 @@ func (ec *executionContext) fieldContext_OrganizationSetting_organizationID(_ co return fc, nil } -func (ec *executionContext) _OrganizationSetting_stripeID(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSetting) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OrganizationSetting_stripeID(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.StripeID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_OrganizationSetting_stripeID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "OrganizationSetting", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - func (ec *executionContext) _OrganizationSetting_organization(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSetting) (ret graphql.Marshaler) { fc, err := ec.fieldContext_OrganizationSetting_organization(ctx, field) if err != nil { @@ -71063,8 +71064,6 @@ func (ec *executionContext) fieldContext_OrganizationSettingEdge_node(_ context. return ec.fieldContext_OrganizationSetting_geoLocation(ctx, field) case "organizationID": return ec.fieldContext_OrganizationSetting_organizationID(ctx, field) - case "stripeID": - return ec.fieldContext_OrganizationSetting_stripeID(ctx, field) case "organization": return ec.fieldContext_OrganizationSetting_organization(ctx, field) case "files": @@ -71767,9 +71766,9 @@ func (ec *executionContext) _OrganizationSettingHistory_billingAddress(ctx conte if resTmp == nil { return graphql.Null } - res := resTmp.(string) + res := resTmp.(models.Address) fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + return ec.marshalOAddress2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋmodelsᚐAddress(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_OrganizationSettingHistory_billingAddress(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -71779,7 +71778,7 @@ func (ec *executionContext) fieldContext_OrganizationSettingHistory_billingAddre IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Address does not have child fields") }, } return fc, nil @@ -71908,47 +71907,6 @@ func (ec *executionContext) fieldContext_OrganizationSettingHistory_organization return fc, nil } -func (ec *executionContext) _OrganizationSettingHistory_stripeID(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingHistory) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OrganizationSettingHistory_stripeID(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.StripeID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_OrganizationSettingHistory_stripeID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "OrganizationSettingHistory", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - func (ec *executionContext) _OrganizationSettingHistoryConnection_edges(ctx context.Context, field graphql.CollectedField, obj *generated.OrganizationSettingHistoryConnection) (ret graphql.Marshaler) { fc, err := ec.fieldContext_OrganizationSettingHistoryConnection_edges(ctx, field) if err != nil { @@ -72168,8 +72126,6 @@ func (ec *executionContext) fieldContext_OrganizationSettingHistoryEdge_node(_ c return ec.fieldContext_OrganizationSettingHistory_geoLocation(ctx, field) case "organizationID": return ec.fieldContext_OrganizationSettingHistory_organizationID(ctx, field) - case "stripeID": - return ec.fieldContext_OrganizationSettingHistory_stripeID(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type OrganizationSettingHistory", field.Name) }, @@ -90671,8 +90627,6 @@ func (ec *executionContext) fieldContext_Query_organizationSetting(ctx context.C return ec.fieldContext_OrganizationSetting_geoLocation(ctx, field) case "organizationID": return ec.fieldContext_OrganizationSetting_organizationID(ctx, field) - case "stripeID": - return ec.fieldContext_OrganizationSetting_stripeID(ctx, field) case "organization": return ec.fieldContext_OrganizationSetting_organization(ctx, field) case "files": @@ -90853,6 +90807,8 @@ func (ec *executionContext) fieldContext_Query_orgSubscription(ctx context.Conte return ec.fieldContext_OrgSubscription_features(ctx, field) case "owner": return ec.fieldContext_OrgSubscription_owner(ctx, field) + case "subscriptionURL": + return ec.fieldContext_OrgSubscription_subscriptionURL(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type OrgSubscription", field.Name) }, @@ -133799,96 +133755,6 @@ func (ec *executionContext) unmarshalInputCreateOrgMembershipInput(ctx context.C return it, nil } -func (ec *executionContext) unmarshalInputCreateOrgSubscriptionInput(ctx context.Context, obj any) (generated.CreateOrgSubscriptionInput, error) { - var it generated.CreateOrgSubscriptionInput - asMap := map[string]any{} - for k, v := range obj.(map[string]any) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"tags", "stripeSubscriptionID", "productTier", "stripeProductTierID", "stripeSubscriptionStatus", "active", "stripeCustomerID", "expiresAt", "features", "ownerID"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "tags": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) - if err != nil { - return it, err - } - it.Tags = data - case "stripeSubscriptionID": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeSubscriptionID")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeSubscriptionID = data - case "productTier": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("productTier")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.ProductTier = data - case "stripeProductTierID": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeProductTierID")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeProductTierID = data - case "stripeSubscriptionStatus": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeSubscriptionStatus")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeSubscriptionStatus = data - case "active": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("active")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) - if err != nil { - return it, err - } - it.Active = data - case "stripeCustomerID": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeCustomerID")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeCustomerID = data - case "expiresAt": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAt")) - data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) - if err != nil { - return it, err - } - it.ExpiresAt = data - case "features": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("features")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) - if err != nil { - return it, err - } - it.Features = data - case "ownerID": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) - data, err := ec.unmarshalOID2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.OwnerID = data - } - } - - return it, nil -} - func (ec *executionContext) unmarshalInputCreateOrganizationInput(ctx context.Context, obj any) (generated.CreateOrganizationInput, error) { var it generated.CreateOrganizationInput asMap := map[string]any{} @@ -134233,7 +134099,7 @@ func (ec *executionContext) unmarshalInputCreateOrganizationSettingInput(ctx con asMap[k] = v } - fieldsInOrder := [...]string{"tags", "domains", "billingContact", "billingEmail", "billingPhone", "billingAddress", "taxIdentifier", "geoLocation", "stripeID", "organizationID", "fileIDs"} + fieldsInOrder := [...]string{"tags", "domains", "billingContact", "billingEmail", "billingPhone", "billingAddress", "taxIdentifier", "geoLocation", "organizationID", "fileIDs"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -134277,7 +134143,7 @@ func (ec *executionContext) unmarshalInputCreateOrganizationSettingInput(ctx con it.BillingPhone = data case "billingAddress": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddress")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + data, err := ec.unmarshalOAddress2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋmodelsᚐAddress(ctx, v) if err != nil { return it, err } @@ -134296,13 +134162,6 @@ func (ec *executionContext) unmarshalInputCreateOrganizationSettingInput(ctx con return it, err } it.GeoLocation = data - case "stripeID": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeID")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeID = data case "organizationID": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationID")) data, err := ec.unmarshalOID2ᚖstring(ctx, v) @@ -173549,7 +173408,7 @@ func (ec *executionContext) unmarshalInputOrganizationSettingHistoryWhereInput(c asMap[k] = v } - fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "idEqualFold", "idContainsFold", "historyTime", "historyTimeNEQ", "historyTimeIn", "historyTimeNotIn", "historyTimeGT", "historyTimeGTE", "historyTimeLT", "historyTimeLTE", "ref", "refNEQ", "refIn", "refNotIn", "refGT", "refGTE", "refLT", "refLTE", "refContains", "refHasPrefix", "refHasSuffix", "refIsNil", "refNotNil", "refEqualFold", "refContainsFold", "operation", "operationNEQ", "operationIn", "operationNotIn", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "billingContact", "billingContactNEQ", "billingContactIn", "billingContactNotIn", "billingContactGT", "billingContactGTE", "billingContactLT", "billingContactLTE", "billingContactContains", "billingContactHasPrefix", "billingContactHasSuffix", "billingContactIsNil", "billingContactNotNil", "billingContactEqualFold", "billingContactContainsFold", "billingEmail", "billingEmailNEQ", "billingEmailIn", "billingEmailNotIn", "billingEmailGT", "billingEmailGTE", "billingEmailLT", "billingEmailLTE", "billingEmailContains", "billingEmailHasPrefix", "billingEmailHasSuffix", "billingEmailIsNil", "billingEmailNotNil", "billingEmailEqualFold", "billingEmailContainsFold", "billingPhone", "billingPhoneNEQ", "billingPhoneIn", "billingPhoneNotIn", "billingPhoneGT", "billingPhoneGTE", "billingPhoneLT", "billingPhoneLTE", "billingPhoneContains", "billingPhoneHasPrefix", "billingPhoneHasSuffix", "billingPhoneIsNil", "billingPhoneNotNil", "billingPhoneEqualFold", "billingPhoneContainsFold", "billingAddress", "billingAddressNEQ", "billingAddressIn", "billingAddressNotIn", "billingAddressGT", "billingAddressGTE", "billingAddressLT", "billingAddressLTE", "billingAddressContains", "billingAddressHasPrefix", "billingAddressHasSuffix", "billingAddressIsNil", "billingAddressNotNil", "billingAddressEqualFold", "billingAddressContainsFold", "taxIdentifier", "taxIdentifierNEQ", "taxIdentifierIn", "taxIdentifierNotIn", "taxIdentifierGT", "taxIdentifierGTE", "taxIdentifierLT", "taxIdentifierLTE", "taxIdentifierContains", "taxIdentifierHasPrefix", "taxIdentifierHasSuffix", "taxIdentifierIsNil", "taxIdentifierNotNil", "taxIdentifierEqualFold", "taxIdentifierContainsFold", "geoLocation", "geoLocationNEQ", "geoLocationIn", "geoLocationNotIn", "geoLocationIsNil", "geoLocationNotNil", "organizationID", "organizationIDNEQ", "organizationIDIn", "organizationIDNotIn", "organizationIDGT", "organizationIDGTE", "organizationIDLT", "organizationIDLTE", "organizationIDContains", "organizationIDHasPrefix", "organizationIDHasSuffix", "organizationIDIsNil", "organizationIDNotNil", "organizationIDEqualFold", "organizationIDContainsFold", "stripeID", "stripeIDNEQ", "stripeIDIn", "stripeIDNotIn", "stripeIDGT", "stripeIDGTE", "stripeIDLT", "stripeIDLTE", "stripeIDContains", "stripeIDHasPrefix", "stripeIDHasSuffix", "stripeIDIsNil", "stripeIDNotNil", "stripeIDEqualFold", "stripeIDContainsFold"} + fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "idEqualFold", "idContainsFold", "historyTime", "historyTimeNEQ", "historyTimeIn", "historyTimeNotIn", "historyTimeGT", "historyTimeGTE", "historyTimeLT", "historyTimeLTE", "ref", "refNEQ", "refIn", "refNotIn", "refGT", "refGTE", "refLT", "refLTE", "refContains", "refHasPrefix", "refHasSuffix", "refIsNil", "refNotNil", "refEqualFold", "refContainsFold", "operation", "operationNEQ", "operationIn", "operationNotIn", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "billingContact", "billingContactNEQ", "billingContactIn", "billingContactNotIn", "billingContactGT", "billingContactGTE", "billingContactLT", "billingContactLTE", "billingContactContains", "billingContactHasPrefix", "billingContactHasSuffix", "billingContactIsNil", "billingContactNotNil", "billingContactEqualFold", "billingContactContainsFold", "billingEmail", "billingEmailNEQ", "billingEmailIn", "billingEmailNotIn", "billingEmailGT", "billingEmailGTE", "billingEmailLT", "billingEmailLTE", "billingEmailContains", "billingEmailHasPrefix", "billingEmailHasSuffix", "billingEmailIsNil", "billingEmailNotNil", "billingEmailEqualFold", "billingEmailContainsFold", "billingPhone", "billingPhoneNEQ", "billingPhoneIn", "billingPhoneNotIn", "billingPhoneGT", "billingPhoneGTE", "billingPhoneLT", "billingPhoneLTE", "billingPhoneContains", "billingPhoneHasPrefix", "billingPhoneHasSuffix", "billingPhoneIsNil", "billingPhoneNotNil", "billingPhoneEqualFold", "billingPhoneContainsFold", "taxIdentifier", "taxIdentifierNEQ", "taxIdentifierIn", "taxIdentifierNotIn", "taxIdentifierGT", "taxIdentifierGTE", "taxIdentifierLT", "taxIdentifierLTE", "taxIdentifierContains", "taxIdentifierHasPrefix", "taxIdentifierHasSuffix", "taxIdentifierIsNil", "taxIdentifierNotNil", "taxIdentifierEqualFold", "taxIdentifierContainsFold", "geoLocation", "geoLocationNEQ", "geoLocationIn", "geoLocationNotIn", "geoLocationIsNil", "geoLocationNotNil", "organizationID", "organizationIDNEQ", "organizationIDIn", "organizationIDNotIn", "organizationIDGT", "organizationIDGTE", "organizationIDLT", "organizationIDLTE", "organizationIDContains", "organizationIDHasPrefix", "organizationIDHasSuffix", "organizationIDIsNil", "organizationIDNotNil", "organizationIDEqualFold", "organizationIDContainsFold"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -174676,111 +174535,6 @@ func (ec *executionContext) unmarshalInputOrganizationSettingHistoryWhereInput(c return it, err } it.BillingPhoneContainsFold = data - case "billingAddress": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddress")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.BillingAddress = data - case "billingAddressNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressNEQ")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressNEQ = data - case "billingAddressIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressIn")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressIn = data - case "billingAddressNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressNotIn")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressNotIn = data - case "billingAddressGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressGT")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressGT = data - case "billingAddressGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressGTE")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressGTE = data - case "billingAddressLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressLT")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressLT = data - case "billingAddressLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressLTE")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressLTE = data - case "billingAddressContains": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressContains")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressContains = data - case "billingAddressHasPrefix": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressHasPrefix")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressHasPrefix = data - case "billingAddressHasSuffix": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressHasSuffix")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressHasSuffix = data - case "billingAddressIsNil": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressIsNil")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressIsNil = data - case "billingAddressNotNil": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressNotNil")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressNotNil = data - case "billingAddressEqualFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressEqualFold")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressEqualFold = data - case "billingAddressContainsFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressContainsFold")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressContainsFold = data case "taxIdentifier": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifier")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) @@ -175033,111 +174787,6 @@ func (ec *executionContext) unmarshalInputOrganizationSettingHistoryWhereInput(c return it, err } it.OrganizationIDContainsFold = data - case "stripeID": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeID")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeID = data - case "stripeIDNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDNEQ")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeIDNEQ = data - case "stripeIDIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDIn")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) - if err != nil { - return it, err - } - it.StripeIDIn = data - case "stripeIDNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDNotIn")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) - if err != nil { - return it, err - } - it.StripeIDNotIn = data - case "stripeIDGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDGT")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeIDGT = data - case "stripeIDGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDGTE")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeIDGTE = data - case "stripeIDLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDLT")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeIDLT = data - case "stripeIDLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDLTE")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeIDLTE = data - case "stripeIDContains": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDContains")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeIDContains = data - case "stripeIDHasPrefix": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDHasPrefix")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeIDHasPrefix = data - case "stripeIDHasSuffix": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDHasSuffix")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeIDHasSuffix = data - case "stripeIDIsNil": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDIsNil")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) - if err != nil { - return it, err - } - it.StripeIDIsNil = data - case "stripeIDNotNil": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDNotNil")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) - if err != nil { - return it, err - } - it.StripeIDNotNil = data - case "stripeIDEqualFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDEqualFold")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeIDEqualFold = data - case "stripeIDContainsFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDContainsFold")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeIDContainsFold = data } } @@ -175151,7 +174800,7 @@ func (ec *executionContext) unmarshalInputOrganizationSettingWhereInput(ctx cont asMap[k] = v } - fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "billingContact", "billingContactNEQ", "billingContactIn", "billingContactNotIn", "billingContactGT", "billingContactGTE", "billingContactLT", "billingContactLTE", "billingContactContains", "billingContactHasPrefix", "billingContactHasSuffix", "billingContactIsNil", "billingContactNotNil", "billingContactEqualFold", "billingContactContainsFold", "billingEmail", "billingEmailNEQ", "billingEmailIn", "billingEmailNotIn", "billingEmailGT", "billingEmailGTE", "billingEmailLT", "billingEmailLTE", "billingEmailContains", "billingEmailHasPrefix", "billingEmailHasSuffix", "billingEmailIsNil", "billingEmailNotNil", "billingEmailEqualFold", "billingEmailContainsFold", "billingPhone", "billingPhoneNEQ", "billingPhoneIn", "billingPhoneNotIn", "billingPhoneGT", "billingPhoneGTE", "billingPhoneLT", "billingPhoneLTE", "billingPhoneContains", "billingPhoneHasPrefix", "billingPhoneHasSuffix", "billingPhoneIsNil", "billingPhoneNotNil", "billingPhoneEqualFold", "billingPhoneContainsFold", "billingAddress", "billingAddressNEQ", "billingAddressIn", "billingAddressNotIn", "billingAddressGT", "billingAddressGTE", "billingAddressLT", "billingAddressLTE", "billingAddressContains", "billingAddressHasPrefix", "billingAddressHasSuffix", "billingAddressIsNil", "billingAddressNotNil", "billingAddressEqualFold", "billingAddressContainsFold", "taxIdentifier", "taxIdentifierNEQ", "taxIdentifierIn", "taxIdentifierNotIn", "taxIdentifierGT", "taxIdentifierGTE", "taxIdentifierLT", "taxIdentifierLTE", "taxIdentifierContains", "taxIdentifierHasPrefix", "taxIdentifierHasSuffix", "taxIdentifierIsNil", "taxIdentifierNotNil", "taxIdentifierEqualFold", "taxIdentifierContainsFold", "geoLocation", "geoLocationNEQ", "geoLocationIn", "geoLocationNotIn", "geoLocationIsNil", "geoLocationNotNil", "organizationID", "organizationIDNEQ", "organizationIDIn", "organizationIDNotIn", "organizationIDGT", "organizationIDGTE", "organizationIDLT", "organizationIDLTE", "organizationIDContains", "organizationIDHasPrefix", "organizationIDHasSuffix", "organizationIDIsNil", "organizationIDNotNil", "organizationIDEqualFold", "organizationIDContainsFold", "stripeID", "stripeIDNEQ", "stripeIDIn", "stripeIDNotIn", "stripeIDGT", "stripeIDGTE", "stripeIDLT", "stripeIDLTE", "stripeIDContains", "stripeIDHasPrefix", "stripeIDHasSuffix", "stripeIDIsNil", "stripeIDNotNil", "stripeIDEqualFold", "stripeIDContainsFold", "hasOrganization", "hasOrganizationWith", "hasFiles", "hasFilesWith"} + fieldsInOrder := [...]string{"not", "and", "or", "id", "idNEQ", "idIn", "idNotIn", "idGT", "idGTE", "idLT", "idLTE", "idEqualFold", "idContainsFold", "createdAt", "createdAtNEQ", "createdAtIn", "createdAtNotIn", "createdAtGT", "createdAtGTE", "createdAtLT", "createdAtLTE", "createdAtIsNil", "createdAtNotNil", "updatedAt", "updatedAtNEQ", "updatedAtIn", "updatedAtNotIn", "updatedAtGT", "updatedAtGTE", "updatedAtLT", "updatedAtLTE", "updatedAtIsNil", "updatedAtNotNil", "createdBy", "createdByNEQ", "createdByIn", "createdByNotIn", "createdByGT", "createdByGTE", "createdByLT", "createdByLTE", "createdByContains", "createdByHasPrefix", "createdByHasSuffix", "createdByIsNil", "createdByNotNil", "createdByEqualFold", "createdByContainsFold", "updatedBy", "updatedByNEQ", "updatedByIn", "updatedByNotIn", "updatedByGT", "updatedByGTE", "updatedByLT", "updatedByLTE", "updatedByContains", "updatedByHasPrefix", "updatedByHasSuffix", "updatedByIsNil", "updatedByNotNil", "updatedByEqualFold", "updatedByContainsFold", "deletedAt", "deletedAtNEQ", "deletedAtIn", "deletedAtNotIn", "deletedAtGT", "deletedAtGTE", "deletedAtLT", "deletedAtLTE", "deletedAtIsNil", "deletedAtNotNil", "deletedBy", "deletedByNEQ", "deletedByIn", "deletedByNotIn", "deletedByGT", "deletedByGTE", "deletedByLT", "deletedByLTE", "deletedByContains", "deletedByHasPrefix", "deletedByHasSuffix", "deletedByIsNil", "deletedByNotNil", "deletedByEqualFold", "deletedByContainsFold", "billingContact", "billingContactNEQ", "billingContactIn", "billingContactNotIn", "billingContactGT", "billingContactGTE", "billingContactLT", "billingContactLTE", "billingContactContains", "billingContactHasPrefix", "billingContactHasSuffix", "billingContactIsNil", "billingContactNotNil", "billingContactEqualFold", "billingContactContainsFold", "billingEmail", "billingEmailNEQ", "billingEmailIn", "billingEmailNotIn", "billingEmailGT", "billingEmailGTE", "billingEmailLT", "billingEmailLTE", "billingEmailContains", "billingEmailHasPrefix", "billingEmailHasSuffix", "billingEmailIsNil", "billingEmailNotNil", "billingEmailEqualFold", "billingEmailContainsFold", "billingPhone", "billingPhoneNEQ", "billingPhoneIn", "billingPhoneNotIn", "billingPhoneGT", "billingPhoneGTE", "billingPhoneLT", "billingPhoneLTE", "billingPhoneContains", "billingPhoneHasPrefix", "billingPhoneHasSuffix", "billingPhoneIsNil", "billingPhoneNotNil", "billingPhoneEqualFold", "billingPhoneContainsFold", "taxIdentifier", "taxIdentifierNEQ", "taxIdentifierIn", "taxIdentifierNotIn", "taxIdentifierGT", "taxIdentifierGTE", "taxIdentifierLT", "taxIdentifierLTE", "taxIdentifierContains", "taxIdentifierHasPrefix", "taxIdentifierHasSuffix", "taxIdentifierIsNil", "taxIdentifierNotNil", "taxIdentifierEqualFold", "taxIdentifierContainsFold", "geoLocation", "geoLocationNEQ", "geoLocationIn", "geoLocationNotIn", "geoLocationIsNil", "geoLocationNotNil", "organizationID", "organizationIDNEQ", "organizationIDIn", "organizationIDNotIn", "organizationIDGT", "organizationIDGTE", "organizationIDLT", "organizationIDLTE", "organizationIDContains", "organizationIDHasPrefix", "organizationIDHasSuffix", "organizationIDIsNil", "organizationIDNotNil", "organizationIDEqualFold", "organizationIDContainsFold", "hasOrganization", "hasOrganizationWith", "hasFiles", "hasFilesWith"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -176089,111 +175738,6 @@ func (ec *executionContext) unmarshalInputOrganizationSettingWhereInput(ctx cont return it, err } it.BillingPhoneContainsFold = data - case "billingAddress": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddress")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.BillingAddress = data - case "billingAddressNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressNEQ")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressNEQ = data - case "billingAddressIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressIn")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressIn = data - case "billingAddressNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressNotIn")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressNotIn = data - case "billingAddressGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressGT")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressGT = data - case "billingAddressGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressGTE")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressGTE = data - case "billingAddressLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressLT")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressLT = data - case "billingAddressLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressLTE")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressLTE = data - case "billingAddressContains": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressContains")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressContains = data - case "billingAddressHasPrefix": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressHasPrefix")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressHasPrefix = data - case "billingAddressHasSuffix": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressHasSuffix")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressHasSuffix = data - case "billingAddressIsNil": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressIsNil")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressIsNil = data - case "billingAddressNotNil": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressNotNil")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressNotNil = data - case "billingAddressEqualFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressEqualFold")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressEqualFold = data - case "billingAddressContainsFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddressContainsFold")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.BillingAddressContainsFold = data case "taxIdentifier": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("taxIdentifier")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) @@ -176446,111 +175990,6 @@ func (ec *executionContext) unmarshalInputOrganizationSettingWhereInput(ctx cont return it, err } it.OrganizationIDContainsFold = data - case "stripeID": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeID")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeID = data - case "stripeIDNEQ": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDNEQ")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeIDNEQ = data - case "stripeIDIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDIn")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) - if err != nil { - return it, err - } - it.StripeIDIn = data - case "stripeIDNotIn": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDNotIn")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) - if err != nil { - return it, err - } - it.StripeIDNotIn = data - case "stripeIDGT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDGT")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeIDGT = data - case "stripeIDGTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDGTE")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeIDGTE = data - case "stripeIDLT": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDLT")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeIDLT = data - case "stripeIDLTE": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDLTE")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeIDLTE = data - case "stripeIDContains": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDContains")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeIDContains = data - case "stripeIDHasPrefix": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDHasPrefix")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeIDHasPrefix = data - case "stripeIDHasSuffix": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDHasSuffix")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeIDHasSuffix = data - case "stripeIDIsNil": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDIsNil")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) - if err != nil { - return it, err - } - it.StripeIDIsNil = data - case "stripeIDNotNil": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDNotNil")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) - if err != nil { - return it, err - } - it.StripeIDNotNil = data - case "stripeIDEqualFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDEqualFold")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeIDEqualFold = data - case "stripeIDContainsFold": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeIDContainsFold")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeIDContainsFold = data case "hasOrganization": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hasOrganization")) data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) @@ -209394,173 +208833,6 @@ func (ec *executionContext) unmarshalInputUpdateOrgMembershipInput(ctx context.C return it, nil } -func (ec *executionContext) unmarshalInputUpdateOrgSubscriptionInput(ctx context.Context, obj any) (generated.UpdateOrgSubscriptionInput, error) { - var it generated.UpdateOrgSubscriptionInput - asMap := map[string]any{} - for k, v := range obj.(map[string]any) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "stripeSubscriptionID", "clearStripeSubscriptionID", "productTier", "clearProductTier", "stripeProductTierID", "clearStripeProductTierID", "stripeSubscriptionStatus", "clearStripeSubscriptionStatus", "active", "stripeCustomerID", "clearStripeCustomerID", "expiresAt", "clearExpiresAt", "features", "appendFeatures", "clearFeatures", "ownerID", "clearOwner"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "tags": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tags")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) - if err != nil { - return it, err - } - it.Tags = data - case "appendTags": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendTags")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) - if err != nil { - return it, err - } - it.AppendTags = data - case "clearTags": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearTags")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) - if err != nil { - return it, err - } - it.ClearTags = data - case "stripeSubscriptionID": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeSubscriptionID")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeSubscriptionID = data - case "clearStripeSubscriptionID": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearStripeSubscriptionID")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) - if err != nil { - return it, err - } - it.ClearStripeSubscriptionID = data - case "productTier": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("productTier")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.ProductTier = data - case "clearProductTier": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearProductTier")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) - if err != nil { - return it, err - } - it.ClearProductTier = data - case "stripeProductTierID": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeProductTierID")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeProductTierID = data - case "clearStripeProductTierID": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearStripeProductTierID")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) - if err != nil { - return it, err - } - it.ClearStripeProductTierID = data - case "stripeSubscriptionStatus": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeSubscriptionStatus")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeSubscriptionStatus = data - case "clearStripeSubscriptionStatus": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearStripeSubscriptionStatus")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) - if err != nil { - return it, err - } - it.ClearStripeSubscriptionStatus = data - case "active": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("active")) - data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) - if err != nil { - return it, err - } - it.Active = data - case "stripeCustomerID": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeCustomerID")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeCustomerID = data - case "clearStripeCustomerID": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearStripeCustomerID")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) - if err != nil { - return it, err - } - it.ClearStripeCustomerID = data - case "expiresAt": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("expiresAt")) - data, err := ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) - if err != nil { - return it, err - } - it.ExpiresAt = data - case "clearExpiresAt": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearExpiresAt")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) - if err != nil { - return it, err - } - it.ClearExpiresAt = data - case "features": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("features")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) - if err != nil { - return it, err - } - it.Features = data - case "appendFeatures": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appendFeatures")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) - if err != nil { - return it, err - } - it.AppendFeatures = data - case "clearFeatures": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearFeatures")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) - if err != nil { - return it, err - } - it.ClearFeatures = data - case "ownerID": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ownerID")) - data, err := ec.unmarshalOID2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.OwnerID = data - case "clearOwner": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearOwner")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) - if err != nil { - return it, err - } - it.ClearOwner = data - } - } - - return it, nil -} - func (ec *executionContext) unmarshalInputUpdateOrganizationInput(ctx context.Context, obj any) (generated.UpdateOrganizationInput, error) { var it generated.UpdateOrganizationInput asMap := map[string]any{} @@ -210418,7 +209690,7 @@ func (ec *executionContext) unmarshalInputUpdateOrganizationSettingInput(ctx con asMap[k] = v } - fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "domains", "appendDomains", "clearDomains", "billingContact", "clearBillingContact", "billingEmail", "clearBillingEmail", "billingPhone", "clearBillingPhone", "billingAddress", "clearBillingAddress", "taxIdentifier", "clearTaxIdentifier", "geoLocation", "clearGeoLocation", "stripeID", "clearStripeID", "organizationID", "clearOrganization", "addFileIDs", "removeFileIDs", "clearFiles"} + fieldsInOrder := [...]string{"tags", "appendTags", "clearTags", "domains", "appendDomains", "clearDomains", "billingContact", "clearBillingContact", "billingEmail", "clearBillingEmail", "billingPhone", "clearBillingPhone", "billingAddress", "clearBillingAddress", "taxIdentifier", "clearTaxIdentifier", "geoLocation", "clearGeoLocation", "organizationID", "clearOrganization", "addFileIDs", "removeFileIDs", "clearFiles"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -210511,7 +209783,7 @@ func (ec *executionContext) unmarshalInputUpdateOrganizationSettingInput(ctx con it.ClearBillingPhone = data case "billingAddress": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("billingAddress")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + data, err := ec.unmarshalOAddress2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋmodelsᚐAddress(ctx, v) if err != nil { return it, err } @@ -210551,20 +209823,6 @@ func (ec *executionContext) unmarshalInputUpdateOrganizationSettingInput(ctx con return it, err } it.ClearGeoLocation = data - case "stripeID": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stripeID")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.StripeID = data - case "clearStripeID": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clearStripeID")) - data, err := ec.unmarshalOBoolean2bool(ctx, v) - if err != nil { - return it, err - } - it.ClearStripeID = data case "organizationID": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("organizationID")) data, err := ec.unmarshalOID2ᚖstring(ctx, v) @@ -231196,6 +230454,8 @@ func (ec *executionContext) _OrgSubscription(ctx context.Context, sel ast.Select } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "subscriptionURL": + out.Values[i] = ec._OrgSubscription_subscriptionURL(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -233149,8 +232409,6 @@ func (ec *executionContext) _OrganizationSetting(ctx context.Context, sel ast.Se out.Values[i] = ec._OrganizationSetting_geoLocation(ctx, field, obj) case "organizationID": out.Values[i] = ec._OrganizationSetting_organizationID(ctx, field, obj) - case "stripeID": - out.Values[i] = ec._OrganizationSetting_stripeID(ctx, field, obj) case "organization": field := field @@ -233385,8 +232643,6 @@ func (ec *executionContext) _OrganizationSettingHistory(ctx context.Context, sel out.Values[i] = ec._OrganizationSettingHistory_geoLocation(ctx, field, obj) case "organizationID": out.Values[i] = ec._OrganizationSettingHistory_organizationID(ctx, field, obj) - case "stripeID": - out.Values[i] = ec._OrganizationSettingHistory_stripeID(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -244378,16 +243634,6 @@ func (ec *executionContext) unmarshalNCreateOrgMembershipInput2ᚖgithubᚗcom return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalNCreateOrgSubscriptionInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrgSubscriptionInput(ctx context.Context, v any) (generated.CreateOrgSubscriptionInput, error) { - res, err := ec.unmarshalInputCreateOrgSubscriptionInput(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) unmarshalNCreateOrgSubscriptionInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrgSubscriptionInput(ctx context.Context, v any) (*generated.CreateOrgSubscriptionInput, error) { - res, err := ec.unmarshalInputCreateOrgSubscriptionInput(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - func (ec *executionContext) unmarshalNCreateOrganizationInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrganizationInput(ctx context.Context, v any) (generated.CreateOrganizationInput, error) { res, err := ec.unmarshalInputCreateOrganizationInput(ctx, v) return res, graphql.ErrorOnPath(ctx, err) @@ -246863,11 +246109,6 @@ func (ec *executionContext) unmarshalNUpdateOrgMembershipInput2githubᚗcomᚋth return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalNUpdateOrgSubscriptionInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateOrgSubscriptionInput(ctx context.Context, v any) (generated.UpdateOrgSubscriptionInput, error) { - res, err := ec.unmarshalInputUpdateOrgSubscriptionInput(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) -} - func (ec *executionContext) unmarshalNUpdateOrganizationInput2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐUpdateOrganizationInput(ctx context.Context, v any) (generated.UpdateOrganizationInput, error) { res, err := ec.unmarshalInputUpdateOrganizationInput(ctx, v) return res, graphql.ErrorOnPath(ctx, err) @@ -249023,26 +248264,6 @@ func (ec *executionContext) unmarshalOCreateOrgMembershipInput2ᚕᚖgithubᚗco return res, nil } -func (ec *executionContext) unmarshalOCreateOrgSubscriptionInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrgSubscriptionInputᚄ(ctx context.Context, v any) ([]*generated.CreateOrgSubscriptionInput, error) { - if v == nil { - return nil, nil - } - var vSlice []any - if v != nil { - vSlice = graphql.CoerceList(v) - } - var err error - res := make([]*generated.CreateOrgSubscriptionInput, len(vSlice)) - for i := range vSlice { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNCreateOrgSubscriptionInput2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrgSubscriptionInput(ctx, vSlice[i]) - if err != nil { - return nil, err - } - } - return res, nil -} - func (ec *executionContext) unmarshalOCreateOrganizationInput2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐCreateOrganizationInputᚄ(ctx context.Context, v any) ([]*generated.CreateOrganizationInput, error) { if v == nil { return nil, nil diff --git a/internal/graphapi/generated/organizationsetting.generated.go b/internal/graphapi/generated/organizationsetting.generated.go index d5c9b721..81a18373 100644 --- a/internal/graphapi/generated/organizationsetting.generated.go +++ b/internal/graphapi/generated/organizationsetting.generated.go @@ -97,8 +97,6 @@ func (ec *executionContext) fieldContext_OrganizationSettingBulkCreatePayload_or return ec.fieldContext_OrganizationSetting_geoLocation(ctx, field) case "organizationID": return ec.fieldContext_OrganizationSetting_organizationID(ctx, field) - case "stripeID": - return ec.fieldContext_OrganizationSetting_stripeID(ctx, field) case "organization": return ec.fieldContext_OrganizationSetting_organization(ctx, field) case "files": @@ -181,8 +179,6 @@ func (ec *executionContext) fieldContext_OrganizationSettingCreatePayload_organi return ec.fieldContext_OrganizationSetting_geoLocation(ctx, field) case "organizationID": return ec.fieldContext_OrganizationSetting_organizationID(ctx, field) - case "stripeID": - return ec.fieldContext_OrganizationSetting_stripeID(ctx, field) case "organization": return ec.fieldContext_OrganizationSetting_organization(ctx, field) case "files": @@ -309,8 +305,6 @@ func (ec *executionContext) fieldContext_OrganizationSettingUpdatePayload_organi return ec.fieldContext_OrganizationSetting_geoLocation(ctx, field) case "organizationID": return ec.fieldContext_OrganizationSetting_organizationID(ctx, field) - case "stripeID": - return ec.fieldContext_OrganizationSetting_stripeID(ctx, field) case "organization": return ec.fieldContext_OrganizationSetting_organization(ctx, field) case "files": diff --git a/internal/graphapi/generated/orgsubscription.generated.go b/internal/graphapi/generated/orgsubscription.generated.go deleted file mode 100644 index d072b715..00000000 --- a/internal/graphapi/generated/orgsubscription.generated.go +++ /dev/null @@ -1,544 +0,0 @@ -// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. - -package gqlgenerated - -import ( - "context" - "errors" - "fmt" - "strconv" - "sync/atomic" - - "github.com/99designs/gqlgen/graphql" - "github.com/theopenlane/core/internal/ent/generated" - "github.com/theopenlane/core/internal/graphapi/model" - "github.com/vektah/gqlparser/v2/ast" -) - -// region ************************** generated!.gotpl ************************** - -// endregion ************************** generated!.gotpl ************************** - -// region ***************************** args.gotpl ***************************** - -// endregion ***************************** args.gotpl ***************************** - -// region ************************** directives.gotpl ************************** - -// endregion ************************** directives.gotpl ************************** - -// region **************************** field.gotpl ***************************** - -func (ec *executionContext) _OrgSubscriptionBulkCreatePayload_orgSubscriptions(ctx context.Context, field graphql.CollectedField, obj *model.OrgSubscriptionBulkCreatePayload) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OrgSubscriptionBulkCreatePayload_orgSubscriptions(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.OrgSubscriptions, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*generated.OrgSubscription) - fc.Result = res - return ec.marshalOOrgSubscription2ᚕᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgSubscriptionᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_OrgSubscriptionBulkCreatePayload_orgSubscriptions(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "OrgSubscriptionBulkCreatePayload", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_OrgSubscription_id(ctx, field) - case "createdAt": - return ec.fieldContext_OrgSubscription_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_OrgSubscription_updatedAt(ctx, field) - case "createdBy": - return ec.fieldContext_OrgSubscription_createdBy(ctx, field) - case "updatedBy": - return ec.fieldContext_OrgSubscription_updatedBy(ctx, field) - case "tags": - return ec.fieldContext_OrgSubscription_tags(ctx, field) - case "deletedAt": - return ec.fieldContext_OrgSubscription_deletedAt(ctx, field) - case "deletedBy": - return ec.fieldContext_OrgSubscription_deletedBy(ctx, field) - case "ownerID": - return ec.fieldContext_OrgSubscription_ownerID(ctx, field) - case "stripeSubscriptionID": - return ec.fieldContext_OrgSubscription_stripeSubscriptionID(ctx, field) - case "productTier": - return ec.fieldContext_OrgSubscription_productTier(ctx, field) - case "stripeProductTierID": - return ec.fieldContext_OrgSubscription_stripeProductTierID(ctx, field) - case "stripeSubscriptionStatus": - return ec.fieldContext_OrgSubscription_stripeSubscriptionStatus(ctx, field) - case "active": - return ec.fieldContext_OrgSubscription_active(ctx, field) - case "stripeCustomerID": - return ec.fieldContext_OrgSubscription_stripeCustomerID(ctx, field) - case "expiresAt": - return ec.fieldContext_OrgSubscription_expiresAt(ctx, field) - case "features": - return ec.fieldContext_OrgSubscription_features(ctx, field) - case "owner": - return ec.fieldContext_OrgSubscription_owner(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type OrgSubscription", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _OrgSubscriptionCreatePayload_orgSubscription(ctx context.Context, field graphql.CollectedField, obj *model.OrgSubscriptionCreatePayload) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OrgSubscriptionCreatePayload_orgSubscription(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.OrgSubscription, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*generated.OrgSubscription) - fc.Result = res - return ec.marshalNOrgSubscription2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgSubscription(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_OrgSubscriptionCreatePayload_orgSubscription(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "OrgSubscriptionCreatePayload", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_OrgSubscription_id(ctx, field) - case "createdAt": - return ec.fieldContext_OrgSubscription_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_OrgSubscription_updatedAt(ctx, field) - case "createdBy": - return ec.fieldContext_OrgSubscription_createdBy(ctx, field) - case "updatedBy": - return ec.fieldContext_OrgSubscription_updatedBy(ctx, field) - case "tags": - return ec.fieldContext_OrgSubscription_tags(ctx, field) - case "deletedAt": - return ec.fieldContext_OrgSubscription_deletedAt(ctx, field) - case "deletedBy": - return ec.fieldContext_OrgSubscription_deletedBy(ctx, field) - case "ownerID": - return ec.fieldContext_OrgSubscription_ownerID(ctx, field) - case "stripeSubscriptionID": - return ec.fieldContext_OrgSubscription_stripeSubscriptionID(ctx, field) - case "productTier": - return ec.fieldContext_OrgSubscription_productTier(ctx, field) - case "stripeProductTierID": - return ec.fieldContext_OrgSubscription_stripeProductTierID(ctx, field) - case "stripeSubscriptionStatus": - return ec.fieldContext_OrgSubscription_stripeSubscriptionStatus(ctx, field) - case "active": - return ec.fieldContext_OrgSubscription_active(ctx, field) - case "stripeCustomerID": - return ec.fieldContext_OrgSubscription_stripeCustomerID(ctx, field) - case "expiresAt": - return ec.fieldContext_OrgSubscription_expiresAt(ctx, field) - case "features": - return ec.fieldContext_OrgSubscription_features(ctx, field) - case "owner": - return ec.fieldContext_OrgSubscription_owner(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type OrgSubscription", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _OrgSubscriptionDeletePayload_deletedID(ctx context.Context, field graphql.CollectedField, obj *model.OrgSubscriptionDeletePayload) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OrgSubscriptionDeletePayload_deletedID(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.DeletedID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_OrgSubscriptionDeletePayload_deletedID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "OrgSubscriptionDeletePayload", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _OrgSubscriptionUpdatePayload_orgSubscription(ctx context.Context, field graphql.CollectedField, obj *model.OrgSubscriptionUpdatePayload) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OrgSubscriptionUpdatePayload_orgSubscription(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { - ctx = rctx // use context from middleware stack in children - return obj.OrgSubscription, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*generated.OrgSubscription) - fc.Result = res - return ec.marshalNOrgSubscription2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋentᚋgeneratedᚐOrgSubscription(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_OrgSubscriptionUpdatePayload_orgSubscription(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "OrgSubscriptionUpdatePayload", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_OrgSubscription_id(ctx, field) - case "createdAt": - return ec.fieldContext_OrgSubscription_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_OrgSubscription_updatedAt(ctx, field) - case "createdBy": - return ec.fieldContext_OrgSubscription_createdBy(ctx, field) - case "updatedBy": - return ec.fieldContext_OrgSubscription_updatedBy(ctx, field) - case "tags": - return ec.fieldContext_OrgSubscription_tags(ctx, field) - case "deletedAt": - return ec.fieldContext_OrgSubscription_deletedAt(ctx, field) - case "deletedBy": - return ec.fieldContext_OrgSubscription_deletedBy(ctx, field) - case "ownerID": - return ec.fieldContext_OrgSubscription_ownerID(ctx, field) - case "stripeSubscriptionID": - return ec.fieldContext_OrgSubscription_stripeSubscriptionID(ctx, field) - case "productTier": - return ec.fieldContext_OrgSubscription_productTier(ctx, field) - case "stripeProductTierID": - return ec.fieldContext_OrgSubscription_stripeProductTierID(ctx, field) - case "stripeSubscriptionStatus": - return ec.fieldContext_OrgSubscription_stripeSubscriptionStatus(ctx, field) - case "active": - return ec.fieldContext_OrgSubscription_active(ctx, field) - case "stripeCustomerID": - return ec.fieldContext_OrgSubscription_stripeCustomerID(ctx, field) - case "expiresAt": - return ec.fieldContext_OrgSubscription_expiresAt(ctx, field) - case "features": - return ec.fieldContext_OrgSubscription_features(ctx, field) - case "owner": - return ec.fieldContext_OrgSubscription_owner(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type OrgSubscription", field.Name) - }, - } - return fc, nil -} - -// endregion **************************** field.gotpl ***************************** - -// region **************************** input.gotpl ***************************** - -// endregion **************************** input.gotpl ***************************** - -// region ************************** interface.gotpl *************************** - -// endregion ************************** interface.gotpl *************************** - -// region **************************** object.gotpl **************************** - -var orgSubscriptionBulkCreatePayloadImplementors = []string{"OrgSubscriptionBulkCreatePayload"} - -func (ec *executionContext) _OrgSubscriptionBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *model.OrgSubscriptionBulkCreatePayload) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, orgSubscriptionBulkCreatePayloadImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("OrgSubscriptionBulkCreatePayload") - case "orgSubscriptions": - out.Values[i] = ec._OrgSubscriptionBulkCreatePayload_orgSubscriptions(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - -var orgSubscriptionCreatePayloadImplementors = []string{"OrgSubscriptionCreatePayload"} - -func (ec *executionContext) _OrgSubscriptionCreatePayload(ctx context.Context, sel ast.SelectionSet, obj *model.OrgSubscriptionCreatePayload) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, orgSubscriptionCreatePayloadImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("OrgSubscriptionCreatePayload") - case "orgSubscription": - out.Values[i] = ec._OrgSubscriptionCreatePayload_orgSubscription(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - -var orgSubscriptionDeletePayloadImplementors = []string{"OrgSubscriptionDeletePayload"} - -func (ec *executionContext) _OrgSubscriptionDeletePayload(ctx context.Context, sel ast.SelectionSet, obj *model.OrgSubscriptionDeletePayload) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, orgSubscriptionDeletePayloadImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("OrgSubscriptionDeletePayload") - case "deletedID": - out.Values[i] = ec._OrgSubscriptionDeletePayload_deletedID(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - -var orgSubscriptionUpdatePayloadImplementors = []string{"OrgSubscriptionUpdatePayload"} - -func (ec *executionContext) _OrgSubscriptionUpdatePayload(ctx context.Context, sel ast.SelectionSet, obj *model.OrgSubscriptionUpdatePayload) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, orgSubscriptionUpdatePayloadImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("OrgSubscriptionUpdatePayload") - case "orgSubscription": - out.Values[i] = ec._OrgSubscriptionUpdatePayload_orgSubscription(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - -// endregion **************************** object.gotpl **************************** - -// region ***************************** type.gotpl ***************************** - -func (ec *executionContext) marshalNOrgSubscriptionBulkCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚋmodelᚐOrgSubscriptionBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v model.OrgSubscriptionBulkCreatePayload) graphql.Marshaler { - return ec._OrgSubscriptionBulkCreatePayload(ctx, sel, &v) -} - -func (ec *executionContext) marshalNOrgSubscriptionBulkCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚋmodelᚐOrgSubscriptionBulkCreatePayload(ctx context.Context, sel ast.SelectionSet, v *model.OrgSubscriptionBulkCreatePayload) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._OrgSubscriptionBulkCreatePayload(ctx, sel, v) -} - -func (ec *executionContext) marshalNOrgSubscriptionCreatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚋmodelᚐOrgSubscriptionCreatePayload(ctx context.Context, sel ast.SelectionSet, v model.OrgSubscriptionCreatePayload) graphql.Marshaler { - return ec._OrgSubscriptionCreatePayload(ctx, sel, &v) -} - -func (ec *executionContext) marshalNOrgSubscriptionCreatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚋmodelᚐOrgSubscriptionCreatePayload(ctx context.Context, sel ast.SelectionSet, v *model.OrgSubscriptionCreatePayload) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._OrgSubscriptionCreatePayload(ctx, sel, v) -} - -func (ec *executionContext) marshalNOrgSubscriptionDeletePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚋmodelᚐOrgSubscriptionDeletePayload(ctx context.Context, sel ast.SelectionSet, v model.OrgSubscriptionDeletePayload) graphql.Marshaler { - return ec._OrgSubscriptionDeletePayload(ctx, sel, &v) -} - -func (ec *executionContext) marshalNOrgSubscriptionDeletePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚋmodelᚐOrgSubscriptionDeletePayload(ctx context.Context, sel ast.SelectionSet, v *model.OrgSubscriptionDeletePayload) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._OrgSubscriptionDeletePayload(ctx, sel, v) -} - -func (ec *executionContext) marshalNOrgSubscriptionUpdatePayload2githubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚋmodelᚐOrgSubscriptionUpdatePayload(ctx context.Context, sel ast.SelectionSet, v model.OrgSubscriptionUpdatePayload) graphql.Marshaler { - return ec._OrgSubscriptionUpdatePayload(ctx, sel, &v) -} - -func (ec *executionContext) marshalNOrgSubscriptionUpdatePayload2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋinternalᚋgraphapiᚋmodelᚐOrgSubscriptionUpdatePayload(ctx context.Context, sel ast.SelectionSet, v *model.OrgSubscriptionUpdatePayload) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._OrgSubscriptionUpdatePayload(ctx, sel, v) -} - -// endregion ***************************** type.gotpl ***************************** diff --git a/internal/graphapi/generated/root_.generated.go b/internal/graphapi/generated/root_.generated.go index 7fd9c6db..2aa68692 100644 --- a/internal/graphapi/generated/root_.generated.go +++ b/internal/graphapi/generated/root_.generated.go @@ -1490,7 +1490,6 @@ type ComplexityRoot struct { CreateBulkCSVInvite func(childComplexity int, input graphql.Upload) int CreateBulkCSVNarrative func(childComplexity int, input graphql.Upload) int CreateBulkCSVOrgMembership func(childComplexity int, input graphql.Upload) int - CreateBulkCSVOrgSubscription func(childComplexity int, input graphql.Upload) int CreateBulkCSVOrganization func(childComplexity int, input graphql.Upload) int CreateBulkCSVOrganizationSetting func(childComplexity int, input graphql.Upload) int CreateBulkCSVPersonalAccessToken func(childComplexity int, input graphql.Upload) int @@ -1520,7 +1519,6 @@ type ComplexityRoot struct { CreateBulkInvite func(childComplexity int, input []*generated.CreateInviteInput) int CreateBulkNarrative func(childComplexity int, input []*generated.CreateNarrativeInput) int CreateBulkOrgMembership func(childComplexity int, input []*generated.CreateOrgMembershipInput) int - CreateBulkOrgSubscription func(childComplexity int, input []*generated.CreateOrgSubscriptionInput) int CreateBulkOrganization func(childComplexity int, input []*generated.CreateOrganizationInput) int CreateBulkOrganizationSetting func(childComplexity int, input []*generated.CreateOrganizationSettingInput) int CreateBulkPersonalAccessToken func(childComplexity int, input []*generated.CreatePersonalAccessTokenInput) int @@ -1552,7 +1550,6 @@ type ComplexityRoot struct { CreateInvite func(childComplexity int, input generated.CreateInviteInput) int CreateNarrative func(childComplexity int, input generated.CreateNarrativeInput) int CreateOrgMembership func(childComplexity int, input generated.CreateOrgMembershipInput) int - CreateOrgSubscription func(childComplexity int, input generated.CreateOrgSubscriptionInput) int CreateOrganization func(childComplexity int, input generated.CreateOrganizationInput) int CreateOrganizationSetting func(childComplexity int, input generated.CreateOrganizationSettingInput) int CreatePersonalAccessToken func(childComplexity int, input generated.CreatePersonalAccessTokenInput) int @@ -1588,7 +1585,6 @@ type ComplexityRoot struct { DeleteInvite func(childComplexity int, id string) int DeleteNarrative func(childComplexity int, id string) int DeleteOrgMembership func(childComplexity int, id string) int - DeleteOrgSubscription func(childComplexity int, id string) int DeleteOrganization func(childComplexity int, id string) int DeleteOrganizationSetting func(childComplexity int, id string) int DeletePersonalAccessToken func(childComplexity int, id string) int @@ -1620,7 +1616,6 @@ type ComplexityRoot struct { UpdateInvite func(childComplexity int, id string, input generated.UpdateInviteInput) int UpdateNarrative func(childComplexity int, id string, input generated.UpdateNarrativeInput) int UpdateOrgMembership func(childComplexity int, id string, input generated.UpdateOrgMembershipInput) int - UpdateOrgSubscription func(childComplexity int, id string, input generated.UpdateOrgSubscriptionInput) int UpdateOrganization func(childComplexity int, id string, input generated.UpdateOrganizationInput) int UpdateOrganizationSetting func(childComplexity int, id string, input generated.UpdateOrganizationSettingInput) int UpdatePersonalAccessToken func(childComplexity int, id string, input generated.UpdatePersonalAccessTokenInput) int @@ -1865,29 +1860,18 @@ type ComplexityRoot struct { StripeProductTierID func(childComplexity int) int StripeSubscriptionID func(childComplexity int) int StripeSubscriptionStatus func(childComplexity int) int + SubscriptionURL func(childComplexity int) int Tags func(childComplexity int) int UpdatedAt func(childComplexity int) int UpdatedBy func(childComplexity int) int } - OrgSubscriptionBulkCreatePayload struct { - OrgSubscriptions func(childComplexity int) int - } - OrgSubscriptionConnection struct { Edges func(childComplexity int) int PageInfo func(childComplexity int) int TotalCount func(childComplexity int) int } - OrgSubscriptionCreatePayload struct { - OrgSubscription func(childComplexity int) int - } - - OrgSubscriptionDeletePayload struct { - DeletedID func(childComplexity int) int - } - OrgSubscriptionEdge struct { Cursor func(childComplexity int) int Node func(childComplexity int) int @@ -1931,10 +1915,6 @@ type ComplexityRoot struct { OrgSubscriptions func(childComplexity int) int } - OrgSubscriptionUpdatePayload struct { - OrgSubscription func(childComplexity int) int - } - Organization struct { APITokens func(childComplexity int) int AvatarRemoteURL func(childComplexity int) int @@ -2064,7 +2044,6 @@ type ComplexityRoot struct { ID func(childComplexity int) int Organization func(childComplexity int) int OrganizationID func(childComplexity int) int - StripeID func(childComplexity int) int Tags func(childComplexity int) int TaxIdentifier func(childComplexity int) int UpdatedAt func(childComplexity int) int @@ -2110,7 +2089,6 @@ type ComplexityRoot struct { Operation func(childComplexity int) int OrganizationID func(childComplexity int) int Ref func(childComplexity int) int - StripeID func(childComplexity int) int Tags func(childComplexity int) int TaxIdentifier func(childComplexity int) int UpdatedAt func(childComplexity int) int @@ -9845,18 +9823,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.CreateBulkCSVOrgMembership(childComplexity, args["input"].(graphql.Upload)), true - case "Mutation.createBulkCSVOrgSubscription": - if e.complexity.Mutation.CreateBulkCSVOrgSubscription == nil { - break - } - - args, err := ec.field_Mutation_createBulkCSVOrgSubscription_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Mutation.CreateBulkCSVOrgSubscription(childComplexity, args["input"].(graphql.Upload)), true - case "Mutation.createBulkCSVOrganization": if e.complexity.Mutation.CreateBulkCSVOrganization == nil { break @@ -10205,18 +10171,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.CreateBulkOrgMembership(childComplexity, args["input"].([]*generated.CreateOrgMembershipInput)), true - case "Mutation.createBulkOrgSubscription": - if e.complexity.Mutation.CreateBulkOrgSubscription == nil { - break - } - - args, err := ec.field_Mutation_createBulkOrgSubscription_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Mutation.CreateBulkOrgSubscription(childComplexity, args["input"].([]*generated.CreateOrgSubscriptionInput)), true - case "Mutation.createBulkOrganization": if e.complexity.Mutation.CreateBulkOrganization == nil { break @@ -10589,18 +10543,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.CreateOrgMembership(childComplexity, args["input"].(generated.CreateOrgMembershipInput)), true - case "Mutation.createOrgSubscription": - if e.complexity.Mutation.CreateOrgSubscription == nil { - break - } - - args, err := ec.field_Mutation_createOrgSubscription_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Mutation.CreateOrgSubscription(childComplexity, args["input"].(generated.CreateOrgSubscriptionInput)), true - case "Mutation.createOrganization": if e.complexity.Mutation.CreateOrganization == nil { break @@ -11021,18 +10963,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.DeleteOrgMembership(childComplexity, args["id"].(string)), true - case "Mutation.deleteOrgSubscription": - if e.complexity.Mutation.DeleteOrgSubscription == nil { - break - } - - args, err := ec.field_Mutation_deleteOrgSubscription_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Mutation.DeleteOrgSubscription(childComplexity, args["id"].(string)), true - case "Mutation.deleteOrganization": if e.complexity.Mutation.DeleteOrganization == nil { break @@ -11405,18 +11335,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.UpdateOrgMembership(childComplexity, args["id"].(string), args["input"].(generated.UpdateOrgMembershipInput)), true - case "Mutation.updateOrgSubscription": - if e.complexity.Mutation.UpdateOrgSubscription == nil { - break - } - - args, err := ec.field_Mutation_updateOrgSubscription_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Mutation.UpdateOrgSubscription(childComplexity, args["id"].(string), args["input"].(generated.UpdateOrgSubscriptionInput)), true - case "Mutation.updateOrganization": if e.complexity.Mutation.UpdateOrganization == nil { break @@ -12612,6 +12530,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.OrgSubscription.StripeSubscriptionStatus(childComplexity), true + case "OrgSubscription.subscriptionURL": + if e.complexity.OrgSubscription.SubscriptionURL == nil { + break + } + + return e.complexity.OrgSubscription.SubscriptionURL(childComplexity), true + case "OrgSubscription.tags": if e.complexity.OrgSubscription.Tags == nil { break @@ -12633,13 +12558,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.OrgSubscription.UpdatedBy(childComplexity), true - case "OrgSubscriptionBulkCreatePayload.orgSubscriptions": - if e.complexity.OrgSubscriptionBulkCreatePayload.OrgSubscriptions == nil { - break - } - - return e.complexity.OrgSubscriptionBulkCreatePayload.OrgSubscriptions(childComplexity), true - case "OrgSubscriptionConnection.edges": if e.complexity.OrgSubscriptionConnection.Edges == nil { break @@ -12661,20 +12579,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.OrgSubscriptionConnection.TotalCount(childComplexity), true - case "OrgSubscriptionCreatePayload.orgSubscription": - if e.complexity.OrgSubscriptionCreatePayload.OrgSubscription == nil { - break - } - - return e.complexity.OrgSubscriptionCreatePayload.OrgSubscription(childComplexity), true - - case "OrgSubscriptionDeletePayload.deletedID": - if e.complexity.OrgSubscriptionDeletePayload.DeletedID == nil { - break - } - - return e.complexity.OrgSubscriptionDeletePayload.DeletedID(childComplexity), true - case "OrgSubscriptionEdge.cursor": if e.complexity.OrgSubscriptionEdge.Cursor == nil { break @@ -12871,13 +12775,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.OrgSubscriptionSearchResult.OrgSubscriptions(childComplexity), true - case "OrgSubscriptionUpdatePayload.orgSubscription": - if e.complexity.OrgSubscriptionUpdatePayload.OrgSubscription == nil { - break - } - - return e.complexity.OrgSubscriptionUpdatePayload.OrgSubscription(childComplexity), true - case "Organization.apiTokens": if e.complexity.Organization.APITokens == nil { break @@ -13569,13 +13466,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.OrganizationSetting.OrganizationID(childComplexity), true - case "OrganizationSetting.stripeID": - if e.complexity.OrganizationSetting.StripeID == nil { - break - } - - return e.complexity.OrganizationSetting.StripeID(childComplexity), true - case "OrganizationSetting.tags": if e.complexity.OrganizationSetting.Tags == nil { break @@ -13765,13 +13655,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.OrganizationSettingHistory.Ref(childComplexity), true - case "OrganizationSettingHistory.stripeID": - if e.complexity.OrganizationSettingHistory.StripeID == nil { - break - } - - return e.complexity.OrganizationSettingHistory.StripeID(childComplexity), true - case "OrganizationSettingHistory.tags": if e.complexity.OrganizationSettingHistory.Tags == nil { break @@ -20668,7 +20551,6 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputCreateNarrativeInput, ec.unmarshalInputCreateNoteInput, ec.unmarshalInputCreateOrgMembershipInput, - ec.unmarshalInputCreateOrgSubscriptionInput, ec.unmarshalInputCreateOrganizationInput, ec.unmarshalInputCreateOrganizationSettingInput, ec.unmarshalInputCreatePersonalAccessTokenInput, @@ -20773,7 +20655,6 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputUpdateNarrativeInput, ec.unmarshalInputUpdateNoteInput, ec.unmarshalInputUpdateOrgMembershipInput, - ec.unmarshalInputUpdateOrgSubscriptionInput, ec.unmarshalInputUpdateOrganizationInput, ec.unmarshalInputUpdateOrganizationSettingInput, ec.unmarshalInputUpdatePersonalAccessTokenInput, @@ -26102,49 +25983,6 @@ input CreateOrgMembershipInput { eventIDs: [ID!] } """ -CreateOrgSubscriptionInput is used for create OrgSubscription object. -Input was generated by ent. -""" -input CreateOrgSubscriptionInput { - """ - tags associated with the object - """ - tags: [String!] - """ - the stripe subscription id - """ - stripeSubscriptionID: String - """ - the common name of the product tier the subscription is associated with, e.g. starter tier - """ - productTier: String - """ - the product id that represents the tier in stripe - """ - stripeProductTierID: String - """ - the status of the subscription in stripe -- see https://docs.stripe.com/api/subscriptions/object#subscription_object-status - """ - stripeSubscriptionStatus: String - """ - indicates if the subscription is active - """ - active: Boolean - """ - the customer ID the subscription is associated to - """ - stripeCustomerID: String - """ - the time the subscription is set to expire; only populated if subscription is cancelled - """ - expiresAt: Time - """ - the features associated with the subscription - """ - features: [String!] - ownerID: ID -} -""" CreateOrganizationInput is used for create Organization object. Input was generated by ent. """ @@ -26241,9 +26079,9 @@ input CreateOrganizationSettingInput { """ billingPhone: String """ - Address to send billing information to + the billing address to send billing information to """ - billingAddress: String + billingAddress: Address """ Usually government-issued tax ID or business ID such as ABN in Australia """ @@ -26252,10 +26090,6 @@ input CreateOrganizationSettingInput { geographical location of the organization """ geoLocation: OrganizationSettingRegion - """ - the ID of the stripe customer associated with the organization - """ - stripeID: String organizationID: ID fileIDs: [ID!] } @@ -36563,9 +36397,9 @@ type OrganizationSetting implements Node { """ billingPhone: String """ - Address to send billing information to + the billing address to send billing information to """ - billingAddress: String + billingAddress: Address """ Usually government-issued tax ID or business ID such as ABN in Australia """ @@ -36578,10 +36412,6 @@ type OrganizationSetting implements Node { the ID of the organization the settings belong to """ organizationID: ID - """ - the ID of the stripe customer associated with the organization - """ - stripeID: String organization: Organization files: [File!] } @@ -36647,9 +36477,9 @@ type OrganizationSettingHistory implements Node { """ billingPhone: String """ - Address to send billing information to + the billing address to send billing information to """ - billingAddress: String + billingAddress: Address """ Usually government-issued tax ID or business ID such as ABN in Australia """ @@ -36662,10 +36492,6 @@ type OrganizationSettingHistory implements Node { the ID of the organization the settings belong to """ organizationID: String - """ - the ID of the stripe customer associated with the organization - """ - stripeID: String } """ A connection to a list of items. @@ -36918,24 +36744,6 @@ input OrganizationSettingHistoryWhereInput { billingPhoneEqualFold: String billingPhoneContainsFold: String """ - billing_address field predicates - """ - billingAddress: String - billingAddressNEQ: String - billingAddressIn: [String!] - billingAddressNotIn: [String!] - billingAddressGT: String - billingAddressGTE: String - billingAddressLT: String - billingAddressLTE: String - billingAddressContains: String - billingAddressHasPrefix: String - billingAddressHasSuffix: String - billingAddressIsNil: Boolean - billingAddressNotNil: Boolean - billingAddressEqualFold: String - billingAddressContainsFold: String - """ tax_identifier field predicates """ taxIdentifier: String @@ -36980,24 +36788,6 @@ input OrganizationSettingHistoryWhereInput { organizationIDNotNil: Boolean organizationIDEqualFold: String organizationIDContainsFold: String - """ - stripe_id field predicates - """ - stripeID: String - stripeIDNEQ: String - stripeIDIn: [String!] - stripeIDNotIn: [String!] - stripeIDGT: String - stripeIDGTE: String - stripeIDLT: String - stripeIDLTE: String - stripeIDContains: String - stripeIDHasPrefix: String - stripeIDHasSuffix: String - stripeIDIsNil: Boolean - stripeIDNotNil: Boolean - stripeIDEqualFold: String - stripeIDContainsFold: String } """ OrganizationSettingRegion is enum for the field geo_location @@ -37176,24 +36966,6 @@ input OrganizationSettingWhereInput { billingPhoneEqualFold: String billingPhoneContainsFold: String """ - billing_address field predicates - """ - billingAddress: String - billingAddressNEQ: String - billingAddressIn: [String!] - billingAddressNotIn: [String!] - billingAddressGT: String - billingAddressGTE: String - billingAddressLT: String - billingAddressLTE: String - billingAddressContains: String - billingAddressHasPrefix: String - billingAddressHasSuffix: String - billingAddressIsNil: Boolean - billingAddressNotNil: Boolean - billingAddressEqualFold: String - billingAddressContainsFold: String - """ tax_identifier field predicates """ taxIdentifier: String @@ -37239,24 +37011,6 @@ input OrganizationSettingWhereInput { organizationIDEqualFold: ID organizationIDContainsFold: ID """ - stripe_id field predicates - """ - stripeID: String - stripeIDNEQ: String - stripeIDIn: [String!] - stripeIDNotIn: [String!] - stripeIDGT: String - stripeIDGTE: String - stripeIDLT: String - stripeIDLTE: String - stripeIDContains: String - stripeIDHasPrefix: String - stripeIDHasSuffix: String - stripeIDIsNil: Boolean - stripeIDNotNil: Boolean - stripeIDEqualFold: String - stripeIDContainsFold: String - """ organization edge predicates """ hasOrganization: Boolean @@ -47225,60 +46979,6 @@ input UpdateOrgMembershipInput { clearEvents: Boolean } """ -UpdateOrgSubscriptionInput is used for update OrgSubscription object. -Input was generated by ent. -""" -input UpdateOrgSubscriptionInput { - """ - tags associated with the object - """ - tags: [String!] - appendTags: [String!] - clearTags: Boolean - """ - the stripe subscription id - """ - stripeSubscriptionID: String - clearStripeSubscriptionID: Boolean - """ - the common name of the product tier the subscription is associated with, e.g. starter tier - """ - productTier: String - clearProductTier: Boolean - """ - the product id that represents the tier in stripe - """ - stripeProductTierID: String - clearStripeProductTierID: Boolean - """ - the status of the subscription in stripe -- see https://docs.stripe.com/api/subscriptions/object#subscription_object-status - """ - stripeSubscriptionStatus: String - clearStripeSubscriptionStatus: Boolean - """ - indicates if the subscription is active - """ - active: Boolean - """ - the customer ID the subscription is associated to - """ - stripeCustomerID: String - clearStripeCustomerID: Boolean - """ - the time the subscription is set to expire; only populated if subscription is cancelled - """ - expiresAt: Time - clearExpiresAt: Boolean - """ - the features associated with the subscription - """ - features: [String!] - appendFeatures: [String!] - clearFeatures: Boolean - ownerID: ID - clearOwner: Boolean -} -""" UpdateOrganizationInput is used for update Organization object. Input was generated by ent. """ @@ -47448,9 +47148,9 @@ input UpdateOrganizationSettingInput { billingPhone: String clearBillingPhone: Boolean """ - Address to send billing information to + the billing address to send billing information to """ - billingAddress: String + billingAddress: Address clearBillingAddress: Boolean """ Usually government-issued tax ID or business ID such as ABN in Australia @@ -47462,11 +47162,6 @@ input UpdateOrganizationSettingInput { """ geoLocation: OrganizationSettingRegion clearGeoLocation: Boolean - """ - the ID of the stripe customer associated with the organization - """ - stripeID: String - clearStripeID: Boolean organizationID: ID clearOrganization: Boolean addFileIDs: [ID!] @@ -51379,97 +51074,9 @@ type OrgMembershipBulkCreatePayload { id: ID! ): OrgSubscription! } - -extend type Mutation{ - """ - Create a new orgSubscription - """ - createOrgSubscription( - """ - values of the orgSubscription - """ - input: CreateOrgSubscriptionInput! - ): OrgSubscriptionCreatePayload! - """ - Create multiple new orgSubscriptions - """ - createBulkOrgSubscription( - """ - values of the orgSubscription - """ - input: [CreateOrgSubscriptionInput!] - ): OrgSubscriptionBulkCreatePayload! - """ - Create multiple new orgSubscriptions via file upload - """ - createBulkCSVOrgSubscription( - """ - csv file containing values of the orgSubscription - """ - input: Upload! - ): OrgSubscriptionBulkCreatePayload! - """ - Update an existing orgSubscription - """ - updateOrgSubscription( - """ - ID of the orgSubscription - """ - id: ID! - """ - New values for the orgSubscription - """ - input: UpdateOrgSubscriptionInput! - ): OrgSubscriptionUpdatePayload! - """ - Delete an existing orgSubscription - """ - deleteOrgSubscription( - """ - ID of the orgSubscription - """ - id: ID! - ): OrgSubscriptionDeletePayload! -} - -""" -Return response for createOrgSubscription mutation -""" -type OrgSubscriptionCreatePayload { - """ - Created orgSubscription - """ - orgSubscription: OrgSubscription! -} - -""" -Return response for updateOrgSubscription mutation -""" -type OrgSubscriptionUpdatePayload { - """ - Updated orgSubscription - """ - orgSubscription: OrgSubscription! -} - -""" -Return response for deleteOrgSubscription mutation -""" -type OrgSubscriptionDeletePayload { - """ - Deleted orgSubscription ID - """ - deletedID: ID! -} - -""" -Return response for createBulkOrgSubscription mutation -""" -type OrgSubscriptionBulkCreatePayload { - """ - Created orgSubscriptions - """ - orgSubscriptions: [OrgSubscription!] +`, BuiltIn: false}, + {Name: "../schema/orgsubscriptionextended.graphql", Input: `extend type OrgSubscription { + subscriptionURL: String }`, BuiltIn: false}, {Name: "../schema/personalaccesstoken.graphql", Input: `extend type Query { """ @@ -52049,7 +51656,8 @@ type RiskBulkCreatePayload { """ risks: [Risk!] }`, BuiltIn: false}, - {Name: "../schema/scalars.graphql", Input: `scalar Upload`, BuiltIn: false}, + {Name: "../schema/scalars.graphql", Input: `scalar Upload +scalar Address`, BuiltIn: false}, {Name: "../schema/search.graphql", Input: `extend type Query{ """ Search across APIToken objects diff --git a/internal/graphapi/generated/scalars.generated.go b/internal/graphapi/generated/scalars.generated.go index 6f736397..44723ea9 100644 --- a/internal/graphapi/generated/scalars.generated.go +++ b/internal/graphapi/generated/scalars.generated.go @@ -6,6 +6,7 @@ import ( "context" "github.com/99designs/gqlgen/graphql" + "github.com/theopenlane/core/pkg/models" "github.com/vektah/gqlparser/v2/ast" ) @@ -54,6 +55,32 @@ func (ec *executionContext) marshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋg return res } +func (ec *executionContext) unmarshalOAddress2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋmodelsᚐAddress(ctx context.Context, v any) (models.Address, error) { + var res models.Address + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOAddress2githubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋmodelsᚐAddress(ctx context.Context, sel ast.SelectionSet, v models.Address) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalOAddress2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋmodelsᚐAddress(ctx context.Context, v any) (*models.Address, error) { + if v == nil { + return nil, nil + } + var res = new(models.Address) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOAddress2ᚖgithubᚗcomᚋtheopenlaneᚋcoreᚋpkgᚋmodelsᚐAddress(ctx context.Context, sel ast.SelectionSet, v *models.Address) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + func (ec *executionContext) unmarshalOUpload2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx context.Context, v any) (*graphql.Upload, error) { if v == nil { return nil, nil diff --git a/internal/graphapi/generated/search.generated.go b/internal/graphapi/generated/search.generated.go index 7ad5847b..e5de60db 100644 --- a/internal/graphapi/generated/search.generated.go +++ b/internal/graphapi/generated/search.generated.go @@ -1448,6 +1448,8 @@ func (ec *executionContext) fieldContext_OrgSubscriptionSearchResult_orgSubscrip return ec.fieldContext_OrgSubscription_features(ctx, field) case "owner": return ec.fieldContext_OrgSubscription_owner(ctx, field) + case "subscriptionURL": + return ec.fieldContext_OrgSubscription_subscriptionURL(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type OrgSubscription", field.Name) }, @@ -1672,8 +1674,6 @@ func (ec *executionContext) fieldContext_OrganizationSettingSearchResult_organiz return ec.fieldContext_OrganizationSetting_geoLocation(ctx, field) case "organizationID": return ec.fieldContext_OrganizationSetting_organizationID(ctx, field) - case "stripeID": - return ec.fieldContext_OrganizationSetting_stripeID(ctx, field) case "organization": return ec.fieldContext_OrganizationSetting_organization(ctx, field) case "files": diff --git a/internal/graphapi/model/gen_models.go b/internal/graphapi/model/gen_models.go index bebc5dbd..3aa0a330 100644 --- a/internal/graphapi/model/gen_models.go +++ b/internal/graphapi/model/gen_models.go @@ -605,36 +605,12 @@ type OrgMembershipUpdatePayload struct { OrgMembership *generated.OrgMembership `json:"orgMembership"` } -// Return response for createBulkOrgSubscription mutation -type OrgSubscriptionBulkCreatePayload struct { - // Created orgSubscriptions - OrgSubscriptions []*generated.OrgSubscription `json:"orgSubscriptions,omitempty"` -} - -// Return response for createOrgSubscription mutation -type OrgSubscriptionCreatePayload struct { - // Created orgSubscription - OrgSubscription *generated.OrgSubscription `json:"orgSubscription"` -} - -// Return response for deleteOrgSubscription mutation -type OrgSubscriptionDeletePayload struct { - // Deleted orgSubscription ID - DeletedID string `json:"deletedID"` -} - type OrgSubscriptionSearchResult struct { OrgSubscriptions []*generated.OrgSubscription `json:"orgSubscriptions,omitempty"` } func (OrgSubscriptionSearchResult) IsSearchResult() {} -// Return response for updateOrgSubscription mutation -type OrgSubscriptionUpdatePayload struct { - // Updated orgSubscription - OrgSubscription *generated.OrgSubscription `json:"orgSubscription"` -} - // Return response for createBulkOrganization mutation type OrganizationBulkCreatePayload struct { // Created organizations diff --git a/internal/graphapi/organization_test.go b/internal/graphapi/organization_test.go index 852b73d9..acf7a7f7 100644 --- a/internal/graphapi/organization_test.go +++ b/internal/graphapi/organization_test.go @@ -15,6 +15,7 @@ import ( "github.com/theopenlane/core/internal/ent/generated/privacy" "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/models" "github.com/theopenlane/core/pkg/openlaneclient" ) @@ -168,6 +169,13 @@ func (suite *GraphTestSuite) TestMutationCreateOrganization() { listOrgs: true, settings: &openlaneclient.CreateOrganizationSettingInput{ Domains: []string{"meow.theopenlane.io"}, + BillingAddress: &models.Address{ + Line1: gofakeit.StreetNumber() + " " + gofakeit.Street(), + City: gofakeit.City(), + State: gofakeit.State(), + PostalCode: gofakeit.Zip(), + Country: gofakeit.Country(), + }, }, parentOrgID: "", // root org client: suite.client.api, @@ -325,6 +333,14 @@ func (suite *GraphTestSuite) TestMutationCreateOrganization() { } else { assert.NotEqual(t, resp.CreateOrganization.Organization.ID, userResp.User.Setting.DefaultOrg.ID) } + + if tc.settings.BillingAddress != nil { + assert.Equal(t, tc.settings.BillingAddress.Line1, resp.CreateOrganization.Organization.Setting.BillingAddress.Line1) + assert.Equal(t, tc.settings.BillingAddress.City, resp.CreateOrganization.Organization.Setting.BillingAddress.City) + assert.Equal(t, tc.settings.BillingAddress.State, resp.CreateOrganization.Organization.Setting.BillingAddress.State) + assert.Equal(t, tc.settings.BillingAddress.PostalCode, resp.CreateOrganization.Organization.Setting.BillingAddress.PostalCode) + assert.Equal(t, tc.settings.BillingAddress.Country, resp.CreateOrganization.Organization.Setting.BillingAddress.Country) + } } // ensure entity types are created diff --git a/internal/graphapi/orgsubscription.resolvers.go b/internal/graphapi/orgsubscription.resolvers.go index d9185685..c89dcdfb 100644 --- a/internal/graphapi/orgsubscription.resolvers.go +++ b/internal/graphapi/orgsubscription.resolvers.go @@ -7,90 +7,9 @@ package graphapi import ( "context" - "github.com/99designs/gqlgen/graphql" - "github.com/rs/zerolog/log" "github.com/theopenlane/core/internal/ent/generated" - "github.com/theopenlane/core/internal/graphapi/model" - "github.com/theopenlane/utils/rout" ) -// CreateOrgSubscription is the resolver for the createOrgSubscription field. -func (r *mutationResolver) CreateOrgSubscription(ctx context.Context, input generated.CreateOrgSubscriptionInput) (*model.OrgSubscriptionCreatePayload, error) { - // set the organization in the auth context if its not done for us - if err := setOrganizationInAuthContext(ctx, input.OwnerID); err != nil { - log.Error().Err(err).Msg("failed to set organization in auth context") - - return nil, rout.NewMissingRequiredFieldError("owner_id") - } - - res, err := withTransactionalMutation(ctx).OrgSubscription.Create().SetInput(input).Save(ctx) - if err != nil { - return nil, parseRequestError(err, action{action: ActionCreate, object: "orgsubscription"}) - } - - return &model.OrgSubscriptionCreatePayload{ - OrgSubscription: res, - }, nil -} - -// CreateBulkOrgSubscription is the resolver for the createBulkOrgSubscription field. -func (r *mutationResolver) CreateBulkOrgSubscription(ctx context.Context, input []*generated.CreateOrgSubscriptionInput) (*model.OrgSubscriptionBulkCreatePayload, error) { - return r.bulkCreateOrgSubscription(ctx, input) -} - -// CreateBulkCSVOrgSubscription is the resolver for the createBulkCSVOrgSubscription field. -func (r *mutationResolver) CreateBulkCSVOrgSubscription(ctx context.Context, input graphql.Upload) (*model.OrgSubscriptionBulkCreatePayload, error) { - data, err := unmarshalBulkData[generated.CreateOrgSubscriptionInput](input) - if err != nil { - log.Error().Err(err).Msg("failed to unmarshal bulk data") - - return nil, err - } - - return r.bulkCreateOrgSubscription(ctx, data) -} - -// UpdateOrgSubscription is the resolver for the updateOrgSubscription field. -func (r *mutationResolver) UpdateOrgSubscription(ctx context.Context, id string, input generated.UpdateOrgSubscriptionInput) (*model.OrgSubscriptionUpdatePayload, error) { - res, err := withTransactionalMutation(ctx).OrgSubscription.Get(ctx, id) - if err != nil { - return nil, parseRequestError(err, action{action: ActionUpdate, object: "orgsubscription"}) - } - // set the organization in the auth context if its not done for us - if err := setOrganizationInAuthContext(ctx, &res.OwnerID); err != nil { - log.Error().Err(err).Msg("failed to set organization in auth context") - - return nil, rout.ErrPermissionDenied - } - - // setup update request - req := res.Update().SetInput(input).AppendTags(input.AppendTags).AppendFeatures(input.AppendFeatures) - - res, err = req.Save(ctx) - if err != nil { - return nil, parseRequestError(err, action{action: ActionUpdate, object: "orgsubscription"}) - } - - return &model.OrgSubscriptionUpdatePayload{ - OrgSubscription: res, - }, nil -} - -// DeleteOrgSubscription is the resolver for the deleteOrgSubscription field. -func (r *mutationResolver) DeleteOrgSubscription(ctx context.Context, id string) (*model.OrgSubscriptionDeletePayload, error) { - if err := withTransactionalMutation(ctx).OrgSubscription.DeleteOneID(id).Exec(ctx); err != nil { - return nil, parseRequestError(err, action{action: ActionDelete, object: "orgsubscription"}) - } - - if err := generated.OrgSubscriptionEdgeCleanup(ctx, id); err != nil { - return nil, newCascadeDeleteError(err) - } - - return &model.OrgSubscriptionDeletePayload{ - DeletedID: id, - }, nil -} - // OrgSubscription is the resolver for the orgSubscription field. func (r *queryResolver) OrgSubscription(ctx context.Context, id string) (*generated.OrgSubscription, error) { res, err := withTransactionalMutation(ctx).OrgSubscription.Get(ctx, id) diff --git a/internal/graphapi/query/adminsearch.graphql b/internal/graphapi/query/adminsearch.graphql index 65303f0d..040dded3 100644 --- a/internal/graphapi/query/adminsearch.graphql +++ b/internal/graphapi/query/adminsearch.graphql @@ -230,7 +230,6 @@ query AdminSearch($query: String!) { billingAddress taxIdentifier organizationID - stripeID } } ... on PersonalAccessTokenSearchResult { diff --git a/internal/graphapi/query/organization.graphql b/internal/graphapi/query/organization.graphql index 2126cfba..8c824c8a 100644 --- a/internal/graphapi/query/organization.graphql +++ b/internal/graphapi/query/organization.graphql @@ -49,7 +49,6 @@ mutation CreateOrganization($input: CreateOrganizationInput!) { taxIdentifier geoLocation tags - stripeID } parent { id @@ -122,7 +121,6 @@ query GetAllOrganizations { taxIdentifier geoLocation tags - stripeID } createdAt updatedAt @@ -176,7 +174,6 @@ query GetOrganizationByID($organizationId: ID!) { taxIdentifier geoLocation tags - stripeID } createdAt createdBy @@ -232,7 +229,6 @@ query GetOrganizations($where: OrganizationWhereInput) { taxIdentifier geoLocation tags - stripeID } createdAt updatedAt @@ -269,7 +265,6 @@ mutation UpdateOrganization($updateOrganizationId: ID!, $input: UpdateOrganizati taxIdentifier geoLocation tags - stripeID } } } diff --git a/internal/graphapi/query/organizationsetting.graphql b/internal/graphapi/query/organizationsetting.graphql index a222cfce..c56d5d2d 100644 --- a/internal/graphapi/query/organizationsetting.graphql +++ b/internal/graphapi/query/organizationsetting.graphql @@ -19,7 +19,6 @@ query GetAllOrganizationSettings { id name } - stripeID } } } @@ -44,7 +43,6 @@ query GetOrganizationSettingByID($organizationSettingId: ID!) { id name } - stripeID } } @@ -69,7 +67,6 @@ query GetOrganizationSettings($where: OrganizationSettingWhereInput!) { id name } - stripeID } } } @@ -95,7 +92,6 @@ mutation UpdateOrganizationSetting($updateOrganizationSettingId: ID!, $input: Up id name } - stripeID } } } diff --git a/internal/graphapi/query/orgsubscription.graphql b/internal/graphapi/query/orgsubscription.graphql index c9065964..74404fa6 100644 --- a/internal/graphapi/query/orgsubscription.graphql +++ b/internal/graphapi/query/orgsubscription.graphql @@ -1,75 +1,3 @@ -mutation CreateBulkCSVOrgSubscription($input: Upload!) { - createBulkCSVOrgSubscription(input: $input) { - orgSubscriptions { - active - createdAt - createdBy - expiresAt - features - id - ownerID - productTier - stripeCustomerID - stripeProductTierID - stripeSubscriptionID - stripeSubscriptionStatus - tags - updatedAt - updatedBy - } - } -} - -mutation CreateBulkOrgSubscription($input: [CreateOrgSubscriptionInput!]) { - createBulkOrgSubscription(input: $input) { - orgSubscriptions { - active - createdAt - createdBy - expiresAt - features - id - ownerID - productTier - stripeCustomerID - stripeProductTierID - stripeSubscriptionID - stripeSubscriptionStatus - tags - updatedAt - updatedBy - } - } -} - -mutation CreateOrgSubscription($input: CreateOrgSubscriptionInput!) { - createOrgSubscription(input: $input) { - orgSubscription { - active - createdAt - createdBy - expiresAt - features - id - ownerID - productTier - stripeCustomerID - stripeProductTierID - stripeSubscriptionID - stripeSubscriptionStatus - tags - updatedAt - updatedBy - } - } -} - -mutation DeleteOrgSubscription($deleteOrgSubscriptionId: ID!) { - deleteOrgSubscription(id: $deleteOrgSubscriptionId) { - deletedID - } -} - query GetAllOrgSubscriptions { orgSubscriptions { edges { @@ -137,25 +65,3 @@ query GetOrgSubscriptions($where: OrgSubscriptionWhereInput) { } } } - -mutation UpdateOrgSubscription($updateOrgSubscriptionId: ID!, $input: UpdateOrgSubscriptionInput!) { - updateOrgSubscription(id: $updateOrgSubscriptionId, input: $input) { - orgSubscription { - active - createdAt - createdBy - expiresAt - features - id - ownerID - productTier - stripeCustomerID - stripeProductTierID - stripeSubscriptionID - stripeSubscriptionStatus - tags - updatedAt - updatedBy - } - } -} diff --git a/internal/graphapi/schema/ent.graphql b/internal/graphapi/schema/ent.graphql index 6af28938..e2623f52 100644 --- a/internal/graphapi/schema/ent.graphql +++ b/internal/graphapi/schema/ent.graphql @@ -4240,49 +4240,6 @@ input CreateOrgMembershipInput { eventIDs: [ID!] } """ -CreateOrgSubscriptionInput is used for create OrgSubscription object. -Input was generated by ent. -""" -input CreateOrgSubscriptionInput { - """ - tags associated with the object - """ - tags: [String!] - """ - the stripe subscription id - """ - stripeSubscriptionID: String - """ - the common name of the product tier the subscription is associated with, e.g. starter tier - """ - productTier: String - """ - the product id that represents the tier in stripe - """ - stripeProductTierID: String - """ - the status of the subscription in stripe -- see https://docs.stripe.com/api/subscriptions/object#subscription_object-status - """ - stripeSubscriptionStatus: String - """ - indicates if the subscription is active - """ - active: Boolean - """ - the customer ID the subscription is associated to - """ - stripeCustomerID: String - """ - the time the subscription is set to expire; only populated if subscription is cancelled - """ - expiresAt: Time - """ - the features associated with the subscription - """ - features: [String!] - ownerID: ID -} -""" CreateOrganizationInput is used for create Organization object. Input was generated by ent. """ @@ -4379,9 +4336,9 @@ input CreateOrganizationSettingInput { """ billingPhone: String """ - Address to send billing information to + the billing address to send billing information to """ - billingAddress: String + billingAddress: Address """ Usually government-issued tax ID or business ID such as ABN in Australia """ @@ -4390,10 +4347,6 @@ input CreateOrganizationSettingInput { geographical location of the organization """ geoLocation: OrganizationSettingRegion - """ - the ID of the stripe customer associated with the organization - """ - stripeID: String organizationID: ID fileIDs: [ID!] } @@ -14701,9 +14654,9 @@ type OrganizationSetting implements Node { """ billingPhone: String """ - Address to send billing information to + the billing address to send billing information to """ - billingAddress: String + billingAddress: Address """ Usually government-issued tax ID or business ID such as ABN in Australia """ @@ -14716,10 +14669,6 @@ type OrganizationSetting implements Node { the ID of the organization the settings belong to """ organizationID: ID - """ - the ID of the stripe customer associated with the organization - """ - stripeID: String organization: Organization files: [File!] } @@ -14785,9 +14734,9 @@ type OrganizationSettingHistory implements Node { """ billingPhone: String """ - Address to send billing information to + the billing address to send billing information to """ - billingAddress: String + billingAddress: Address """ Usually government-issued tax ID or business ID such as ABN in Australia """ @@ -14800,10 +14749,6 @@ type OrganizationSettingHistory implements Node { the ID of the organization the settings belong to """ organizationID: String - """ - the ID of the stripe customer associated with the organization - """ - stripeID: String } """ A connection to a list of items. @@ -15056,24 +15001,6 @@ input OrganizationSettingHistoryWhereInput { billingPhoneEqualFold: String billingPhoneContainsFold: String """ - billing_address field predicates - """ - billingAddress: String - billingAddressNEQ: String - billingAddressIn: [String!] - billingAddressNotIn: [String!] - billingAddressGT: String - billingAddressGTE: String - billingAddressLT: String - billingAddressLTE: String - billingAddressContains: String - billingAddressHasPrefix: String - billingAddressHasSuffix: String - billingAddressIsNil: Boolean - billingAddressNotNil: Boolean - billingAddressEqualFold: String - billingAddressContainsFold: String - """ tax_identifier field predicates """ taxIdentifier: String @@ -15118,24 +15045,6 @@ input OrganizationSettingHistoryWhereInput { organizationIDNotNil: Boolean organizationIDEqualFold: String organizationIDContainsFold: String - """ - stripe_id field predicates - """ - stripeID: String - stripeIDNEQ: String - stripeIDIn: [String!] - stripeIDNotIn: [String!] - stripeIDGT: String - stripeIDGTE: String - stripeIDLT: String - stripeIDLTE: String - stripeIDContains: String - stripeIDHasPrefix: String - stripeIDHasSuffix: String - stripeIDIsNil: Boolean - stripeIDNotNil: Boolean - stripeIDEqualFold: String - stripeIDContainsFold: String } """ OrganizationSettingRegion is enum for the field geo_location @@ -15314,24 +15223,6 @@ input OrganizationSettingWhereInput { billingPhoneEqualFold: String billingPhoneContainsFold: String """ - billing_address field predicates - """ - billingAddress: String - billingAddressNEQ: String - billingAddressIn: [String!] - billingAddressNotIn: [String!] - billingAddressGT: String - billingAddressGTE: String - billingAddressLT: String - billingAddressLTE: String - billingAddressContains: String - billingAddressHasPrefix: String - billingAddressHasSuffix: String - billingAddressIsNil: Boolean - billingAddressNotNil: Boolean - billingAddressEqualFold: String - billingAddressContainsFold: String - """ tax_identifier field predicates """ taxIdentifier: String @@ -15377,24 +15268,6 @@ input OrganizationSettingWhereInput { organizationIDEqualFold: ID organizationIDContainsFold: ID """ - stripe_id field predicates - """ - stripeID: String - stripeIDNEQ: String - stripeIDIn: [String!] - stripeIDNotIn: [String!] - stripeIDGT: String - stripeIDGTE: String - stripeIDLT: String - stripeIDLTE: String - stripeIDContains: String - stripeIDHasPrefix: String - stripeIDHasSuffix: String - stripeIDIsNil: Boolean - stripeIDNotNil: Boolean - stripeIDEqualFold: String - stripeIDContainsFold: String - """ organization edge predicates """ hasOrganization: Boolean @@ -25363,60 +25236,6 @@ input UpdateOrgMembershipInput { clearEvents: Boolean } """ -UpdateOrgSubscriptionInput is used for update OrgSubscription object. -Input was generated by ent. -""" -input UpdateOrgSubscriptionInput { - """ - tags associated with the object - """ - tags: [String!] - appendTags: [String!] - clearTags: Boolean - """ - the stripe subscription id - """ - stripeSubscriptionID: String - clearStripeSubscriptionID: Boolean - """ - the common name of the product tier the subscription is associated with, e.g. starter tier - """ - productTier: String - clearProductTier: Boolean - """ - the product id that represents the tier in stripe - """ - stripeProductTierID: String - clearStripeProductTierID: Boolean - """ - the status of the subscription in stripe -- see https://docs.stripe.com/api/subscriptions/object#subscription_object-status - """ - stripeSubscriptionStatus: String - clearStripeSubscriptionStatus: Boolean - """ - indicates if the subscription is active - """ - active: Boolean - """ - the customer ID the subscription is associated to - """ - stripeCustomerID: String - clearStripeCustomerID: Boolean - """ - the time the subscription is set to expire; only populated if subscription is cancelled - """ - expiresAt: Time - clearExpiresAt: Boolean - """ - the features associated with the subscription - """ - features: [String!] - appendFeatures: [String!] - clearFeatures: Boolean - ownerID: ID - clearOwner: Boolean -} -""" UpdateOrganizationInput is used for update Organization object. Input was generated by ent. """ @@ -25586,9 +25405,9 @@ input UpdateOrganizationSettingInput { billingPhone: String clearBillingPhone: Boolean """ - Address to send billing information to + the billing address to send billing information to """ - billingAddress: String + billingAddress: Address clearBillingAddress: Boolean """ Usually government-issued tax ID or business ID such as ABN in Australia @@ -25600,11 +25419,6 @@ input UpdateOrganizationSettingInput { """ geoLocation: OrganizationSettingRegion clearGeoLocation: Boolean - """ - the ID of the stripe customer associated with the organization - """ - stripeID: String - clearStripeID: Boolean organizationID: ID clearOrganization: Boolean addFileIDs: [ID!] diff --git a/internal/graphapi/schema/orgsubscription.graphql b/internal/graphapi/schema/orgsubscription.graphql index f1d1fd73..54c5d3be 100644 --- a/internal/graphapi/schema/orgsubscription.graphql +++ b/internal/graphapi/schema/orgsubscription.graphql @@ -9,95 +9,3 @@ extend type Query { id: ID! ): OrgSubscription! } - -extend type Mutation{ - """ - Create a new orgSubscription - """ - createOrgSubscription( - """ - values of the orgSubscription - """ - input: CreateOrgSubscriptionInput! - ): OrgSubscriptionCreatePayload! - """ - Create multiple new orgSubscriptions - """ - createBulkOrgSubscription( - """ - values of the orgSubscription - """ - input: [CreateOrgSubscriptionInput!] - ): OrgSubscriptionBulkCreatePayload! - """ - Create multiple new orgSubscriptions via file upload - """ - createBulkCSVOrgSubscription( - """ - csv file containing values of the orgSubscription - """ - input: Upload! - ): OrgSubscriptionBulkCreatePayload! - """ - Update an existing orgSubscription - """ - updateOrgSubscription( - """ - ID of the orgSubscription - """ - id: ID! - """ - New values for the orgSubscription - """ - input: UpdateOrgSubscriptionInput! - ): OrgSubscriptionUpdatePayload! - """ - Delete an existing orgSubscription - """ - deleteOrgSubscription( - """ - ID of the orgSubscription - """ - id: ID! - ): OrgSubscriptionDeletePayload! -} - -""" -Return response for createOrgSubscription mutation -""" -type OrgSubscriptionCreatePayload { - """ - Created orgSubscription - """ - orgSubscription: OrgSubscription! -} - -""" -Return response for updateOrgSubscription mutation -""" -type OrgSubscriptionUpdatePayload { - """ - Updated orgSubscription - """ - orgSubscription: OrgSubscription! -} - -""" -Return response for deleteOrgSubscription mutation -""" -type OrgSubscriptionDeletePayload { - """ - Deleted orgSubscription ID - """ - deletedID: ID! -} - -""" -Return response for createBulkOrgSubscription mutation -""" -type OrgSubscriptionBulkCreatePayload { - """ - Created orgSubscriptions - """ - orgSubscriptions: [OrgSubscription!] -} \ No newline at end of file diff --git a/internal/graphapi/schema/orgsubscriptionextended.graphql b/internal/graphapi/schema/orgsubscriptionextended.graphql new file mode 100644 index 00000000..571a0b18 --- /dev/null +++ b/internal/graphapi/schema/orgsubscriptionextended.graphql @@ -0,0 +1,3 @@ +extend type OrgSubscription { + subscriptionURL: String +} \ No newline at end of file diff --git a/internal/graphapi/schema/scalars.graphql b/internal/graphapi/schema/scalars.graphql index fca9ea1f..133d5334 100644 --- a/internal/graphapi/schema/scalars.graphql +++ b/internal/graphapi/schema/scalars.graphql @@ -1 +1,2 @@ -scalar Upload \ No newline at end of file +scalar Upload +scalar Address \ No newline at end of file diff --git a/internal/graphapi/search.go b/internal/graphapi/search.go index 5bdb01ef..d0e3ea3c 100644 --- a/internal/graphapi/search.go +++ b/internal/graphapi/search.go @@ -686,10 +686,12 @@ func adminSearchOrganizationSettings(ctx context.Context, query string) ([]*gene organizationsetting.BillingContactContainsFold(query), // search by BillingContact organizationsetting.BillingEmailContainsFold(query), // search by BillingEmail organizationsetting.BillingPhoneContainsFold(query), // search by BillingPhone - organizationsetting.BillingAddressContainsFold(query), // search by BillingAddress + func(s *sql.Selector) { + likeQuery := "%" + query + "%" + s.Where(sql.ExprP("(billingaddress)::text LIKE $8", likeQuery)) // search by BillingAddress + }, organizationsetting.TaxIdentifierContainsFold(query), // search by TaxIdentifier organizationsetting.OrganizationIDContainsFold(query), // search by OrganizationID - organizationsetting.StripeIDContainsFold(query), // search by StripeID ), ).All(ctx) } diff --git a/internal/httpserve/serveropts/option.go b/internal/httpserve/serveropts/option.go index 7fe36eec..c39db679 100644 --- a/internal/httpserve/serveropts/option.go +++ b/internal/httpserve/serveropts/option.go @@ -460,11 +460,9 @@ func WithObjectStorage() ServerOption { func WithEntitlements() ServerOption { return newApplyFunc(func(s *ServerOptions) { if s.Config.Settings.Entitlements.Enabled { - config := entitlements.NewConfig(entitlements.WithTrialSubscriptionPriceID(s.Config.Settings.Entitlements.TrialSubscriptionPriceID), entitlements.WithStripeWebhookSecret(s.Config.Settings.Entitlements.StripeWebhookSecret)) - client := entitlements.NewStripeClient( entitlements.WithAPIKey(s.Config.Settings.Entitlements.PrivateStripeKey), - entitlements.WithConfig(*config)) + entitlements.WithConfig(s.Config.Settings.Entitlements)) s.Config.Handler.Entitlements = client } diff --git a/pkg/entitlements/customers.go b/pkg/entitlements/customers.go index 0d420a32..0fda1d9d 100644 --- a/pkg/entitlements/customers.go +++ b/pkg/entitlements/customers.go @@ -17,15 +17,15 @@ func (sc *StripeClient) CreateCustomer(c *OrganizationCustomer) (*stripe.Custome } customer, err := sc.Client.Customers.New(&stripe.CustomerParams{ - Email: &c.BillingEmail, + Email: &c.Email, Name: &c.OrganizationID, - Phone: &c.BillingPhone, + Phone: &c.Phone, Address: &stripe.AddressParams{ - Line1: c.ContactInfo.Line1, - City: c.ContactInfo.City, - State: c.ContactInfo.State, - PostalCode: c.ContactInfo.PostalCode, - Country: c.ContactInfo.Country, + Line1: c.Line1, + City: c.City, + State: c.State, + PostalCode: c.PostalCode, + Country: c.Country, }, Metadata: map[string]string{ "organization_id": c.OrganizationID, diff --git a/pkg/entitlements/helpers.go b/pkg/entitlements/helpers.go index 89c3bfbf..78f6ca18 100644 --- a/pkg/entitlements/helpers.go +++ b/pkg/entitlements/helpers.go @@ -6,9 +6,11 @@ import ( "github.com/stripe/stripe-go/v81" "gopkg.in/yaml.v3" + + "github.com/theopenlane/core/pkg/models" ) -// checkForBillingUpdate checks for updates to billing information in the properties and returns a stripe.CustomerParams object with the updated information +// CheckForBillingUpdate checks for updates to billing information in the properties and returns a stripe.CustomerParams object with the updated information // and a boolean indicating whether there are updates func CheckForBillingUpdate(props map[string]interface{}, stripeCustomer *OrganizationCustomer) (params *stripe.CustomerParams, hasUpdate bool) { params = &stripe.CustomerParams{} @@ -16,7 +18,7 @@ func CheckForBillingUpdate(props map[string]interface{}, stripeCustomer *Organiz billingEmail, exists := props["billing_email"] if exists && billingEmail != "" { email := billingEmail.(string) - if stripeCustomer.BillingEmail != email { + if stripeCustomer.Email != email { params.Email = &email hasUpdate = true } @@ -25,12 +27,27 @@ func CheckForBillingUpdate(props map[string]interface{}, stripeCustomer *Organiz billingPhone, exists := props["billing_phone"] if exists && billingPhone != "" { phone := billingPhone.(string) - if stripeCustomer.BillingPhone != phone { + if stripeCustomer.Phone != phone { params.Phone = &phone hasUpdate = true } } + billingAddress, exists := props["billing_address"] + if exists && billingAddress != nil { + hasUpdate = true + + address := billingAddress.(models.Address) + params.Address = &stripe.AddressParams{ + Line1: &address.Line1, + Line2: &address.Line2, + City: &address.City, + State: &address.State, + PostalCode: &address.PostalCode, + Country: &address.Country, + } + } + return params, hasUpdate } diff --git a/pkg/entitlements/helpers_test.go b/pkg/entitlements/helpers_test.go index 42370eca..228b3351 100644 --- a/pkg/entitlements/helpers_test.go +++ b/pkg/entitlements/helpers_test.go @@ -22,8 +22,10 @@ func TestCheckForBillingUpdate(t *testing.T) { "billing_phone": "1234567890", }, stripeCustomer: &OrganizationCustomer{ - BillingEmail: "test@example.com", - BillingPhone: "1234567890", + ContactInfo: ContactInfo{ + Email: "test@example.com", + Phone: "1234567890", + }, }, expectedParams: &stripe.CustomerParams{}, expectedUpdate: false, @@ -35,8 +37,10 @@ func TestCheckForBillingUpdate(t *testing.T) { "billing_phone": "1234567890", }, stripeCustomer: &OrganizationCustomer{ - BillingEmail: "test@example.com", - BillingPhone: "1234567890", + ContactInfo: ContactInfo{ + Email: "test@example.com", + Phone: "1234567890", + }, }, expectedParams: &stripe.CustomerParams{ Email: stripe.String("new@example.com"), @@ -50,8 +54,10 @@ func TestCheckForBillingUpdate(t *testing.T) { "billing_phone": "0987654321", }, stripeCustomer: &OrganizationCustomer{ - BillingEmail: "test@example.com", - BillingPhone: "1234567890", + ContactInfo: ContactInfo{ + Email: "test@example.com", + Phone: "1234567890", + }, }, expectedParams: &stripe.CustomerParams{ Phone: stripe.String("0987654321"), diff --git a/pkg/entitlements/models.go b/pkg/entitlements/models.go index b67fb607..56697d9c 100644 --- a/pkg/entitlements/models.go +++ b/pkg/entitlements/models.go @@ -12,8 +12,6 @@ type OrganizationCustomer struct { OrganizationID string `json:"organization_id"` OrganizationSettingsID string `json:"organization_settings_id"` StripeCustomerID string `json:"stripe_customer_id"` - BillingEmail string `json:"billing_email"` - BillingPhone string `json:"billing_phone"` OrganizationName string `json:"organization_name"` Features []string Subscription @@ -34,9 +32,9 @@ type ContactInfo struct { func (o *OrganizationCustomer) MapToStripeCustomer() *stripe.CustomerParams { return &stripe.CustomerParams{ - Email: &o.BillingEmail, + Email: &o.Email, Name: &o.OrganizationID, - Phone: &o.BillingPhone, + Phone: &o.Phone, Address: &stripe.AddressParams{ Line1: o.Line1, Line2: o.Line2, @@ -56,12 +54,12 @@ func (o *OrganizationCustomer) MapToStripeCustomer() *stripe.CustomerParams { // Validate checks if the OrganizationCustomer contains necessary fields func (o *OrganizationCustomer) Validate() error { o.OrganizationID = strings.TrimSpace(o.OrganizationID) - o.BillingEmail = strings.TrimSpace(o.BillingEmail) + o.Email = strings.TrimSpace(o.Email) switch { case o.OrganizationID == "": return rout.NewMissingRequiredFieldError("organization_id") - case o.BillingEmail == "": + case o.Email == "": return rout.NewMissingRequiredFieldError("billing_email") } diff --git a/pkg/models/address.go b/pkg/models/address.go new file mode 100644 index 00000000..59fe8639 --- /dev/null +++ b/pkg/models/address.go @@ -0,0 +1,57 @@ +package models + +import ( + "encoding/json" + "io" + + "github.com/rs/zerolog/log" +) + +// Address is a custom type for Address +type Address struct { + // Line1 is the first line of the address + Line1 string `json:"line1"` + // Line2 is the second line of the address + Line2 string `json:"line2"` + // City is the city of the address + City string `json:"city"` + // State is the state of the address + State string `json:"state"` + // PostalCode is the postal code of the address + PostalCode string `json:"postalCode"` + // Country is the country of the address + Country string `json:"country"` +} + +// String returns a string representation of the address +func (a Address) String() string { + return a.Line1 + " " + a.Line2 + " " + a.City + ", " + a.State + " " + a.PostalCode + " " + a.Country +} + +// MarshalGQL implement the Marshaler interface for gqlgen +func (a Address) MarshalGQL(w io.Writer) { + byteData, err := json.Marshal(a) + if err != nil { + log.Fatal().Err(err).Msg("error marshalling json object") + } + + _, err = w.Write(byteData) + if err != nil { + log.Fatal().Err(err).Msg("error writing json object") + } +} + +// UnmarshalGQL implement the Unmarshaler interface for gqlgen +func (a *Address) UnmarshalGQL(v interface{}) error { + byteData, err := json.Marshal(v) + if err != nil { + return err + } + + err = json.Unmarshal(byteData, &a) + if err != nil { + return err + } + + return err +} diff --git a/pkg/openlaneclient/graphclient.go b/pkg/openlaneclient/graphclient.go index 13eebdc5..5ea9e2af 100644 --- a/pkg/openlaneclient/graphclient.go +++ b/pkg/openlaneclient/graphclient.go @@ -10,6 +10,7 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/Yamashou/gqlgenc/clientv2" "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/models" "github.com/theopenlane/entx/history" ) @@ -198,14 +199,9 @@ type OpenlaneGraphClient interface { UpdateUserRoleInOrg(ctx context.Context, updateOrgMemberID string, input UpdateOrgMembershipInput, interceptors ...clientv2.RequestInterceptor) (*UpdateUserRoleInOrg, error) GetAllOrgMembershipHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOrgMembershipHistories, error) GetOrgMembershipHistories(ctx context.Context, where *OrgMembershipHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrgMembershipHistories, error) - CreateBulkCSVOrgSubscription(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVOrgSubscription, error) - CreateBulkOrgSubscription(ctx context.Context, input []*CreateOrgSubscriptionInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkOrgSubscription, error) - CreateOrgSubscription(ctx context.Context, input CreateOrgSubscriptionInput, interceptors ...clientv2.RequestInterceptor) (*CreateOrgSubscription, error) - DeleteOrgSubscription(ctx context.Context, deleteOrgSubscriptionID string, interceptors ...clientv2.RequestInterceptor) (*DeleteOrgSubscription, error) GetAllOrgSubscriptions(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOrgSubscriptions, error) GetOrgSubscriptionByID(ctx context.Context, orgSubscriptionID string, interceptors ...clientv2.RequestInterceptor) (*GetOrgSubscriptionByID, error) GetOrgSubscriptions(ctx context.Context, where *OrgSubscriptionWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrgSubscriptions, error) - UpdateOrgSubscription(ctx context.Context, updateOrgSubscriptionID string, input UpdateOrgSubscriptionInput, interceptors ...clientv2.RequestInterceptor) (*UpdateOrgSubscription, error) GetAllOrgSubscriptionHistories(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllOrgSubscriptionHistories, error) GetOrgSubscriptionHistories(ctx context.Context, where *OrgSubscriptionHistoryWhereInput, interceptors ...clientv2.RequestInterceptor) (*GetOrgSubscriptionHistories, error) CreateBulkCSVPersonalAccessToken(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVPersonalAccessToken, error) @@ -2678,20 +2674,19 @@ func (t *AdminSearch_AdminSearch_Nodes_OrganizationSearchResult) GetOrganization } type AdminSearch_AdminSearch_Nodes_OrganizationSettingSearchResult_OrganizationSettings struct { - BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" - BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" - BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" - BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" - DeletedBy *string "json:\"deletedBy,omitempty\" graphql:\"deletedBy\"" - Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" - ID string "json:\"id\" graphql:\"id\"" - OrganizationID *string "json:\"organizationID,omitempty\" graphql:\"organizationID\"" - StripeID *string "json:\"stripeID,omitempty\" graphql:\"stripeID\"" - Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" - TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + BillingAddress *models.Address "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + DeletedBy *string "json:\"deletedBy,omitempty\" graphql:\"deletedBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + ID string "json:\"id\" graphql:\"id\"" + OrganizationID *string "json:\"organizationID,omitempty\" graphql:\"organizationID\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" } -func (t *AdminSearch_AdminSearch_Nodes_OrganizationSettingSearchResult_OrganizationSettings) GetBillingAddress() *string { +func (t *AdminSearch_AdminSearch_Nodes_OrganizationSettingSearchResult_OrganizationSettings) GetBillingAddress() *models.Address { if t == nil { t = &AdminSearch_AdminSearch_Nodes_OrganizationSettingSearchResult_OrganizationSettings{} } @@ -2739,12 +2734,6 @@ func (t *AdminSearch_AdminSearch_Nodes_OrganizationSettingSearchResult_Organizat } return t.OrganizationID } -func (t *AdminSearch_AdminSearch_Nodes_OrganizationSettingSearchResult_OrganizationSettings) GetStripeID() *string { - if t == nil { - t = &AdminSearch_AdminSearch_Nodes_OrganizationSettingSearchResult_OrganizationSettings{} - } - return t.StripeID -} func (t *AdminSearch_AdminSearch_Nodes_OrganizationSettingSearchResult_OrganizationSettings) GetTags() []string { if t == nil { t = &AdminSearch_AdminSearch_Nodes_OrganizationSettingSearchResult_OrganizationSettings{} @@ -23210,23 +23199,22 @@ func (t *CreateBulkOrganization_CreateBulkOrganization) GetOrganizations() []*Cr } type CreateOrganization_CreateOrganization_Organization_Setting struct { - BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" - BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" - BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" - BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" - CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" - CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" - Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" - GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" - ID string "json:\"id\" graphql:\"id\"" - StripeID *string "json:\"stripeID,omitempty\" graphql:\"stripeID\"" - Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" - TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" - UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" - UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" -} - -func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetBillingAddress() *string { + BillingAddress *models.Address "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + ID string "json:\"id\" graphql:\"id\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetBillingAddress() *models.Address { if t == nil { t = &CreateOrganization_CreateOrganization_Organization_Setting{} } @@ -23280,12 +23268,6 @@ func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetID() str } return t.ID } -func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetStripeID() *string { - if t == nil { - t = &CreateOrganization_CreateOrganization_Organization_Setting{} - } - return t.StripeID -} func (t *CreateOrganization_CreateOrganization_Organization_Setting) GetTags() []string { if t == nil { t = &CreateOrganization_CreateOrganization_Organization_Setting{} @@ -23609,23 +23591,22 @@ func (t *GetAllOrganizations_Organizations_Edges_Node_Members) GetUser() *GetAll } type GetAllOrganizations_Organizations_Edges_Node_Setting struct { - BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" - BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" - BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" - BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" - CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" - CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" - Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" - GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" - ID string "json:\"id\" graphql:\"id\"" - StripeID *string "json:\"stripeID,omitempty\" graphql:\"stripeID\"" - Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" - TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" - UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" - UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" -} - -func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetBillingAddress() *string { + BillingAddress *models.Address "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + ID string "json:\"id\" graphql:\"id\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetBillingAddress() *models.Address { if t == nil { t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} } @@ -23679,12 +23660,6 @@ func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetID() string { } return t.ID } -func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetStripeID() *string { - if t == nil { - t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} - } - return t.StripeID -} func (t *GetAllOrganizations_Organizations_Edges_Node_Setting) GetTags() []string { if t == nil { t = &GetAllOrganizations_Organizations_Edges_Node_Setting{} @@ -23943,23 +23918,22 @@ func (t *GetOrganizationByID_Organization_Members) GetUser() *GetOrganizationByI } type GetOrganizationByID_Organization_Setting struct { - BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" - BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" - BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" - BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" - CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" - CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" - Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" - GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" - ID string "json:\"id\" graphql:\"id\"" - StripeID *string "json:\"stripeID,omitempty\" graphql:\"stripeID\"" - Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" - TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" - UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" - UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" -} - -func (t *GetOrganizationByID_Organization_Setting) GetBillingAddress() *string { + BillingAddress *models.Address "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + ID string "json:\"id\" graphql:\"id\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetOrganizationByID_Organization_Setting) GetBillingAddress() *models.Address { if t == nil { t = &GetOrganizationByID_Organization_Setting{} } @@ -24013,12 +23987,6 @@ func (t *GetOrganizationByID_Organization_Setting) GetID() string { } return t.ID } -func (t *GetOrganizationByID_Organization_Setting) GetStripeID() *string { - if t == nil { - t = &GetOrganizationByID_Organization_Setting{} - } - return t.StripeID -} func (t *GetOrganizationByID_Organization_Setting) GetTags() []string { if t == nil { t = &GetOrganizationByID_Organization_Setting{} @@ -24269,23 +24237,22 @@ func (t *GetOrganizations_Organizations_Edges_Node_Members) GetUser() *GetOrgani } type GetOrganizations_Organizations_Edges_Node_Setting struct { - BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" - BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" - BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" - BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" - CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" - CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" - Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" - GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" - ID string "json:\"id\" graphql:\"id\"" - StripeID *string "json:\"stripeID,omitempty\" graphql:\"stripeID\"" - Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" - TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" - UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" - UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" -} - -func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetBillingAddress() *string { + BillingAddress *models.Address "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + ID string "json:\"id\" graphql:\"id\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetBillingAddress() *models.Address { if t == nil { t = &GetOrganizations_Organizations_Edges_Node_Setting{} } @@ -24339,12 +24306,6 @@ func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetID() string { } return t.ID } -func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetStripeID() *string { - if t == nil { - t = &GetOrganizations_Organizations_Edges_Node_Setting{} - } - return t.StripeID -} func (t *GetOrganizations_Organizations_Edges_Node_Setting) GetTags() []string { if t == nil { t = &GetOrganizations_Organizations_Edges_Node_Setting{} @@ -24506,23 +24467,22 @@ func (t *UpdateOrganization_UpdateOrganization_Organization_Members) GetUserID() } type UpdateOrganization_UpdateOrganization_Organization_Setting struct { - BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" - BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" - BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" - BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" - CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" - CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" - Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" - GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" - ID string "json:\"id\" graphql:\"id\"" - StripeID *string "json:\"stripeID,omitempty\" graphql:\"stripeID\"" - Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" - TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" - UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" - UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" -} - -func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetBillingAddress() *string { + BillingAddress *models.Address "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + ID string "json:\"id\" graphql:\"id\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetBillingAddress() *models.Address { if t == nil { t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} } @@ -24576,12 +24536,6 @@ func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetID() str } return t.ID } -func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetStripeID() *string { - if t == nil { - t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} - } - return t.StripeID -} func (t *UpdateOrganization_UpdateOrganization_Organization_Setting) GetTags() []string { if t == nil { t = &UpdateOrganization_UpdateOrganization_Organization_Setting{} @@ -24959,7 +24913,7 @@ func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node_Organization } type GetAllOrganizationSettings_OrganizationSettings_Edges_Node struct { - BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + BillingAddress *models.Address "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" @@ -24969,14 +24923,13 @@ type GetAllOrganizationSettings_OrganizationSettings_Edges_Node struct { GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" ID string "json:\"id\" graphql:\"id\"" Organization *GetAllOrganizationSettings_OrganizationSettings_Edges_Node_Organization "json:\"organization,omitempty\" graphql:\"organization\"" - StripeID *string "json:\"stripeID,omitempty\" graphql:\"stripeID\"" Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" } -func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetBillingAddress() *string { +func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetBillingAddress() *models.Address { if t == nil { t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} } @@ -25036,12 +24989,6 @@ func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetOrganiza } return t.Organization } -func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetStripeID() *string { - if t == nil { - t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} - } - return t.StripeID -} func (t *GetAllOrganizationSettings_OrganizationSettings_Edges_Node) GetTags() []string { if t == nil { t = &GetAllOrganizationSettings_OrganizationSettings_Edges_Node{} @@ -25108,7 +25055,7 @@ func (t *GetOrganizationSettingByID_OrganizationSetting_Organization) GetName() } type GetOrganizationSettingByID_OrganizationSetting struct { - BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + BillingAddress *models.Address "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" @@ -25118,14 +25065,13 @@ type GetOrganizationSettingByID_OrganizationSetting struct { GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" ID string "json:\"id\" graphql:\"id\"" Organization *GetOrganizationSettingByID_OrganizationSetting_Organization "json:\"organization,omitempty\" graphql:\"organization\"" - StripeID *string "json:\"stripeID,omitempty\" graphql:\"stripeID\"" Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" } -func (t *GetOrganizationSettingByID_OrganizationSetting) GetBillingAddress() *string { +func (t *GetOrganizationSettingByID_OrganizationSetting) GetBillingAddress() *models.Address { if t == nil { t = &GetOrganizationSettingByID_OrganizationSetting{} } @@ -25185,12 +25131,6 @@ func (t *GetOrganizationSettingByID_OrganizationSetting) GetOrganization() *GetO } return t.Organization } -func (t *GetOrganizationSettingByID_OrganizationSetting) GetStripeID() *string { - if t == nil { - t = &GetOrganizationSettingByID_OrganizationSetting{} - } - return t.StripeID -} func (t *GetOrganizationSettingByID_OrganizationSetting) GetTags() []string { if t == nil { t = &GetOrganizationSettingByID_OrganizationSetting{} @@ -25235,7 +25175,7 @@ func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node_Organization) G } type GetOrganizationSettings_OrganizationSettings_Edges_Node struct { - BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + BillingAddress *models.Address "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" @@ -25245,14 +25185,13 @@ type GetOrganizationSettings_OrganizationSettings_Edges_Node struct { GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" ID string "json:\"id\" graphql:\"id\"" Organization *GetOrganizationSettings_OrganizationSettings_Edges_Node_Organization "json:\"organization,omitempty\" graphql:\"organization\"" - StripeID *string "json:\"stripeID,omitempty\" graphql:\"stripeID\"" Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" } -func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetBillingAddress() *string { +func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetBillingAddress() *models.Address { if t == nil { t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} } @@ -25312,12 +25251,6 @@ func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetOrganizatio } return t.Organization } -func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetStripeID() *string { - if t == nil { - t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} - } - return t.StripeID -} func (t *GetOrganizationSettings_OrganizationSettings_Edges_Node) GetTags() []string { if t == nil { t = &GetOrganizationSettings_OrganizationSettings_Edges_Node{} @@ -25384,7 +25317,7 @@ func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting } type UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting struct { - BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + BillingAddress *models.Address "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" @@ -25394,14 +25327,13 @@ type UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting str GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" ID string "json:\"id\" graphql:\"id\"" Organization *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting_Organization "json:\"organization,omitempty\" graphql:\"organization\"" - StripeID *string "json:\"stripeID,omitempty\" graphql:\"stripeID\"" Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" } -func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetBillingAddress() *string { +func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetBillingAddress() *models.Address { if t == nil { t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} } @@ -25461,12 +25393,6 @@ func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting } return t.Organization } -func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetStripeID() *string { - if t == nil { - t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} - } - return t.StripeID -} func (t *UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting) GetTags() []string { if t == nil { t = &UpdateOrganizationSetting_UpdateOrganizationSetting_OrganizationSetting{} @@ -25504,26 +25430,26 @@ func (t *UpdateOrganizationSetting_UpdateOrganizationSetting) GetOrganizationSet } type GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node struct { - BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" - BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" - BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" - BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" - CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" - CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" - Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" - GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" - HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" - ID string "json:\"id\" graphql:\"id\"" - Operation history.OpType "json:\"operation\" graphql:\"operation\"" - OrganizationID *string "json:\"organizationID,omitempty\" graphql:\"organizationID\"" - Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" - Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" - TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" - UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" - UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" -} - -func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetBillingAddress() *string { + BillingAddress *models.Address "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OrganizationID *string "json:\"organizationID,omitempty\" graphql:\"organizationID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetBillingAddress() *models.Address { if t == nil { t = &GetAllOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} } @@ -25649,26 +25575,26 @@ func (t *GetAllOrganizationSettingHistories_OrganizationSettingHistories) GetEdg } type GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node struct { - BillingAddress *string "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" - BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" - BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" - BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" - CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" - CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" - Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" - GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" - HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" - ID string "json:\"id\" graphql:\"id\"" - Operation history.OpType "json:\"operation\" graphql:\"operation\"" - OrganizationID *string "json:\"organizationID,omitempty\" graphql:\"organizationID\"" - Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" - Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" - TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" - UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" - UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" -} - -func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetBillingAddress() *string { + BillingAddress *models.Address "json:\"billingAddress,omitempty\" graphql:\"billingAddress\"" + BillingContact *string "json:\"billingContact,omitempty\" graphql:\"billingContact\"" + BillingEmail *string "json:\"billingEmail,omitempty\" graphql:\"billingEmail\"" + BillingPhone *string "json:\"billingPhone,omitempty\" graphql:\"billingPhone\"" + CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" + CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" + Domains []string "json:\"domains,omitempty\" graphql:\"domains\"" + GeoLocation *enums.Region "json:\"geoLocation,omitempty\" graphql:\"geoLocation\"" + HistoryTime time.Time "json:\"historyTime\" graphql:\"historyTime\"" + ID string "json:\"id\" graphql:\"id\"" + Operation history.OpType "json:\"operation\" graphql:\"operation\"" + OrganizationID *string "json:\"organizationID,omitempty\" graphql:\"organizationID\"" + Ref *string "json:\"ref,omitempty\" graphql:\"ref\"" + Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" + TaxIdentifier *string "json:\"taxIdentifier,omitempty\" graphql:\"taxIdentifier\"" + UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" + UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" +} + +func (t *GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node) GetBillingAddress() *models.Address { if t == nil { t = &GetOrganizationSettingHistories_OrganizationSettingHistories_Edges_Node{} } @@ -26282,377 +26208,6 @@ func (t *GetOrgMembershipHistories_OrgMembershipHistories) GetEdges() []*GetOrgM return t.Edges } -type CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions struct { - Active bool "json:\"active\" graphql:\"active\"" - CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" - CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" - ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" - Features []string "json:\"features,omitempty\" graphql:\"features\"" - ID string "json:\"id\" graphql:\"id\"" - OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" - ProductTier *string "json:\"productTier,omitempty\" graphql:\"productTier\"" - StripeCustomerID *string "json:\"stripeCustomerID,omitempty\" graphql:\"stripeCustomerID\"" - StripeProductTierID *string "json:\"stripeProductTierID,omitempty\" graphql:\"stripeProductTierID\"" - StripeSubscriptionID *string "json:\"stripeSubscriptionID,omitempty\" graphql:\"stripeSubscriptionID\"" - StripeSubscriptionStatus *string "json:\"stripeSubscriptionStatus,omitempty\" graphql:\"stripeSubscriptionStatus\"" - Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" - UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" - UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" -} - -func (t *CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions) GetActive() bool { - if t == nil { - t = &CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions{} - } - return t.Active -} -func (t *CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions) GetCreatedAt() *time.Time { - if t == nil { - t = &CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions{} - } - return t.CreatedAt -} -func (t *CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions) GetCreatedBy() *string { - if t == nil { - t = &CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions{} - } - return t.CreatedBy -} -func (t *CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions) GetExpiresAt() *time.Time { - if t == nil { - t = &CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions{} - } - return t.ExpiresAt -} -func (t *CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions) GetFeatures() []string { - if t == nil { - t = &CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions{} - } - return t.Features -} -func (t *CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions) GetID() string { - if t == nil { - t = &CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions{} - } - return t.ID -} -func (t *CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions) GetOwnerID() *string { - if t == nil { - t = &CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions{} - } - return t.OwnerID -} -func (t *CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions) GetProductTier() *string { - if t == nil { - t = &CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions{} - } - return t.ProductTier -} -func (t *CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions) GetStripeCustomerID() *string { - if t == nil { - t = &CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions{} - } - return t.StripeCustomerID -} -func (t *CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions) GetStripeProductTierID() *string { - if t == nil { - t = &CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions{} - } - return t.StripeProductTierID -} -func (t *CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions) GetStripeSubscriptionID() *string { - if t == nil { - t = &CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions{} - } - return t.StripeSubscriptionID -} -func (t *CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions) GetStripeSubscriptionStatus() *string { - if t == nil { - t = &CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions{} - } - return t.StripeSubscriptionStatus -} -func (t *CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions) GetTags() []string { - if t == nil { - t = &CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions{} - } - return t.Tags -} -func (t *CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions) GetUpdatedAt() *time.Time { - if t == nil { - t = &CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions{} - } - return t.UpdatedAt -} -func (t *CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions) GetUpdatedBy() *string { - if t == nil { - t = &CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions{} - } - return t.UpdatedBy -} - -type CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription struct { - OrgSubscriptions []*CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions "json:\"orgSubscriptions,omitempty\" graphql:\"orgSubscriptions\"" -} - -func (t *CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription) GetOrgSubscriptions() []*CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription_OrgSubscriptions { - if t == nil { - t = &CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription{} - } - return t.OrgSubscriptions -} - -type CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions struct { - Active bool "json:\"active\" graphql:\"active\"" - CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" - CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" - ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" - Features []string "json:\"features,omitempty\" graphql:\"features\"" - ID string "json:\"id\" graphql:\"id\"" - OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" - ProductTier *string "json:\"productTier,omitempty\" graphql:\"productTier\"" - StripeCustomerID *string "json:\"stripeCustomerID,omitempty\" graphql:\"stripeCustomerID\"" - StripeProductTierID *string "json:\"stripeProductTierID,omitempty\" graphql:\"stripeProductTierID\"" - StripeSubscriptionID *string "json:\"stripeSubscriptionID,omitempty\" graphql:\"stripeSubscriptionID\"" - StripeSubscriptionStatus *string "json:\"stripeSubscriptionStatus,omitempty\" graphql:\"stripeSubscriptionStatus\"" - Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" - UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" - UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" -} - -func (t *CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions) GetActive() bool { - if t == nil { - t = &CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions{} - } - return t.Active -} -func (t *CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions) GetCreatedAt() *time.Time { - if t == nil { - t = &CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions{} - } - return t.CreatedAt -} -func (t *CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions) GetCreatedBy() *string { - if t == nil { - t = &CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions{} - } - return t.CreatedBy -} -func (t *CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions) GetExpiresAt() *time.Time { - if t == nil { - t = &CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions{} - } - return t.ExpiresAt -} -func (t *CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions) GetFeatures() []string { - if t == nil { - t = &CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions{} - } - return t.Features -} -func (t *CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions) GetID() string { - if t == nil { - t = &CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions{} - } - return t.ID -} -func (t *CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions) GetOwnerID() *string { - if t == nil { - t = &CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions{} - } - return t.OwnerID -} -func (t *CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions) GetProductTier() *string { - if t == nil { - t = &CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions{} - } - return t.ProductTier -} -func (t *CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions) GetStripeCustomerID() *string { - if t == nil { - t = &CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions{} - } - return t.StripeCustomerID -} -func (t *CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions) GetStripeProductTierID() *string { - if t == nil { - t = &CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions{} - } - return t.StripeProductTierID -} -func (t *CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions) GetStripeSubscriptionID() *string { - if t == nil { - t = &CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions{} - } - return t.StripeSubscriptionID -} -func (t *CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions) GetStripeSubscriptionStatus() *string { - if t == nil { - t = &CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions{} - } - return t.StripeSubscriptionStatus -} -func (t *CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions) GetTags() []string { - if t == nil { - t = &CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions{} - } - return t.Tags -} -func (t *CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions) GetUpdatedAt() *time.Time { - if t == nil { - t = &CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions{} - } - return t.UpdatedAt -} -func (t *CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions) GetUpdatedBy() *string { - if t == nil { - t = &CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions{} - } - return t.UpdatedBy -} - -type CreateBulkOrgSubscription_CreateBulkOrgSubscription struct { - OrgSubscriptions []*CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions "json:\"orgSubscriptions,omitempty\" graphql:\"orgSubscriptions\"" -} - -func (t *CreateBulkOrgSubscription_CreateBulkOrgSubscription) GetOrgSubscriptions() []*CreateBulkOrgSubscription_CreateBulkOrgSubscription_OrgSubscriptions { - if t == nil { - t = &CreateBulkOrgSubscription_CreateBulkOrgSubscription{} - } - return t.OrgSubscriptions -} - -type CreateOrgSubscription_CreateOrgSubscription_OrgSubscription struct { - Active bool "json:\"active\" graphql:\"active\"" - CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" - CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" - ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" - Features []string "json:\"features,omitempty\" graphql:\"features\"" - ID string "json:\"id\" graphql:\"id\"" - OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" - ProductTier *string "json:\"productTier,omitempty\" graphql:\"productTier\"" - StripeCustomerID *string "json:\"stripeCustomerID,omitempty\" graphql:\"stripeCustomerID\"" - StripeProductTierID *string "json:\"stripeProductTierID,omitempty\" graphql:\"stripeProductTierID\"" - StripeSubscriptionID *string "json:\"stripeSubscriptionID,omitempty\" graphql:\"stripeSubscriptionID\"" - StripeSubscriptionStatus *string "json:\"stripeSubscriptionStatus,omitempty\" graphql:\"stripeSubscriptionStatus\"" - Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" - UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" - UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" -} - -func (t *CreateOrgSubscription_CreateOrgSubscription_OrgSubscription) GetActive() bool { - if t == nil { - t = &CreateOrgSubscription_CreateOrgSubscription_OrgSubscription{} - } - return t.Active -} -func (t *CreateOrgSubscription_CreateOrgSubscription_OrgSubscription) GetCreatedAt() *time.Time { - if t == nil { - t = &CreateOrgSubscription_CreateOrgSubscription_OrgSubscription{} - } - return t.CreatedAt -} -func (t *CreateOrgSubscription_CreateOrgSubscription_OrgSubscription) GetCreatedBy() *string { - if t == nil { - t = &CreateOrgSubscription_CreateOrgSubscription_OrgSubscription{} - } - return t.CreatedBy -} -func (t *CreateOrgSubscription_CreateOrgSubscription_OrgSubscription) GetExpiresAt() *time.Time { - if t == nil { - t = &CreateOrgSubscription_CreateOrgSubscription_OrgSubscription{} - } - return t.ExpiresAt -} -func (t *CreateOrgSubscription_CreateOrgSubscription_OrgSubscription) GetFeatures() []string { - if t == nil { - t = &CreateOrgSubscription_CreateOrgSubscription_OrgSubscription{} - } - return t.Features -} -func (t *CreateOrgSubscription_CreateOrgSubscription_OrgSubscription) GetID() string { - if t == nil { - t = &CreateOrgSubscription_CreateOrgSubscription_OrgSubscription{} - } - return t.ID -} -func (t *CreateOrgSubscription_CreateOrgSubscription_OrgSubscription) GetOwnerID() *string { - if t == nil { - t = &CreateOrgSubscription_CreateOrgSubscription_OrgSubscription{} - } - return t.OwnerID -} -func (t *CreateOrgSubscription_CreateOrgSubscription_OrgSubscription) GetProductTier() *string { - if t == nil { - t = &CreateOrgSubscription_CreateOrgSubscription_OrgSubscription{} - } - return t.ProductTier -} -func (t *CreateOrgSubscription_CreateOrgSubscription_OrgSubscription) GetStripeCustomerID() *string { - if t == nil { - t = &CreateOrgSubscription_CreateOrgSubscription_OrgSubscription{} - } - return t.StripeCustomerID -} -func (t *CreateOrgSubscription_CreateOrgSubscription_OrgSubscription) GetStripeProductTierID() *string { - if t == nil { - t = &CreateOrgSubscription_CreateOrgSubscription_OrgSubscription{} - } - return t.StripeProductTierID -} -func (t *CreateOrgSubscription_CreateOrgSubscription_OrgSubscription) GetStripeSubscriptionID() *string { - if t == nil { - t = &CreateOrgSubscription_CreateOrgSubscription_OrgSubscription{} - } - return t.StripeSubscriptionID -} -func (t *CreateOrgSubscription_CreateOrgSubscription_OrgSubscription) GetStripeSubscriptionStatus() *string { - if t == nil { - t = &CreateOrgSubscription_CreateOrgSubscription_OrgSubscription{} - } - return t.StripeSubscriptionStatus -} -func (t *CreateOrgSubscription_CreateOrgSubscription_OrgSubscription) GetTags() []string { - if t == nil { - t = &CreateOrgSubscription_CreateOrgSubscription_OrgSubscription{} - } - return t.Tags -} -func (t *CreateOrgSubscription_CreateOrgSubscription_OrgSubscription) GetUpdatedAt() *time.Time { - if t == nil { - t = &CreateOrgSubscription_CreateOrgSubscription_OrgSubscription{} - } - return t.UpdatedAt -} -func (t *CreateOrgSubscription_CreateOrgSubscription_OrgSubscription) GetUpdatedBy() *string { - if t == nil { - t = &CreateOrgSubscription_CreateOrgSubscription_OrgSubscription{} - } - return t.UpdatedBy -} - -type CreateOrgSubscription_CreateOrgSubscription struct { - OrgSubscription CreateOrgSubscription_CreateOrgSubscription_OrgSubscription "json:\"orgSubscription\" graphql:\"orgSubscription\"" -} - -func (t *CreateOrgSubscription_CreateOrgSubscription) GetOrgSubscription() *CreateOrgSubscription_CreateOrgSubscription_OrgSubscription { - if t == nil { - t = &CreateOrgSubscription_CreateOrgSubscription{} - } - return &t.OrgSubscription -} - -type DeleteOrgSubscription_DeleteOrgSubscription struct { - DeletedID string "json:\"deletedID\" graphql:\"deletedID\"" -} - -func (t *DeleteOrgSubscription_DeleteOrgSubscription) GetDeletedID() string { - if t == nil { - t = &DeleteOrgSubscription_DeleteOrgSubscription{} - } - return t.DeletedID -} - type GetAllOrgSubscriptions_OrgSubscriptions_Edges_Node struct { Active bool "json:\"active\" graphql:\"active\"" CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" @@ -27024,126 +26579,6 @@ func (t *GetOrgSubscriptions_OrgSubscriptions) GetEdges() []*GetOrgSubscriptions return t.Edges } -type UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription struct { - Active bool "json:\"active\" graphql:\"active\"" - CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" - CreatedBy *string "json:\"createdBy,omitempty\" graphql:\"createdBy\"" - ExpiresAt *time.Time "json:\"expiresAt,omitempty\" graphql:\"expiresAt\"" - Features []string "json:\"features,omitempty\" graphql:\"features\"" - ID string "json:\"id\" graphql:\"id\"" - OwnerID *string "json:\"ownerID,omitempty\" graphql:\"ownerID\"" - ProductTier *string "json:\"productTier,omitempty\" graphql:\"productTier\"" - StripeCustomerID *string "json:\"stripeCustomerID,omitempty\" graphql:\"stripeCustomerID\"" - StripeProductTierID *string "json:\"stripeProductTierID,omitempty\" graphql:\"stripeProductTierID\"" - StripeSubscriptionID *string "json:\"stripeSubscriptionID,omitempty\" graphql:\"stripeSubscriptionID\"" - StripeSubscriptionStatus *string "json:\"stripeSubscriptionStatus,omitempty\" graphql:\"stripeSubscriptionStatus\"" - Tags []string "json:\"tags,omitempty\" graphql:\"tags\"" - UpdatedAt *time.Time "json:\"updatedAt,omitempty\" graphql:\"updatedAt\"" - UpdatedBy *string "json:\"updatedBy,omitempty\" graphql:\"updatedBy\"" -} - -func (t *UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription) GetActive() bool { - if t == nil { - t = &UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription{} - } - return t.Active -} -func (t *UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription) GetCreatedAt() *time.Time { - if t == nil { - t = &UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription{} - } - return t.CreatedAt -} -func (t *UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription) GetCreatedBy() *string { - if t == nil { - t = &UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription{} - } - return t.CreatedBy -} -func (t *UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription) GetExpiresAt() *time.Time { - if t == nil { - t = &UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription{} - } - return t.ExpiresAt -} -func (t *UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription) GetFeatures() []string { - if t == nil { - t = &UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription{} - } - return t.Features -} -func (t *UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription) GetID() string { - if t == nil { - t = &UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription{} - } - return t.ID -} -func (t *UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription) GetOwnerID() *string { - if t == nil { - t = &UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription{} - } - return t.OwnerID -} -func (t *UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription) GetProductTier() *string { - if t == nil { - t = &UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription{} - } - return t.ProductTier -} -func (t *UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription) GetStripeCustomerID() *string { - if t == nil { - t = &UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription{} - } - return t.StripeCustomerID -} -func (t *UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription) GetStripeProductTierID() *string { - if t == nil { - t = &UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription{} - } - return t.StripeProductTierID -} -func (t *UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription) GetStripeSubscriptionID() *string { - if t == nil { - t = &UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription{} - } - return t.StripeSubscriptionID -} -func (t *UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription) GetStripeSubscriptionStatus() *string { - if t == nil { - t = &UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription{} - } - return t.StripeSubscriptionStatus -} -func (t *UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription) GetTags() []string { - if t == nil { - t = &UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription{} - } - return t.Tags -} -func (t *UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription) GetUpdatedAt() *time.Time { - if t == nil { - t = &UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription{} - } - return t.UpdatedAt -} -func (t *UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription) GetUpdatedBy() *string { - if t == nil { - t = &UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription{} - } - return t.UpdatedBy -} - -type UpdateOrgSubscription_UpdateOrgSubscription struct { - OrgSubscription UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription "json:\"orgSubscription\" graphql:\"orgSubscription\"" -} - -func (t *UpdateOrgSubscription_UpdateOrgSubscription) GetOrgSubscription() *UpdateOrgSubscription_UpdateOrgSubscription_OrgSubscription { - if t == nil { - t = &UpdateOrgSubscription_UpdateOrgSubscription{} - } - return &t.OrgSubscription -} - type GetAllOrgSubscriptionHistories_OrgSubscriptionHistories_Edges_Node struct { Active bool "json:\"active\" graphql:\"active\"" CreatedAt *time.Time "json:\"createdAt,omitempty\" graphql:\"createdAt\"" @@ -47238,50 +46673,6 @@ func (t *GetOrgMembershipHistories) GetOrgMembershipHistories() *GetOrgMembershi return &t.OrgMembershipHistories } -type CreateBulkCSVOrgSubscription struct { - CreateBulkCSVOrgSubscription CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription "json:\"createBulkCSVOrgSubscription\" graphql:\"createBulkCSVOrgSubscription\"" -} - -func (t *CreateBulkCSVOrgSubscription) GetCreateBulkCSVOrgSubscription() *CreateBulkCSVOrgSubscription_CreateBulkCSVOrgSubscription { - if t == nil { - t = &CreateBulkCSVOrgSubscription{} - } - return &t.CreateBulkCSVOrgSubscription -} - -type CreateBulkOrgSubscription struct { - CreateBulkOrgSubscription CreateBulkOrgSubscription_CreateBulkOrgSubscription "json:\"createBulkOrgSubscription\" graphql:\"createBulkOrgSubscription\"" -} - -func (t *CreateBulkOrgSubscription) GetCreateBulkOrgSubscription() *CreateBulkOrgSubscription_CreateBulkOrgSubscription { - if t == nil { - t = &CreateBulkOrgSubscription{} - } - return &t.CreateBulkOrgSubscription -} - -type CreateOrgSubscription struct { - CreateOrgSubscription CreateOrgSubscription_CreateOrgSubscription "json:\"createOrgSubscription\" graphql:\"createOrgSubscription\"" -} - -func (t *CreateOrgSubscription) GetCreateOrgSubscription() *CreateOrgSubscription_CreateOrgSubscription { - if t == nil { - t = &CreateOrgSubscription{} - } - return &t.CreateOrgSubscription -} - -type DeleteOrgSubscription struct { - DeleteOrgSubscription DeleteOrgSubscription_DeleteOrgSubscription "json:\"deleteOrgSubscription\" graphql:\"deleteOrgSubscription\"" -} - -func (t *DeleteOrgSubscription) GetDeleteOrgSubscription() *DeleteOrgSubscription_DeleteOrgSubscription { - if t == nil { - t = &DeleteOrgSubscription{} - } - return &t.DeleteOrgSubscription -} - type GetAllOrgSubscriptions struct { OrgSubscriptions GetAllOrgSubscriptions_OrgSubscriptions "json:\"orgSubscriptions\" graphql:\"orgSubscriptions\"" } @@ -47315,17 +46706,6 @@ func (t *GetOrgSubscriptions) GetOrgSubscriptions() *GetOrgSubscriptions_OrgSubs return &t.OrgSubscriptions } -type UpdateOrgSubscription struct { - UpdateOrgSubscription UpdateOrgSubscription_UpdateOrgSubscription "json:\"updateOrgSubscription\" graphql:\"updateOrgSubscription\"" -} - -func (t *UpdateOrgSubscription) GetUpdateOrgSubscription() *UpdateOrgSubscription_UpdateOrgSubscription { - if t == nil { - t = &UpdateOrgSubscription{} - } - return &t.UpdateOrgSubscription -} - type GetAllOrgSubscriptionHistories struct { OrgSubscriptionHistories GetAllOrgSubscriptionHistories_OrgSubscriptionHistories "json:\"orgSubscriptionHistories\" graphql:\"orgSubscriptionHistories\"" } @@ -49286,7 +48666,6 @@ const AdminSearchDocument = `query AdminSearch ($query: String!) { billingAddress taxIdentifier organizationID - stripeID } } ... on PersonalAccessTokenSearchResult { @@ -55765,7 +55144,6 @@ const CreateOrganizationDocument = `mutation CreateOrganization ($input: CreateO taxIdentifier geoLocation tags - stripeID } parent { id @@ -55874,7 +55252,6 @@ const GetAllOrganizationsDocument = `query GetAllOrganizations { taxIdentifier geoLocation tags - stripeID } createdAt updatedAt @@ -55944,7 +55321,6 @@ const GetOrganizationByIDDocument = `query GetOrganizationByID ($organizationId: taxIdentifier geoLocation tags - stripeID } createdAt createdBy @@ -56018,7 +55394,6 @@ const GetOrganizationsDocument = `query GetOrganizations ($where: OrganizationWh taxIdentifier geoLocation tags - stripeID } createdAt updatedAt @@ -56073,7 +55448,6 @@ const UpdateOrganizationDocument = `mutation UpdateOrganization ($updateOrganiza taxIdentifier geoLocation tags - stripeID } } } @@ -56201,7 +55575,6 @@ const GetAllOrganizationSettingsDocument = `query GetAllOrganizationSettings { id name } - stripeID } } } @@ -56242,7 +55615,6 @@ const GetOrganizationSettingByIDDocument = `query GetOrganizationSettingByID ($o id name } - stripeID } } ` @@ -56285,7 +55657,6 @@ const GetOrganizationSettingsDocument = `query GetOrganizationSettings ($where: id name } - stripeID } } } @@ -56329,7 +55700,6 @@ const UpdateOrganizationSettingDocument = `mutation UpdateOrganizationSetting ($ id name } - stripeID } } } @@ -56692,150 +56062,6 @@ func (c *Client) GetOrgMembershipHistories(ctx context.Context, where *OrgMember return &res, nil } -const CreateBulkCSVOrgSubscriptionDocument = `mutation CreateBulkCSVOrgSubscription ($input: Upload!) { - createBulkCSVOrgSubscription(input: $input) { - orgSubscriptions { - active - createdAt - createdBy - expiresAt - features - id - ownerID - productTier - stripeCustomerID - stripeProductTierID - stripeSubscriptionID - stripeSubscriptionStatus - tags - updatedAt - updatedBy - } - } -} -` - -func (c *Client) CreateBulkCSVOrgSubscription(ctx context.Context, input graphql.Upload, interceptors ...clientv2.RequestInterceptor) (*CreateBulkCSVOrgSubscription, error) { - vars := map[string]any{ - "input": input, - } - - var res CreateBulkCSVOrgSubscription - if err := c.Client.Post(ctx, "CreateBulkCSVOrgSubscription", CreateBulkCSVOrgSubscriptionDocument, &res, vars, interceptors...); err != nil { - if c.Client.ParseDataWhenErrors { - return &res, err - } - - return nil, err - } - - return &res, nil -} - -const CreateBulkOrgSubscriptionDocument = `mutation CreateBulkOrgSubscription ($input: [CreateOrgSubscriptionInput!]) { - createBulkOrgSubscription(input: $input) { - orgSubscriptions { - active - createdAt - createdBy - expiresAt - features - id - ownerID - productTier - stripeCustomerID - stripeProductTierID - stripeSubscriptionID - stripeSubscriptionStatus - tags - updatedAt - updatedBy - } - } -} -` - -func (c *Client) CreateBulkOrgSubscription(ctx context.Context, input []*CreateOrgSubscriptionInput, interceptors ...clientv2.RequestInterceptor) (*CreateBulkOrgSubscription, error) { - vars := map[string]any{ - "input": input, - } - - var res CreateBulkOrgSubscription - if err := c.Client.Post(ctx, "CreateBulkOrgSubscription", CreateBulkOrgSubscriptionDocument, &res, vars, interceptors...); err != nil { - if c.Client.ParseDataWhenErrors { - return &res, err - } - - return nil, err - } - - return &res, nil -} - -const CreateOrgSubscriptionDocument = `mutation CreateOrgSubscription ($input: CreateOrgSubscriptionInput!) { - createOrgSubscription(input: $input) { - orgSubscription { - active - createdAt - createdBy - expiresAt - features - id - ownerID - productTier - stripeCustomerID - stripeProductTierID - stripeSubscriptionID - stripeSubscriptionStatus - tags - updatedAt - updatedBy - } - } -} -` - -func (c *Client) CreateOrgSubscription(ctx context.Context, input CreateOrgSubscriptionInput, interceptors ...clientv2.RequestInterceptor) (*CreateOrgSubscription, error) { - vars := map[string]any{ - "input": input, - } - - var res CreateOrgSubscription - if err := c.Client.Post(ctx, "CreateOrgSubscription", CreateOrgSubscriptionDocument, &res, vars, interceptors...); err != nil { - if c.Client.ParseDataWhenErrors { - return &res, err - } - - return nil, err - } - - return &res, nil -} - -const DeleteOrgSubscriptionDocument = `mutation DeleteOrgSubscription ($deleteOrgSubscriptionId: ID!) { - deleteOrgSubscription(id: $deleteOrgSubscriptionId) { - deletedID - } -} -` - -func (c *Client) DeleteOrgSubscription(ctx context.Context, deleteOrgSubscriptionID string, interceptors ...clientv2.RequestInterceptor) (*DeleteOrgSubscription, error) { - vars := map[string]any{ - "deleteOrgSubscriptionId": deleteOrgSubscriptionID, - } - - var res DeleteOrgSubscription - if err := c.Client.Post(ctx, "DeleteOrgSubscription", DeleteOrgSubscriptionDocument, &res, vars, interceptors...); err != nil { - if c.Client.ParseDataWhenErrors { - return &res, err - } - - return nil, err - } - - return &res, nil -} - const GetAllOrgSubscriptionsDocument = `query GetAllOrgSubscriptions { orgSubscriptions { edges { @@ -56956,47 +56182,6 @@ func (c *Client) GetOrgSubscriptions(ctx context.Context, where *OrgSubscription return &res, nil } -const UpdateOrgSubscriptionDocument = `mutation UpdateOrgSubscription ($updateOrgSubscriptionId: ID!, $input: UpdateOrgSubscriptionInput!) { - updateOrgSubscription(id: $updateOrgSubscriptionId, input: $input) { - orgSubscription { - active - createdAt - createdBy - expiresAt - features - id - ownerID - productTier - stripeCustomerID - stripeProductTierID - stripeSubscriptionID - stripeSubscriptionStatus - tags - updatedAt - updatedBy - } - } -} -` - -func (c *Client) UpdateOrgSubscription(ctx context.Context, updateOrgSubscriptionID string, input UpdateOrgSubscriptionInput, interceptors ...clientv2.RequestInterceptor) (*UpdateOrgSubscription, error) { - vars := map[string]any{ - "updateOrgSubscriptionId": updateOrgSubscriptionID, - "input": input, - } - - var res UpdateOrgSubscription - if err := c.Client.Post(ctx, "UpdateOrgSubscription", UpdateOrgSubscriptionDocument, &res, vars, interceptors...); err != nil { - if c.Client.ParseDataWhenErrors { - return &res, err - } - - return nil, err - } - - return &res, nil -} - const GetAllOrgSubscriptionHistoriesDocument = `query GetAllOrgSubscriptionHistories { orgSubscriptionHistories { edges { @@ -62633,14 +61818,9 @@ var DocumentOperationNames = map[string]string{ UpdateUserRoleInOrgDocument: "UpdateUserRoleInOrg", GetAllOrgMembershipHistoriesDocument: "GetAllOrgMembershipHistories", GetOrgMembershipHistoriesDocument: "GetOrgMembershipHistories", - CreateBulkCSVOrgSubscriptionDocument: "CreateBulkCSVOrgSubscription", - CreateBulkOrgSubscriptionDocument: "CreateBulkOrgSubscription", - CreateOrgSubscriptionDocument: "CreateOrgSubscription", - DeleteOrgSubscriptionDocument: "DeleteOrgSubscription", GetAllOrgSubscriptionsDocument: "GetAllOrgSubscriptions", GetOrgSubscriptionByIDDocument: "GetOrgSubscriptionByID", GetOrgSubscriptionsDocument: "GetOrgSubscriptions", - UpdateOrgSubscriptionDocument: "UpdateOrgSubscription", GetAllOrgSubscriptionHistoriesDocument: "GetAllOrgSubscriptionHistories", GetOrgSubscriptionHistoriesDocument: "GetOrgSubscriptionHistories", CreateBulkCSVPersonalAccessTokenDocument: "CreateBulkCSVPersonalAccessToken", diff --git a/pkg/openlaneclient/models.go b/pkg/openlaneclient/models.go index 99af5526..fd3bd13d 100644 --- a/pkg/openlaneclient/models.go +++ b/pkg/openlaneclient/models.go @@ -10,6 +10,7 @@ import ( "time" "github.com/theopenlane/core/pkg/enums" + "github.com/theopenlane/core/pkg/models" "github.com/theopenlane/entx/history" ) @@ -3512,30 +3513,6 @@ type CreateOrgMembershipInput struct { EventIDs []string `json:"eventIDs,omitempty"` } -// CreateOrgSubscriptionInput is used for create OrgSubscription object. -// Input was generated by ent. -type CreateOrgSubscriptionInput struct { - // tags associated with the object - Tags []string `json:"tags,omitempty"` - // the stripe subscription id - StripeSubscriptionID *string `json:"stripeSubscriptionID,omitempty"` - // the common name of the product tier the subscription is associated with, e.g. starter tier - ProductTier *string `json:"productTier,omitempty"` - // the product id that represents the tier in stripe - StripeProductTierID *string `json:"stripeProductTierID,omitempty"` - // the status of the subscription in stripe -- see https://docs.stripe.com/api/subscriptions/object#subscription_object-status - StripeSubscriptionStatus *string `json:"stripeSubscriptionStatus,omitempty"` - // indicates if the subscription is active - Active *bool `json:"active,omitempty"` - // the customer ID the subscription is associated to - StripeCustomerID *string `json:"stripeCustomerID,omitempty"` - // the time the subscription is set to expire; only populated if subscription is cancelled - ExpiresAt *time.Time `json:"expiresAt,omitempty"` - // the features associated with the subscription - Features []string `json:"features,omitempty"` - OwnerID *string `json:"ownerID,omitempty"` -} - // CreateOrganizationInput is used for create Organization object. // Input was generated by ent. type CreateOrganizationInput struct { @@ -3606,16 +3583,14 @@ type CreateOrganizationSettingInput struct { BillingEmail *string `json:"billingEmail,omitempty"` // Phone number to contact for billing BillingPhone *string `json:"billingPhone,omitempty"` - // Address to send billing information to - BillingAddress *string `json:"billingAddress,omitempty"` + // the billing address to send billing information to + BillingAddress *models.Address `json:"billingAddress,omitempty"` // Usually government-issued tax ID or business ID such as ABN in Australia TaxIdentifier *string `json:"taxIdentifier,omitempty"` // geographical location of the organization - GeoLocation *enums.Region `json:"geoLocation,omitempty"` - // the ID of the stripe customer associated with the organization - StripeID *string `json:"stripeID,omitempty"` - OrganizationID *string `json:"organizationID,omitempty"` - FileIDs []string `json:"fileIDs,omitempty"` + GeoLocation *enums.Region `json:"geoLocation,omitempty"` + OrganizationID *string `json:"organizationID,omitempty"` + FileIDs []string `json:"fileIDs,omitempty"` } // CreatePersonalAccessTokenInput is used for create PersonalAccessToken object. @@ -11055,18 +11030,13 @@ type OrgSubscription struct { // the time the subscription is set to expire; only populated if subscription is cancelled ExpiresAt *time.Time `json:"expiresAt,omitempty"` // the features associated with the subscription - Features []string `json:"features,omitempty"` - Owner *Organization `json:"owner,omitempty"` + Features []string `json:"features,omitempty"` + Owner *Organization `json:"owner,omitempty"` + SubscriptionURL *string `json:"subscriptionURL,omitempty"` } func (OrgSubscription) IsNode() {} -// Return response for createBulkOrgSubscription mutation -type OrgSubscriptionBulkCreatePayload struct { - // Created orgSubscriptions - OrgSubscriptions []*OrgSubscription `json:"orgSubscriptions,omitempty"` -} - // A connection to a list of items. type OrgSubscriptionConnection struct { // A list of edges. @@ -11077,18 +11047,6 @@ type OrgSubscriptionConnection struct { TotalCount int64 `json:"totalCount"` } -// Return response for createOrgSubscription mutation -type OrgSubscriptionCreatePayload struct { - // Created orgSubscription - OrgSubscription *OrgSubscription `json:"orgSubscription"` -} - -// Return response for deleteOrgSubscription mutation -type OrgSubscriptionDeletePayload struct { - // Deleted orgSubscription ID - DeletedID string `json:"deletedID"` -} - // An edge in a connection. type OrgSubscriptionEdge struct { // The item at the end of the edge. @@ -11396,12 +11354,6 @@ type OrgSubscriptionSearchResult struct { func (OrgSubscriptionSearchResult) IsSearchResult() {} -// Return response for updateOrgSubscription mutation -type OrgSubscriptionUpdatePayload struct { - // Updated orgSubscription - OrgSubscription *OrgSubscription `json:"orgSubscription"` -} - // OrgSubscriptionWhereInput is used for filtering OrgSubscription objects. // Input was generated by ent. type OrgSubscriptionWhereInput struct { @@ -11993,18 +11945,16 @@ type OrganizationSetting struct { BillingEmail *string `json:"billingEmail,omitempty"` // Phone number to contact for billing BillingPhone *string `json:"billingPhone,omitempty"` - // Address to send billing information to - BillingAddress *string `json:"billingAddress,omitempty"` + // the billing address to send billing information to + BillingAddress *models.Address `json:"billingAddress,omitempty"` // Usually government-issued tax ID or business ID such as ABN in Australia TaxIdentifier *string `json:"taxIdentifier,omitempty"` // geographical location of the organization GeoLocation *enums.Region `json:"geoLocation,omitempty"` // the ID of the organization the settings belong to - OrganizationID *string `json:"organizationID,omitempty"` - // the ID of the stripe customer associated with the organization - StripeID *string `json:"stripeID,omitempty"` - Organization *Organization `json:"organization,omitempty"` - Files []*File `json:"files,omitempty"` + OrganizationID *string `json:"organizationID,omitempty"` + Organization *Organization `json:"organization,omitempty"` + Files []*File `json:"files,omitempty"` } func (OrganizationSetting) IsNode() {} @@ -12066,16 +12016,14 @@ type OrganizationSettingHistory struct { BillingEmail *string `json:"billingEmail,omitempty"` // Phone number to contact for billing BillingPhone *string `json:"billingPhone,omitempty"` - // Address to send billing information to - BillingAddress *string `json:"billingAddress,omitempty"` + // the billing address to send billing information to + BillingAddress *models.Address `json:"billingAddress,omitempty"` // Usually government-issued tax ID or business ID such as ABN in Australia TaxIdentifier *string `json:"taxIdentifier,omitempty"` // geographical location of the organization GeoLocation *enums.Region `json:"geoLocation,omitempty"` // the ID of the organization the settings belong to OrganizationID *string `json:"organizationID,omitempty"` - // the ID of the stripe customer associated with the organization - StripeID *string `json:"stripeID,omitempty"` } func (OrganizationSettingHistory) IsNode() {} @@ -12274,22 +12222,6 @@ type OrganizationSettingHistoryWhereInput struct { BillingPhoneNotNil *bool `json:"billingPhoneNotNil,omitempty"` BillingPhoneEqualFold *string `json:"billingPhoneEqualFold,omitempty"` BillingPhoneContainsFold *string `json:"billingPhoneContainsFold,omitempty"` - // billing_address field predicates - BillingAddress *string `json:"billingAddress,omitempty"` - BillingAddressNeq *string `json:"billingAddressNEQ,omitempty"` - BillingAddressIn []string `json:"billingAddressIn,omitempty"` - BillingAddressNotIn []string `json:"billingAddressNotIn,omitempty"` - BillingAddressGt *string `json:"billingAddressGT,omitempty"` - BillingAddressGte *string `json:"billingAddressGTE,omitempty"` - BillingAddressLt *string `json:"billingAddressLT,omitempty"` - BillingAddressLte *string `json:"billingAddressLTE,omitempty"` - BillingAddressContains *string `json:"billingAddressContains,omitempty"` - BillingAddressHasPrefix *string `json:"billingAddressHasPrefix,omitempty"` - BillingAddressHasSuffix *string `json:"billingAddressHasSuffix,omitempty"` - BillingAddressIsNil *bool `json:"billingAddressIsNil,omitempty"` - BillingAddressNotNil *bool `json:"billingAddressNotNil,omitempty"` - BillingAddressEqualFold *string `json:"billingAddressEqualFold,omitempty"` - BillingAddressContainsFold *string `json:"billingAddressContainsFold,omitempty"` // tax_identifier field predicates TaxIdentifier *string `json:"taxIdentifier,omitempty"` TaxIdentifierNeq *string `json:"taxIdentifierNEQ,omitempty"` @@ -12329,22 +12261,6 @@ type OrganizationSettingHistoryWhereInput struct { OrganizationIDNotNil *bool `json:"organizationIDNotNil,omitempty"` OrganizationIDEqualFold *string `json:"organizationIDEqualFold,omitempty"` OrganizationIDContainsFold *string `json:"organizationIDContainsFold,omitempty"` - // stripe_id field predicates - StripeID *string `json:"stripeID,omitempty"` - StripeIdneq *string `json:"stripeIDNEQ,omitempty"` - StripeIDIn []string `json:"stripeIDIn,omitempty"` - StripeIDNotIn []string `json:"stripeIDNotIn,omitempty"` - StripeIdgt *string `json:"stripeIDGT,omitempty"` - StripeIdgte *string `json:"stripeIDGTE,omitempty"` - StripeIdlt *string `json:"stripeIDLT,omitempty"` - StripeIdlte *string `json:"stripeIDLTE,omitempty"` - StripeIDContains *string `json:"stripeIDContains,omitempty"` - StripeIDHasPrefix *string `json:"stripeIDHasPrefix,omitempty"` - StripeIDHasSuffix *string `json:"stripeIDHasSuffix,omitempty"` - StripeIDIsNil *bool `json:"stripeIDIsNil,omitempty"` - StripeIDNotNil *bool `json:"stripeIDNotNil,omitempty"` - StripeIDEqualFold *string `json:"stripeIDEqualFold,omitempty"` - StripeIDContainsFold *string `json:"stripeIDContainsFold,omitempty"` } type OrganizationSettingSearchResult struct { @@ -12505,22 +12421,6 @@ type OrganizationSettingWhereInput struct { BillingPhoneNotNil *bool `json:"billingPhoneNotNil,omitempty"` BillingPhoneEqualFold *string `json:"billingPhoneEqualFold,omitempty"` BillingPhoneContainsFold *string `json:"billingPhoneContainsFold,omitempty"` - // billing_address field predicates - BillingAddress *string `json:"billingAddress,omitempty"` - BillingAddressNeq *string `json:"billingAddressNEQ,omitempty"` - BillingAddressIn []string `json:"billingAddressIn,omitempty"` - BillingAddressNotIn []string `json:"billingAddressNotIn,omitempty"` - BillingAddressGt *string `json:"billingAddressGT,omitempty"` - BillingAddressGte *string `json:"billingAddressGTE,omitempty"` - BillingAddressLt *string `json:"billingAddressLT,omitempty"` - BillingAddressLte *string `json:"billingAddressLTE,omitempty"` - BillingAddressContains *string `json:"billingAddressContains,omitempty"` - BillingAddressHasPrefix *string `json:"billingAddressHasPrefix,omitempty"` - BillingAddressHasSuffix *string `json:"billingAddressHasSuffix,omitempty"` - BillingAddressIsNil *bool `json:"billingAddressIsNil,omitempty"` - BillingAddressNotNil *bool `json:"billingAddressNotNil,omitempty"` - BillingAddressEqualFold *string `json:"billingAddressEqualFold,omitempty"` - BillingAddressContainsFold *string `json:"billingAddressContainsFold,omitempty"` // tax_identifier field predicates TaxIdentifier *string `json:"taxIdentifier,omitempty"` TaxIdentifierNeq *string `json:"taxIdentifierNEQ,omitempty"` @@ -12560,22 +12460,6 @@ type OrganizationSettingWhereInput struct { OrganizationIDNotNil *bool `json:"organizationIDNotNil,omitempty"` OrganizationIDEqualFold *string `json:"organizationIDEqualFold,omitempty"` OrganizationIDContainsFold *string `json:"organizationIDContainsFold,omitempty"` - // stripe_id field predicates - StripeID *string `json:"stripeID,omitempty"` - StripeIdneq *string `json:"stripeIDNEQ,omitempty"` - StripeIDIn []string `json:"stripeIDIn,omitempty"` - StripeIDNotIn []string `json:"stripeIDNotIn,omitempty"` - StripeIdgt *string `json:"stripeIDGT,omitempty"` - StripeIdgte *string `json:"stripeIDGTE,omitempty"` - StripeIdlt *string `json:"stripeIDLT,omitempty"` - StripeIdlte *string `json:"stripeIDLTE,omitempty"` - StripeIDContains *string `json:"stripeIDContains,omitempty"` - StripeIDHasPrefix *string `json:"stripeIDHasPrefix,omitempty"` - StripeIDHasSuffix *string `json:"stripeIDHasSuffix,omitempty"` - StripeIDIsNil *bool `json:"stripeIDIsNil,omitempty"` - StripeIDNotNil *bool `json:"stripeIDNotNil,omitempty"` - StripeIDEqualFold *string `json:"stripeIDEqualFold,omitempty"` - StripeIDContainsFold *string `json:"stripeIDContainsFold,omitempty"` // organization edge predicates HasOrganization *bool `json:"hasOrganization,omitempty"` HasOrganizationWith []*OrganizationWhereInput `json:"hasOrganizationWith,omitempty"` @@ -19236,41 +19120,6 @@ type UpdateOrgMembershipInput struct { ClearEvents *bool `json:"clearEvents,omitempty"` } -// UpdateOrgSubscriptionInput is used for update OrgSubscription object. -// Input was generated by ent. -type UpdateOrgSubscriptionInput struct { - // tags associated with the object - Tags []string `json:"tags,omitempty"` - AppendTags []string `json:"appendTags,omitempty"` - ClearTags *bool `json:"clearTags,omitempty"` - // the stripe subscription id - StripeSubscriptionID *string `json:"stripeSubscriptionID,omitempty"` - ClearStripeSubscriptionID *bool `json:"clearStripeSubscriptionID,omitempty"` - // the common name of the product tier the subscription is associated with, e.g. starter tier - ProductTier *string `json:"productTier,omitempty"` - ClearProductTier *bool `json:"clearProductTier,omitempty"` - // the product id that represents the tier in stripe - StripeProductTierID *string `json:"stripeProductTierID,omitempty"` - ClearStripeProductTierID *bool `json:"clearStripeProductTierID,omitempty"` - // the status of the subscription in stripe -- see https://docs.stripe.com/api/subscriptions/object#subscription_object-status - StripeSubscriptionStatus *string `json:"stripeSubscriptionStatus,omitempty"` - ClearStripeSubscriptionStatus *bool `json:"clearStripeSubscriptionStatus,omitempty"` - // indicates if the subscription is active - Active *bool `json:"active,omitempty"` - // the customer ID the subscription is associated to - StripeCustomerID *string `json:"stripeCustomerID,omitempty"` - ClearStripeCustomerID *bool `json:"clearStripeCustomerID,omitempty"` - // the time the subscription is set to expire; only populated if subscription is cancelled - ExpiresAt *time.Time `json:"expiresAt,omitempty"` - ClearExpiresAt *bool `json:"clearExpiresAt,omitempty"` - // the features associated with the subscription - Features []string `json:"features,omitempty"` - AppendFeatures []string `json:"appendFeatures,omitempty"` - ClearFeatures *bool `json:"clearFeatures,omitempty"` - OwnerID *string `json:"ownerID,omitempty"` - ClearOwner *bool `json:"clearOwner,omitempty"` -} - // UpdateOrganizationInput is used for update Organization object. // Input was generated by ent. type UpdateOrganizationInput struct { @@ -19419,23 +19268,20 @@ type UpdateOrganizationSettingInput struct { // Phone number to contact for billing BillingPhone *string `json:"billingPhone,omitempty"` ClearBillingPhone *bool `json:"clearBillingPhone,omitempty"` - // Address to send billing information to - BillingAddress *string `json:"billingAddress,omitempty"` - ClearBillingAddress *bool `json:"clearBillingAddress,omitempty"` + // the billing address to send billing information to + BillingAddress *models.Address `json:"billingAddress,omitempty"` + ClearBillingAddress *bool `json:"clearBillingAddress,omitempty"` // Usually government-issued tax ID or business ID such as ABN in Australia TaxIdentifier *string `json:"taxIdentifier,omitempty"` ClearTaxIdentifier *bool `json:"clearTaxIdentifier,omitempty"` // geographical location of the organization - GeoLocation *enums.Region `json:"geoLocation,omitempty"` - ClearGeoLocation *bool `json:"clearGeoLocation,omitempty"` - // the ID of the stripe customer associated with the organization - StripeID *string `json:"stripeID,omitempty"` - ClearStripeID *bool `json:"clearStripeID,omitempty"` - OrganizationID *string `json:"organizationID,omitempty"` - ClearOrganization *bool `json:"clearOrganization,omitempty"` - AddFileIDs []string `json:"addFileIDs,omitempty"` - RemoveFileIDs []string `json:"removeFileIDs,omitempty"` - ClearFiles *bool `json:"clearFiles,omitempty"` + GeoLocation *enums.Region `json:"geoLocation,omitempty"` + ClearGeoLocation *bool `json:"clearGeoLocation,omitempty"` + OrganizationID *string `json:"organizationID,omitempty"` + ClearOrganization *bool `json:"clearOrganization,omitempty"` + AddFileIDs []string `json:"addFileIDs,omitempty"` + RemoveFileIDs []string `json:"removeFileIDs,omitempty"` + ClearFiles *bool `json:"clearFiles,omitempty"` } // UpdatePersonalAccessTokenInput is used for update PersonalAccessToken object.