@accounter/server 0.0.8-alpha-20251029233659-8fb74309c9f1de4f20423db029c5740e2df4bb5d → 0.0.8-alpha-20251029234818-bb69914cb7aaa4859296baa4a256c251158fd15b
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 +33 -4
- package/dist/green-invoice-graphql/src/mesh-artifacts/index.d.ts +1 -1
- package/dist/server/src/__generated__/types.d.ts +82 -18
- package/dist/server/src/__generated__/types.js.map +1 -1
- package/dist/server/src/modules/financial-entities/__generated__/admin-businesses.types.d.ts +57 -0
- package/dist/server/src/modules/financial-entities/__generated__/admin-businesses.types.js +0 -1
- package/dist/server/src/modules/financial-entities/__generated__/admin-businesses.types.js.map +1 -1
- package/dist/server/src/modules/financial-entities/__generated__/types.d.ts +33 -10
- package/dist/server/src/modules/financial-entities/__generated__/types.js.map +1 -1
- package/dist/server/src/modules/financial-entities/helpers/admin-businesses.helper.d.ts +31 -0
- package/dist/server/src/modules/financial-entities/helpers/admin-businesses.helper.js +27 -0
- package/dist/server/src/modules/financial-entities/helpers/admin-businesses.helper.js.map +1 -0
- package/dist/server/src/modules/financial-entities/providers/admin-businesses.provider.d.ts +2 -1
- package/dist/server/src/modules/financial-entities/providers/admin-businesses.provider.js +37 -0
- package/dist/server/src/modules/financial-entities/providers/admin-businesses.provider.js.map +1 -1
- package/dist/server/src/modules/financial-entities/resolvers/admin-businesses.resolver.js +46 -11
- package/dist/server/src/modules/financial-entities/resolvers/admin-businesses.resolver.js.map +1 -1
- package/dist/server/src/modules/financial-entities/typeDefs/admin-businesses.graphql.js +49 -16
- package/dist/server/src/modules/financial-entities/typeDefs/admin-businesses.graphql.js.map +1 -1
- package/dist/server/src/modules/financial-entities/types.d.ts +1 -1
- package/dist/server/src/modules/ledger/__generated__/types.d.ts +3 -2
- package/dist/server/src/modules/ledger/__generated__/types.js.map +1 -1
- package/dist/server/src/modules/ledger/resolvers/ledger.resolver.js +5 -0
- package/dist/server/src/modules/ledger/resolvers/ledger.resolver.js.map +1 -1
- package/dist/server/src/modules/ledger/typeDefs/ledger.graphql.js +2 -0
- package/dist/server/src/modules/ledger/typeDefs/ledger.graphql.js.map +1 -1
- package/dist/server/src/modules/transactions/__generated__/types.d.ts +2 -1
- package/dist/server/src/modules/transactions/__generated__/types.js.map +1 -1
- package/dist/server/src/modules/transactions/resolvers/transactions.resolver.js +10 -0
- package/dist/server/src/modules/transactions/resolvers/transactions.resolver.js.map +1 -1
- package/dist/server/src/modules/transactions/typeDefs/transactions.graphql.js +1 -0
- package/dist/server/src/modules/transactions/typeDefs/transactions.graphql.js.map +1 -1
- package/package.json +1 -1
- package/src/__generated__/types.ts +92 -18
- package/src/modules/financial-entities/__generated__/admin-businesses.types.ts +60 -0
- package/src/modules/financial-entities/__generated__/types.ts +33 -10
- package/src/modules/financial-entities/helpers/admin-businesses.helper.ts +33 -0
- package/src/modules/financial-entities/providers/admin-businesses.provider.ts +44 -0
- package/src/modules/financial-entities/resolvers/admin-businesses.resolver.ts +53 -11
- package/src/modules/financial-entities/typeDefs/admin-businesses.graphql.ts +49 -16
- package/src/modules/financial-entities/types.ts +1 -1
- package/src/modules/ledger/__generated__/types.ts +3 -2
- package/src/modules/ledger/resolvers/ledger.resolver.ts +5 -0
- package/src/modules/ledger/typeDefs/ledger.graphql.ts +2 -0
- package/src/modules/transactions/__generated__/types.ts +2 -1
- package/src/modules/transactions/resolvers/transactions.resolver.ts +10 -0
- package/src/modules/transactions/typeDefs/transactions.graphql.ts +1 -0
|
@@ -19,34 +19,67 @@ export default gql`
|
|
|
19
19
|
id: UUID!
|
|
20
20
|
name: String!
|
|
21
21
|
governmentId: String!
|
|
22
|
-
business: LtdFinancialEntity!
|
|
23
|
-
withholdingTaxBookNumber: String
|
|
24
|
-
withholdingTaxFileNumber: String
|
|
25
|
-
socialSecurityEmployerId: String
|
|
26
|
-
taxAdvancesRate: Float
|
|
27
|
-
taxAdvancesId: String
|
|
28
22
|
registrationDate: TimelessDate!
|
|
23
|
+
business: LtdFinancialEntity!
|
|
24
|
+
" Tax Advances Info "
|
|
25
|
+
taxAdvancesAnnualIds: [AnnualId!]!
|
|
26
|
+
taxAdvancesRates: [TaxAdvancesRate!]!
|
|
27
|
+
" Withholding Tax Info "
|
|
28
|
+
withholdingTaxCompanyId: String
|
|
29
|
+
withholdingTaxAnnualIds: [AnnualId!]!
|
|
30
|
+
" Social Security Info "
|
|
31
|
+
socialSecurityDeductionsId: String
|
|
32
|
+
socialSecurityEmployerIds: [AnnualId!]!
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
" Represents an annual identifier for tax purposes. "
|
|
36
|
+
type AnnualId {
|
|
37
|
+
year: Int!
|
|
38
|
+
id: String!
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
" Represents the tax advance rate for a specific date. "
|
|
42
|
+
type TaxAdvancesRate {
|
|
43
|
+
date: TimelessDate!
|
|
44
|
+
rate: Float!
|
|
29
45
|
}
|
|
30
46
|
|
|
31
47
|
" Input type for creating a new admin business. "
|
|
32
48
|
input CreateAdminBusinessInput {
|
|
33
49
|
businessId: UUID!
|
|
34
|
-
withholdingTaxBookNumber: String
|
|
35
|
-
withholdingTaxFileNumber: String
|
|
36
|
-
socialSecurityEmployerId: String
|
|
37
|
-
taxAdvancesRate: Float
|
|
38
|
-
taxAdvancesId: String
|
|
39
50
|
registrationDate: TimelessDate!
|
|
51
|
+
companyTaxId: String!
|
|
52
|
+
taxAdvancesAnnualId: String
|
|
53
|
+
taxAdvancesRate: Float
|
|
54
|
+
withholdingTaxAnnualId: String
|
|
55
|
+
socialSecurityEmployerId: String
|
|
40
56
|
}
|
|
41
57
|
|
|
42
58
|
" Input type for updating admin business details. "
|
|
43
59
|
input UpdateAdminBusinessInput {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
socialSecurityEmployerId: String
|
|
47
|
-
taxAdvancesRate: Float
|
|
48
|
-
taxAdvancesId: String
|
|
60
|
+
name: String
|
|
61
|
+
governmentId: String
|
|
49
62
|
registrationDate: TimelessDate
|
|
63
|
+
" Tax Advances Info "
|
|
64
|
+
taxAdvancesAnnualIds: [AnnualIdInput!]
|
|
65
|
+
taxAdvancesRates: [TaxAdvancesRateInput!]
|
|
66
|
+
" Withholding Tax Info "
|
|
67
|
+
withholdingTaxCompanyId: String
|
|
68
|
+
withholdingTaxAnnualIds: [AnnualIdInput!]
|
|
69
|
+
" Social Security Info "
|
|
70
|
+
socialSecurityEmployerIds: [AnnualIdInput!]
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
" Input type representing an annual identifier for tax purposes. "
|
|
74
|
+
input AnnualIdInput {
|
|
75
|
+
year: Int!
|
|
76
|
+
id: String!
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
" Input type representing the tax advance rate for a specific date. "
|
|
80
|
+
input TaxAdvancesRateInput {
|
|
81
|
+
date: TimelessDate!
|
|
82
|
+
rate: Float!
|
|
50
83
|
}
|
|
51
84
|
|
|
52
85
|
extend type LtdFinancialEntity {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './__generated__/types.js';
|
|
2
|
-
export type { Json, pcn874_record_type } from './__generated__/businesses.types.js';
|
|
2
|
+
export type { Json, pcn874_record_type, DateOrString } from './__generated__/businesses.types.js';
|
|
3
3
|
export * from './__generated__/businesses.types.js';
|
|
4
4
|
export * from './__generated__/businesses-operation.types.js';
|
|
5
5
|
export * from './__generated__/admin-businesses.types.js';
|
|
@@ -2,7 +2,7 @@ import * as Types from "../../../__generated__/types.js";
|
|
|
2
2
|
import * as gm from "graphql-modules";
|
|
3
3
|
export namespace LedgerModule {
|
|
4
4
|
interface DefinedFields {
|
|
5
|
-
Query: 'chargesWithLedgerChanges' | 'ledgerRecordsByDates';
|
|
5
|
+
Query: 'chargesWithLedgerChanges' | 'ledgerRecordsByDates' | 'ledgerRecordsByFinancialEntity';
|
|
6
6
|
Mutation: 'regenerateLedgerRecords' | 'lockLedgerRecords';
|
|
7
7
|
LedgerRecord: 'id' | 'debitAmount1' | 'debitAmount2' | 'creditAmount1' | 'creditAmount2' | 'localCurrencyDebitAmount1' | 'localCurrencyDebitAmount2' | 'localCurrencyCreditAmount1' | 'localCurrencyCreditAmount2' | 'invoiceDate' | 'valueDate' | 'description' | 'reference';
|
|
8
8
|
LedgerBalanceUnbalancedEntity: 'entity' | 'balance';
|
|
@@ -30,9 +30,9 @@ export namespace LedgerModule {
|
|
|
30
30
|
export type ChargeFilter = Types.ChargeFilter;
|
|
31
31
|
export type LedgerRecord = Pick<Types.LedgerRecord, DefinedFields['LedgerRecord']>;
|
|
32
32
|
export type TimelessDate = Types.TimelessDate;
|
|
33
|
+
export type UUID = Types.Uuid;
|
|
33
34
|
export type Mutation = Pick<Types.Mutation, DefinedFields['Mutation']>;
|
|
34
35
|
export type GeneratedLedgerRecords = Types.GeneratedLedgerRecords;
|
|
35
|
-
export type UUID = Types.Uuid;
|
|
36
36
|
export type FinancialAmount = Types.FinancialAmount;
|
|
37
37
|
export type DateTime = Types.DateTime;
|
|
38
38
|
export type Charge = Types.Charge;
|
|
@@ -108,6 +108,7 @@ export namespace LedgerModule {
|
|
|
108
108
|
'*'?: gm.Middleware[];
|
|
109
109
|
chargesWithLedgerChanges?: gm.Middleware[];
|
|
110
110
|
ledgerRecordsByDates?: gm.Middleware[];
|
|
111
|
+
ledgerRecordsByFinancialEntity?: gm.Middleware[];
|
|
111
112
|
};
|
|
112
113
|
Mutation?: {
|
|
113
114
|
'*'?: gm.Middleware[];
|
|
@@ -165,6 +165,11 @@ export const ledgerResolvers: LedgerModule.Resolvers & Pick<Resolvers, 'Generate
|
|
|
165
165
|
throw new GraphQLError('Failed to fetch ledger records');
|
|
166
166
|
});
|
|
167
167
|
},
|
|
168
|
+
ledgerRecordsByFinancialEntity: async (_, { financialEntityId }, { injector }) => {
|
|
169
|
+
return await injector
|
|
170
|
+
.get(LedgerProvider)
|
|
171
|
+
.getLedgerRecordsByFinancialEntityIdLoader.load(financialEntityId);
|
|
172
|
+
},
|
|
168
173
|
},
|
|
169
174
|
Mutation: {
|
|
170
175
|
regenerateLedgerRecords: async (_, { chargeId }, context, info) => {
|
|
@@ -6,6 +6,8 @@ export default gql`
|
|
|
6
6
|
@auth(role: ACCOUNTANT)
|
|
7
7
|
ledgerRecordsByDates(fromDate: TimelessDate!, toDate: TimelessDate!): [LedgerRecord!]!
|
|
8
8
|
@auth(role: ACCOUNTANT)
|
|
9
|
+
ledgerRecordsByFinancialEntity(financialEntityId: UUID!): [LedgerRecord!]!
|
|
10
|
+
@auth(role: ACCOUNTANT)
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
extend type Mutation {
|
|
@@ -2,7 +2,7 @@ import * as Types from "../../../__generated__/types.js";
|
|
|
2
2
|
import * as gm from "graphql-modules";
|
|
3
3
|
export namespace TransactionsModule {
|
|
4
4
|
interface DefinedFields {
|
|
5
|
-
Query: 'similarTransactions' | 'transactionsByIDs';
|
|
5
|
+
Query: 'similarTransactions' | 'transactionsByIDs' | 'transactionsByFinancialEntity';
|
|
6
6
|
TransactionSuggestions: 'business';
|
|
7
7
|
Mutation: 'updateTransaction' | 'updateTransactions';
|
|
8
8
|
CommonTransaction: 'missingInfoSuggestions' | 'id' | 'referenceKey' | 'eventDate' | 'effectiveDate' | 'sourceEffectiveDate' | 'exactEffectiveDate' | 'direction' | 'amount' | 'sourceDescription' | 'balance' | 'createdAt' | 'updatedAt' | 'isFee' | 'chargeId';
|
|
@@ -119,6 +119,7 @@ export namespace TransactionsModule {
|
|
|
119
119
|
'*'?: gm.Middleware[];
|
|
120
120
|
similarTransactions?: gm.Middleware[];
|
|
121
121
|
transactionsByIDs?: gm.Middleware[];
|
|
122
|
+
transactionsByFinancialEntity?: gm.Middleware[];
|
|
122
123
|
};
|
|
123
124
|
CommonTransaction?: {
|
|
124
125
|
'*'?: gm.Middleware[];
|
|
@@ -43,6 +43,16 @@ export const transactionsResolvers: TransactionsModule.Resolvers &
|
|
|
43
43
|
});
|
|
44
44
|
return transactionIDs;
|
|
45
45
|
},
|
|
46
|
+
transactionsByFinancialEntity: async (_, { financialEntityID }, { injector, adminContext }) => {
|
|
47
|
+
const transactions = await injector
|
|
48
|
+
.get(TransactionsProvider)
|
|
49
|
+
.getTransactionsByFilters({
|
|
50
|
+
businessIDs: [financialEntityID],
|
|
51
|
+
ownerIDs: [adminContext.defaultAdminBusinessId],
|
|
52
|
+
})
|
|
53
|
+
.then(res => res.map(t => t.id));
|
|
54
|
+
return transactions;
|
|
55
|
+
},
|
|
46
56
|
},
|
|
47
57
|
Mutation: {
|
|
48
58
|
updateTransaction: async (_, { transactionId, fields }, { injector }) => {
|
|
@@ -3,6 +3,7 @@ import { gql } from 'graphql-modules';
|
|
|
3
3
|
export default gql`
|
|
4
4
|
extend type Query {
|
|
5
5
|
transactionsByIDs(transactionIDs: [UUID!]!): [Transaction!]! @auth(role: ACCOUNTANT)
|
|
6
|
+
transactionsByFinancialEntity(financialEntityID: UUID!): [Transaction!]! @auth(role: ACCOUNTANT)
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
extend type Mutation {
|