Skip to content

Commit

Permalink
Change send slash fkey to distribution_id
Browse files Browse the repository at this point in the history
  • Loading branch information
youngkidwarrior committed Nov 27, 2024
1 parent 6547d57 commit f30b4bc
Show file tree
Hide file tree
Showing 3 changed files with 410 additions and 27 deletions.
2 changes: 1 addition & 1 deletion apps/distributor/src/distributorv2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ export class DistributorV2Worker {
const { data: sendSlash, error: sendSlashError } = await supabaseAdmin
.from('send_slash')
.select('*')
.eq('distribution_number', distribution.number)
.eq('distribution_id', distribution.id)
.single()

if (sendSlashError) {
Expand Down
43 changes: 17 additions & 26 deletions supabase/database-generated.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -861,27 +861,30 @@ export type Database = {
}
send_slash: {
Row: {
distribution_id: number | null
distribution_number: number
minimum_sends: number
scaling_divisor: number
}
Insert: {
distribution_id?: number | null
distribution_number: number
minimum_sends?: number
scaling_divisor?: number
}
Update: {
distribution_id?: number | null
distribution_number?: number
minimum_sends?: number
scaling_divisor?: number
}
Relationships: [
{
foreignKeyName: "send_slash_distribution_number_fkey"
columns: ["distribution_number"]
isOneToOne: true
foreignKeyName: "send_slash_distribution_id_fkey"
columns: ["distribution_id"]
isOneToOne: false
referencedRelation: "distributions"
referencedColumns: ["number"]
referencedColumns: ["id"]
},
]
}
Expand Down Expand Up @@ -1339,28 +1342,16 @@ export type Database = {
user_id: string
}
}
sum_qualification_sends:
| {
Args: {
distribution_number: number
}
Returns: {
user_id: string
amount: number
sent_to: string[]
}[]
}
| {
Args: {
distribution_number: number
send_ceiling: number
}
Returns: {
user_id: string
amount: number
sent_to: string[]
}[]
}
sum_qualification_sends: {
Args: {
distribution_number: number
}
Returns: {
user_id: string
amount: number
sent_to: string[]
}[]
}
tag_search: {
Args: {
query: string
Expand Down
Loading

0 comments on commit f30b4bc

Please sign in to comment.