(userId: string, now: Date)
| 69 | > /* + whatever else you call */ |
| 70 | |
| 71 | function buildActiveGrantsFilter(userId: string, now: Date) { |
| 72 | return and( |
| 73 | eq(schema.creditLedger.user_id, userId), |
| 74 | or( |
| 75 | isNull(schema.creditLedger.expires_at), |
| 76 | gt(schema.creditLedger.expires_at, now), |
| 77 | ), |
| 78 | ) |
| 79 | } |
| 80 | |
| 81 | /** |
| 82 | * Gets active grants for a user, ordered by expiration (soonest first), then priority, and creation date. |
no outgoing calls
no test coverage detected