@accounter/server 0.0.8-alpha-20251030162201-d2f279aafe537912ec3546af855cbd3a38ac0f5c → 0.0.8-alpha-20251030164843-d2f490daba879840366288d1f62974ab25081876

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.
Files changed (56) hide show
  1. package/CHANGELOG.md +33 -20
  2. package/dist/server/src/__generated__/types.d.ts +37 -70
  3. package/dist/server/src/__generated__/types.js.map +1 -1
  4. package/dist/server/src/modules/contracts/__generated__/contracts.types.d.ts +29 -0
  5. package/dist/server/src/modules/contracts/__generated__/types.d.ts +3 -1
  6. package/dist/server/src/modules/contracts/__generated__/types.js.map +1 -1
  7. package/dist/server/src/modules/contracts/providers/contracts.provider.d.ts +5 -1
  8. package/dist/server/src/modules/contracts/providers/contracts.provider.js +37 -7
  9. package/dist/server/src/modules/contracts/providers/contracts.provider.js.map +1 -1
  10. package/dist/server/src/modules/contracts/resolvers/contracts.resolver.js +27 -0
  11. package/dist/server/src/modules/contracts/resolvers/contracts.resolver.js.map +1 -1
  12. package/dist/server/src/modules/contracts/typeDefs/contracts.graphql.js +2 -0
  13. package/dist/server/src/modules/contracts/typeDefs/contracts.graphql.js.map +1 -1
  14. package/dist/server/src/modules/financial-entities/__generated__/admin-businesses.types.d.ts +0 -57
  15. package/dist/server/src/modules/financial-entities/__generated__/admin-businesses.types.js +1 -0
  16. package/dist/server/src/modules/financial-entities/__generated__/admin-businesses.types.js.map +1 -1
  17. package/dist/server/src/modules/financial-entities/__generated__/types.d.ts +10 -33
  18. package/dist/server/src/modules/financial-entities/__generated__/types.js.map +1 -1
  19. package/dist/server/src/modules/financial-entities/providers/admin-businesses.provider.d.ts +1 -2
  20. package/dist/server/src/modules/financial-entities/providers/admin-businesses.provider.js +0 -37
  21. package/dist/server/src/modules/financial-entities/providers/admin-businesses.provider.js.map +1 -1
  22. package/dist/server/src/modules/financial-entities/resolvers/admin-businesses.resolver.js +11 -46
  23. package/dist/server/src/modules/financial-entities/resolvers/admin-businesses.resolver.js.map +1 -1
  24. package/dist/server/src/modules/financial-entities/typeDefs/admin-businesses.graphql.js +16 -49
  25. package/dist/server/src/modules/financial-entities/typeDefs/admin-businesses.graphql.js.map +1 -1
  26. package/dist/server/src/modules/financial-entities/types.d.ts +1 -1
  27. package/dist/server/src/modules/green-invoice/__generated__/types.d.ts +2 -1
  28. package/dist/server/src/modules/green-invoice/__generated__/types.js.map +1 -1
  29. package/dist/server/src/modules/green-invoice/helpers/contract-to-draft.helper.d.ts +5 -0
  30. package/dist/server/src/modules/green-invoice/helpers/contract-to-draft.helper.js +60 -0
  31. package/dist/server/src/modules/green-invoice/helpers/contract-to-draft.helper.js.map +1 -0
  32. package/dist/server/src/modules/green-invoice/resolvers/green-invoice.resolvers.js +10 -54
  33. package/dist/server/src/modules/green-invoice/resolvers/green-invoice.resolvers.js.map +1 -1
  34. package/dist/server/src/modules/green-invoice/typeDefs/green-invoice.graphql.js +4 -0
  35. package/dist/server/src/modules/green-invoice/typeDefs/green-invoice.graphql.js.map +1 -1
  36. package/package.json +1 -1
  37. package/src/__generated__/types.ts +43 -76
  38. package/src/modules/contracts/__generated__/contracts.types.ts +32 -0
  39. package/src/modules/contracts/__generated__/types.ts +3 -1
  40. package/src/modules/contracts/providers/contracts.provider.ts +51 -6
  41. package/src/modules/contracts/resolvers/contracts.resolver.ts +24 -0
  42. package/src/modules/contracts/typeDefs/contracts.graphql.ts +2 -0
  43. package/src/modules/financial-entities/__generated__/admin-businesses.types.ts +0 -60
  44. package/src/modules/financial-entities/__generated__/types.ts +10 -33
  45. package/src/modules/financial-entities/providers/admin-businesses.provider.ts +0 -44
  46. package/src/modules/financial-entities/resolvers/admin-businesses.resolver.ts +11 -53
  47. package/src/modules/financial-entities/typeDefs/admin-businesses.graphql.ts +16 -49
  48. package/src/modules/financial-entities/types.ts +1 -1
  49. package/src/modules/green-invoice/__generated__/types.ts +2 -1
  50. package/src/modules/green-invoice/helpers/contract-to-draft.helper.ts +75 -0
  51. package/src/modules/green-invoice/resolvers/green-invoice.resolvers.ts +15 -63
  52. package/src/modules/green-invoice/typeDefs/green-invoice.graphql.ts +4 -0
  53. package/dist/server/src/modules/financial-entities/helpers/admin-businesses.helper.d.ts +0 -31
  54. package/dist/server/src/modules/financial-entities/helpers/admin-businesses.helper.js +0 -27
  55. package/dist/server/src/modules/financial-entities/helpers/admin-businesses.helper.js.map +0 -1
  56. package/src/modules/financial-entities/helpers/admin-businesses.helper.ts +0 -33
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @accounter/server
2
2
 
3
- ## 0.0.8-alpha-20251030162201-d2f279aafe537912ec3546af855cbd3a38ac0f5c
3
+ ## 0.0.8-alpha-20251030164843-d2f490daba879840366288d1f62974ab25081876
4
4
 
5
5
  ### Patch Changes
6
6
 
