aa-structures 2.15.0__py3-none-any.whl → 2.17.0__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.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: aa-structures
3
- Version: 2.15.0
3
+ Version: 2.17.0
4
4
  Summary: App for managing Eve Online structures with Alliance Auth.
5
5
  Author-email: Erik Kalkoken <kalkoken87@gmail.com>
6
6
  Requires-Python: >=3.8
@@ -1,26 +1,26 @@
1
- structures/__init__.py,sha256=DW_FAyoVYr5DMbDmmJQ_yaBVMMVB07QHRZP71oApKTA,204
1
+ structures/__init__.py,sha256=IHFQy-PBTGawZQIDMVt3La5YoH6pK9dlDO5jvrQQph4,204
2
2
  structures/admin.py,sha256=K7wh8mHFfGHONn7oLdqXsBAxq0rmYrwbZ7S3uIOuMtg,41303
3
3
  structures/app_settings.py,sha256=aWA2bTcv_vVwIyisx-G7GBSpfM6JDyt2MWcXKtHnjK0,6651
4
4
  structures/apps.py,sha256=MNZH9l3qWCwuS7OGiKGkBVrDzKoOFlqwDdEgyEFzxVA,195
5
5
  structures/auth_hooks.py,sha256=nRbrixFkAE5gphDokB1E8xhH8FY2VtXVwu0XMmSGBAw,1013
6
- structures/constants.py,sha256=12iIVgFWSNaH1iYBByrsv3OQKCnNxluuckOdrfgzWzA,995
6
+ structures/constants.py,sha256=k5rfD29ZjR7ToRmJw4WnLVd4LmoZvDw4OK5IoiiyJ6w,1063
7
7
  structures/forms.py,sha256=kXs-SGIIj-D9xtFCILKe_PMRU4eHl3-HLNWRhaZKmnQ,391
8
8
  structures/helpers.py,sha256=_dw7j7yobpcV70VwWxoQiptk69b3ksvaDlRQKHg8Kmg,2344
9
- structures/managers.py,sha256=6zGvmiP1_TZ1uZlPTxNFYgJ77JIjY3uw2PmYeyrJ10E,20063
9
+ structures/managers.py,sha256=_XZhsWb4is7LpQTUmGZwxQeJzyZnsB3n21EETgEIlzU,20062
10
10
  structures/providers.py,sha256=9QYHd8X5HwBhrbgbX3LUrXXV1KGM3hFhcxK6qIJjJtg,317
11
11
  structures/tasks.py,sha256=INZ3soMYHYfxrQsyTO-ozoxbVX6lpMnF3AUo8ybWIoA,9083
12
12
  structures/urls.py,sha256=An5v27AD_NXMNL66cMVtQNci1C_Aqry32rrvDkMpgYo,1467
13
13
  structures/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  structures/core/notification_timers.py,sha256=KLjkVrlCCKTWtHJNUfI3U6ppAIZN8vPnIx1zCafRkKQ,16748
15
- structures/core/notification_types.py,sha256=Ebl4i-mvyGe4luxeNiPmxf7T9bmghe8NU5Giu9pqPCo,13262
15
+ structures/core/notification_types.py,sha256=AMelkzBgOVcXKQauHEjBkcu5iFcLx6R_e9kXLBasbrs,13676
16
16
  structures/core/serializers.py,sha256=4W6kA7mhVvc-1OSiTl_w0rSio_HUsjIBm9qbkEr9vCY,20965
17
17
  structures/core/sovereignty.py,sha256=XKgjAFO4BfLpEEUz_hBr2DVDnvWBq9sL9EEQiT4T0n0,730
18
18
  structures/core/starbases.py,sha256=nw7skHYATrnAV-zuPAuxmhM5E4Aqjc_DHSU2TYWgBng,1757
19
19
  structures/core/notification_embeds/__init__.py,sha256=30cpjKLZ5_OFtXDACDcjvWQAYszM2BrYxUYb5PRQoTA,131
20
20
  structures/core/notification_embeds/billing_embeds.py,sha256=d9XkTyYH7U3UDZaqXu0WoN0wvlrT2S68Rfn2jEpVtM4,5164
21
- structures/core/notification_embeds/corporate_embeds.py,sha256=mfm6dDrgzupyRZ9TZGXML-UGoY_PymNj9LuR8EthdDA,6098
21
+ structures/core/notification_embeds/corporate_embeds.py,sha256=v1ala3_2czhXRoUEk-XvripsbYyBY0bjci7UjwNTSZQ,8367
22
22
  structures/core/notification_embeds/helpers.py,sha256=0SlrLLFyV0IrdOYfIOLQs0xZgzK8bO7Iroqh7dZnm98,2974
23
- structures/core/notification_embeds/main.py,sha256=B8OReupxjSbtxqw2MXC9qN41A4Bw8x6_n0LIZlfIJxE,17311
23
+ structures/core/notification_embeds/main.py,sha256=QRMbJoOV-Y6mrplJlbJsILN8PhBXHCePEdepyWM6MSw,17658
24
24
  structures/core/notification_embeds/moonmining_embeds.py,sha256=5OJtfwoLE18mB62iwyHTcMo9eOPBC2vQFSjQlDnTcTY,7130
25
25
  structures/core/notification_embeds/orbital_embeds.py,sha256=abU9eN7-4FV2wm6IbZt5O0hQZ09hdrkSJ4JaKLBksTE,2864
