Skip to content

Commit 16f5d72

Browse files
committed
renamed clients to organizations
1 parent 01c4807 commit 16f5d72

File tree

154 files changed

+2962
-2816
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+2962
-2816
lines changed

alembic/versions/494b702c2db7_initial_build.py

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
def upgrade() -> None:
2626
# ### commands auto generated by Alembic - please adjust! ###
2727
op.create_table(
28-
"client",
28+
"organization",
2929
sa.Column("id", UUIDType(binary=False), nullable=False),
3030
sa.Column("slug", sa.String(length=64), nullable=False),
3131
sa.Column("title", sa.String(length=255), nullable=False),
@@ -36,9 +36,9 @@ def upgrade() -> None:
3636
sa.PrimaryKeyConstraint("id"),
3737
mysql_engine="InnoDB",
3838
)
39-
op.create_index(op.f("ix_client_id"), "client", ["id"], unique=True)
40-
op.create_index(op.f("ix_client_slug"), "client", ["slug"], unique=True)
41-
op.create_index(op.f("ix_client_title"), "client", ["title"], unique=True)
39+
op.create_index(op.f("ix_organization_id"), "organization", ["id"], unique=True)
40+
op.create_index(op.f("ix_organization_slug"), "organization", ["slug"], unique=True)
41+
op.create_index(op.f("ix_organization_title"), "organization", ["title"], unique=True)
4242
op.create_table(
4343
"geocoord",
4444
sa.Column("id", UUIDType(binary=False), nullable=False),
@@ -100,78 +100,78 @@ def upgrade() -> None:
100100
)
101101
op.create_index(op.f("ix_website_id"), "website", ["id"], unique=True)
102102
op.create_table(
103-
"client_platform",
103+
"organization_platform",
104104
sa.Column("id", UUIDType(binary=False), nullable=False),
105-
sa.Column("client_id", UUIDType(binary=False), nullable=False),
105+
sa.Column("organization_id", UUIDType(binary=False), nullable=False),
106106
sa.Column("platform_id", UUIDType(binary=False), nullable=False),
107107
sa.Column("created", sa.DateTime(), nullable=False),
108108
sa.Column("updated", sa.DateTime(), nullable=False),
109109
sa.ForeignKeyConstraint(
110-
["client_id"],
111-
["client.id"],
110+
["organization_id"],
111+
["organization.id"],
112112
),
113113
sa.ForeignKeyConstraint(
114114
["platform_id"],
115115
["platform.id"],
116116
),
117-
sa.PrimaryKeyConstraint("client_id", "platform_id"),
117+
sa.PrimaryKeyConstraint("organization_id", "platform_id"),
118118
)
119119
op.create_index(
120-
op.f("ix_client_platform_id"), "client_platform", ["id"], unique=True
120+
op.f("ix_organization_platform_id"), "organization_platform", ["id"], unique=True
121121
)
122122
op.create_table(
123-
"client_styleguide",
123+
"organization_styleguide",
124124
sa.Column("id", UUIDType(binary=False), nullable=False),
125125
sa.Column("title", sa.String(length=255), nullable=False),
126126
sa.Column("description", sa.String(length=5000), nullable=True),
127127
sa.Column("styleguide", JSONType(), nullable=True),
128128
sa.Column("url", sa.String(length=2048), nullable=True),
129129
sa.Column("is_active", sa.Boolean(), nullable=False),
130-
sa.Column("client_id", UUIDType(binary=False), nullable=False),
130+
sa.Column("organization_id", UUIDType(binary=False), nullable=False),
131131
sa.Column("created", sa.DateTime(), nullable=False),
132132
sa.Column("updated", sa.DateTime(), nullable=False),
133133
sa.ForeignKeyConstraint(
134-
["client_id"],
135-
["client.id"],
134+
["organization_id"],
135+
["organization.id"],
136136
),
137137
sa.PrimaryKeyConstraint("id"),
138138
mysql_engine="InnoDB",
139139
)
140140
op.create_index(
141-
op.f("ix_client_styleguide_id"), "client_styleguide", ["id"], unique=True
141+
op.f("ix_organization_styleguide_id"), "organization_styleguide", ["id"], unique=True
142142
)
143143
op.create_index(
144-
op.f("ix_client_styleguide_title"), "client_styleguide", ["title"], unique=True
144+
op.f("ix_organization_styleguide_title"), "organization_styleguide", ["title"], unique=True
145145
)
146146
op.create_table(
147-
"client_website",
147+
"organization_website",
148148
sa.Column("id", UUIDType(binary=False), nullable=False),
149-
sa.Column("client_id", UUIDType(binary=False), nullable=False),
149+
sa.Column("organization_id", UUIDType(binary=False), nullable=False),
150150
sa.Column("website_id", UUIDType(binary=False), nullable=False),
151151
sa.Column("created", sa.DateTime(), nullable=False),
152152
sa.Column("updated", sa.DateTime(), nullable=False),
153153
sa.ForeignKeyConstraint(
154-
["client_id"],
155-
["client.id"],
154+
["organization_id"],
155+
["organization.id"],
156156
),
157157
sa.ForeignKeyConstraint(
158158
["website_id"],
159159
["website.id"],
160160
),
161-
sa.PrimaryKeyConstraint("client_id", "website_id"),
161+
sa.PrimaryKeyConstraint("organization_id", "website_id"),
162162
)
163-
op.create_index(op.f("ix_client_website_id"), "client_website", ["id"], unique=True)
163+
op.create_index(op.f("ix_organization_website_id"), "organization_website", ["id"], unique=True)
164164
op.create_table(
165165
"gcft",
166166
sa.Column("id", UUIDType(binary=False), nullable=False),
167167
sa.Column("group_name", sa.String(length=255), nullable=False),
168168
sa.Column("group_slug", sa.String(length=16), nullable=False),
169-
sa.Column("client_id", UUIDType(binary=False), nullable=False),
169+
sa.Column("organization_id", UUIDType(binary=False), nullable=False),
170170
sa.Column("created", sa.DateTime(), nullable=False),
171171
sa.Column("updated", sa.DateTime(), nullable=False),
172172
sa.ForeignKeyConstraint(
173-
["client_id"],
174-
["client.id"],
173+
["organization_id"],
174+
["organization.id"],
175175
),
176176
sa.PrimaryKeyConstraint("id"),
177177
mysql_engine="InnoDB",
@@ -185,12 +185,12 @@ def upgrade() -> None:
185185
sa.Column("title", sa.String(length=255), nullable=False),
186186
sa.Column("property_id", sa.String(length=16), nullable=False),
187187
sa.Column("platform_id", UUIDType(binary=False), nullable=False),
188-
sa.Column("client_id", UUIDType(binary=False), nullable=False),
188+
sa.Column("organization_id", UUIDType(binary=False), nullable=False),
189189
sa.Column("created", sa.DateTime(), nullable=False),
190190
sa.Column("updated", sa.DateTime(), nullable=False),
191191
sa.ForeignKeyConstraint(
192-
["client_id"],
193-
["client.id"],
192+
["organization_id"],
193+
["organization.id"],
194194
),
195195
sa.ForeignKeyConstraint(
196196
["platform_id"],
@@ -208,12 +208,12 @@ def upgrade() -> None:
208208
sa.Column("title", sa.String(length=255), nullable=False),
209209
sa.Column("measurement_id", sa.String(length=16), nullable=False),
210210
sa.Column("platform_id", UUIDType(binary=False), nullable=False),
211-
sa.Column("client_id", UUIDType(binary=False), nullable=False),
211+
sa.Column("organization_id", UUIDType(binary=False), nullable=False),
212212
sa.Column("created", sa.DateTime(), nullable=False),
213213
sa.Column("updated", sa.DateTime(), nullable=False),
214214
sa.ForeignKeyConstraint(
215-
["client_id"],
216-
["client.id"],
215+
["organization_id"],
216+
["organization.id"],
217217
),
218218
sa.ForeignKeyConstraint(
219219
["platform_id"],
@@ -232,13 +232,13 @@ def upgrade() -> None:
232232
sa.Column("id", UUIDType(binary=False), nullable=False),
233233
sa.Column("title", sa.String(length=255), nullable=False),
234234
sa.Column("platform_id", UUIDType(binary=False), nullable=False),
235-
sa.Column("client_id", UUIDType(binary=False), nullable=False),
235+
sa.Column("organization_id", UUIDType(binary=False), nullable=False),
236236
sa.Column("website_id", UUIDType(binary=False), nullable=False),
237237
sa.Column("created", sa.DateTime(), nullable=False),
238238
sa.Column("updated", sa.DateTime(), nullable=False),
239239
sa.ForeignKeyConstraint(
240-
["client_id"],
241-
["client.id"],
240+
["organization_id"],
241+
["organization.id"],
242242
),
243243
sa.ForeignKeyConstraint(
244244
["platform_id"],
@@ -302,36 +302,36 @@ def upgrade() -> None:
302302
sa.Column("utm_content", sa.String(length=255), nullable=True),
303303
sa.Column("utm_term", sa.String(length=255), nullable=True),
304304
sa.Column("is_active", sa.Boolean(), nullable=False),
305-
sa.Column("client_id", UUIDType(binary=False), nullable=True),
305+
sa.Column("organization_id", UUIDType(binary=False), nullable=True),
306306
sa.Column("created", sa.DateTime(), nullable=False),
307307
sa.Column("updated", sa.DateTime(), nullable=False),
308308
sa.ForeignKeyConstraint(
309-
["client_id"],
310-
["client.id"],
309+
["organization_id"],
310+
["organization.id"],
311311
),
312312
sa.PrimaryKeyConstraint("id"),
313313
sa.UniqueConstraint("url_hash"),
314314
mysql_engine="InnoDB",
315315
)
316316
op.create_index(op.f("ix_tracking_link_id"), "tracking_link", ["id"], unique=True)
317317
op.create_table(
318-
"user_client",
318+
"user_organization",
319319
sa.Column("id", UUIDType(binary=False), nullable=False),
320320
sa.Column("user_id", UUIDType(binary=False), nullable=False),
321-
sa.Column("client_id", UUIDType(binary=False), nullable=False),
321+
sa.Column("organization_id", UUIDType(binary=False), nullable=False),
322322
sa.Column("created", sa.DateTime(), nullable=False),
323323
sa.Column("updated", sa.DateTime(), nullable=False),
324324
sa.ForeignKeyConstraint(
325-
["client_id"],
326-
["client.id"],
325+
["organization_id"],
326+
["organization.id"],
327327
),
328328
sa.ForeignKeyConstraint(
329329
["user_id"],
330330
["user.id"],
331331
),
332-
sa.PrimaryKeyConstraint("user_id", "client_id"),
332+
sa.PrimaryKeyConstraint("user_id", "organization_id"),
333333
)
334-
op.create_index(op.f("ix_user_client_id"), "user_client", ["id"], unique=True)
334+
op.create_index(op.f("ix_user_organization_id"), "user_organization", ["id"], unique=True)
335335
op.create_table(
336336
"website_page",
337337
sa.Column("id", UUIDType(binary=False), nullable=False),
@@ -728,8 +728,8 @@ def downgrade() -> None:
728728
op.drop_index(op.f("ix_website_page_website_id"), table_name="website_page")
729729
op.drop_index(op.f("ix_website_page_id"), table_name="website_page")
730730
op.drop_table("website_page")
731-
op.drop_index(op.f("ix_user_client_id"), table_name="user_client")
732-
op.drop_table("user_client")
731+
op.drop_index(op.f("ix_user_organization_id"), table_name="user_organization")
732+
op.drop_table("user_organization")
733733
op.drop_index(op.f("ix_tracking_link_id"), table_name="tracking_link")
734734
op.drop_table("tracking_link")
735735
op.drop_index(op.f("ix_ipaddress_id"), table_name="ipaddress")
@@ -750,13 +750,13 @@ def downgrade() -> None:
750750
op.drop_index(op.f("ix_gcft_group_slug"), table_name="gcft")
751751
op.drop_index(op.f("ix_gcft_group_name"), table_name="gcft")
752752
op.drop_table("gcft")
753-
op.drop_index(op.f("ix_client_website_id"), table_name="client_website")
754-
op.drop_table("client_website")
755-
op.drop_index(op.f("ix_client_styleguide_title"), table_name="client_styleguide")
756-
op.drop_index(op.f("ix_client_styleguide_id"), table_name="client_styleguide")
757-
op.drop_table("client_styleguide")
758-
op.drop_index(op.f("ix_client_platform_id"), table_name="client_platform")
759-
op.drop_table("client_platform")
753+
op.drop_index(op.f("ix_organization_website_id"), table_name="organization_website")
754+
op.drop_table("organization_website")
755+
op.drop_index(op.f("ix_organization_styleguide_title"), table_name="organization_styleguide")
756+
op.drop_index(op.f("ix_organization_styleguide_id"), table_name="organization_styleguide")
757+
op.drop_table("organization_styleguide")
758+
op.drop_index(op.f("ix_organization_platform_id"), table_name="organization_platform")
759+
op.drop_table("organization_platform")
760760
op.drop_index(op.f("ix_website_id"), table_name="website")
761761
op.drop_table("website")
762762
op.drop_index(op.f("ix_user_username"), table_name="user")
@@ -767,8 +767,8 @@ def downgrade() -> None:
767767
op.drop_index(op.f("ix_platform_id"), table_name="platform")
768768
op.drop_table("platform")
769769
op.drop_table("geocoord")
770-
op.drop_index(op.f("ix_client_title"), table_name="client")
771-
op.drop_index(op.f("ix_client_slug"), table_name="client")
772-
op.drop_index(op.f("ix_client_id"), table_name="client")
773-
op.drop_table("client")
770+
op.drop_index(op.f("ix_organization_title"), table_name="organization")
771+
op.drop_index(op.f("ix_organization_slug"), table_name="organization")
772+
op.drop_index(op.f("ix_organization_id"), table_name="organization")
773+
op.drop_table("organization")
774774
# ### end Alembic commands ###

app/api/endpoints_v1.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from fastapi import APIRouter, Depends
22

3-
from app.entities.client.router import router as client_router
43
from app.entities.go_property.router import router as go_property_router
4+
from app.entities.organization.router import router as organization_router
55
from app.entities.platform.router import router as platform_router
66
from app.entities.public.router import router as public_router
77
from app.entities.security.router import router as security_router
@@ -38,11 +38,11 @@
3838
tags=["Users"],
3939
)
4040

41-
# Client routes
41+
# Organization routes
4242
router_v1.include_router(
43-
client_router,
44-
prefix="/clients",
45-
tags=["Clients"],
43+
organization_router,
44+
prefix="/organizations",
45+
tags=["Organizations"],
4646
)
4747

4848
# Platforms routes

app/api/exceptions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from fastapi import FastAPI
22

33
from app.entities.api.exceptions import configure_api_exceptions
4-
from app.entities.client.exceptions import configure_client_exceptions
4+
from app.entities.organization.exceptions import configure_organization_exceptions
55
from app.entities.user.exceptions import configure_user_exceptions
66
from app.entities.website.exceptions import configure_website_exceptions
77
from app.services.auth0 import configure_authorization_exceptions
@@ -13,7 +13,7 @@
1313
def configure_exceptions(app: FastAPI) -> None:
1414
configure_api_exceptions(app)
1515
configure_user_exceptions(app)
16-
configure_client_exceptions(app)
16+
configure_organization_exceptions(app)
1717
configure_website_exceptions(app)
1818
configure_permissions_exceptions(app)
1919
configure_authorization_exceptions(app)

0 commit comments

Comments
 (0)