Skip to content

Open source AI coding agent. Designed for large projects and real world tasks.

move stripe-related code out of core repo

Dane Schneider79306f46abfb
diff --git a/app/server/db/db.go b/app/server/db/db.go
index 9b94b7d2..d43aeddd 100644
--- a/app/server/db/db.go
+++ b/app/server/db/db.go
@@ -86,7 +86,7 @@ func migrationsUp(dir string) error {
// Uncomment below (and update migration version) to reset migration state to a specific version after a failure
// if os.Getenv("GOENV") == "development" {
- // migrateVersion := 2024041500
+ // migrateVersion := 2024060700
// if err := m.Force(migrateVersion); err != nil {
// return fmt.Errorf("error forcing migration version: %v", err)
// }
diff --git a/app/server/go.mod b/app/server/go.mod
index 1f7fc05c..9d1ec75a 100644
--- a/app/server/go.mod
+++ b/app/server/go.mod
@@ -40,7 +40,6 @@ require (
github.com/jmoiron/sqlx v1.4.0
github.com/lib/pq v1.10.9
github.com/smacker/go-tree-sitter v0.0.0-20240625050157-a31a98a7c0f6
- github.com/stripe/stripe-go/v79 v79.7.0
)
replace github.com/plandex/plandex/shared => ../shared
diff --git a/app/server/go.sum b/app/server/go.sum
index aa46bd80..af0d3f6f 100644
--- a/app/server/go.sum
+++ b/app/server/go.sum
@@ -91,13 +91,10 @@ github.com/smacker/go-tree-sitter v0.0.0-20240625050157-a31a98a7c0f6 h1:mtD4ESyO
github.com/smacker/go-tree-sitter v0.0.0-20240625050157-a31a98a7c0f6/go.mod h1:q99oHDsbP0xRwmn7Vmob8gbSMNyvJ83OauXPSuHQuKE=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
-github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.4/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
-github.com/stripe/stripe-go/v79 v79.7.0 h1:6oRLRWVvkDObiiSLc0PJZz5zxyMIRj/f9dqs9dn1LB4=
-github.com/stripe/stripe-go/v79 v79.7.0/go.mod h1:cuH6X0zC8peY6f1AubHwgJ/fJSn2dh5pfiCr6CjyKVU=
github.com/tadvi/systray v0.0.0-20190226123456-11a2b8fa57af h1:6yITBqGTE2lEeTPG04SN9W+iWHCRyHqlVYILiSXziwk=
github.com/tadvi/systray v0.0.0-20190226123456-11a2b8fa57af/go.mod h1:4F09kP5F+am0jAwlQLddpoMDM+iewkxxt6nxUQ5nq5o=
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
@@ -106,20 +103,12 @@ golang.org/x/image v0.18.0 h1:jGzIakQa/ZXI1I0Fxvaa9W7yP25TqT6cHIHn+6CqvSQ=
golang.org/x/image v0.18.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E=
golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU=
golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
-golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
-golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
-golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
-golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
-golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.10.0 h1:tvDr/iQoUqNdohiYm0LmmKcBk+q86lb9EprIUFhHHGg=
golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
diff --git a/app/server/migrations/2024060700_add_stripe_customer_id_to_orgs.down.sql b/app/server/migrations/2024060700_add_stripe_customer_id_to_orgs.down.sql
deleted file mode 100644
index 44277e7a..00000000
--- a/app/server/migrations/2024060700_add_stripe_customer_id_to_orgs.down.sql
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE orgs DROP COLUMN stripe_customer_id;
\ No newline at end of file
diff --git a/app/server/migrations/2024060700_add_stripe_customer_id_to_orgs.up.sql b/app/server/migrations/2024060700_add_stripe_customer_id_to_orgs.up.sql
deleted file mode 100644
index f0135d49..00000000
--- a/app/server/migrations/2024060700_add_stripe_customer_id_to_orgs.up.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-ALTER TABLE orgs ADD COLUMN stripe_customer_id VARCHAR(255);
-CREATE UNIQUE INDEX orgs_stripe_customer_id_idx ON orgs(stripe_customer_id);
\ No newline at end of file
diff --git a/app/server/migrations/2024062000_subscription_plans.down.sql b/app/server/migrations/2024062000_subscription_plans.down.sql
deleted file mode 100644
index 7767df81..00000000
--- a/app/server/migrations/2024062000_subscription_plans.down.sql
+++ /dev/null
@@ -1 +0,0 @@
-DROP IF TABLE EXISTS subscription_plans;
\ No newline at end of file
diff --git a/app/server/migrations/2024062000_subscription_plans.up.sql b/app/server/migrations/2024062000_subscription_plans.up.sql
deleted file mode 100644
index be748730..00000000
--- a/app/server/migrations/2024062000_subscription_plans.up.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-CREATE TABLE IF NOT EXISTS subscription_plans (
- id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
- stripe_price_id VARCHAR(255) NOT NULL,
- name VARCHAR(255) NOT NULL,
- created_at TIMESTAMP NOT NULL DEFAULT NOW()
-);
-
-CREATE UNIQUE INDEX subscription_plans_stripe_id_idx ON subscription_plans(stripe_price_id);
\ No newline at end of file
diff --git a/app/server/migrations/2024062100_subscriptions.down.sql b/app/server/migrations/2024062100_subscriptions.down.sql
deleted file mode 100644
index 1145dca2..00000000
--- a/app/server/migrations/2024062100_subscriptions.down.sql
+++ /dev/null
@@ -1 +0,0 @@
-DROP TABLE IF EXISTS subscriptions;
\ No newline at end of file
diff --git a/app/server/migrations/2024062100_subscriptions.up.sql b/app/server/migrations/2024062100_subscriptions.up.sql
deleted file mode 100644
index cd4b8d98..00000000
--- a/app/server/migrations/2024062100_subscriptions.up.sql
+++ /dev/null
@@ -1,11 +0,0 @@
-CREATE TABLE IF NOT EXISTS subscriptions (
- id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
- stripe_subscription_id VARCHAR(255) NOT NULL,
- subscription_plan_id UUID NOT NULL REFERENCES subscription_plans(id),
- org_id UUID NOT NULL REFERENCES orgs(id),
- status VARCHAR(255) NOT NULL,
- created_at TIMESTAMP NOT NULL DEFAULT NOW(),
- updated_at TIMESTAMP NOT NULL DEFAULT NOW()
-);
-CREATE UNIQUE INDEX subscriptions_stripe_subscription_id_idx ON subscriptions(stripe_subscription_id);
-CREATE TRIGGER update_subscriptions_modtime BEFORE UPDATE ON subscriptions FOR EACH ROW EXECUTE FUNCTION update_updated_at_column();
\ No newline at end of file
diff --git a/app/server/setup/setup.go b/app/server/setup/setup.go
index 8bdc1bca..2916893c 100644
--- a/app/server/setup/setup.go
+++ b/app/server/setup/setup.go
@@ -33,6 +33,7 @@ func MustInitDb() {
if err != nil {
log.Fatal("Error running migrations: ", err)
}
+
}
func StartServer(r *mux.Router) {