PlusSuggestionRepository
app/features/plus-suggestions/PlusSuggestionRepository.server.ts- Tables
- PlusSuggestionPlusTierUserUserSubmittedImage
- Calls
- no other repositories
- Imports
- no other modules
- Used by
- 1 loader3 actions1 route1 repository1 script3 other
Types
export type FindAllByMonthItem = Unwrapped<typeof findAllByMonth>;
export interface MonthSummary { /** How many users have been suggested, per tier. */ suggestionCountsByTier: Record<PlusTier, number>; /** Tiers `userId` has themselves been suggested to. */ suggestedForTiers: Array<PlusTier>; /** Whether `userId` has started a suggestion of their own this month. */ hasSuggested: boolean; }
Only used inside the module
Functions & values
export async function findAllByMonth(args: MonthYear & { tier?: number })
export async function findMonthSummary( args: MonthYear & { userId: number | null }, ): Promise<MonthSummary>
TablesPlusSuggestionPlusTier
export function insert(args: Insertable<DB["PlusSuggestion"]>)
TablesPlusSuggestion
export function updateTextById(id: number, text: string)
TablesPlusSuggestion
Actions/plus/suggestions
export function deleteWithCommentsBySuggestedUserId({ tier, userId, month, year, }: { tier: number; userId: number; month: number; year: number; })
TablesPlusSuggestion
Actions/plus/suggestions