@notidotbot/noti-api-client 1.9.61 → 1.9.63

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.
@@ -33,6 +33,43 @@ model GuildGiveaway {
33
33
  roleBonuses GuildGiveawayRoleBonus[]
34
34
  requirements GuildGiveawayRequirements?
35
35
  bypassRequirementsRoles String[]
36
+
37
+ // Claim to win (phases/giveaway-claims/). Null window = no claiming, the original behaviour.
38
+ claimWindowMinutes Int?
39
+ claimRound Int @default(0)
40
+ claimFinishedAt DateTime?
41
+ claimMessageId String?
42
+ winners GuildGiveawayWinner[]
43
+
44
+ winnerRoleId String?
45
+ winnerRoleRemoveAfterDays Int?
46
+ dmWinners Boolean?
47
+
48
+ // Public giveaways page: null follows the server's `publicGiveaways`, true/false overrides it.
49
+ publicListing Boolean?
50
+
51
+ // The public page scans running giveaways across every server.
52
+ @@index([endedAt, startedAt])
53
+ }
54
+
55
+ // One row per user drawn as a winner, per giveaway. `winnerIds` on the giveaway still means "current
56
+ // winners" for every existing reader; this table holds the claim state behind it. The unique pair is
57
+ // what makes "never draw someone who already won a round" a property of the table.
58
+ model GuildGiveawayWinner {
59
+ dbId String @id @default(uuid())
60
+
61
+ userId String
62
+ round Int
63
+ status GiveawayWinnerStatusEnum
64
+ claimDeadline DateTime?
65
+ claimedAt DateTime?
66
+ createdAt DateTime @default(now())
67
+
68
+ guildGiveawayId String
69
+ guildGiveaway GuildGiveaway? @relation(fields: [guildGiveawayId], references: [dbId], onUpdate: Cascade, onDelete: Cascade)
70
+
71
+ @@unique([guildGiveawayId, userId])
72
+ @@index([guildGiveawayId, status])
36
73
  }
37
74
 
38
75
  model GuildGiveawayEntry {
@@ -44,6 +81,11 @@ model GuildGiveawayEntry {
44
81
 
45
82
  guildGiveawayId String
46
83
  guildGiveaway GuildGiveaway? @relation(fields: [guildGiveawayId], references: [dbId], onUpdate: Cascade, onDelete: Cascade)
84
+
85
+ // One entry per user per giveaway, enforced here rather than by an in-memory check that two fast clicks
86
+ // could both pass. Run src/scripts/dedupe-giveaway-entries.ts --apply BEFORE the push that adds this.
87
+ @@unique([guildGiveawayId, userId])
88
+ @@index([guildGiveawayId])
47
89
  }
48
90
 
49
91
  model GuildGiveawayFilter {
@@ -76,6 +118,7 @@ model GuildGiveawayRequirements {
76
118
  boostingServer Boolean?
77
119
  messageCount Int?
78
120
  roles String[]
121
+ minAccountAgeDays Int?
79
122
 
80
123
  guildGiveawayId String @unique
81
124
  guildGiveaway GuildGiveaway? @relation(fields: [guildGiveawayId], references: [dbId], onUpdate: Cascade, onDelete: Cascade)
@@ -32,6 +32,9 @@ model Guild {
32
32
 
33
33
  disableDoubleVoteEntry Boolean?
34
34
  giveawayLogsChannelId String?
35
+ // Public giveaways page. Written only by /data/guild/:guildId/public-giveaways (updatePublicGiveawaySettings).
36
+ publicGiveaways Boolean @default(true)
37
+ giveawayJoinLinks Boolean @default(false)
35
38
 
36
39
  randomMessages GuildRandomMessage[]
37
40
 
@@ -178,6 +178,12 @@ enum RoleBonusEnum {
178
178
  highest
179
179
  }
180
180
 
181
+ enum GiveawayWinnerStatusEnum {
182
+ pending
183
+ claimed
184
+ expired
185
+ }
186
+
181
187
  enum UserNotificationSeverityEnum {
182
188
  info
183
189
  warning