Files
InvoiceShelf/resources/scripts-v2/config/abilities.ts
Darko Gjorgjijoski 991b716b33 Phase 1: TypeScript foundation in scripts-v2/
Create the complete TypeScript foundation for the Vue 3 migration
in a parallel scripts-v2/ directory. 72 files, 5430 lines, zero
any types, strict mode.

- types/ (21 files): Domain interfaces for all 17 entities derived
  from actual Laravel models and API resources. Enums for all
  statuses. Generic API response wrappers.
- api/ (29 files): Typed axios client with interceptors, endpoint
  constants from routes/api.php, 25 typed service classes covering
  every API endpoint.
- composables/ (14 files): Vue 3 composition functions for auth,
  notifications, dialogs, modals, pagination, filters, currency,
  dates, theme, sidebar, company context, and permissions.
- utils/ (5 files): Pure typed utilities for money formatting,
  date formatting (date-fns), localStorage, and error handling.
- config/ (3 files): Typed ability constants, app constants.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 05:00:00 +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]