f3-data-models 0.5.15__py3-none-any.whl → 0.5.17__py3-none-any.whl

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.
f3_data_models/models.py CHANGED
@@ -136,6 +136,38 @@ class Event_Cadence(enum.Enum):
136
136
  monthly = 2
137
137
 
138
138
 
139
+ class Achievement_Cadence(enum.Enum):
140
+ """
141
+ Enum representing the cadence of an achievement.
142
+
143
+ Attributes:
144
+ weekly
145
+ monthly
146
+ quarterly
147
+ yearly
148
+ lifetime
149
+ """
150
+
151
+ weekly = 1
152
+ monthly = 2
153
+ quarterly = 3
154
+ yearly = 4
155
+ lifetime = 5
156
+
157
+
158
+ class Achievement_Threshold_Type(enum.Enum):
159
+ """
160
+ Enum representing the type of threshold for an achievement.
161
+
162
+ Attributes:
163
+ posts
164
+ unique_aos
165
+ """
166
+
167
+ posts = 1
168
+ unique_aos = 2
169
+
170
+
139
171
  class Org_Type(enum.Enum):
140
172
  """
141
173
  Enum representing the type of organization.
@@ -957,7 +989,7 @@ class SlackUser(Base):
957
989
  strava_expires_at (Optional[datetime]): The expiration time of the Strava token.
958
990
  strava_athlete_id (Optional[int]): The Strava athlete ID of the user.
959
991
  meta (Optional[Dict[str, Any]]): Additional metadata for the Slack user.
960
- slack_updated (Optional[datetime]): The last update time of the Slack user.
992
+ slack_updated (Optional[int]): The last update time of the Slack user.
961
993
  created (datetime): The timestamp when the record was created.
962
994
  updated (datetime): The timestamp when the record was last updated.
963
995
  """ # noqa: E501
@@ -979,7 +1011,7 @@ class SlackUser(Base):
979
1011
  strava_expires_at: Mapped[Optional[datetime]]
980
1012
  strava_athlete_id: Mapped[Optional[int]]
981
1013
  meta: Mapped[Optional[Dict[str, Any]]]
982
- slack_updated: Mapped[Optional[datetime]]
1014
+ slack_updated: Mapped[Optional[int]]
983
1015
  created: Mapped[dt_create]
984
1016
  updated: Mapped[dt_update]
985
1017
 
@@ -1044,9 +1076,14 @@ class Achievement(Base):
1044
1076
  id (int): Primary Key of the model.
1045
1077
  name (str): The name of the achievement.
1046
1078
  description (Optional[str]): A description of the achievement.
1047
- verb (str): The verb associated with the achievement.
1048
1079
  image_url (Optional[str]): The URL of the achievement's image.
1049
1080
  specific_org_id (Optional[int]): The ID of the specific region if a custom achievement. If null, the achievement is available to all regions.
1081
+ is_active (bool): Whether the achievement is active. Default is True.
1082
+ auto_award (bool): Whether the achievement is automatically awarded or needs to be manually tagged. Default is False.
1083
+ auto_cadence (Optional[Achievement_Cadence]): The cadence for automatic awarding of the achievement.
1084
+ auto_threshold (Optional[int]): The threshold for automatic awarding of the achievement.
1085
+ auto_threshold_type (Optional[Achievement_Threshold_Type]): The type of threshold for automatic awarding of the achievement ('posts', 'unique_aos', etc.).
1086
+ auto_filters (Optional[Dict[str, Any]]): Event filters for automatic awarding of the achievement. Should be a format like {'include': [{'event_type_id': [1, 2]}, {'event_tag_id': [3]}], 'exclude': [{'event_category': ['third_f']}]}.
1050
1087
  created (datetime): The timestamp when the record was created.
1051
1088
  updated (datetime): The timestamp when the record was last updated.
