@accounter/server 0.0.8-alpha-20251022144027-c9c7a4b309de8a72dfd0ec4f11e63713ad12878f → 0.0.8-alpha-20251022162652-6facbcde08fdda0fb354ba7105432df320367509

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @accounter/server
2
2
 
3
- ## 0.0.8-alpha-20251022144027-c9c7a4b309de8a72dfd0ec4f11e63713ad12878f
3
+ ## 0.0.8-alpha-20251022162652-6facbcde08fdda0fb354ba7105432df320367509
4
4
 
5
5
  ### Patch Changes
6
6
 
@@ -140,6 +140,12 @@
140
140
  [`@ai-sdk/anthropic@2.0.35` ↗︎](https://www.npmjs.com/package/@ai-sdk/anthropic/v/2.0.35) (from
141
141
  `2.0.34`, in `dependencies`)
142
142
 
143
+ - [#2605](https://github.com/Urigo/accounter-fullstack/pull/2605)
144
+ [`7d9f1ae`](https://github.com/Urigo/accounter-fullstack/commit/7d9f1ae5ba5a047d8228099de8ed84e7c13fbdc0)
145
+ Thanks [@gilgardosh](https://github.com/gilgardosh)! - dependencies updates:
146
+ - Updated dependency [`puppeteer@24.26.0` ↗︎](https://www.npmjs.com/package/puppeteer/v/24.26.0)
147
+ (from `24.25.0`, in `dependencies`)
148
+
143
149
  - [#2551](https://github.com/Urigo/accounter-fullstack/pull/2551)
144
150
  [`14900d1`](https://github.com/Urigo/accounter-fullstack/commit/14900d10209272429118ff4bd2e52893c813170b)
145
151
  Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Error Handling Standardization**: The
@@ -282,6 +288,23 @@
282
288
  `documents.resolver.ts` and `green-invoice.helper.ts`, new document insertions explicitly set
283
289
  `fileHash` to `null` where the hash is not generated at that specific point in the workflow.
284
290
 
291
+ - [#2605](https://github.com/Urigo/accounter-fullstack/pull/2605)
292
+ [`da6cc9b`](https://github.com/Urigo/accounter-fullstack/commit/da6cc9bc05d1bee5cfd1f0902808ceaa0bfa6fc1)
293
+ Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **New Admin Business Configuration Tab**:
294
+ Introduced a dedicated "Admin" tab within the business details page to manage administrative
295
+ financial information.
296
+ - **Frontend Component Development**: A new `AdminBusinessSection` React component was created,
297
+ featuring a form for various tax and registration details, with client-side validation using
298
+ `zod` and `react-hook-form`.
299
+ - **GraphQL API Extension**: New GraphQL types (`CreateAdminBusinessInput`,
300
+ `UpdateAdminBusinessInput`) and mutations (`createAdminBusiness`, `updateAdminBusiness`,
301
+ `deleteAdminBusiness`) were added to the backend to support the management of admin business
302
+ data.
303
+ - **Data Fetching and Update Logic**: A new `useUpdateAdminBusiness` hook was implemented on the
304
+ frontend to interact with the new GraphQL mutations, handling data submission and user feedback.
305
+ - **Backend Resolver Implementation**: Server-side resolvers were updated to expose administrative
306
+ business fields and handle the logic for fetching and updating this data.
307
+
285
308
  - [#2561](https://github.com/Urigo/accounter-fullstack/pull/2561)
286
309
  [`e853097`](https://github.com/Urigo/accounter-fullstack/commit/e853097bbe987be8292981c527ba49562bf2f28b)
287
310
  Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Refactored Ledger Storage Helper**: The
@@ -317,9 +340,9 @@
317
340
  [[`65e3c7f`](https://github.com/Urigo/accounter-fullstack/commit/65e3c7f01993eb4f41244a40feefefa08b31a4e6),
318
341
  [`65e3c7f`](https://github.com/Urigo/accounter-fullstack/commit/65e3c7f01993eb4f41244a40feefefa08b31a4e6),
319
342
  [`65e3c7f`](https://github.com/Urigo/accounter-fullstack/commit/65e3c7f01993eb4f41244a40feefefa08b31a4e6)]:
320
- - @accounter/pcn874-generator@0.6.3-alpha-20251022144027-c9c7a4b309de8a72dfd0ec4f11e63713ad12878f
321
- - @accounter/shaam-uniform-format-generator@0.2.2-alpha-20251022144027-c9c7a4b309de8a72dfd0ec4f11e63713ad12878f
322
- - @accounter/shaam6111-generator@0.1.4-alpha-20251022144027-c9c7a4b309de8a72dfd0ec4f11e63713ad12878f
343
+ - @accounter/pcn874-generator@0.6.3-alpha-20251022162652-6facbcde08fdda0fb354ba7105432df320367509
344
+ - @accounter/shaam-uniform-format-generator@0.2.2-alpha-20251022162652-6facbcde08fdda0fb354ba7105432df320367509
345
+ - @accounter/shaam6111-generator@0.1.4-alpha-20251022162652-6facbcde08fdda0fb354ba7105432df320367509
323
346
 
324
347
  ## 0.0.7
325
348
 
@@ -4,8 +4,8 @@ import type { GetMeshOptions } from '@graphql-mesh/runtime';
4
4
  import type { YamlConfig } from '@graphql-mesh/types';
5
5
  import { MeshHTTPHandler } from '@graphql-mesh/http';
6
6
  import { type ExecuteMeshFn, type SubscribeMeshFn, type MeshContext as BaseMeshContext, type MeshInstance } from '@graphql-mesh/runtime';
7
- import type { GreenInvoiceNewTypes } from './sources/GreenInvoiceNew/types';
8
7
  import type { GreenInvoiceTypes } from './sources/GreenInvoice/types';
8
+ import type { GreenInvoiceNewTypes } from './sources/GreenInvoiceNew/types';
9
9
  export type Maybe<T> = T | null;
10
10
  export type InputMaybe<T> = Maybe<T>;
11
11
  export type Exact<T extends {
@@ -195,7 +195,7 @@ export type AdminBusiness = {
195
195
  readonly id: Scalars['UUID']['output'];
196
196
  readonly name: Scalars['String']['output'];
197
197
  readonly nationalInsuranceEmployerId?: Maybe<Scalars['String']['output']>;
198
- readonly registrationDate?: Maybe<Scalars['TimelessDate']['output']>;
198
+ readonly registrationDate: Scalars['TimelessDate']['output'];
199
199
  readonly taxPrepaymentId?: Maybe<Scalars['String']['output']>;
200
200
  };
201
201
  /** defines a tag / category for charge arrangement */
@@ -1104,12 +1104,12 @@ export type Country = {
1104
1104
  };
1105
1105
  /** Input type for creating a new admin business. */
1106
1106
  export type CreateAdminBusinessInput = {
1107
- readonly advanceTaxRate: Scalars['Float']['input'];
1107
+ readonly advanceTaxRate?: InputMaybe<Scalars['Float']['input']>;
1108
1108
  readonly businessId: Scalars['UUID']['input'];
1109
- readonly employerWithholdingTaxAccountNumber: Scalars['String']['input'];
1110
- readonly nationalInsuranceEmployerId: Scalars['String']['input'];
1109
+ readonly employerWithholdingTaxAccountNumber?: InputMaybe<Scalars['String']['input']>;
1110
+ readonly nationalInsuranceEmployerId?: InputMaybe<Scalars['String']['input']>;
1111
1111
  readonly registrationDate: Scalars['TimelessDate']['input'];
1112
- readonly taxPrepaymentId: Scalars['String']['input'];
1112
+ readonly taxPrepaymentId?: InputMaybe<Scalars['String']['input']>;
1113
1113
  };
1114
1114
  /** input for creating a new contract */
1115
1115
  export type CreateContractInput = {
@@ -4779,7 +4779,7 @@ export type AdminBusinessResolvers<ContextType = GraphQLModules.Context, ParentT
4779
4779
  id?: Resolver<ResolversTypes['UUID'], ParentType, ContextType>;
4780
4780
  name?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
4781
4781
  nationalInsuranceEmployerId?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
4782
- registrationDate?: Resolver<Maybe<ResolversTypes['TimelessDate']>, ParentType, ContextType>;
4782
+ registrationDate?: Resolver<ResolversTypes['TimelessDate'], ParentType, ContextType>;
4783
4783
  taxPrepaymentId?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
4784
4784
  __isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
4785
4785
  };
@@ -1,5 +1,5 @@
1
1
  import { GraphQLError } from 'graphql';
2
- import { optionalDateToTimelessDateString } from '../../../shared/helpers/index.js';
2
+ import { dateToTimelessDateString } from '../../../shared/helpers/index.js';
3
3
  import { AdminBusinessesProvider } from '../providers/admin-businesses.provider.js';
4
4
  import { BusinessesProvider } from '../providers/businesses.provider.js';
5
5
  export const adminBusinessesResolvers = {
@@ -38,7 +38,12 @@ export const adminBusinessesResolvers = {
38
38
  taxPrepaymentId: admin => admin.tax_siduri_number_2022,
39
39
  nationalInsuranceEmployerId: admin => admin.pinkas_social_security_2022,
40
40
  advanceTaxRate: admin => admin.advance_tax_rate,
41
- registrationDate: admin => optionalDateToTimelessDateString(admin.registration_date),
41
+ registrationDate: admin => {
42
+ if (!admin.registration_date) {
43
+ throw new GraphQLError(`Admin business ID="${admin.id}" has no registration date`);
44
+ }
45
+ return dateToTimelessDateString(admin.registration_date);
46
+ },
42
47
  },
43
48
  LtdFinancialEntity: {
44
49
  adminInfo: async (parentBusiness, _, { injector }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"admin-businesses.resolver.js","sourceRoot":"","sources":["../../../../../../src/modules/financial-entities/resolvers/admin-businesses.resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAGzE,MAAM,CAAC,MAAM,wBAAwB,GAAsC;IACzE,KAAK,EAAE;QACL,aAAa,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAC/C,MAAM,aAAa,GAAG,MAAM,QAAQ;iBACjC,GAAG,CAAC,uBAAuB,CAAC;iBAC5B,0BAA0B,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACvC,IAAI,CAAC,aAAa,EAAE,CAAC;gBACnB,MAAM,IAAI,YAAY,CAAC,sBAAsB,EAAE,aAAa,CAAC,CAAC;YAChE,CAAC;YAED,OAAO,aAAa,CAAC;QACvB,CAAC;QACD,kBAAkB,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAChD,MAAM,eAAe,GAAG,MAAM,QAAQ,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC,qBAAqB,EAAE,CAAC;YAE5F,OAAO,eAAe,CAAC;QACzB,CAAC;KACF;IACD,aAAa,EAAE;QACb,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,E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,CAAC,EAAE,CAAC,CAAC;YAEtD,OAAO,aAAa,IAAI,IAAI,CAAC;QAC/B,CAAC;KACF;CACF,CAAC"}
1
+ {"version":3,"file":"admin-businesses.resolver.js","sourceRoot":"","sources":["../../../../../../src/modules/financial-entities/resolvers/admin-businesses.resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAGzE,MAAM,CAAC,MAAM,wBAAwB,GAAsC;IACzE,KAAK,EAAE;QACL,aAAa,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAC/C,MAAM,aAAa,GAAG,MAAM,QAAQ;iBACjC,GAAG,CAAC,uBAAuB,CAAC;iBAC5B,0BAA0B,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACvC,IAAI,CAAC,aAAa,EAAE,CAAC;gBACnB,MAAM,IAAI,YAAY,CAAC,sBAAsB,EAAE,aAAa,CAAC,CAAC;YAChE,CAAC;YAED,OAAO,aAAa,CAAC;QACvB,CAAC;QACD,kBAAkB,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAChD,MAAM,eAAe,GAAG,MAAM,QAAQ,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC,qBAAqB,EAAE,CAAC;YAE5F,OAAO,eAAe,CAAC;QACzB,CAAC;KACF;IACD,aAAa,EAAE;QACb,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE;QACrB,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI;QACzB,YAAY,EAAE,KAAK,CAAC,EAAE;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AG,CAAC,uBAAuB,CAAC;iBAC5B,0BAA0B,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;YAEtD,OAAO,aAAa,IAAI,IAAI,CAAC;QAC/B,CAAC;KACF;CACF,CAAC"}
@@ -23,16 +23,16 @@ export default gql `
23
23
  taxPrepaymentId: String
24
24
  nationalInsuranceEmployerId: String
25
25
  advanceTaxRate: Float
26
- registrationDate: TimelessDate
26
+ registrationDate: TimelessDate!
27
27
  }
28
28
 
29
29
  " Input type for creating a new admin business. "
30
30
  input CreateAdminBusinessInput {
31
31
  businessId: UUID!
32
- employerWithholdingTaxAccountNumber: String!
33
- taxPrepaymentId: String!
34
- nationalInsuranceEmployerId: String!
35
- advanceTaxRate: Float!
32
+ employerWithholdingTaxAccountNumber: String
33
+ taxPrepaymentId: String
34
+ nationalInsuranceEmployerId: String
35
+ advanceTaxRate: Float
36
36
  registrationDate: TimelessDate!
37
37
  }
38
38
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@accounter/server",
3
- "version": "0.0.8-alpha-20251022144027-c9c7a4b309de8a72dfd0ec4f11e63713ad12878f",
3
+ "version": "0.0.8-alpha-20251022162652-6facbcde08fdda0fb354ba7105432df320367509",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "license": "MIT",
@@ -150,7 +150,7 @@ export type AdminBusiness = {
150
150
  readonly id: Scalars['UUID']['output'];
151
151
  readonly name: Scalars['String']['output'];
152
152
  readonly nationalInsuranceEmployerId?: Maybe<Scalars['String']['output']>;
153
- readonly registrationDate?: Maybe<Scalars['TimelessDate']['output']>;
153
+ readonly registrationDate: Scalars['TimelessDate']['output'];
154
154
  readonly taxPrepaymentId?: Maybe<Scalars['String']['output']>;
155
155
  };
156
156
 
@@ -1145,12 +1145,12 @@ export type Country = {
1145
1145
 
1146
1146
  /** Input type for creating a new admin business. */
1147
1147
  export type CreateAdminBusinessInput = {
1148
- readonly advanceTaxRate: Scalars['Float']['input'];
1148
+ readonly advanceTaxRate?: InputMaybe<Scalars['Float']['input']>;
1149
1149
  readonly businessId: Scalars['UUID']['input'];
1150
- readonly employerWithholdingTaxAccountNumber: Scalars['String']['input'];
1151
- readonly nationalInsuranceEmployerId: Scalars['String']['input'];
1150
+ readonly employerWithholdingTaxAccountNumber?: InputMaybe<Scalars['String']['input']>;
1151
+ readonly nationalInsuranceEmployerId?: InputMaybe<Scalars['String']['input']>;
1152
1152
  readonly registrationDate: Scalars['TimelessDate']['input'];
1153
- readonly taxPrepaymentId: Scalars['String']['input'];
1153
+ readonly taxPrepaymentId?: InputMaybe<Scalars['String']['input']>;
1154
1154
  };
1155
1155
 
1156
1156
  /** input for creating a new contract */
@@ -5529,7 +5529,7 @@ export type AdminBusinessResolvers<ContextType = GraphQLModules.Context, ParentT
5529
5529
  id?: Resolver<ResolversTypes['UUID'], ParentType, ContextType>;
5530
5530
  name?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
5531
5531
  nationalInsuranceEmployerId?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
5532
- registrationDate?: Resolver<Maybe<ResolversTypes['TimelessDate']>, ParentType, ContextType>;
5532
+ registrationDate?: Resolver<ResolversTypes['TimelessDate'], ParentType, ContextType>;
5533
5533
  taxPrepaymentId?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
5534
5534
  __isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
5535
5535
  };
@@ -1,5 +1,5 @@
1
1
  import { GraphQLError } from 'graphql';
2
- import { optionalDateToTimelessDateString } from '@shared/helpers';
2
+ import { dateToTimelessDateString } from '@shared/helpers';
3
3
  import { AdminBusinessesProvider } from '../providers/admin-businesses.provider.js';
4
4
  import { BusinessesProvider } from '../providers/businesses.provider.js';
5
5
  import type { FinancialEntitiesModule } from '../types.js';
@@ -42,7 +42,12 @@ export const adminBusinessesResolvers: FinancialEntitiesModule.Resolvers = {
42
42
  taxPrepaymentId: admin => admin.tax_siduri_number_2022,
43
43
  nationalInsuranceEmployerId: admin => admin.pinkas_social_security_2022,
44
44
  advanceTaxRate: admin => admin.advance_tax_rate,
45
- registrationDate: admin => optionalDateToTimelessDateString(admin.registration_date),
45
+ registrationDate: admin => {
46
+ if (!admin.registration_date) {
47
+ throw new GraphQLError(`Admin business ID="${admin.id}" has no registration date`);
48
+ }
49
+ return dateToTimelessDateString(admin.registration_date);
50
+ },
46
51
  },
47
52
  LtdFinancialEntity: {
48
53
  adminInfo: async (parentBusiness, _, { injector }) => {
@@ -24,16 +24,16 @@ export default gql`
24
24
  taxPrepaymentId: String
25
25
  nationalInsuranceEmployerId: String
26
26
  advanceTaxRate: Float
27
- registrationDate: TimelessDate
27
+ registrationDate: TimelessDate!
28
28
  }
29
29
 
30
30
  " Input type for creating a new admin business. "
31
31
  input CreateAdminBusinessInput {
32
32
  businessId: UUID!
33
- employerWithholdingTaxAccountNumber: String!
34
- taxPrepaymentId: String!
35
- nationalInsuranceEmployerId: String!
36
- advanceTaxRate: Float!
33
+ employerWithholdingTaxAccountNumber: String
34
+ taxPrepaymentId: String
35
+ nationalInsuranceEmployerId: String
36
+ advanceTaxRate: Float
37
37
  registrationDate: TimelessDate!
38
38
  }
39
39