Files
InvoiceShelf/resources/scripts/config/abilities.ts
Darko Gjorgjijoski 71388ec6a5 Rename resources/scripts-v2 to resources/scripts and drop @v2 alias
Now that the legacy v1 frontend (commit 064bdf53) is gone, the v2 directory is the only frontend and the v2 suffix is just noise. Renames resources/scripts-v2 to resources/scripts via git mv (so git records the move as renames, preserving blame and log --follow), then bulk-rewrites the 152 files that imported via @v2/... to use @/scripts/... instead. The existing @ alias (resources/) covers the new path with no extra config needed.

Drops the now-unused @v2 alias from vite.config.js and points the laravel-vite-plugin entry at resources/scripts/main.ts. Updates the only blade reference (resources/views/app.blade.php) to match. The package.json test script (eslint ./resources/scripts) automatically targets the right place after the rename without any edit.

Verified: npm run build exits clean and the Vite warning lines now reference resources/scripts/plugins/i18n.ts, confirming every import resolved through the new path. git log --follow on any moved file walks back through its scripts-v2 history.
2026-04-07 12:50:16 +02:00

83 lines
2.2 KiB
TypeScript

export const ABILITIES = {
// Dashboard
DASHBOARD: 'dashboard',
// Customers
CREATE_CUSTOMER: 'create-customer',
DELETE_CUSTOMER: 'delete-customer',
EDIT_CUSTOMER: 'edit-customer',
VIEW_CUSTOMER: 'view-customer',
// Items
CREATE_ITEM: 'create-item',
DELETE_ITEM: 'delete-item',
EDIT_ITEM: 'edit-item',
VIEW_ITEM: 'view-item',
// Tax Types
CREATE_TAX_TYPE: 'create-tax-type',
DELETE_TAX_TYPE: 'delete-tax-type',
EDIT_TAX_TYPE: 'edit-tax-type',
VIEW_TAX_TYPE: 'view-tax-type',
// Estimates
CREATE_ESTIMATE: 'create-estimate',
DELETE_ESTIMATE: 'delete-estimate',
EDIT_ESTIMATE: 'edit-estimate',
VIEW_ESTIMATE: 'view-estimate',
SEND_ESTIMATE: 'send-estimate',
// Invoices
CREATE_INVOICE: 'create-invoice',
DELETE_INVOICE: 'delete-invoice',
EDIT_INVOICE: 'edit-invoice',
VIEW_INVOICE: 'view-invoice',
SEND_INVOICE: 'send-invoice',
// Recurring Invoices
CREATE_RECURRING_INVOICE: 'create-recurring-invoice',
DELETE_RECURRING_INVOICE: 'delete-recurring-invoice',
EDIT_RECURRING_INVOICE: 'edit-recurring-invoice',
VIEW_RECURRING_INVOICE: 'view-recurring-invoice',
// Payments
CREATE_PAYMENT: 'create-payment',
DELETE_PAYMENT: 'delete-payment',
EDIT_PAYMENT: 'edit-payment',
VIEW_PAYMENT: 'view-payment',
SEND_PAYMENT: 'send-payment',
// Expenses
CREATE_EXPENSE: 'create-expense',
DELETE_EXPENSE: 'delete-expense',
EDIT_EXPENSE: 'edit-expense',
VIEW_EXPENSE: 'view-expense',
// Custom Fields
CREATE_CUSTOM_FIELDS: 'create-custom-field',
DELETE_CUSTOM_FIELDS: 'delete-custom-field',
EDIT_CUSTOM_FIELDS: 'edit-custom-field',
VIEW_CUSTOM_FIELDS: 'view-custom-field',
// Roles
CREATE_ROLE: 'create-role',
DELETE_ROLE: 'delete-role',
EDIT_ROLE: 'edit-role',
VIEW_ROLE: 'view-role',
// Exchange Rates
VIEW_EXCHANGE_RATE: 'view-exchange-rate-provider',
CREATE_EXCHANGE_RATE: 'create-exchange-rate-provider',
EDIT_EXCHANGE_RATE: 'edit-exchange-rate-provider',
DELETE_EXCHANGE_RATE: 'delete-exchange-rate-provider',
// Reports
VIEW_FINANCIAL_REPORT: 'view-financial-reports',
// Notes
MANAGE_NOTE: 'manage-all-notes',
VIEW_NOTE: 'view-all-notes',
} as const
export type Ability = typeof ABILITIES[keyof typeof ABILITIES]