1052
1089
  """ # noqa: E501
@@ -1056,9 +1093,15 @@ class Achievement(Base):
1056
1093
  id: Mapped[intpk]
1057
1094
  name: Mapped[str]
1058
1095
  description: Mapped[Optional[str]]
1059
- verb: Mapped[str]
1060
1096
  image_url: Mapped[Optional[str]]
1061
1097
  specific_org_id: Mapped[Optional[int]] = mapped_column(ForeignKey("orgs.id"))
1098
+ is_active: Mapped[bool] = mapped_column(Boolean, server_default="true", nullable=False)
1099
+ auto_award: Mapped[bool] = mapped_column(Boolean, server_default="false", nullable=False)
1100
+ auto_cadence: Mapped[Optional[Achievement_Cadence]]
1101
+ auto_threshold_type: Mapped[Optional[Achievement_Threshold_Type]]
1102
+ auto_threshold: Mapped[Optional[int]]
1103
+ auto_filters: Mapped[Optional[Dict[str, Any]]] = mapped_column(JSON, default=dict)
1104
+ meta: Mapped[Optional[Dict[str, Any]]] = mapped_column(JSON, default=dict)
1062
1105
  created: Mapped[dt_create]
1063
1106
  updated: Mapped[dt_update]
1064
1107
 
@@ -1070,6 +1113,8 @@ class Achievement_x_User(Base):
1070
1113
  Attributes:
1071
1114
  achievement_id (int): The ID of the associated achievement.
1072
1115
  user_id (int): The ID of the associated user.
1116
+ award_year (int): The year the achievement was awarded. Default is -1 (used for lifetime achievements).
1117
+ award_period (int): The period (ie week, month) the achievement was awarded in. Default is -1 (used for lifetime achievements).
1073
1118
  date_awarded (date): The date the achievement was awarded. Default is the current date.
1074
1119
  """ # noqa: E501
1075
1120
 
@@ -1077,6 +1122,8 @@ class Achievement_x_User(Base):
1077
1122
 
1078
1123
  achievement_id: Mapped[int] = mapped_column(ForeignKey("achievements.id"), primary_key=True)
1079
1124
  user_id: Mapped[int] = mapped_column(ForeignKey("users.id"), primary_key=True)
1125
+ award_year: Mapped[int] = mapped_column(Integer, primary_key=True, server_default="-1")
1126
+ award_period: Mapped[int] = mapped_column(Integer, primary_key=True, server_default="-1")
1080
1127
  date_awarded: Mapped[date] = mapped_column(DateTime, server_default=func.timezone("utc", func.now()))
1081
1128
 
1082
1129
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: f3-data-models
3
- Version: 0.5.15
3
+ Version: 0.5.17
4
4
  Summary: The data schema and models for F3 Nation applications.
5
5
  License: MIT
6
6
  Author: Evan Petzoldt
@@ -0,0 +1,7 @@
1
+ f3_data_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ f3_data_models/models.py,sha256=xotjDo6U3DLtur0qieMslPiVZnQ3tr9q1EcXTqDC2FI,55093
3
+ f3_data_models/testing.py,sha256=uHHgrfMOpUvu6-yOyuMsGadyeN-zuAFRYuGQNpXX4Lk,598
4
+ f3_data_models/utils.py,sha256=5ijpywxWMZZ5TZr7L7rLjs3QVsAHFvTQLtsrzIcnm04,12153
5
+ f3_data_models-0.5.17.dist-info/METADATA,sha256=GCWp-vZAzpnd3055TVMKM0XxRo-4mtpnK8pJl8Pnnyk,3675
6
+ f3_data_models-0.5.17.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
7
+ f3_data_models-0.5.17.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- f3_data_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- f3_data_models/models.py,sha256=b_hKsW-5aFbFXsUohdiaVa5rN8xfb0EQ6NvXfTNSoAo,52919
3
- f3_data_models/testing.py,sha256=uHHgrfMOpUvu6-yOyuMsGadyeN-zuAFRYuGQNpXX4Lk,598
4
- f3_data_models/utils.py,sha256=5ijpywxWMZZ5TZr7L7rLjs3QVsAHFvTQLtsrzIcnm04,12153
5
- f3_data_models-0.5.15.dist-info/METADATA,sha256=g2JE4e2oBUBQTSGxqNAyVGQjMEb93KZXeINTtS8REkY,3675
6
- f3_data_models-0.5.15.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
7
- f3_data_models-0.5.15.dist-info/RECORD,,