26
26
  structures/core/notification_embeds/skyhook_embeds.py,sha256=Wl7G3jYin8IfSPFWfoBHndtvxiOUTIboD9xfJ1VJd_4,3019
@@ -61,11 +61,12 @@ structures/migrations/0005_add_notification_types.py,sha256=aIgNZN4Gsvh9GiJ0i4Xm
61
61
  structures/migrations/0006_add_ownercharacter_disabled.py,sha256=yfcuwWHdSoF7HTEzdtQ1bGhI-K78SxCeE3g3z6UjbqI,726
62
62
  structures/migrations/0007_add_notificationtypes_skyhook_metenox.py,sha256=5qxb2AyZyyHFAU39ScFW4eCHHWBL9lMszt0MzXJu4RM,7835
63
63
  structures/migrations/0008_add_notificationtypes_skyhook_metenox.py,sha256=5QtcYJR7krqKheJ-vBb7QT771mK39aET7F07hhMy9q4,7844
64
+ structures/migrations/0009_add_project_goal_notifications.py,sha256=ig0ZLIvoml2WTBRp2-5nEI57P5nKSJGf1y7hAlGG2I0,8074
64
65
  structures/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
65
66
  structures/models/__init__.py,sha256=Da0-Z4BtsZ_mlnI6XtyvoE0UtTuOA0psGCuVhVPVKrM,916
66
67
  structures/models/eveuniverse.py,sha256=vTIfzZL9guEDuZHQvRdG6pI4zSEdMqfVE-2SkHdqbRo,2213
67
68
  structures/models/notifications.py,sha256=HwQc-ChdP0ULuJgxUym9_CBsCWCmcHT7whlk9tB2vzw,35364
68
- structures/models/owners.py,sha256=7CKpwHlw4Nz8lTJUgQZxI-GHon5FrlMEILxe7q7Vfgg,58391
69
+ structures/models/owners.py,sha256=yXeP21KkdpNdO6yqKLoEMfYVA72uVaCvBmq0e19Qm78,59611
69
70
  structures/models/structures_1.py,sha256=zk380uG2DuQ7exO7THbq5TE5Ro2jr6EyVCIxRJXHIJI,29958
70
71
  structures/models/structures_2.py,sha256=g5Pct5jNmZC-n7fnpLs5UyiP9JLrGdI1vjYucHTV_wQ,10371
71
72
  structures/static/structures/css/global.css,sha256=R4LEH9PwLoN77qkqBK7u2y_vzRC3fq8X_zKnAW7yhiA,1165
@@ -185,19 +186,20 @@ structures/tests/models/test_notifications_2.py,sha256=wBoB6lHMK4yrd63DSkZ570yXW
185
186
  structures/tests/models/test_notifications_3.py,sha256=u11s0k9EmtFgL3kyb4zDyLVliQLOps701ZgEA2T2i0Y,7257
186
187
  structures/tests/models/test_notifications_discord.py,sha256=6maDXjl2C5yH2XRgsvMtb3P-tfOdZLQDaksffiqS8OM,6312
187
188
  structures/tests/models/test_owners_1.py,sha256=o8AJasQ0-Pdb0FRFZcmNcMGjaIk8fH3OZIZw4paJiDw,24433
188
- structures/tests/models/test_owners_2.py,sha256=GZYdsFey6bQHuk9BiT1KFT_vW01mUHRtDxJRHPEmrC4,22539
189
+ structures/tests/models/test_owners_2.py,sha256=RSaeLz6S6ncoikWwDjNh6YZftpBN8TGdzAl8E2tgkqA,24527
189
190
  structures/tests/models/test_owners_3.py,sha256=cpDkfFkVvC1v4uuXha1vGUmWZ163huYTUDuZyed9Rdc,16947
190
191
  structures/tests/models/test_owners_4.py,sha256=_VP4QsPYGwBnn_bVN4aNX2ZVeJzMAzWObZrgCJkOPgY,19496
191
192
  structures/tests/models/test_owners_5.py,sha256=TIF_SqJqyGja8FBV2lQNAC4yff1usmJ4e0QW7e68zTg,36929
192
193
  structures/tests/models/test_owners_6.py,sha256=R9UE2QGwiGTWLHzzOZwGQPWJrAPwIIl7UwrHH-ki4Ak,940
193
194
  structures/tests/models/test_structures.py,sha256=iCCa0yYyPHieNfj8TQbdoIv141oLc6hlICZ6AsTnHAw,41849
194
195
  structures/tests/testdata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
195
- structures/tests/testdata/create_eveuniverse.py,sha256=6CYgXtJaEwxWvQFyH-P0SKsRqeMuSyJ92ZJiXe_-nuY,2256
196
- structures/tests/testdata/entities.json,sha256=vmb0uhwTpD0gycGAakgYidr3qSbnHiMubAd4u7T2l70,36053
196
+ structures/tests/testdata/constants.py,sha256=iab-9cHjAO4RBM88UeWbBypRm9qoZcViwZ8BPY17p1Q,441
197
+ structures/tests/testdata/create_eveuniverse.py,sha256=a5DHYAxxsytOeevAL53RDoeDWObKwViqfpXRlmZeOHY,2157
198
+ structures/tests/testdata/entities.json,sha256=G4OyYlrAbUa0eY1PZgA-K-77c-w5TrDvoF-dI-duNSo,37358
197
199
  structures/tests/testdata/esi_data.json,sha256=DX47oSlRZIPxlPueMfiNElbZbAip2cp3LAUmv8GAPJ0,13864