@@ -231,6 +231,15 @@
231
231
  [`@envelop/generic-auth@10.0.1` ↗︎](https://www.npmjs.com/package/@envelop/generic-auth/v/10.0.1)
232
232
  (from `10.0.0`, in `dependencies`)
233
233
 
234
+ - [#2646](https://github.com/Urigo/accounter-fullstack/pull/2646)
235
+ [`3266908`](https://github.com/Urigo/accounter-fullstack/commit/3266908bd76d58229510147d03f2dd137172abca)
236
+ Thanks [@gilgardosh](https://github.com/gilgardosh)! - dependencies updates:
237
+ - Updated dependency
238
+ [`@ai-sdk/anthropic@2.0.39` ↗︎](https://www.npmjs.com/package/@ai-sdk/anthropic/v/2.0.39) (from
239
+ `2.0.38`, in `dependencies`)
240
+ - Updated dependency [`ai@5.0.82` ↗︎](https://www.npmjs.com/package/ai/v/5.0.82) (from `5.0.81`,
241
+ in `dependencies`)
242
+
234
243
  - [#2631](https://github.com/Urigo/accounter-fullstack/pull/2631)
235
244
  [`86c8b3e`](https://github.com/Urigo/accounter-fullstack/commit/86c8b3ebea4e3be0c0e99a108ec1cdad8b39e5d8)
236
245
  Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Database Schema Update**: A new
@@ -469,21 +478,6 @@
469
478
  streamline the process of adding new businesses, specifically by simplifying the handling of tax
470
479
  category insertions.
471
480
 
472
- - [#2645](https://github.com/Urigo/accounter-fullstack/pull/2645)
473
- [`69331f9`](https://github.com/Urigo/accounter-fullstack/commit/69331f9b74e1afdc954f3cddb93735445fb9ad8d)
474
- Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Database Schema Refactor**: The
475
- `businesses_admin` table is updated to replace single-value fields for tax and social security
476
- identifiers with array-based JSONB columns, allowing for multiple annual IDs and historical tax
477
- rates.
478
- - **GraphQL Schema Update**: The GraphQL `AdminBusiness` type and related input types
479
- (`CreateAdminBusinessInput`, `UpdateAdminBusinessInput`) are modified to reflect the new array
480
- structures, introducing `AnnualId` and `TaxAdvancesRate` types.
481
- - **Frontend Form Overhaul**: The `admin-business-section.tsx` component is refactored to use
482
- `react-hook-form`'s `useFieldArray` for dynamic management of annual IDs and tax rates,
483
- providing a more flexible user interface.
484
- - **Backend Logic Adaptation**: New Zod schemas and resolver logic are implemented on the server
485
- to validate and process the updated array-based data for admin business updates.
486
-
487
481
  - [#2640](https://github.com/Urigo/accounter-fullstack/pull/2640)
488
482
  [`26618ff`](https://github.com/Urigo/accounter-fullstack/commit/26618ff2d4a47d63e16ecec59f39887f48df52cf)
489
483
  Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **Renaming and Restructuring**: Key
@@ -498,6 +492,25 @@
498
492
  support fetching ledger records and transactions specifically by financial entity, catering to
499
493
  the new UI structure.
500
494
 
495
+ - [#2646](https://github.com/Urigo/accounter-fullstack/pull/2646)
496
+ [`ea9fe94`](https://github.com/Urigo/accounter-fullstack/commit/ea9fe94330f6315a71eb09553473ec0d576151f2)
497
+ Thanks [@gilgardosh](https://github.com/gilgardosh)! - - **New Contracts Screen**: A dedicated
498
+ user interface has been introduced for viewing and managing client contracts, accessible via a new
499
+ sidebar link.
500
+ - **Enhanced Contract Management**: The new screen features a comprehensive data table for
501
+ contracts, offering functionalities like sorting, filtering by various criteria (product type,
502
+ billing cycle, subscription plan, active status), column visibility toggling, and pagination.
503
+ - **Contract Editing Functionality**: Users can now edit existing contracts directly from the
504
+ contracts table through a modified dialog that fetches and pre-fills contract details for a
505
+ seamless editing experience.
506
+ - **Bulk Document Issuance**: A new modal allows users to select multiple contracts and generate
507
+ document drafts for a specified month, streamlining the process of creating invoices or other
508
+ contract-related documents.
509
+ - **Backend API and Caching Improvements**: New GraphQL queries and resolvers have been added to
510
+ support fetching contracts by administrator ID and individual contract details. The backend also
511
+ includes refined cache invalidation logic for contract operations, ensuring data consistency and
512
+ improved performance.
513
+
501
514
  - [#2547](https://github.com/Urigo/accounter-fullstack/pull/2547)
502
515
  [`fd9fb24`](https://github.com/Urigo/accounter-fullstack/commit/fd9fb2445cba9a450f8c78f8100160d9b7c5c38a)
503
516
  Thanks [@gilgardosh](https://github.com/gilgardosh)! - 1. **Environment Variable Validation**: The
@@ -521,10 +534,10 @@
521
534
  [`65e3c7f`](https://github.com/Urigo/accounter-fullstack/commit/65e3c7f01993eb4f41244a40feefefa08b31a4e6),
522
535
  [`65e3c7f`](https://github.com/Urigo/accounter-fullstack/commit/65e3c7f01993eb4f41244a40feefefa08b31a4e6),
523
536
  [`65e3c7f`](https://github.com/Urigo/accounter-fullstack/commit/65e3c7f01993eb4f41244a40feefefa08b31a4e6)]:
524
- - @accounter/green-invoice-graphql@0.8.2-alpha-20251030162201-d2f279aafe537912ec3546af855cbd3a38ac0f5c
525
- - @accounter/pcn874-generator@0.6.3-alpha-20251030162201-d2f279aafe537912ec3546af855cbd3a38ac0f5c
526
- - @accounter/shaam-uniform-format-generator@0.2.2-alpha-20251030162201-d2f279aafe537912ec3546af855cbd3a38ac0f5c
527
- - @accounter/shaam6111-generator@0.1.4-alpha-20251030162201-d2f279aafe537912ec3546af855cbd3a38ac0f5c
537
+ - @accounter/green-invoice-graphql@0.8.2-alpha-20251030164843-d2f490daba879840366288d1f62974ab25081876
538
+ - @accounter/pcn874-generator@0.6.3-alpha-20251030164843-d2f490daba879840366288d1f62974ab25081876
539
+ - @accounter/shaam-uniform-format-generator@0.2.2-alpha-20251030164843-d2f490daba879840366288d1f62974ab25081876
540
+ - @accounter/shaam6111-generator@0.1.4-alpha-20251030164843-d2f490daba879840366288d1f62974ab25081876
528
541
 
529
542
  ## 0.0.7
530
543
 
@@ -193,15 +193,11 @@ export type AdminBusiness = {
193
193
  readonly id: Scalars['UUID']['output'];
194
194
  readonly name: Scalars['String']['output'];
195
195
  readonly registrationDate: Scalars['TimelessDate']['output'];
196
- /** Social Security Info */
197
- readonly socialSecurityDeductionsId?: Maybe<Scalars['String']['output']>;
198
- readonly socialSecurityEmployerIds: ReadonlyArray<AnnualId>;
199
- /** Tax Advances Info */
200
- readonly taxAdvancesAnnualIds: ReadonlyArray<AnnualId>;
201
- readonly taxAdvancesRates: ReadonlyArray<TaxAdvancesRate>;
202
- readonly withholdingTaxAnnualIds: ReadonlyArray<AnnualId>;
203
- /** Withholding Tax Info */
204
- readonly withholdingTaxCompanyId?: Maybe<Scalars['String']['output']>;
196
+ readonly socialSecurityEmployerId?: Maybe<Scalars['String']['output']>;
197
+ readonly taxAdvancesId?: Maybe<Scalars['String']['output']>;
198
+ readonly taxAdvancesRate?: Maybe<Scalars['Float']['output']>;
199
+ readonly withholdingTaxBookNumber?: Maybe<Scalars['String']['output']>;
200
+ readonly withholdingTaxFileNumber?: Maybe<Scalars['String']['output']>;
205
201
  };
206
202
  /** defines a tag / category for charge arrangement */
207
203
  export type AdminContext = {
@@ -335,17 +331,6 @@ export type AdminContextInput = {
335
331
  readonly zkufotExpensesTaxCategoryId?: InputMaybe<Scalars['UUID']['input']>;
336
332
  readonly zkufotIncomeTaxCategoryId?: InputMaybe<Scalars['UUID']['input']>;
337
333
  };
338
- /** Represents an annual identifier for tax purposes. */
339
- export type AnnualId = {
340
- readonly __typename?: 'AnnualId';
341
- readonly id: Scalars['String']['output'];
342
- readonly year: Scalars['Int']['output'];
343
- };
344
- /** Input type representing an annual identifier for tax purposes. */
345
- export type AnnualIdInput = {
346
- readonly id: Scalars['String']['input'];
347
- readonly year: Scalars['Int']['input'];
348
- };
349
334
  /** Audit opinion type enum (חוות דעת) */
350
335
  export type AuditOpinionType =
351
336
  /** Adverse opinion (שלילית) */
@@ -1122,12 +1107,12 @@ export type Country = {
1122
1107
  /** Input type for creating a new admin business. */
1123
1108
  export type CreateAdminBusinessInput = {
1124
1109
  readonly businessId: Scalars['UUID']['input'];
1125
- readonly companyTaxId: Scalars['String']['input'];
1126
1110
  readonly registrationDate: Scalars['TimelessDate']['input'];
1127
1111
  readonly socialSecurityEmployerId?: InputMaybe<Scalars['String']['input']>;
1128
- readonly taxAdvancesAnnualId?: InputMaybe<Scalars['String']['input']>;
1112
+ readonly taxAdvancesId?: InputMaybe<Scalars['String']['input']>;
1129
1113
  readonly taxAdvancesRate?: InputMaybe<Scalars['Float']['input']>;
1130
- readonly withholdingTaxAnnualId?: InputMaybe<Scalars['String']['input']>;
1114
+ readonly withholdingTaxBookNumber?: InputMaybe<Scalars['String']['input']>;
1115
+ readonly withholdingTaxFileNumber?: InputMaybe<Scalars['String']['input']>;
1131
1116
  };
1132
1117
  /** input for creating a new contract */
1133
1118
  export type CreateContractInput = {
@@ -2865,9 +2850,12 @@ export type Query = {
2865
2850
  readonly chargesWithLedgerChanges: ReadonlyArray<ChargesWithLedgerChangesResult>;
2866
2851
  readonly chargesWithMissingRequiredInfo: PaginatedCharges;
2867
2852
  readonly client: Client;
2853
+ readonly clientChargesDraftsByContracts: ReadonlyArray<NewDocumentInfo>;
2868
2854
  readonly clientMonthlyChargeDraft: NewDocumentInfo;
2869
2855
  readonly clientMonthlyChargesDrafts: ReadonlyArray<NewDocumentInfo>;
2856
+ readonly contractsByAdmin: ReadonlyArray<Contract>;
2870
2857
  readonly contractsByClient: ReadonlyArray<Contract>;
2858
+ readonly contractsById: Contract;
2871
2859
  readonly corporateTaxByDate: CorporateTax;
2872
2860
  readonly corporateTaxRulingComplianceReport: ReadonlyArray<CorporateTaxRulingComplianceReport>;
2873
2861
  readonly deposit: BankDeposit;
@@ -2988,6 +2976,11 @@ export type QueryClientArgs = {
2988
2976
  businessId: Scalars['UUID']['input'];
2989
2977
  };
2990
2978
  /** query root */
2979
+ export type QueryClientChargesDraftsByContractsArgs = {
2980
+ contractIds: ReadonlyArray<Scalars['UUID']['input']>;
2981
+ issueMonth: Scalars['TimelessDate']['input'];
2982
+ };
2983
+ /** query root */
2991
2984
  export type QueryClientMonthlyChargeDraftArgs = {
2992
2985
  clientId: Scalars['UUID']['input'];
2993
2986
  issueMonth: Scalars['TimelessDate']['input'];
@@ -2997,10 +2990,18 @@ export type QueryClientMonthlyChargesDraftsArgs = {
2997
2990
  issueMonth: Scalars['TimelessDate']['input'];
2998
2991
  };
2999
2992
  /** query root */
2993
+ export type QueryContractsByAdminArgs = {
2994
+ adminId: Scalars['UUID']['input'];
2995
+ };
2996
+ /** query root */
3000
2997
  export type QueryContractsByClientArgs = {
3001
2998
  clientId: Scalars['UUID']['input'];
3002
2999
  };
3003
3000
  /** query root */
3001
+ export type QueryContractsByIdArgs = {
3002
+ id: Scalars['UUID']['input'];
3003
+ };
3004
+ /** query root */
3004
3005
  export type QueryCorporateTaxByDateArgs = {
3005
3006
  date: Scalars['TimelessDate']['input'];
3006
3007
  };
@@ -3556,17 +3557,6 @@ export type Tag = {
3556
3557
  export type TagInput = {
3557
3558
  readonly id: Scalars['String']['input'];
3558
3559
  };
3559
- /** Represents the tax advance rate for a specific date. */
3560
- export type TaxAdvancesRate = {
3561
- readonly __typename?: 'TaxAdvancesRate';
3562
- readonly date: Scalars['TimelessDate']['output'];
3563
- readonly rate: Scalars['Float']['output'];
3564
- };
3565
- /** Input type representing the tax advance rate for a specific date. */
3566
- export type TaxAdvancesRateInput = {
3567
- readonly date: Scalars['TimelessDate']['input'];
3568
- readonly rate: Scalars['Float']['input'];
3569
- };
3570
3560
  /** Tax category entity used for ledger records */
3571
3561
  export type TaxCategory = FinancialEntity & {
3572
3562
  readonly __typename?: 'TaxCategory';
@@ -3681,17 +3671,12 @@ export type Unprocessed = Document & Linkable & {
3681
3671
  };
3682
3672
  /** Input type for updating admin business details. */
3683
3673
  export type UpdateAdminBusinessInput = {
3684
- readonly governmentId?: InputMaybe<Scalars['String']['input']>;
3685
- readonly name?: InputMaybe<Scalars['String']['input']>;
3686
3674
  readonly registrationDate?: InputMaybe<Scalars['TimelessDate']['input']>;
3687
- /** Social Security Info */
3688
- readonly socialSecurityEmployerIds?: InputMaybe<ReadonlyArray<AnnualIdInput>>;
3689
- /** Tax Advances Info */
3690
- readonly taxAdvancesAnnualIds?: InputMaybe<ReadonlyArray<AnnualIdInput>>;
3691
- readonly taxAdvancesRates?: InputMaybe<ReadonlyArray<TaxAdvancesRateInput>>;
3692
- readonly withholdingTaxAnnualIds?: InputMaybe<ReadonlyArray<AnnualIdInput>>;
3693
- /** Withholding Tax Info */
3694
- readonly withholdingTaxCompanyId?: InputMaybe<Scalars['String']['input']>;
3675
+ readonly socialSecurityEmployerId?: InputMaybe<Scalars['String']['input']>;
3676
+ readonly taxAdvancesId?: InputMaybe<Scalars['String']['input']>;
3677
+ readonly taxAdvancesRate?: InputMaybe<Scalars['Float']['input']>;
3678
+ readonly withholdingTaxBookNumber?: InputMaybe<Scalars['String']['input']>;
3679
+ readonly withholdingTaxFileNumber?: InputMaybe<Scalars['String']['input']>;
3695
3680
  };
3696
3681
  /** input for updateBusiness */
3697
3682
  export type UpdateBusinessInput = {
@@ -4123,8 +4108,6 @@ export type ResolversTypes = {
4123
4108
  AdminBusiness: ResolverTypeWrapper<IGetAllAdminBusinessesResult>;
4124
4109
  AdminContext: ResolverTypeWrapper<IGetAdminContextsResult>;
4125
4110
  AdminContextInput: AdminContextInput;
4126
- AnnualId: ResolverTypeWrapper<AnnualId>;
4127
- AnnualIdInput: AnnualIdInput;
4128
4111
  AuditOpinionType: AuditOpinionType;
4129
4112
  BalanceTransactions: ResolverTypeWrapper<IGetNormalizedBalanceTransactionsResult>;
4130
4113
  BankDeposit: ResolverTypeWrapper<Omit<BankDeposit, 'transactions'> & {
@@ -4394,8 +4377,6 @@ export type ResolversTypes = {
4394
4377
  SuggestionsInput: SuggestionsInput;
4395
4378
  Tag: ResolverTypeWrapper<IGetAllTagsResult>;
4396
4379
  TagInput: TagInput;
4397
- TaxAdvancesRate: ResolverTypeWrapper<TaxAdvancesRate>;
4398
- TaxAdvancesRateInput: TaxAdvancesRateInput;
4399
4380
  TaxCategory: ResolverTypeWrapper<IGetAllTaxCategoriesResult>;
4400
4381
  TaxReport: ResolverTypeWrapper<Omit<TaxReport, 'reference' | 'report'> & {
4401
4382
  reference: ReadonlyArray<ResolversTypes['TaxReportYear']>;
@@ -4494,8 +4475,6 @@ export type ResolversParentTypes = {
4494
4475
  AdminBusiness: IGetAllAdminBusinessesResult;
4495
4476
  AdminContext: IGetAdminContextsResult;
4496
4477
  AdminContextInput: AdminContextInput;
4497
- AnnualId: AnnualId;
4498
- AnnualIdInput: AnnualIdInput;
4499
4478
  BalanceTransactions: IGetNormalizedBalanceTransactionsResult;
4500
4479
  BankDeposit: Omit<BankDeposit, 'transactions'> & {
4501
4480
  transactions: ReadonlyArray<ResolversParentTypes['Transaction']>;
@@ -4730,8 +4709,6 @@ export type ResolversParentTypes = {
4730
4709
  SuggestionsInput: SuggestionsInput;
4731
4710
  Tag: IGetAllTagsResult;
4732
4711
  TagInput: TagInput;
4733
- TaxAdvancesRate: TaxAdvancesRate;
4734
- TaxAdvancesRateInput: TaxAdvancesRateInput;
4735
4712
  TaxCategory: IGetAllTaxCategoriesResult;
4736
4713
  TaxReport: Omit<TaxReport, 'reference' | 'report'> & {
4737
4714
  reference: ReadonlyArray<ResolversParentTypes['TaxReportYear']>;
@@ -4833,12 +4810,11 @@ export type AdminBusinessResolvers<ContextType = GraphQLModules.Context, ParentT
4833
4810
  id?: Resolver<ResolversTypes['UUID'], ParentType, ContextType>;
4834
4811
  name?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
4835
4812
  registrationDate?: Resolver<ResolversTypes['TimelessDate'], ParentType, ContextType>;
4836
- socialSecurityDeductionsId?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
4837
- socialSecurityEmployerIds?: Resolver<ReadonlyArray<ResolversTypes['AnnualId']>, ParentType, ContextType>;
4838
- taxAdvancesAnnualIds?: Resolver<ReadonlyArray<ResolversTypes['AnnualId']>, ParentType, ContextType>;
4839
- taxAdvancesRates?: Resolver<ReadonlyArray<ResolversTypes['TaxAdvancesRate']>, ParentType, ContextType>;
4840
- withholdingTaxAnnualIds?: Resolver<ReadonlyArray<ResolversTypes['AnnualId']>, ParentType, ContextType>;
4841
- withholdingTaxCompanyId?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
4813
+ socialSecurityEmployerId?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
4814
+ taxAdvancesId?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
4815
+ taxAdvancesRate?: Resolver<Maybe<ResolversTypes['Float']>, ParentType, ContextType>;
4816
+ withholdingTaxBookNumber?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
4817
+ withholdingTaxFileNumber?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
4842
4818
  __isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
4843
4819
  };
4844
4820
  export type AdminContextResolvers<ContextType = GraphQLModules.Context, ParentType extends ResolversParentTypes['AdminContext'] = ResolversParentTypes['AdminContext']> = {
@@ -4907,11 +4883,6 @@ export type AdminContextResolvers<ContextType = GraphQLModules.Context, ParentTy
4907
4883
  zkufotIncomeTaxCategory?: Resolver<Maybe<ResolversTypes['TaxCategory']>, ParentType, ContextType>;
4908
4884
  __isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
4909
4885
  };
4910
- export type AnnualIdResolvers<ContextType = GraphQLModules.Context, ParentType extends ResolversParentTypes['AnnualId'] = ResolversParentTypes['AnnualId']> = {
4911
- id?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
4912
- year?: Resolver<ResolversTypes['Int'], ParentType, ContextType>;
4913
- __isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
4914
- };
4915
4886
  export type BalanceTransactionsResolvers<ContextType = GraphQLModules.Context, ParentType extends ResolversParentTypes['BalanceTransactions'] = ResolversParentTypes['BalanceTransactions']> = {
4916
4887
  amount?: Resolver<ResolversTypes['FinancialAmount'], ParentType, ContextType>;
4917
4888
  amountUsd?: Resolver<ResolversTypes['FinancialAmount'], ParentType, ContextType>;
@@ -6442,9 +6413,12 @@ export type QueryResolvers<ContextType = GraphQLModules.Context, ParentType exte
6442
6413
  chargesWithLedgerChanges?: Resolver<ReadonlyArray<ResolversTypes['ChargesWithLedgerChangesResult']>, ParentType, ContextType, Partial<QueryChargesWithLedgerChangesArgs>>;
6443
6414
  chargesWithMissingRequiredInfo?: Resolver<ResolversTypes['PaginatedCharges'], ParentType, ContextType, RequireFields<QueryChargesWithMissingRequiredInfoArgs, 'limit' | 'page'>>;
6444
6415
  client?: Resolver<ResolversTypes['Client'], ParentType, ContextType, RequireFields<QueryClientArgs, 'businessId'>>;
6416
+ clientChargesDraftsByContracts?: Resolver<ReadonlyArray<ResolversTypes['NewDocumentInfo']>, ParentType, ContextType, RequireFields<QueryClientChargesDraftsByContractsArgs, 'contractIds' | 'issueMonth'>>;
6445
6417
  clientMonthlyChargeDraft?: Resolver<ResolversTypes['NewDocumentInfo'], ParentType, ContextType, RequireFields<QueryClientMonthlyChargeDraftArgs, 'clientId' | 'issueMonth'>>;
6446
6418
  clientMonthlyChargesDrafts?: Resolver<ReadonlyArray<ResolversTypes['NewDocumentInfo']>, ParentType, ContextType, RequireFields<QueryClientMonthlyChargesDraftsArgs, 'issueMonth'>>;
6419
+ contractsByAdmin?: Resolver<ReadonlyArray<ResolversTypes['Contract']>, ParentType, ContextType, RequireFields<QueryContractsByAdminArgs, 'adminId'>>;
6447
6420
  contractsByClient?: Resolver<ReadonlyArray<ResolversTypes['Contract']>, ParentType, ContextType, RequireFields<QueryContractsByClientArgs, 'clientId'>>;
6421
+ contractsById?: Resolver<ResolversTypes['Contract'], ParentType, ContextType, RequireFields<QueryContractsByIdArgs, 'id'>>;
6448
6422
  corporateTaxByDate?: Resolver<ResolversTypes['CorporateTax'], ParentType, ContextType, RequireFields<QueryCorporateTaxByDateArgs, 'date'>>;
6449
6423
  corporateTaxRulingComplianceReport?: Resolver<ReadonlyArray<ResolversTypes['CorporateTaxRulingComplianceReport']>, ParentType, ContextType, RequireFields<QueryCorporateTaxRulingComplianceReportArgs, 'years'>>;
6450
6424
  deposit?: Resolver<ResolversTypes['BankDeposit'], ParentType, ContextType, RequireFields<QueryDepositArgs, 'depositId'>>;
@@ -6706,11 +6680,6 @@ export type TagResolvers<ContextType = GraphQLModules.Context, ParentType extend
6706
6680
  parent?: Resolver<Maybe<ResolversTypes['Tag']>, ParentType, ContextType>;
6707
6681
  __isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
6708
6682
  };
6709
- export type TaxAdvancesRateResolvers<ContextType = GraphQLModules.Context, ParentType extends ResolversParentTypes['TaxAdvancesRate'] = ResolversParentTypes['TaxAdvancesRate']> = {
6710
- date?: Resolver<ResolversTypes['TimelessDate'], ParentType, ContextType>;
6711
- rate?: Resolver<ResolversTypes['Float'], ParentType, ContextType>;
6712
- __isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
6713
- };
6714
6683
  export type TaxCategoryResolvers<ContextType = GraphQLModules.Context, ParentType extends ResolversParentTypes['TaxCategory'] = ResolversParentTypes['TaxCategory']> = {
6715
6684
  createdAt?: Resolver<ResolversTypes['DateTime'], ParentType, ContextType>;
6716
6685
  id?: Resolver<ResolversTypes['UUID'], ParentType, ContextType>;
@@ -6943,7 +6912,6 @@ export type YearlyLedgerReportFinancialEntityInfoResolvers<ContextType = GraphQL
6943
6912
  export type Resolvers<ContextType = GraphQLModules.Context> = {
6944
6913
  AdminBusiness?: AdminBusinessResolvers<ContextType>;
6945
6914
  AdminContext?: AdminContextResolvers<ContextType>;
6946
- AnnualId?: AnnualIdResolvers<ContextType>;
6947
6915
  BalanceTransactions?: BalanceTransactionsResolvers<ContextType>;
6948
6916
  BankDeposit?: BankDepositResolvers<ContextType>;
6949
6917
  BankDepositCharge?: BankDepositChargeResolvers<ContextType>;
@@ -7089,7 +7057,6 @@ export type Resolvers<ContextType = GraphQLModules.Context> = {
7089
7057
  Suggestions?: SuggestionsResolvers<ContextType>;
7090
7058
  SuggestionsEmailListenerConfig?: SuggestionsEmailListenerConfigResolvers<ContextType>;
7091
7059
  Tag?: TagResolvers<ContextType>;
7092
- TaxAdvancesRate?: TaxAdvancesRateResolvers<ContextType>;
7093
7060
  TaxCategory?: TaxCategoryResolvers<ContextType>;
7094
7061
  TaxReport?: TaxReportResolvers<ContextType>;
7095
7062
  TaxReportYear?: TaxReportYearResolvers<ContextType>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/__generated__/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAs3BrD,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAyX7B,OAAO,EAAE,QAAQ,EAAE,CAAC;AAuLpB,OAAO,EAAE,YAAY,EAAE,CAAC;AA2lCxB,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAw4D7B,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/__generated__/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAq2BrD,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAyX7B,OAAO,EAAE,QAAQ,EAAE,CAAC;AAuLpB,OAAO,EAAE,YAAY,EAAE,CAAC;AA2lCxB,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAi5D7B,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
@@ -58,6 +58,35 @@ export interface IGetContractsByIdsQuery {
58
58
  params: IGetContractsByIdsParams;
59
59
  result: IGetContractsByIdsResult;
60
60
  }
61
+ /** 'GetContractsByAdminBusinessIds' parameters type */
62
+ export interface IGetContractsByAdminBusinessIdsParams {
63
+ adminBusinessIds: readonly (string | null | void)[];
64
+ }
65
+ /** 'GetContractsByAdminBusinessIds' return type */
66
+ export interface IGetContractsByAdminBusinessIdsResult {
67
+ amount: number;
68
+ billing_cycle: string;
69
+ client_id: string;
70
+ currency: currency;
71
+ document_type: document_type;
72
+ end_date: Date;
73
+ id: string;
74
+ is_active: boolean | null;
75
+ ms_cloud: string | null;
76
+ operations_count: string;
77
+ owner_id: string | null;
78
+ plan: string | null;
79
+ product: string | null;
80
+ purchase_orders: stringArray;
81
+ remarks: string | null;
82
+ signed_agreement: string | null;
83
+ start_date: Date;
84
+ }
85
+ /** 'GetContractsByAdminBusinessIds' query type */
86
+ export interface IGetContractsByAdminBusinessIdsQuery {
87
+ params: IGetContractsByAdminBusinessIdsParams;
88
+ result: IGetContractsByAdminBusinessIdsResult;
89
+ }
61
90
  /** 'GetContractsByClientIds' parameters type */
62
91
  export interface IGetContractsByClientIdsParams {
63
92
  clientIds: readonly (string | null | void)[];
@@ -2,7 +2,7 @@ import * as Types from "../../../__generated__/types.js";
2
2
  import * as gm from "graphql-modules";
3
3
  export declare namespace ContractsModule {
4
4
  interface DefinedFields {
5
- Query: 'allOpenContracts' | 'contractsByClient';
5
+ Query: 'allOpenContracts' | 'contractsByClient' | 'contractsByAdmin' | 'contractsById';
6
6
  Mutation: 'updateContract' | 'deleteContract' | 'createContract';
7
7
  Contract: 'id' | 'client' | 'purchaseOrders' | 'startDate' | 'endDate' | 'remarks' | 'amount' | 'documentType' | 'billingCycle' | 'isActive' | 'product' | 'plan' | 'msCloud' | 'operationsLimit';
8
8
  }
@@ -46,6 +46,8 @@ export declare namespace ContractsModule {
46
46
  '*'?: gm.Middleware[];
47
47
  allOpenContracts?: gm.Middleware[];
48
48
  contractsByClient?: gm.Middleware[];
49
+ contractsByAdmin?: gm.Middleware[];
50
+ contractsById?: gm.Middleware[];
49
51
  };
50
52
  Mutation?: {
51
53
  '*'?: gm.Middleware[];
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/modules/contracts/__generated__/types.ts"],"names":[],"mappings":"AAEA,MAAM,KAAW,eAAe,CA6E/B;AA7ED,WAAiB,eAAe;IAK7B,CAAC;IAMD,CAAC;IAKD,CAAC;IA0BD,CAAC;IAkCD,CAAC;AACJ,CAAC,EA7EgB,eAAe,KAAf,eAAe,QA6E/B"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/modules/contracts/__generated__/types.ts"],"names":[],"mappings":"AAEA,MAAM,KAAW,eAAe,CA+E/B;AA/ED,WAAiB,eAAe;IAK7B,CAAC;IAMD,CAAC;IAKD,CAAC;IA0BD,CAAC;IAoCD,CAAC;AACJ,CAAC,EA/EgB,eAAe,KAAf,eAAe,QA+E/B"}
@@ -1,8 +1,10 @@
1
1
  import DataLoader from 'dataloader';
2
2
  import { DBProvider } from '../../app-providers/db.provider.js';
3
+ import { BusinessesProvider } from '../../financial-entities/providers/businesses.provider.js';
3
4
  import type { IGetAllOpenContractsResult, IInsertContractParams, IUpdateContractParams } from '../types.js';
4
5
  export declare class ContractsProvider {
5
6
  private dbProvider;
7
+ private businessesProvider;
6
8
  cache: {
7
9
  get: <T>(key: import("node-cache").Key) => T | undefined;
8
10
  set: {
@@ -12,10 +14,12 @@ export declare class ContractsProvider {
12
14
  delete: (keys: import("node-cache").Key | import("node-cache").Key[]) => number;
13
15
  clear: () => void;
14
16
  };
15
- constructor(dbProvider: DBProvider);
17
+ constructor(dbProvider: DBProvider, businessesProvider: BusinessesProvider);
16
18
  getAllOpenContracts(): Promise<IGetAllOpenContractsResult[]>;
17
19
  private contractsByIds;
18
20
  getContractsByIdLoader: DataLoader<string, import("../types.js").IGetContractsByIdsResult | undefined, import("node-cache").Key | import("node-cache").Key[]>;
21
+ private contractsByAdminBusinessIds;
22
+ getContractsByAdminBusinessIdLoader: DataLoader<string, import("../types.js").IGetContractsByAdminBusinessIdsResult[], import("node-cache").Key | import("node-cache").Key[]>;
19
23
  private contractsByClients;
20
24
  getContractsByClientIdLoader: DataLoader<string, import("../types.js").IGetContractsByClientIdsResult[], import("node-cache").Key | import("node-cache").Key[]>;
21
25
  createContract(params: IInsertContractParams): Promise<import("../types.js").IInsertContractResult>;
@@ -2,6 +2,7 @@ import { __decorate, __metadata } from "tslib";
2
2
  import DataLoader from 'dataloader';
3
3
  import { Injectable, Scope } from 'graphql-modules';
4
4
  import { DBProvider } from '../../app-providers/db.provider.js';
5
+ import { BusinessesProvider } from '../../financial-entities/providers/businesses.provider.js';
5
6
  import { sql } from '@pgtyped/runtime';
6
7
  import { getCacheInstance } from '../../../shared/helpers/index.js';
7
8
  const getAllOpenContracts = sql `
@@ -12,6 +13,11 @@ const getContractsByIds = sql `
12
13
  SELECT *
13
14
  FROM accounter_schema.clients_contracts
14
15
  WHERE id In $$ids;`;
16
+ const getContractsByAdminBusinessIds = sql `
17
+ SELECT fe.owner_id, c.*
18
+ FROM accounter_schema.clients_contracts c
19
+ LEFT JOIN accounter_schema.financial_entities fe ON c.client_id = fe.id
20
+ WHERE owner_id IN $$adminBusinessIds;`;
15
21
  const getContractsByClientIds = sql `
16
22
  SELECT *
17
23
  FROM accounter_schema.clients_contracts
@@ -116,11 +122,13 @@ const insertContract = sql `
116
122
  RETURNING *;`;
117
123
  let ContractsProvider = class ContractsProvider {
118
124
  dbProvider;
125
+ businessesProvider;
119
126
  cache = getCacheInstance({
120
127
  stdTTL: 60 * 60, // 1 hours
121
128
  });
122
- constructor(dbProvider) {
129
+ constructor(dbProvider, businessesProvider) {
123
130
  this.dbProvider = dbProvider;
131
+ this.businessesProvider = businessesProvider;
124
132
  }
125
133
  getAllOpenContracts() {
126
134
  const cached = this.cache.get('all-contracts');
@@ -145,6 +153,14 @@ let ContractsProvider = class ContractsProvider {
145
153
  cacheKeyFn: id => `contract-${id}`,
146
154
  cacheMap: this.cache,
147
155
  });
156
+ async contractsByAdminBusinessIds(adminBusinessIds) {
157
+ const contracts = await getContractsByAdminBusinessIds.run({ adminBusinessIds }, this.dbProvider);
158
+ return adminBusinessIds.map(adminBusinessId => contracts.filter(contract => contract.owner_id === adminBusinessId));
159
+ }
160
+ getContractsByAdminBusinessIdLoader = new DataLoader((adminBusinessIds) => this.contractsByAdminBusinessIds(adminBusinessIds), {
161
+ cacheKeyFn: adminBusinessId => `admin-business-${adminBusinessId}-contracts`,
162
+ cacheMap: this.cache,
163
+ });
148
164
  async contractsByClients(clientIds) {
149
165
  const contracts = await getContractsByClientIds.run({ clientIds }, this.dbProvider);
150
166
  return clientIds.map(clientId => contracts.filter(contract => contract.client_id === clientId));
@@ -154,28 +170,41 @@ let ContractsProvider = class ContractsProvider {
154
170
  cacheMap: this.cache,
155
171
  });
156
172
  async createContract(params) {
157
- this.clearCache();
158
173
  const [newContract] = await insertContract.run(params, this.dbProvider);
159
174
  this.cache.set(`contract-${newContract.id}`, newContract);
175
+ // Invalidate list caches
176
+ this.getContractsByClientIdLoader.clear(newContract.client_id);
177
+ const business = await this.businessesProvider.getBusinessByIdLoader.load(newContract.client_id);
178
+ if (business?.owner_id) {
179
+ this.getContractsByAdminBusinessIdLoader.clear(business.owner_id);
180
+ }
160
181
  return newContract;
161
182
  }
162
183
  async updateContract(params) {
163
- this.clearCache();
164
184
  const [updatedContract] = await updateContract.run(params, this.dbProvider);
185
+ if (params.contractId) {
186
+ this.invalidateCacheForContract(params.contractId);
187
+ }
188
+ else {
189
+ this.clearCache();
190
+ }
165
191
  this.cache.set(`contract-${updatedContract.id}`, updatedContract);
166
192
  return updatedContract;
167
193
  }
168
194
  async deleteContract(contractId) {
169
195
  await deleteContract.run({ id: contractId }, this.dbProvider);
170
- this.clearCache();
196
+ this.invalidateCacheForContract(contractId);
171
197
  return true;
172
198
  }
173
199
  async invalidateCacheForContract(contractId) {
174
200
  const contract = await this.getContractsByIdLoader.load(contractId);
175
201
  if (contract) {
176
202
  this.cache.delete(`client-contracts-${contract.client_id}`);
203
+ const business = await this.businessesProvider.getBusinessByIdLoader.load(contract.client_id);
204
+ if (business?.owner_id) {
205
+ this.cache.delete(`admin-business-${business.owner_id}-contracts`);
206
+ }
177
207
  }
178
- this.cache.delete(`contract-${contractId}`);
179
208
  }
180
209
  clearCache() {
181
210
  this.cache.clear();
@@ -183,10 +212,11 @@ let ContractsProvider = class ContractsProvider {
183
212
  };
184
213
  ContractsProvider = __decorate([
185
214
  Injectable({
186
- scope: Scope.Singleton,
215
+ scope: Scope.Operation,
187
216
  global: true,
188
217
  }),
189
- __metadata("design:paramtypes", [DBProvider])
218
+ __metadata("design:paramtypes", [DBProvider,
219
+ BusinessesProvider])
190
220
  ], ContractsProvider);
191
221
  export { ContractsProvider };
192
222
  //# sourceMappingURL=contracts.provider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contracts.provider.js","sourceRoot":"","sources":["../../../../../../src/modules/contracts/providers/contracts.provider.ts"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,u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C,CAAC;IAEM,UAAU;QACf,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACF,CAAA;AAhFY,iBAAiB;IAJ7B,UAAU,CAAC;QACV,KAAK,EAAE,KAAK,CAAC,SAAS;QACtB,MAAM,EAAE,IAAI;KACb,CAAC;qCAMgC,UAAU;GAL/B,iBAAiB,CAgF7B"}
1
+ {"version":3,"file":"contracts.provider.js","sourceRoot":"","sources":["../../../../../../src/modules/contracts/providers/contracts.provider.ts"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8DAA8D,CAAC;AAClG,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAcnD,MAAM,mBAAmB,GAAG,GAAG,CAA2B;;;6BAG7B,CAAC;AAE9B,MAAM,iBAAiB,GAAG,GAAG,CAAyB;;;uBAG/B,CAAC;AAExB,MAAM,8BAA8B,GAAG,GAAG,CAAsC;;;;0CAItC,CAAC;AAE3C,MAAM,uBAAuB,GAAG,GAAG,CAA+B;;;oCAG9B,CAAC;AAErC,MAAM,cAAc,GAAG,GAAG,CAAsB;;oBAE5B,CAAC;AAErB,MAAM,cAAc,GAAG,GAAG,CAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8D3C,CAAC;AAEN,MAAM,cAAc,GAAG,GAAG,CAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA+B3B,CAAC;AAMf,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAMlB;IACA;IANV,KAAK,GAAG,gBAAgB,CAAC;QACvB,MAAM,EAA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IAAI,CAAC,0BAA0B,CAAC,UAAU,CAAC,CAAC;QAC5C,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,0BAA0B,CAAC,UAAkB;QACxD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACpE,IAAI,QAAQ,EAAE,CAAC;YACb,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,oBAAoB,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC;YAC5D,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;YAC9F,IAAI,QAAQ,EAAE,QAAQ,EAAE,CAAC;gBACvB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,kBAAkB,QAAQ,CAAC,QAAQ,YAAY,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;IACH,CAAC;IAEM,UAAU;QACf,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACF,CAAA;AArHY,iBAAiB;IAJ7B,UAAU,CAAC;QACV,KAAK,EAAE,KAAK,CAAC,SAAS;QACtB,MAAM,EAAE,IAAI;KACb,CAAC;qCAOsB,UAAU;QACF,kBAAkB;GAPrC,iBAAiB,CAqH7B"}
@@ -25,6 +25,33 @@ export const contractsResolvers = {
25
25
  throw new GraphQLError(message);
26
26
  }
27
27
  },
28
+ contractsByAdmin: async (_, { adminId }, { injector }) => {
29
+ try {
30
+ return injector.get(ContractsProvider).getContractsByAdminBusinessIdLoader.load(adminId);
31
+ }
32
+ catch (e) {
33
+ const message = 'Error fetching contracts by admin';
34
+ console.error(message, e);
35
+ throw new GraphQLError(message);
36
+ }
37
+ },
38
+ contractsById: async (_, { id }, { injector }) => {
39
+ try {
40
+ return injector
41
+ .get(ContractsProvider)
42
+ .getContractsByIdLoader.load(id)
43
+ .then(res => {
44
+ if (!res)
45
+ throw new GraphQLError('Contract not found');
46
+ return res;
47
+ });
48
+ }
49
+ catch (e) {
50
+ const message = 'Error fetching contracts by id';
51
+ console.error(message, e);
52
+ throw new GraphQLError(message);
53
+ }
54
+ },
28
55
  },
29
56
  Mutation: {
30
57
  createContract: async (_, { input }, { injector }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"contracts.resolver.js","sourceRoot":"","sources":["../../../../../../src/modules/contracts/resolvers/contracts.resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,2DAA2D,CAAC;AAC5F,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAClF,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,yBAAyB,GAC1B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAGvE,MAAM,CAAC,MAAM,kBAAkB,GAA8B;IAC3D,KAAK,EAAE;QACL,gBAAgB,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAC9C,IAAI,CAAC;gBACH,OAAO,QAAQ,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,mBAAmB,EAAE,CAAC;YAC/D,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,CAAC,CAAC,CAAC;gBAC7C,MAAM,IAAI,YAAY,CAAC,0BAA0B,CAAC,CAAC;YACrD,CAAC;QACH,CAAC;QACD,iBAAiB,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YACzD,IAAI,CAAC;gBACH,OAAO,QAAQ,CAAC,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ractsByClient(clientId: UUID!): [Contract!]! @auth(role: ACCOUNTANT)
6
+ contractsByAdmin(adminId: UUID!): [Contract!]! @auth(role: ACCOUNTANT)
7
+ contractsById(id: UUID!): Contract! @auth(role: ACCOUNTANT)
6
8
  }
7
9
 
8
10
  extend type Mutation {
@@ -1 +1 @@
1
- {"version":3,"file":"contracts.graphql.js","sourceRoot":"","sources":["../../../../../../src/modules/contracts/typeDefs/contracts.graphql.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkFjB,CAAC"}
1
+ {"version":3,"file":"contracts.graphql.js","sourceRoot":"","sources":["../../../../../../src/modules/contracts/typeDefs/contracts.graphql.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoFjB,CAAC"}