Conversation
WalkthroughType annotations were added to column-visibility dropdown callbacks across several Vue pages. Patent status defaults and mapping were updated: database default changed to 'not_paid', helpers now explicitly return string with a default branch, and select option order adjusted. AgreementPatentStatus union order was rearranged. Workspace dependencies were bumped. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant UI as Web UI (pages/*)
participant DB as DB (partnerAgreements)
participant Helpers as helpers.getPatentStatus
User->>UI: Open Agreement/Products page
UI->>DB: Fetch partner agreement (patentStatus)
DB-->>UI: patentStatus (defaults to "not_paid" if unset)
UI->>Helpers: getPatentStatus(status)
alt known status
Helpers-->>UI: mapped label (string)
else unknown/undefined
Helpers-->>UI: "" (default branch)
end
UI-->>User: Render status label and column dropdown
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (8)
pnpm-workspace.yaml (1)
6-6: Add missing Node engine constraints and verify Nuxt/Vue peerDependencies
- Only the root package (
roll-stack) specifiesengines.node(>=22.18.0); add a consistentengines.node(≥18 or ≥20) field to all other packages.- No package declares
peerDependenciesfornuxt,@nuxt/ui, orvue; confirm whether they’re required.pnpm-lock.yamlcorrectly reflects the@antfu/eslint-config@5.2.2bump.apps/web-app/app/pages/head/task/index.vue (1)
75-76: Avoid any: type columns as TanStack Column<Task, unknown>Keeps IntelliSense and catches API drift while remaining template-friendly.
Apply:
- .filter((column: any) => column.getCanHide()) - .map((column: any) => ({ + .filter((column: Column<Task, unknown>) => column.getCanHide()) + .map((column: Column<Task, unknown>) => ({Add to <script setup>:
import type { Column } from '@tanstack/table-core'apps/web-app/app/pages/product/[productId]/usage.vue (1)
16-17: Strongly type table columnsPrefer Column<MenuCategory, unknown> to preserve API typing.
Apply:
- .filter((column: any) => column.getCanHide()) - .map((column: any) => ({ + .filter((column: Column<MenuCategory, unknown>) => column.getCanHide()) + .map((column: Column<MenuCategory, unknown>) => ({And in <script setup>:
import type { Column } from '@tanstack/table-core'apps/web-app/app/pages/print/index.vue (1)
37-38: Type safety for columns in templateUse Column<PrintWithData, unknown> instead of any.
Apply:
- .filter((column: any) => column.getCanHide()) - .map((column: any) => ({ + .filter((column: Column<PrintWithData, unknown>) => column.getCanHide()) + .map((column: Column<PrintWithData, unknown>) => ({Add to <script setup>:
import type { Column } from '@tanstack/table-core'apps/web-app/app/pages/agreement/index.vue (1)
18-19: Replace any with precise TanStack Column typeImproves TS coverage without changing behavior.
Apply:
- .filter((column: any) => column.getCanHide()) - .map((column: any) => ({ + .filter((column: Column<PartnerAgreementWithAllData, unknown>) => column.getCanHide()) + .map((column: Column<PartnerAgreementWithAllData, unknown>) => ({And add:
import type { Column } from '@tanstack/table-core'apps/web-app/app/pages/product/index.vue (1)
27-29: Avoid any: type columns with TanStack Column to keep safetyUse Column<ProductWithData, unknown> instead of any in filter/map.
- .filter((column: any) => column.getCanHide()) - .map((column: any) => ({ + .filter((column: Column<ProductWithData, unknown>) => column.getCanHide()) + .map((column: Column<ProductWithData, unknown>) => ({Add import in <script setup>:
import type { Column } from '@tanstack/table-core'apps/web-app/app/pages/kitchen/index.vue (1)
18-20: Same: replace any with Column<KitchenWithData, unknown>Keep template type-safe; mirrors product page suggestion.
- .filter((column: any) => column.getCanHide()) - .map((column: any) => ({ + .filter((column: Column<KitchenWithData, unknown>) => column.getCanHide()) + .map((column: Column<KitchenWithData, unknown>) => ({Also add:
import type { Column } from '@tanstack/table-core'apps/web-app/shared/utils/helpers.ts (1)
34-46: Drop default to keep exhaustiveness on AgreementPatentStatusDefault branch hides future status additions from the type checker. Prefer exhaustive switch (or assertNever).
export function getPatentStatus(status: AgreementPatentStatus): string { switch (status) { case 'not_paid': return 'Не оплачен' case 'in_work': return 'В работе' case 'on_registration': return 'На регистрации' case 'registered': return 'Зарегистрирован' - default: - return '' } }Optional helper (outside this range) if you want a runtime guard:
function assertNever(x: never): never { throw new Error(`Unhandled status: ${x}`) }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (10)
apps/web-app/app/pages/agreement/index.vue(1 hunks)apps/web-app/app/pages/head/task/index.vue(1 hunks)apps/web-app/app/pages/kitchen/index.vue(1 hunks)apps/web-app/app/pages/print/index.vue(1 hunks)apps/web-app/app/pages/product/[productId]/usage.vue(1 hunks)apps/web-app/app/pages/product/index.vue(1 hunks)apps/web-app/shared/utils/helpers.ts(1 hunks)packages/database/src/tables.ts(1 hunks)packages/database/src/types.ts(1 hunks)pnpm-workspace.yaml(3 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
packages/database/src/tables.ts (1)
packages/database/src/types.ts (1)
AgreementPatentStatus(21-21)
apps/web-app/shared/utils/helpers.ts (1)
packages/database/src/types.ts (1)
AgreementPatentStatus(21-21)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (2)
packages/database/src/types.ts (1)
21-21: Union reorder is fineOrder change preserves the set of literals; no runtime impact. Aligns with new DB default and helpers.
apps/web-app/shared/utils/helpers.ts (1)
49-55: Select options order update matches new defaultNot_paid first is consistent across DB and UI. LGTM.
| lumpSumPayment: numeric('lump_sum_payment', { mode: 'number' }).notNull().default(0), | ||
| comment: varchar('comment'), | ||
| patentStatus: varchar('patent_status').notNull().default('in_work').$type<AgreementPatentStatus>(), | ||
| patentStatus: varchar('patent_status').notNull().default('not_paid').$type<AgreementPatentStatus>(), |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Change DB default → add migration and check seed assumptions
Default switched to 'not_paid'. Ensure a migration alters the column default and that any seeds/tests relying on 'in_work' are adjusted.
Example Drizzle SQL migration:
ALTER TABLE "partner_agreements"
ALTER COLUMN "patent_status" SET DEFAULT 'not_paid';Quick scan script to find hardcoded assumptions:
🏁 Script executed:
#!/bin/bash
rg -nP "(patent_status|patentStatus).*(in_work)"
rg -nP "default\\(['\"]in_work['\"]\\)"Length of output: 224
🏁 Script executed:
#!/bin/bash
# Search migrations for patent_status default alterations
rg -nP 'ALTER TABLE.*patent_status.*DEFAULT' -g '*/migrations/*'
# Search seeds for explicit patent_status 'in_work' usage
rg -nP 'patent_status.*in_work' -g '*/seed*/*'Length of output: 413
🏁 Script executed:
#!/bin/bash
# Locate migrations directories
find . -type d -iname '*migrations*'
# Search migration files for any patent_status references
rg -n 'patent_status' -g '*/migrations/*'
# Locate seed directories
find . -type d -iname '*seed*'
# Search seed files for patent_status and in_work usages
rg -n 'patent_status' -g '*/seed*/*'
rg -n 'in_work' -g '*/seed*/*'
# Search entire codebase for in_work references (tests, services, etc.)
rg -n 'in_work'Length of output: 1047
Add migration to update patent_status default
- Create a migration altering
partner_agreements.patent_statusdefault to'not_paid'(e.g.ALTER TABLE "partner_agreements" ALTER COLUMN "patent_status" SET DEFAULT 'not_paid'; ```)
- Manually verify there are no seed scripts or test fixtures still assuming the old default (
'in_work')—none were found inmigrations/orseed*/directories, but double-check any custom fixtures.
🤖 Prompt for AI Agents
In packages/database/src/tables.ts around line 128, the schema default for
patentStatus was changed to 'not_paid' but no DB migration was added; create a
new migration that runs an ALTER TABLE "partner_agreements" ALTER COLUMN
"patent_status" SET DEFAULT 'not_paid' (and the corresponding DOWN migration to
reset to the previous default if needed), apply it to your migrations directory,
and run/verify it against your dev DB; also search and manually verify all seed
scripts, test fixtures, and custom fixtures for any assumptions of the old
default 'in_work' and update them if found.



Summary by CodeRabbit
New Features
Chores
Refactor