198
- structures/tests/testdata/eveuniverse.json,sha256=3fhD72lUNLj96wO4ASbpNcdH_8VbqcXUvKUXR6j0768,1028885
200
+ structures/tests/testdata/eveuniverse.json,sha256=7RA5qeaPYx78Mk5_zixL2XYd-Oa4omhUihjgAbgNLyc,1616628
199
201
  structures/tests/testdata/factories.py,sha256=UF7Zao2-DjVFLZLEBWaJv4Pg1uw5D6p0TO8ZKuoAI_8,25293
200
- structures/tests/testdata/generate_notifications.py,sha256=lhcnbsnE4O6g0OFUAYO2sCfu8vmwBcFtxn-TuTLtFnM,5417
202
+ structures/tests/testdata/generate_notifications.py,sha256=MmgG8N-0k1WMNJ_r1TEnbDwLs4su6--gUEZ3lJ6qhOk,5416
201
203
  structures/tests/testdata/generate_notifications_2.py,sha256=mdoGXd9vgy_opmrwTr9MfGe-QieHV4BHtRA7VFzxFKM,1413
202
204
  structures/tests/testdata/generate_structures.py,sha256=4p2ypDj-goniBnraTP2KfWzEX3YLj0qhKPNTfCXy05g,9134
203
205
  structures/tests/testdata/helpers.py,sha256=FSlg7-6Dn3aMQnQPUnH9o9r8WsV1_BYxElm-E9x_5uo,6316
@@ -223,7 +225,7 @@ structures/webhooks/models.py,sha256=kUkt9rnRQIJIrU9Bjcs34rvkb-TMbUubHdn-kny08kI
223
225
  structures/webhooks/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
224
226
  structures/webhooks/tests/test_core.py,sha256=4NcEAQgK2KhQkFOxYh2ad0S-qUWh1DNGDmLo5Mo5opI,6762
225
227
  structures/webhooks/tests/test_utils.py,sha256=ekADFv0JOEtXeqdiejbeqrABO__Q1flJHzVieQ7L9e0,459
226
- aa_structures-2.15.0.dist-info/LICENSE,sha256=XZiwB_S_40_HhnvLg5xvtBb3g1oGjPrk0rpFwk8iInE,1070
227
- aa_structures-2.15.0.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
228
- aa_structures-2.15.0.dist-info/METADATA,sha256=UZGw51TIsMgIdznKyyE9prBvlgDQQpJ3k3z4Url-DEE,5972
229
- aa_structures-2.15.0.dist-info/RECORD,,
228
+ aa_structures-2.17.0.dist-info/LICENSE,sha256=XZiwB_S_40_HhnvLg5xvtBb3g1oGjPrk0rpFwk8iInE,1070
229
+ aa_structures-2.17.0.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
230
+ aa_structures-2.17.0.dist-info/METADATA,sha256=3WP4Xyde_TRUUwypayCkO-nnldwGuQqYtNpwGiQClIE,5972
231
+ aa_structures-2.17.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: flit 3.9.0
2
+ Generator: flit 3.10.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
structures/__init__.py CHANGED
@@ -3,5 +3,5 @@
3
3
  # pylint: disable = invalid-name
4
4
  default_app_config = "structures.apps.StructuresConfig"
5
5
 
6
- __version__ = "2.15.0"
6
+ __version__ = "2.17.0"
7
7
  __title__ = "Structures"
structures/constants.py CHANGED
@@ -16,6 +16,7 @@ class EveCategoryId(IntEnum):
16
16
  ORBITAL = 46
17
17
  STARBASE = 23
18
18
  STRUCTURE = 65
19
+ STRUCTURE_MODULE = 66
19
20
 
20
21
 
21
22
  class EveGroupId(IntEnum):
@@ -26,11 +27,13 @@ class EveGroupId(IntEnum):
26
27
  ENGINEERING_COMPLEX = 1404
27
28
  FUEL_BLOCK = 1136
28
29
  ICE_PRODUCT = 423
29
- REFINERY = 1406
30
+ MOON = 8
30
31
  PLANET = 7
32
+ QUANTUM_CORES = 4086
33
+ REFINERY = 1406
31
34
  STRUCTURE_CITADEL_SERVICE_MODULE = 1321
32
35
  UNCOMMON_MOON_ASTEROIDS = 1921
33
- QUANTUM_CORES = 4086
36
+ UPWELL_MOON_DRILL = 4744
34
37
 
35
38
 
36
39
  class EveTypeId(IntEnum):
@@ -42,8 +45,8 @@ class EveTypeId(IntEnum):
42
45
  IHUB = 32458
43
46
  JUMP_GATE = 35841
44
47
  LIQUID_OZONE = 16273
45
- ORBITAL_SKYHOOK = 81080
46
48
  NITROGEN_FUEL_BLOCK = 4051
49
+ ORBITAL_SKYHOOK = 81080
47
50
  STRONTIUM = 16275
48
51
  TCU = 32226
49
52
 
@@ -157,3 +157,61 @@ class NotificationCharLeftCorpMsg(NotificationCorpCharEmbed):
157
157
  "corporation_name": self._corporation_link,
