f3-data-models 0.3.1__tar.gz → 0.3.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: f3-data-models
3
- Version: 0.3.1
3
+ Version: 0.3.4
4
4
  Summary: The data schema and models for F3 Nation applications.
5
5
  License: MIT
6
6
  Author: Evan Petzoldt
@@ -79,6 +79,25 @@ class Day_Of_Week(enum.Enum):
79
79
  sunday = 6
80
80
 
81
81
 
82
+ class Event_Cadence(enum.Enum):
83
+ weekly = 1
84
+ monthly = 2
85
+
86
+
87
+ class Org_Type(enum.Enum):
88
+ ao = 1
89
+ region = 2
90
+ area = 3
91
+ sector = 4
92
+ nation = 5
93
+
94
+
95
+ class Event_Category(enum.Enum):
96
+ first_f = 1
97
+ second_f = 2
98
+ third_f = 3
99
+
100
+
82
101
  class Base(DeclarativeBase):
83
102
  """
84
103
  Base class for all models, providing common methods.
@@ -181,48 +200,6 @@ class SlackSpace(Base):
181
200
  updated: Mapped[dt_update]
182
201
 
183
202
 
184
- class OrgType(Base):
185
- """
186
- Model representing an organization type / level. 1=AO, 2=Region, 3=Area, 4=Sector
187
-
188
- Attributes:
189
- id (int): Primary Key of the model.
190
- name (str): The name of the organization type.
191
- description (Optional[text]): A description of the organization type.
192
- created (datetime): The timestamp when the record was created.
193
- updated (datetime): The timestamp when the record was last updated.
194
- """
195
-
196
- __tablename__ = "org_types"
197
-
198
- id: Mapped[intpk]
199
- name: Mapped[str]
200
- description: Mapped[Optional[text]]
201
- created: Mapped[dt_create]
202
- updated: Mapped[dt_update]
203
-
204
-
205
- class EventCategory(Base):
206
- """
207
- Model representing an event category. These are immutable cateogies that we will define at the Nation level.
208
-
209
- Attributes:
210
- id (int): Primary Key of the model.
211
- name (str): The name of the event category.
212
- description (Optional[text]): A description of the event category.
213
- created (datetime): The timestamp when the record was created.
214
- updated (datetime): The timestamp when the record was last updated.
215
- """
216
-
217
- __tablename__ = "event_categories"
218
-
219
- id: Mapped[intpk]
220
- name: Mapped[str]
221
- description: Mapped[Optional[text]]
222
- created: Mapped[dt_create]
223
- updated: Mapped[dt_update]
224
-
225
-
226
203
  class Role(Base):
227
204
  """
228
205
  Model representing a role. A role is a set of permissions that can be assigned to users.
@@ -306,7 +283,7 @@ class Org(Base):
306
283
  Attributes:
307
284
  id (int): Primary Key of the model.
308
285
  parent_id (Optional[int]): The ID of the parent organization.
309
- org_type_id (int): The ID of the organization type.
286
+ org_type (Org_Type): The type of the organization.
310
287
  default_location_id (Optional[int]): The ID of the default location.
311
288
  name (str): The name of the organization.
312
289
  description (Optional[text]): A description of the organization.
@@ -334,7 +311,7 @@ class Org(Base):
334
311
 
335
312
  id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
336
313
  parent_id: Mapped[Optional[int]] = mapped_column(ForeignKey("orgs.id"))
337
- org_type_id: Mapped[int] = mapped_column(ForeignKey("org_types.id"))
314
+ org_type: Mapped[Org_Type]
338
315
  default_location_id: Mapped[Optional[int]]
339
316
  name: Mapped[str]
340
317
  description: Mapped[Optional[text]]
@@ -366,7 +343,9 @@ class Org(Base):
366
343
  viewonly=True,
367
344
  )
368
345
  achievements: Mapped[Optional[List["Achievement"]]] = relationship(
369
- "Achievement", secondary="achievements_x_org", cascade="expunge"
346
+ "Achievement",
347
+ cascade="expunge",
348
+ primaryjoin="or_(Achievement.specific_org_id == Org.id, Achievement.specific_org_id.is_(None))",
370
349
  )
