@accounter/client 0.0.8-alpha-20251021225827-178e480c997a9811913e16f85cb94329041b096e → 0.0.8-alpha-20251022130946-0923a77d2ee3f22a60a7f5b1e0623bd3bee88868
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -25
- package/dist/assets/index-B2UYAO1O.css +1 -0
- package/dist/assets/index-BexxGuN6.js +1224 -0
- package/dist/assets/{index.es-CYeQ4a5s.js → index.es-CWwhWGxX.js} +5 -5
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/src/components/business-transactions/business-extended-info.tsx +15 -13
- package/src/components/business-transactions/business-transactions-single.tsx +3 -3
- package/src/components/business-transactions/index.tsx +1 -12
- package/src/components/business-trips/business-trip.tsx +3 -3
- package/src/components/charges/cells/business-trip.tsx +8 -6
- package/src/components/charges/cells/counterparty.tsx +5 -7
- package/src/components/common/accounter-table.tsx +5 -6
- package/src/components/common/business-trip-report/parts/core-expense-row.tsx +9 -11
- package/src/components/common/business-trip-report/parts/uncategorized-transactions.tsx +13 -11
- package/src/components/common/buttons/button-with-label.tsx +41 -0
- package/src/components/common/buttons/button.tsx +44 -0
- package/src/components/common/buttons/index.ts +2 -0
- package/src/components/common/buttons/logout-button.tsx +6 -7
- package/src/components/common/documents-to-charge-matcher/selection-handler/index.tsx +2 -4
- package/src/components/common/documents-to-charge-matcher/selection-handler/wide-filtered-selection.tsx +7 -5
- package/src/components/common/forms/edit-document.tsx +10 -23
- package/src/components/common/new-documents-list.tsx +8 -10
- package/src/components/documents-table/cells/creditor.tsx +4 -11
- package/src/components/documents-table/cells/debtor.tsx +4 -11
- package/src/components/layout/dashboard-layout.tsx +0 -4
- package/src/components/layout/sidelinks.tsx +27 -28
- package/src/components/ledger-table/counterparty-cell.tsx +13 -19
- package/src/components/login-page.tsx +1 -2
- package/src/components/reports/corporate-tax-ruling-compliance-report/index.tsx +3 -3
- package/src/components/reports/profit-and-loss-report/index.tsx +3 -3
- package/src/components/reports/tax-report/index.tsx +3 -3
- package/src/components/screens/businesses/business.tsx +9 -21
- package/src/components/screens/charges/charge.tsx +9 -22
- package/src/components/transactions-table/cells/counterparty.tsx +2 -9
- package/src/components/transactions-table/cells-legacy/counterparty.tsx +2 -9
- package/src/gql/graphql.ts +4842 -1554
- package/src/index.tsx +22 -4
- package/src/providers/auth-guard.tsx +23 -14
- package/src/providers/index.tsx +2 -7
- package/src/providers/urql.tsx +12 -7
- package/src/providers/user-provider.tsx +2 -3
- package/dist/assets/Checkbox-CxedbJAl.js +0 -6
- package/dist/assets/Progress-D5SuJtCd.js +0 -1
- package/dist/assets/Typography-BQFz-z7L.js +0 -1
- package/dist/assets/accordion-COWOBKuq.js +0 -1
- package/dist/assets/accountant-approvals-Bd2y8us_.js +0 -1
- package/dist/assets/all-charges-SWBnaZu7.js +0 -1
- package/dist/assets/arrow-up-down-dZmrBLse.js +0 -6
- package/dist/assets/business--GVVfDEa.js +0 -37
- package/dist/assets/business-transactions-single-BsbkUf_H.js +0 -1
- package/dist/assets/business-trip-ByXPVXdG.js +0 -1
- package/dist/assets/charges-filters-D43UbXob.js +0 -1
- package/dist/assets/charges-ledger-validation-D0uMH_JE.js +0 -1
- package/dist/assets/chart-ClU1KbWe.js +0 -74
- package/dist/assets/data-table-pagination-D9Y0_Tn8.js +0 -11
- package/dist/assets/editable-business-trip-DhqOQBPa.js +0 -16
- package/dist/assets/graphql-document-dedupe-fragments-ByT8-wlV.js +0 -1
- package/dist/assets/index-1U6rQgQe.js +0 -6
- package/dist/assets/index-3-AKn8tg.js +0 -1
- package/dist/assets/index-91A2PLZ6.js +0 -137
- package/dist/assets/index-BBHuCWRn.js +0 -1
- package/dist/assets/index-BPNuFFtx.js +0 -1
- package/dist/assets/index-BXqHnRVY.js +0 -1
- package/dist/assets/index-BciOH8FS.js +0 -1
- package/dist/assets/index-BjHuUHDO.js +0 -1
- package/dist/assets/index-BxKmoNQd.js +0 -1
- package/dist/assets/index-C3bqiFIv.js +0 -2
- package/dist/assets/index-C5MeepK_.js +0 -11
- package/dist/assets/index-CAwm68Mg.js +0 -1
- package/dist/assets/index-CJ8OGXxv.js +0 -1
- package/dist/assets/index-CJyY-qF6.js +0 -1
- package/dist/assets/index-CMYnx46_.js +0 -6
- package/dist/assets/index-CNrwxUZ7.js +0 -1
- package/dist/assets/index-CvV5z5r9.js +0 -876
- package/dist/assets/index-D08H2GXq.js +0 -17
- package/dist/assets/index-GFsPY1p4.js +0 -2
- package/dist/assets/index-KwNwThNu.js +0 -1
- package/dist/assets/index-YA8IBFyB.js +0 -1
- package/dist/assets/index-ZpyI3qxW.js +0 -24
- package/dist/assets/index-gdTXrWXt.css +0 -1
- package/dist/assets/index-ytnIEraq.js +0 -9
- package/dist/assets/issue-document-CdikNnO2.js +0 -1
- package/dist/assets/login-page-effgZS3V.js +0 -1
- package/dist/assets/missing-info-charges-CnPFTzoZ.js +0 -1
- package/dist/assets/page-not-found-D8YlgDOm.js +0 -1
- package/dist/assets/pencil-mxW0-tGM.js +0 -6
- package/dist/assets/report-commentary-row-DCozKgVE.js +0 -1
- package/dist/assets/save-CHlytUqu.js +0 -11
- package/dist/assets/sequential-CAnleQny.js +0 -1
- package/dist/assets/similar-charges-by-business-modal-Dzbspk_r.js +0 -1
- package/dist/assets/sub-Cp_PhKiD.js +0 -1
- package/dist/assets/subMonths-DCj_iXAn.js +0 -1
- package/src/components/error-boundary.tsx +0 -189
- package/src/components/layout/breadcrumbs.tsx +0 -77
- package/src/components/layout/document-title.tsx +0 -31
- package/src/components/layout/navigation-progress.tsx +0 -52
- package/src/components/layout/page-skeleton.tsx +0 -49
- package/src/providers/urql-client.ts +0 -86
- package/src/router/config.tsx +0 -534
- package/src/router/layouts/dashboard-layout.tsx +0 -20
- package/src/router/layouts/root-layout.tsx +0 -69
- package/src/router/loaders/auth-loader.ts +0 -32
- package/src/router/loaders/business-loader.ts +0 -25
- package/src/router/loaders/charge-loader.ts +0 -25
- package/src/router/loaders/index.ts +0 -17
- package/src/router/routes.ts +0 -88
- package/src/router/types.ts +0 -62
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { LoaderFunctionArgs } from 'react-router-dom';
|
|
2
|
-
import { ChargeScreenDocument } from '../../gql/graphql.js';
|
|
3
|
-
import { getUrqlClient } from '../../providers/urql-client.js';
|
|
4
|
-
import { validateChargeParams } from '../types.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Charge loader - prefetches charge data before component renders
|
|
8
|
-
* Used by: /charges/:chargeId route
|
|
9
|
-
*/
|
|
10
|
-
export async function chargeLoader({ params }: LoaderFunctionArgs) {
|
|
11
|
-
const { chargeId } = validateChargeParams(params);
|
|
12
|
-
|
|
13
|
-
const client = getUrqlClient();
|
|
14
|
-
const result = await client.query(ChargeScreenDocument, { chargeId }).toPromise();
|
|
15
|
-
|
|
16
|
-
if (result.error) {
|
|
17
|
-
throw new Response('Failed to load charge', { status: 500 });
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
if (!result.data?.charge) {
|
|
21
|
-
throw new Response('Charge not found', { status: 404 });
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return result.data;
|
|
25
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Centralized exports for all route loaders
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Centralized exports for all route loaders
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
export { publicOnly, requireAuth } from './auth-loader.js';
|
|
10
|
-
export { chargeLoader } from './charge-loader.js';
|
|
11
|
-
export { businessLoader } from './business-loader.js';
|
|
12
|
-
|
|
13
|
-
// TODO: Add more loaders as they are implemented
|
|
14
|
-
// export { chargeLoader } from './charge-loader.js';
|
|
15
|
-
// export { businessLoader } from './business-loader.js';
|
|
16
|
-
// export { businessTripLoader } from './business-trip-loader.js';
|
|
17
|
-
// export { taxReportLoader } from './report-loaders/tax-report-loader.js';
|
package/src/router/routes.ts
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type-safe route definitions for the application
|
|
3
|
-
*
|
|
4
|
-
* Usage:
|
|
5
|
-
* - navigate(ROUTES.CHARGES.DETAIL('charge-123'))
|
|
6
|
-
* - <Link to={ROUTES.REPORTS.TAX(2024)}>Tax Report</Link>
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
export const ROUTES = {
|
|
10
|
-
HOME: '/',
|
|
11
|
-
LOGIN: '/login',
|
|
12
|
-
NETWORK_ERROR: '/network-error',
|
|
13
|
-
|
|
14
|
-
CHARGES: {
|
|
15
|
-
ROOT: '/charges',
|
|
16
|
-
ALL: '/charges',
|
|
17
|
-
MISSING_INFO: '/charges/missing-info',
|
|
18
|
-
LEDGER_VALIDATION: '/charges/ledger-validation',
|
|
19
|
-
DETAIL: (chargeId: string) => `/charges/${chargeId}`,
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
BUSINESSES: {
|
|
23
|
-
ROOT: '/businesses',
|
|
24
|
-
ALL: '/businesses',
|
|
25
|
-
TRANSACTIONS: '/businesses/transactions',
|
|
26
|
-
DETAIL: (businessId: string) => `/businesses/${businessId}`,
|
|
27
|
-
DETAIL_TRANSACTIONS: (businessId: string) => `/businesses/${businessId}/transactions`,
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
BUSINESS_TRIPS: {
|
|
31
|
-
ROOT: '/business-trips',
|
|
32
|
-
ALL: '/business-trips',
|
|
33
|
-
DETAIL: (businessTripId: string) => `/business-trips/${businessTripId}`,
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
CHARTS: {
|
|
37
|
-
ROOT: '/charts',
|
|
38
|
-
MAIN: '/charts',
|
|
39
|
-
MONTHLY_INCOME_EXPENSE: '/charts/monthly-income-expense',
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
DOCUMENTS: {
|
|
43
|
-
ROOT: '/documents',
|
|
44
|
-
ALL: '/documents',
|
|
45
|
-
ISSUE_DOCUMENT: '/documents/issue-document',
|
|
46
|
-
ISSUE_DOCUMENTS: '/documents/issue-documents',
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
REPORTS: {
|
|
50
|
-
ROOT: '/reports',
|
|
51
|
-
TRIAL_BALANCE: '/reports/trial-balance',
|
|
52
|
-
CONTO: '/reports/conto',
|
|
53
|
-
VAT_MONTHLY: '/reports/vat-monthly',
|
|
54
|
-
PROFIT_AND_LOSS: (year?: number) =>
|
|
55
|
-
year ? `/reports/profit-and-loss/${year}` : '/reports/profit-and-loss',
|
|
56
|
-
TAX: (year?: number) => (year ? `/reports/tax/${year}` : '/reports/tax'),
|
|
57
|
-
DEPRECIATION: '/reports/depreciation',
|
|
58
|
-
SHAAM_6111: '/reports/shaam6111',
|
|
59
|
-
YEARLY_LEDGER: '/reports/yearly-ledger',
|
|
60
|
-
CORPORATE_TAX_RULING_COMPLIANCE: (year?: number) =>
|
|
61
|
-
year
|
|
62
|
-
? `/reports/corporate-tax-ruling-compliance/${year}`
|
|
63
|
-
: '/reports/corporate-tax-ruling-compliance',
|
|
64
|
-
BALANCE: '/reports/balance',
|
|
65
|
-
VALIDATE_REPORTS: '/reports/validate-reports',
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
ACCOUNTANT_APPROVALS: '/accountant-approvals',
|
|
69
|
-
SALARIES: '/salaries',
|
|
70
|
-
TAGS: '/tags',
|
|
71
|
-
TAX_CATEGORIES: '/tax-categories',
|
|
72
|
-
SORT_CODES: '/sort-codes',
|
|
73
|
-
} as const;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Type helper to extract all valid route paths
|
|
77
|
-
*/
|
|
78
|
-
export type RoutePath = string;
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Helper to check if a path matches a route pattern
|
|
82
|
-
*/
|
|
83
|
-
export function matchesRoute(currentPath: string, routePattern: string): boolean {
|
|
84
|
-
// Simple matcher - can be enhanced with path-to-regexp if needed
|
|
85
|
-
const pattern = routePattern.replace(/:[^/]+/g, '[^/]+');
|
|
86
|
-
const regex = new RegExp(`^${pattern}$`);
|
|
87
|
-
return regex.test(currentPath);
|
|
88
|
-
}
|
package/src/router/types.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { LoaderFunctionArgs, Params } from 'react-router-dom';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Type-safe route parameter definitions
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
export interface ChargeParams extends Params {
|
|
8
|
-
chargeId: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface BusinessParams extends Params {
|
|
12
|
-
businessId: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface BusinessTripParams extends Params {
|
|
16
|
-
businessTripId: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface ReportYearParams extends Params {
|
|
20
|
-
year?: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Type-safe loader argument types
|
|
25
|
-
*/
|
|
26
|
-
export type ChargeLoaderArgs = LoaderFunctionArgs<ChargeParams>;
|
|
27
|
-
export type BusinessLoaderArgs = LoaderFunctionArgs<BusinessParams>;
|
|
28
|
-
export type BusinessTripLoaderArgs = LoaderFunctionArgs<BusinessTripParams>;
|
|
29
|
-
export type ReportYearLoaderArgs = LoaderFunctionArgs<ReportYearParams>;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Helper functions to validate and parse params
|
|
33
|
-
*/
|
|
34
|
-
export function validateChargeParams(params: Params): ChargeParams {
|
|
35
|
-
if (!params.chargeId) {
|
|
36
|
-
throw new Response('Charge ID is required', { status: 400 });
|
|
37
|
-
}
|
|
38
|
-
return { chargeId: params.chargeId };
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function validateBusinessParams(params: Params): BusinessParams {
|
|
42
|
-
if (!params.businessId) {
|
|
43
|
-
throw new Response('Business ID is required', { status: 400 });
|
|
44
|
-
}
|
|
45
|
-
return { businessId: params.businessId };
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function validateBusinessTripParams(params: Params): BusinessTripParams {
|
|
49
|
-
if (!params.businessTripId) {
|
|
50
|
-
throw new Response('Business Trip ID is required', { status: 400 });
|
|
51
|
-
}
|
|
52
|
-
return { businessTripId: params.businessTripId };
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export function parseYearParam(params: Params): number | undefined {
|
|
56
|
-
if (!params.year) return undefined;
|
|
57
|
-
const year = parseInt(params.year, 10);
|
|
58
|
-
if (Number.isNaN(year) || year < 2000 || year > 2100) {
|
|
59
|
-
throw new Response('Invalid year parameter', { status: 400 });
|
|
60
|
-
}
|
|
61
|
-
return year;
|
|
62
|
-
}
|