158
158
  }
159
159
  self._color = Webhook.Color.INFO
160
+
161
+
162
+ class NotificationCorpGoalEmbed(NotificationBaseEmbed):
163
+ def __init__(self, notification: Notification) -> None:
164
+ super().__init__(notification)
165
+ self._creator = get_or_create_eve_entity(id=self._data["creator_id"])
166
+ self._creator_link = gen_eve_entity_link(self._creator)
167
+ self._corporation = get_or_create_eve_entity(id=self._data["corporation_id"])
168
+ self._goal_name = self._data["goal_name"]
169
+ self._thumbnail = dhooks_lite.Thumbnail(
170
+ self._corporation.icon_url(size=self.ICON_DEFAULT_SIZE)
171
+ )
172
+
173
+
174
+ class NotificationCorpGoalClosed(NotificationCorpGoalEmbed):
175
+ def __init__(self, notification: Notification) -> None:
176
+ super().__init__(notification)
177
+ self._title = _("Project canceled")
178
+ closer = get_or_create_eve_entity(id=self._data["closer_id"])
179
+ self._description = _(
180
+ "Project **%(goal_name)s** has ben closed by %(closer)s "
181
+ "and will not accept further contributions."
182
+ % {
183
+ "goal_name": self._goal_name,
184
+ "closer": gen_eve_entity_link(closer),
185
+ }
186
+ )
187
+ self._color = Webhook.Color.INFO
188
+
189
+
190
+ class NotificationCorpGoalCompleted(NotificationCorpGoalEmbed):
191
+ def __init__(self, notification: Notification) -> None:
192
+ super().__init__(notification)
193
+ self._title = _("Project completed")
194
+ self._description = _(
195
+ "Project **%(goal_name)s** created by %(creator)s "
196
+ "has been successfully completed after reaching it's target."
197
+ % {
198
+ "goal_name": self._goal_name,
199
+ "creator": self._creator_link,
200
+ }
201
+ )
202
+ self._color = Webhook.Color.SUCCESS
203
+
204
+
205
+ class NotificationCorpGoalCreated(NotificationCorpGoalEmbed):
206
+ def __init__(self, notification: Notification) -> None:
207
+ super().__init__(notification)
208
+ self._title = _("New Project Available")
209
+ self._description = _(
210
+ "Project **%(goal_name)s** has been created by %(creator)s "
211
+ "and is open for contributions."
212
+ % {
213
+ "goal_name": self._goal_name,
214
+ "creator": self._creator_link,
215
+ }
216
+ )
217
+ self._color = Webhook.Color.INFO
@@ -1,4 +1,4 @@
1
- """Billing embeds."""
1
+ """Dispatcher for all embeds."""
2
2
 
3
3
  # pylint: disable=missing-class-docstring
4
4
 
@@ -198,6 +198,9 @@ class NotificationBaseEmbed:
198
198
  NotificationCorpAppInvitedMsg,
199
199
  NotificationCorpAppNewMsg,
200
200
  NotificationCorpAppRejectCustomMsg,
201
+ NotificationCorpGoalClosed,
202
+ NotificationCorpGoalCompleted,
203
+ NotificationCorpGoalCreated,
201
204
  )