371
350
  parent_org: Mapped[Optional["Org"]] = relationship(
372
351
  "Org", remote_side=[id], cascade="expunge"
@@ -385,7 +364,7 @@ class EventType(Base):
385
364
  name (str): The name of the event type.
386
365
  description (Optional[text]): A description of the event type.
387
366
  acronym (Optional[str]): Acronyms associated with the event type.
388
- category_id (int): The ID of the associated event category.
367
+ event_category (Event_Category): The category of the event type (first_f, second_f, third_f).
389
368
  specific_org_id (Optional[int]): The ID of the specific organization.
390
369
  created (datetime): The timestamp when the record was created.
391
370
  updated (datetime): The timestamp when the record was last updated.
@@ -397,7 +376,7 @@ class EventType(Base):
397
376
  name: Mapped[str]
398
377
  description: Mapped[Optional[text]]
399
378
  acronym: Mapped[Optional[str]]
400
- category_id: Mapped[int] = mapped_column(ForeignKey("event_categories.id"))
379
+ event_category: Mapped[Event_Category]
401
380
  specific_org_id: Mapped[Optional[int]] = mapped_column(ForeignKey("orgs.id"))
402
381
  created: Mapped[dt_create]
403
382
  updated: Mapped[dt_update]
@@ -593,7 +572,7 @@ class Event(Base):
593
572
  name (str): The name of the event.
594
573
  description (Optional[text]): A description of the event.
595
574
  email (Optional[str]): A contact email address associated with the event.
596
- recurrence_pattern (Optional[str]): The recurrence pattern of the event. Current options are 'weekly' or 'monthly'.
575
+ recurrence_pattern (Optional[Event_Cadence]): The recurrence pattern of the event. Current options are 'weekly' or 'monthly'.
597
576
  recurrence_interval (Optional[int]): The recurrence interval of the event (e.g. every 2 weeks).
598
577
  index_within_interval (Optional[int]): The index within the recurrence interval. (e.g. 2nd Tuesday of the month).
599
578
  pax_count (Optional[int]): The number of participants.
@@ -633,7 +612,7 @@ class Event(Base):
633
612
  name: Mapped[str]
634
613
  description: Mapped[Optional[text]]
635
614
  email: Mapped[Optional[str]]
636
- recurrence_pattern: Mapped[Optional[str]]
615
+ recurrence_pattern: Mapped[Optional[Event_Cadence]]
637
616
  recurrence_interval: Mapped[Optional[int]]
638
617
  index_within_interval: Mapped[Optional[int]]
639
618
  pax_count: Mapped[Optional[int]]
@@ -860,6 +839,7 @@ class Achievement(Base):
860
839
  description (Optional[str]): A description of the achievement.
861
840
  verb (str): The verb associated with the achievement.
862
841
  image_url (Optional[str]): The URL of the achievement's image.
842
+ specific_org_id (Optional[int]): The ID of the specific region if a custom achievement. If null, the achievement is available to all regions.
863
843
  created (datetime): The timestamp when the record was created.
864
844
  updated (datetime): The timestamp when the record was last updated.
865
845
  """
@@ -871,6 +851,7 @@ class Achievement(Base):
871
851
  description: Mapped[Optional[str]]
872
852
  verb: Mapped[str]
873
853
  image_url: Mapped[Optional[str]]
854
+ specific_org_id: Mapped[Optional[int]] = mapped_column(ForeignKey("orgs.id"))
874
855
  created: Mapped[dt_create]
875
856
  updated: Mapped[dt_update]
876
857
 
@@ -896,23 +877,6 @@ class Achievement_x_User(Base):
896
877
  )
897
878
 
898
879
 
899
- class Achievement_x_Org(Base):
900
- """
901
- Model representing the association between achievements and organizations.
902
-
903
- Attributes:
904
- achievement_id (int): The ID of the associated achievement.
905
- org_id (int): The ID of the associated organization.
906
- """
907
-
908
- __tablename__ = "achievements_x_org"
909
-
910
- achievement_id: Mapped[int] = mapped_column(
911
- ForeignKey("achievements.id"), primary_key=True
912
- )
913
- org_id: Mapped[int] = mapped_column(ForeignKey("orgs.id"), primary_key=True)
914
-
915
-
916
880
  class Position(Base):
917
881
  """
918
882
  Model representing a position.
@@ -920,7 +884,7 @@ class Position(Base):
920
884
  Attributes:
921
885
  name (str): The name of the position.
922
886
  description (Optional[str]): A description of the position.
923
- org_type_id (Optional[int]): The ID of the associated organization type. This is used to limit the positions available to certain types of organizations. If null, the position is available to all organization types.
887
+ org_type (Optional[Org_Type]): The associated organization type. This is used to limit the positions available to certain types of organizations. If null, the position is available to all organization types.
924
888
  org_id (Optional[int]): The ID of the associated organization. This is used to limit the positions available to certain organizations. If null, the position is available to all organizations.
925
889
  """
926
890
 
@@ -929,7 +893,7 @@ class Position(Base):
929
893
  id: Mapped[intpk]
930
894
  name: Mapped[str]
931
895
  description: Mapped[Optional[str]]
932
- org_type_id: Mapped[Optional[int]] = mapped_column(ForeignKey("org_types.id"))
896
+ org_type: Mapped[Optional[Org_Type]]
933
897
  org_id: Mapped[Optional[int]] = mapped_column(ForeignKey("orgs.id"))
934
898
  created: Mapped[dt_create]
935
899
  updated: Mapped[dt_update]
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "f3-data-models"
3
- version = "0.3.1"
3
+ version = "0.3.4"
4
4
  description = "The data schema and models for F3 Nation applications."
5
5
  authors = ["Evan Petzoldt <evan.petzoldt@protonmail.com>"]
6
6
  readme = "README.md"
File without changes