Skip to content

Commit 6ebb393

Browse files
authored
Modular memberships (#659)
### Description Switched association's membership from Enum to database table. Changed reception route module accordingly ### Checklist - [x] Created tests which fail without the change (if possible) - [x] All tests passing - [x] Extended the documentation, if necessary
1 parent 60c193c commit 6ebb393

18 files changed

+2556
-461
lines changed

app/core/core_endpoints/models_core.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,9 @@
11
"""Common model files for all core in order to avoid circular import due to bidirectional relationship"""
22

3-
from datetime import date
4-
5-
from sqlalchemy import ForeignKey
63
from sqlalchemy.orm import Mapped, mapped_column
74

85
from app.core.groups.groups_type import AccountType
9-
from app.types.membership import AvailableAssociationMembership
10-
from app.types.sqlalchemy import Base, PrimaryKey
11-
12-
13-
class CoreAssociationMembership(Base):
14-
__tablename__ = "core_association_membership"
15-
16-
id: Mapped[PrimaryKey]
17-
user_id: Mapped[str] = mapped_column(
18-
ForeignKey("core_user.id"),
19-
)
20-
membership: Mapped[AvailableAssociationMembership] = mapped_column(
21-
index=True,
22-
)
23-
start_date: Mapped[date]
24-
end_date: Mapped[date]
6+
from app.types.sqlalchemy import Base
257

268

279
class CoreData(Base):

app/core/groups/groups_type.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class GroupType(str, Enum):
2424
ph = "4ec5ae77-f955-4309-96a5-19cc3c8be71c"
2525
admin_cdr = "c1275229-46b2-4e53-a7c4-305513bb1a2a"
2626
eclair = "1f841bd9-00be-41a7-96e1-860a18a46105"
27+
BDS = "61af3e52-7ef9-4608-823a-39d51e83d1db"
2728

2829
# Auth related groups
2930

app/core/memberships/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)