202
205
  from .moonmining_embeds import (
203
206
  NotificationMoonminningAutomaticFracture,
@@ -283,7 +286,7 @@ class NotificationBaseEmbed:
283
286
  NT.BILLING_CORP_ALL_BILL_MSG: NotificationCorpAllBillMsg,
284
287
  NT.BILLING_I_HUB_BILL_ABOUT_TO_EXPIRE: NotificationBillingIHubBillAboutToExpire,
285
288
  NT.BILLING_I_HUB_DESTROYED_BY_BILL_FAILURE: NotificationBillingIHubDestroyedByBillFailure,
286
- # character
289
+ # Corporate
287
290
  NT.CHAR_APP_ACCEPT_MSG: NotificationCharAppAcceptMsg,
288
291
  NT.CHAR_APP_WITHDRAW_MSG: NotificationCharAppWithdrawMsg,
289
292
  NT.CHAR_LEFT_CORP_MSG: NotificationCharLeftCorpMsg,
@@ -291,6 +294,9 @@ class NotificationBaseEmbed:
291
294
  NT.CORP_APP_NEW_MSG: NotificationCorpAppNewMsg,
292
295
  NT.CORP_APP_REJECT_CUSTOM_MSG: NotificationCorpAppRejectCustomMsg,
293
296
  NT.CORP_APP_REJECT_MSG: NotificationCharAppRejectMsg,
297
+ NT.CORPORATION_GOAL_CLOSED: NotificationCorpGoalClosed,
298
+ NT.CORPORATION_GOAL_COMPLETED: NotificationCorpGoalCompleted,
299
+ NT.CORPORATION_GOAL_CREATED: NotificationCorpGoalCreated,
294
300
  # moonmining
295
301
  NT.MOONMINING_AUTOMATIC_FRACTURE: NotificationMoonminningAutomaticFracture,
296
302
  NT.MOONMINING_EXTRACTION_CANCELLED: NotificationMoonminningExtractionCanceled,
@@ -11,61 +11,42 @@ from structures.app_settings import STRUCTURES_FEATURE_REFUELED_NOTIFICATIONS
11
11
  class NotificationType(models.TextChoices):
12
12
  """Definition of all supported notification types."""
13
13
 
14
- # upwell structures
15
- OWNERSHIP_TRANSFERRED = "OwnershipTransferred", _(
16
- "Upwell structure ownership transferred"
17
- )
18
- STRUCTURE_ANCHORING = "StructureAnchoring", _("Upwell structure anchoring")
19
- STRUCTURE_DESTROYED = "StructureDestroyed", _("Upwell structure destroyed")
20
- STRUCTURE_FUEL_ALERT = "StructureFuelAlert", _("Upwell structure fuel alert")
21
- STRUCTURE_JUMP_FUEL_ALERT = "StructureJumpFuelAlert", _(
22
- "Upwell structure jump fuel alert"
23
- )
24
- STRUCTURE_LOST_ARMOR = "StructureLostArmor", _("Upwell structure lost armor")
25
- STRUCTURE_LOST_SHIELD = "StructureLostShields", _("Upwell structure lost shields")
26
- STRUCTURE_LOW_REAGENTS_ALERT = "StructureLowReagentsAlert", _(
27
- "Structure low reagents alert"
28
- )
29
- STRUCTURE_NO_REAGENTS_ALERT = "StructureNoReagentsAlert", _(
30
- "Structure no reagents alert"
31
- )
32
- STRUCTURE_ONLINE = "StructureOnline", _("Upwell structure went online")
33
- STRUCTURE_REFUELED_EXTRA = "StructureRefueledExtra", _("Upwell structure refueled")
34
- STRUCTURE_REINFORCEMENT_CHANGED = "StructuresReinforcementChanged", _(
35
- "Upwell structure reinforcement time changed"
36
- )
37
- STRUCTURE_SERVICES_OFFLINE = "StructureServicesOffline", _(
38
- "Upwell structure services went offline"
14
+ # billing
15
+ BILLING_BILL_OUT_OF_MONEY_MSG = "BillOutOfMoneyMsg", _("Bill out of money")
16
+ BILLING_CORP_ALL_BILL_MSG = "CorpAllBillMsg", _("Corp alliance billing message")
17
+ BILLING_I_HUB_BILL_ABOUT_TO_EXPIRE = (
18
+ "InfrastructureHubBillAboutToExpire",
19
+ _("I-HUB bill about to expire"),
39
20
  )
40
- STRUCTURE_UNANCHORING = "StructureUnanchoring", _("Upwell structure unanchoring")
41
- STRUCTURE_UNDER_ATTACK = "StructureUnderAttack", _(
42
- "Upwell structure is under attack"
21
+ BILLING_I_HUB_DESTROYED_BY_BILL_FAILURE = (
22
+ "IHubDestroyedByBillFailure",
23
+ _("I_HUB destroyed by bill failure"),
43
24
  )
44
- STRUCTURE_WENT_HIGH_POWER = "StructureWentHighPower", _(
45
- "Upwell structure went high power"
25
+
26
+ # Corporation Membership
27
+ CHAR_APP_ACCEPT_MSG = "CharAppAcceptMsg", _("Character joins corporation")
28
+ CORP_APP_INVITED_MSG = "CorpAppInvitedMsg", _(
29
+ "Character invited to join corporation"
46
30
  )
47
- STRUCTURE_WENT_LOW_POWER = "StructureWentLowPower", _(
48
- "Upwell structure went low power"
31
+ CORP_APP_NEW_MSG = "CorpAppNewMsg", _("Character submitted application")
32
+ CORP_APP_REJECT_MSG = "CharAppRejectMsg", _("Corp application rejected message")
33
+ CORP_APP_REJECT_CUSTOM_MSG = "CorpAppRejectCustomMsg", _(
34
+ "Corp application rejected custom message"
49
35
  )
36
+ CHAR_APP_WITHDRAW_MSG = "CharAppWithdrawMsg", _("Character withdrew application")
37
+ CHAR_LEFT_CORP_MSG = "CharLeftCorpMsg", _("Character leaves corporation")
50
38
 
51
- # Skyhook structures
52
- SKYHOOK_DEPLOYED = "SkyhookDeployed", _("Skyhook deployed")
53
- SKYHOOK_DESTROYED = "SkyhookDestroyed", _("Skyhook destroyed")
54
- SKYHOOK_LOST_SHIELDS = "SkyhookLostShields", _("Skyhook lost shields")
55
- SKYHOOK_ONLINE = "SkyhookOnline", _("Skyhook online")
56
- SKYHOOK_UNDER_ATTACK = "SkyhookUnderAttack", _("Skyhook under attack")
57
-
58
- # customs offices
59
- ORBITAL_ATTACKED = "OrbitalAttacked", _("Customs office attacked")
60
- ORBITAL_REINFORCED = "OrbitalReinforced", _("Customs office reinforced")
39
+ # Corporation Goals
40
+ CORPORATION_GOAL_CLOSED = "CorporationGoalClosed", _("Corporation goal closed")
41
+ CORPORATION_GOAL_COMPLETED = "CorporationGoalCompleted", _(
42
+ "Corporation goal completed"
43
+ )
44
+ CORPORATION_GOAL_CREATED = "CorporationGoalCreated", _("Corporation goal created")
45
+ # CORPORATION_GOAL_NAME_CHANGE = "CorporationGoalNameChange", _(
46
+ # "Corporation goal name change"
47
+ # )
61
48
 
62
- # starbases
63
- TOWER_ALERT_MSG = "TowerAlertMsg", _("Starbase attacked")
64
- TOWER_REFUELED_EXTRA = "TowerRefueledExtra", _("Starbase refueled (BETA)")
65
- TOWER_REINFORCED_EXTRA = "TowerReinforcedExtra", _("Starbase reinforced (BETA)")
66
- TOWER_RESOURCE_ALERT_MSG = "TowerResourceAlertMsg", _("Starbase fuel alert")
67
-
68
- # moon mining
49
+ # Moon Mining
69
50
  MOONMINING_AUTOMATIC_FRACTURE = "MoonminingAutomaticFracture", _(
70
51
  "Moon mining automatic fracture triggered"
71
52
  )
@@ -80,7 +61,18 @@ class NotificationType(models.TextChoices):
80
61
  )
81
62
  MOONMINING_LASER_FIRED = "MoonminingLaserFired", _("Moonmining laser fired")
82
63
 
83
- # sov
64
+ # Skyhook structures
65
+ SKYHOOK_DEPLOYED = "SkyhookDeployed", _("Skyhook deployed")
66
+ SKYHOOK_DESTROYED = "SkyhookDestroyed", _("Skyhook destroyed")
67
+ SKYHOOK_LOST_SHIELDS = "SkyhookLostShields", _("Skyhook lost shields")
68
+ SKYHOOK_ONLINE = "SkyhookOnline", _("Skyhook online")
69
+ SKYHOOK_UNDER_ATTACK = "SkyhookUnderAttack", _("Skyhook under attack")
70
+
71
+ # Orbitals
72
+ ORBITAL_ATTACKED = "OrbitalAttacked", _("Customs office attacked")
73
+ ORBITAL_REINFORCED = "OrbitalReinforced", _("Customs office reinforced")
74
+
75
+ # Sov
84
76
  SOV_ALL_CLAIM_ACQUIRED_MSG = "SovAllClaimAquiredMsg", _(
85
77
  "Sovereignty claim acknowledgment" # SovAllClaimAquiredMsg [sic!]
86
78
  )
@@ -101,7 +93,50 @@ class NotificationType(models.TextChoices):
101
93
  "Sovereignty command node event started"
102
94
  )
103
95
 
104
- # wars
96
+ # Starbases
97
+ TOWER_ALERT_MSG = "TowerAlertMsg", _("Starbase attacked")
98
+ TOWER_REFUELED_EXTRA = "TowerRefueledExtra", _("Starbase refueled (BETA)")
99
+ TOWER_REINFORCED_EXTRA = "TowerReinforcedExtra", _("Starbase reinforced (BETA)")
100
+ TOWER_RESOURCE_ALERT_MSG = "TowerResourceAlertMsg", _("Starbase fuel alert")
101
+
102
+ # Upwell Structures
103
+ OWNERSHIP_TRANSFERRED = "OwnershipTransferred", _(
104
+ "Upwell structure ownership transferred"
105
+ )
106
+ STRUCTURE_ANCHORING = "StructureAnchoring", _("Upwell structure anchoring")
107
+ STRUCTURE_DESTROYED = "StructureDestroyed", _("Upwell structure destroyed")
108
+ STRUCTURE_FUEL_ALERT = "StructureFuelAlert", _("Upwell structure fuel alert")
109
+ STRUCTURE_JUMP_FUEL_ALERT = "StructureJumpFuelAlert", _(
110
+ "Upwell structure jump fuel alert"
111
+ )
112
+ STRUCTURE_LOST_ARMOR = "StructureLostArmor", _("Upwell structure lost armor")
113
+ STRUCTURE_LOST_SHIELD = "StructureLostShields", _("Upwell structure lost shields")
114
+ STRUCTURE_LOW_REAGENTS_ALERT = "StructureLowReagentsAlert", _(
115
+ "Structure low reagents alert"
116
+ )
117
+ STRUCTURE_NO_REAGENTS_ALERT = "StructureNoReagentsAlert", _(
118
+ "Structure no reagents alert"
119
+ )
120
+ STRUCTURE_ONLINE = "StructureOnline", _("Upwell structure went online")
121
+ STRUCTURE_REFUELED_EXTRA = "StructureRefueledExtra", _("Upwell structure refueled")
122
+ STRUCTURE_REINFORCEMENT_CHANGED = "StructuresReinforcementChanged", _(
123
+ "Upwell structure reinforcement time changed"
124
+ )
125
+ STRUCTURE_SERVICES_OFFLINE = "StructureServicesOffline", _(
126
+ "Upwell structure services went offline"
127
+ )
128
+ STRUCTURE_UNANCHORING = "StructureUnanchoring", _("Upwell structure unanchoring")
129
+ STRUCTURE_UNDER_ATTACK = "StructureUnderAttack", _(
130
+ "Upwell structure is under attack"
131
+ )
132
+ STRUCTURE_WENT_HIGH_POWER = "StructureWentHighPower", _(
133
+ "Upwell structure went high power"
134
+ )
135
+ STRUCTURE_WENT_LOW_POWER = "StructureWentLowPower", _(
136
+ "Upwell structure went low power"
137
+ )
138
+
139
+ # Wars
105
140
  WAR_ACCEPTED_ALLY = "AcceptedAlly", _("War accepted ally")
106
141
  WAR_ALL_WAR_CORP_JOINED_ALLIANCE_MSG = "AllWarCorpJoinedAllianceMsg", _(
107
142
  "Alliance war corporation joined alliance message"
@@ -142,31 +177,6 @@ class NotificationType(models.TextChoices):
142
177
  )
143
178
  WAR_WAR_SURRENDER_OFFER_MSG = "WarSurrenderOfferMsg", _("War surrender offered")
144
179
 
145
- # corporation membership
146
- CHAR_APP_ACCEPT_MSG = "CharAppAcceptMsg", _("Character joins corporation")
147
- CORP_APP_INVITED_MSG = "CorpAppInvitedMsg", _(
148
- "Character invited to join corporation"
149
- )
150
- CORP_APP_NEW_MSG = "CorpAppNewMsg", _("Character submitted application")
151
- CORP_APP_REJECT_MSG = "CharAppRejectMsg", _("Corp application rejected message")
152
- CORP_APP_REJECT_CUSTOM_MSG = "CorpAppRejectCustomMsg", _(
153
- "Corp application rejected custom message"
154
- )
155
- CHAR_APP_WITHDRAW_MSG = "CharAppWithdrawMsg", _("Character withdrew application")
156
- CHAR_LEFT_CORP_MSG = "CharLeftCorpMsg", _("Character leaves corporation")
157
-
158
- # billing
159
- BILLING_BILL_OUT_OF_MONEY_MSG = "BillOutOfMoneyMsg", _("Bill out of money")
160
- BILLING_CORP_ALL_BILL_MSG = "CorpAllBillMsg", _("Corp alliance billing message")
161
- BILLING_I_HUB_BILL_ABOUT_TO_EXPIRE = (
162
- "InfrastructureHubBillAboutToExpire",
163
- _("I-HUB bill about to expire"),
164
- )
165
- BILLING_I_HUB_DESTROYED_BY_BILL_FAILURE = (
166
- "IHubDestroyedByBillFailure",
167
- _("I_HUB destroyed by bill failure"),
168
- )
169
-
170
180
  @classmethod
171
181
  def esi_notifications(cls) -> Set["NotificationType"]:
172
182
  """Return all ESI notification types."""
structures/managers.py CHANGED
@@ -392,7 +392,7 @@ class StructureManagerBase(models.Manager):
392
392
  def update_or_create_from_dict(
393
393
  self, structure: dict, owner: Owner
394
394
  ) -> Tuple[Any, bool]:
395
- """update or create structure from given dict"""
395
+ """Update or create a structure from a dict."""
396
396
 
397
397
  eve_type: EveType = EveType.objects.get_or_create_esi(id=structure["type_id"])[
398
398
  0
@@ -0,0 +1,152 @@
1
+ # Generated by Django 4.2.16 on 2024-11-05 14:05
2
+
3
+ import multiselectfield.db.fields
4
+
5
+ from django.db import migrations
6
+
7
+
8
+ class Migration(migrations.Migration):
9
+
10
+ dependencies = [
11
+ ("structures", "0008_add_notificationtypes_skyhook_metenox"),
12
+ ]
13
+
14
+ operations = [
15
+ migrations.AlterField(
16
+ model_name="webhook",
17
+ name="notification_types",
18
+ field=multiselectfield.db.fields.MultiSelectField(
19
+ choices=[
20
+ ("BillOutOfMoneyMsg", "Bill out of money"),
21
+ ("CorpAllBillMsg", "Corp alliance billing message"),
22
+ (
23
+ "InfrastructureHubBillAboutToExpire",
24
+ "I-HUB bill about to expire",
25
+ ),
26
+ ("IHubDestroyedByBillFailure", "I_HUB destroyed by bill failure"),
27
+ ("CharAppAcceptMsg", "Character joins corporation"),
28
+ ("CorpAppInvitedMsg", "Character invited to join corporation"),
29
+ ("CorpAppNewMsg", "Character submitted application"),
30
+ ("CharAppRejectMsg", "Corp application rejected message"),
31
+ (
32
+ "CorpAppRejectCustomMsg",
33
+ "Corp application rejected custom message",
34
+ ),
35
+ ("CharAppWithdrawMsg", "Character withdrew application"),
36
+ ("CharLeftCorpMsg", "Character leaves corporation"),
37
+ ("CorporationGoalClosed", "Corporation goal closed"),
38
+ ("CorporationGoalCompleted", "Corporation goal completed"),
39
+ ("CorporationGoalCreated", "Corporation goal created"),
40
+ (
41
+ "MoonminingAutomaticFracture",
42
+ "Moon mining automatic fracture triggered",
43
+ ),
44
+ (
45
+ "MoonminingExtractionCancelled",
46
+ "Moon mining extraction cancelled",
47
+ ),
48
+ ("MoonminingExtractionFinished", "Moon mining extraction finished"),
49
+ ("MoonminingExtractionStarted", "Moon mining extraction started"),
50
+ ("MoonminingLaserFired", "Moonmining laser fired"),
51
+ ("SkyhookDeployed", "Skyhook deployed"),
52
+ ("SkyhookDestroyed", "Skyhook destroyed"),
53
+ ("SkyhookLostShields", "Skyhook lost shields"),
54
+ ("SkyhookOnline", "Skyhook online"),
55
+ ("SkyhookUnderAttack", "Skyhook under attack"),
56
+ ("OrbitalAttacked", "Customs office attacked"),
57
+ ("OrbitalReinforced", "Customs office reinforced"),
58
+ ("SovAllClaimAquiredMsg", "Sovereignty claim acknowledgment"),
59
+ ("SovAllClaimLostMsg", "Sovereignty lost"),
60
+ ("AllAnchoringMsg", "Structure anchoring in alliance space"),
61
+ ("EntosisCaptureStarted", "Sovereignty entosis capture started"),
62
+ ("SovStructureDestroyed", "Sovereignty structure destroyed"),
63
+ ("SovStructureReinforced", "Sovereignty structure reinforced"),
64
+ (
65
+ "SovCommandNodeEventStarted",
66
+ "Sovereignty command node event started",
67
+ ),
68
+ ("TowerAlertMsg", "Starbase attacked"),
69
+ ("TowerRefueledExtra", "Starbase refueled (BETA)"),
70
+ ("TowerReinforcedExtra", "Starbase reinforced (BETA)"),
71
+ ("TowerResourceAlertMsg", "Starbase fuel alert"),
72
+ ("OwnershipTransferred", "Upwell structure ownership transferred"),
73
+ ("StructureAnchoring", "Upwell structure anchoring"),
74
+ ("StructureDestroyed", "Upwell structure destroyed"),
75
+ ("StructureFuelAlert", "Upwell structure fuel alert"),
76
+ ("StructureJumpFuelAlert", "Upwell structure jump fuel alert"),
77
+ ("StructureLostArmor", "Upwell structure lost armor"),
78
+ ("StructureLostShields", "Upwell structure lost shields"),
79
+ ("StructureLowReagentsAlert", "Structure low reagents alert"),
80
+ ("StructureNoReagentsAlert", "Structure no reagents alert"),
81
+ ("StructureOnline", "Upwell structure went online"),
82
+ ("StructureRefueledExtra", "Upwell structure refueled"),
83
+ (
84
+ "StructuresReinforcementChanged",
85
+ "Upwell structure reinforcement time changed",
86
+ ),
87
+ (
88
+ "StructureServicesOffline",
89
+ "Upwell structure services went offline",
90
+ ),
91
+ ("StructureUnanchoring", "Upwell structure unanchoring"),
92
+ ("StructureUnderAttack", "Upwell structure is under attack"),
93
+ ("StructureWentHighPower", "Upwell structure went high power"),
94
+ ("StructureWentLowPower", "Upwell structure went low power"),
95
+ ("AcceptedAlly", "War accepted ally"),
96
+ (
97
+ "AllWarCorpJoinedAllianceMsg",
98
+ "Alliance war corporation joined alliance message",
99
+ ),
100
+ ("AllWarSurrenderMsg", "Alliance war surrender message"),
101
+ ("AllyJoinedWarAggressorMsg", "War ally joined aggressor"),
102
+ ("AllyJoinedWarAllyMsg", "War ally joined ally"),
103
+ ("AllyJoinedWarDefenderMsg", "War ally joined defender"),
104
+ ("CorpWarSurrenderMsg", "War party surrendered"),
105
+ ("CorpBecameWarEligible", "War corporation became eligible"),
106
+ ("CorpNoLongerWarEligible", "War corporation no longer eligible"),
107
+ ("DeclareWar", "War declared"),
108
+ ("WarHQRemovedFromSpace", "War HQ removed from space"),
109
+ ("WarInvalid", "War invalid"),
110
+ (
111
+ "MercOfferedNegotiationMsg",
112
+ "War mercenary offered negotiation message",
113
+ ),
114
+ ("MercOfferRetractedMsg", "War mercenary offer retracted message"),
115
+ ("OfferedSurrender", "War offered surrender"),
116
+ ("OfferedToAlly", "War offered to become ally"),
117
+ ("WarAdopted", "War adopted"),
118
+ ("WarDeclared", "War declared"),
119
+ ("WarInherited", "War inherited"),
120
+ ("WarRetractedByConcord", "War retracted by Concord"),
121
+ ("WarSurrenderOfferMsg", "War surrender offered"),
122
+ ],
123
+ default=[
124
+ "OrbitalAttacked",
125
+ "OrbitalReinforced",
126
+ "SkyhookDestroyed",
127
+ "SkyhookLostShields",
128
+ "SkyhookOnline",
129
+ "SkyhookUnderAttack",
130
+ "SovStructureDestroyed",
131
+ "SovStructureReinforced",
132
+ "StructureAnchoring",
133
+ "StructureDestroyed",
134
+ "StructureFuelAlert",
135
+ "StructureLostArmor",
136
+ "StructureLostShields",
137
+ "StructureLowReagentsAlert",
138
+ "StructureNoReagentsAlert",
139
+ "StructureOnline",
140
+ "StructureServicesOffline",
141
+ "StructureUnderAttack",
142
+ "StructureWentHighPower",
143
+ "StructureWentLowPower",
144
+ "TowerAlertMsg",
145
+ "TowerResourceAlertMsg",
146
+ ],
147
+ help_text="Select which type of notifications should be forwarded to this webhook",
148
+ max_length=1544,
149
+ verbose_name="notification types",
150
+ ),
151
+ ),
152
+ ]