@accounter/server 0.0.8-alpha-20251029233438-f1242515c3b15dfb9387a5658e2417a7c063aa12 → 0.0.8-alpha-20251029233659-8fb74309c9f1de4f20423db029c5740e2df4bb5d
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 +4 -33
- package/dist/green-invoice-graphql/src/mesh-artifacts/index.d.ts +1 -1
- package/dist/server/src/__generated__/types.d.ts +18 -82
- package/dist/server/src/__generated__/types.js.map +1 -1
- package/dist/server/src/modules/financial-entities/__generated__/admin-businesses.types.d.ts +0 -57
- package/dist/server/src/modules/financial-entities/__generated__/admin-businesses.types.js +1 -0
- 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 +10 -33
- package/dist/server/src/modules/financial-entities/__generated__/types.js.map +1 -1
- package/dist/server/src/modules/financial-entities/providers/admin-businesses.provider.d.ts +1 -2
- package/dist/server/src/modules/financial-entities/providers/admin-businesses.provider.js +0 -37
- 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 +11 -45
- 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 +16 -49
- 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 +2 -3
- package/dist/server/src/modules/ledger/__generated__/types.js.map +1 -1
- package/dist/server/src/modules/ledger/resolvers/ledger.resolver.js +0 -5
- package/dist/server/src/modules/ledger/resolvers/ledger.resolver.js.map +1 -1
- package/dist/server/src/modules/ledger/typeDefs/ledger.graphql.js +0 -2
- package/dist/server/src/modules/ledger/typeDefs/ledger.graphql.js.map +1 -1
- package/dist/server/src/modules/transactions/__generated__/types.d.ts +1 -2
- package/dist/server/src/modules/transactions/__generated__/types.js.map +1 -1
- package/dist/server/src/modules/transactions/resolvers/transactions.resolver.js +0 -10
- package/dist/server/src/modules/transactions/resolvers/transactions.resolver.js.map +1 -1
- package/dist/server/src/modules/transactions/typeDefs/transactions.graphql.js +0 -1
- package/dist/server/src/modules/transactions/typeDefs/transactions.graphql.js.map +1 -1
- package/package.json +1 -1
- package/src/__generated__/types.ts +18 -92
- package/src/modules/financial-entities/__generated__/admin-businesses.types.ts +0 -60
- package/src/modules/financial-entities/__generated__/types.ts +10 -33
- package/src/modules/financial-entities/providers/admin-businesses.provider.ts +0 -44
- package/src/modules/financial-entities/resolvers/admin-businesses.resolver.ts +11 -52
- package/src/modules/financial-entities/typeDefs/admin-businesses.graphql.ts +16 -49
- package/src/modules/financial-entities/types.ts +1 -1
- package/src/modules/ledger/__generated__/types.ts +2 -3
- package/src/modules/ledger/resolvers/ledger.resolver.ts +0 -5
- package/src/modules/ledger/typeDefs/ledger.graphql.ts +0 -2
- package/src/modules/transactions/__generated__/types.ts +1 -2
- package/src/modules/transactions/resolvers/transactions.resolver.ts +0 -10
- package/src/modules/transactions/typeDefs/transactions.graphql.ts +0 -1
- package/dist/server/src/modules/financial-entities/helpers/admin-businesses.helper.d.ts +0 -31
- package/dist/server/src/modules/financial-entities/helpers/admin-businesses.helper.js +0 -27
- package/dist/server/src/modules/financial-entities/helpers/admin-businesses.helper.js.map +0 -1
- package/src/modules/financial-entities/helpers/admin-businesses.helper.ts +0 -33
|
@@ -19,67 +19,34 @@ export default gql`
|
|
|
19
19
|
id: UUID!
|
|
20
20
|
name: String!
|
|
21
21
|
governmentId: String!
|
|
22
|
-
registrationDate: TimelessDate!
|
|
23
22
|
business: LtdFinancialEntity!
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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!
|
|
23
|
+
withholdingTaxBookNumber: String
|
|
24
|
+
withholdingTaxFileNumber: String
|
|
25
|
+
socialSecurityEmployerId: String
|
|
26
|
+
taxAdvancesRate: Float
|
|
27
|
+
taxAdvancesId: String
|
|
28
|
+
registrationDate: TimelessDate!
|
|
45
29
|
}
|
|
46
30
|
|
|
47
31
|
" Input type for creating a new admin business. "
|
|
48
32
|
input CreateAdminBusinessInput {
|
|
49
33
|
businessId: UUID!
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
taxAdvancesAnnualId: String
|
|
53
|
-
taxAdvancesRate: Float
|
|
54
|
-
withholdingTaxAnnualId: String
|
|
34
|
+
withholdingTaxBookNumber: String
|
|
35
|
+
withholdingTaxFileNumber: String
|
|
55
36
|
socialSecurityEmployerId: String
|
|
37
|
+
taxAdvancesRate: Float
|
|
38
|
+
taxAdvancesId: String
|
|
39
|
+
registrationDate: TimelessDate!
|
|
56
40
|
}
|
|
57
41
|
|
|
58
42
|
" Input type for updating admin business details. "
|
|
59
43
|
input UpdateAdminBusinessInput {
|
|
60
|
-
|
|
61
|
-
|
|
44
|
+
withholdingTaxBookNumber: String
|
|
45
|
+
withholdingTaxFileNumber: String
|
|
46
|
+
socialSecurityEmployerId: String
|
|
47
|
+
taxAdvancesRate: Float
|
|
48
|
+
taxAdvancesId: String
|
|
62
49
|
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!
|
|
83
50
|
}
|
|
84
51
|
|
|
85
52
|
extend type LtdFinancialEntity {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './__generated__/types.js';
|
|
2
|
-
export type { Json, pcn874_record_type
|
|
2
|
+
export type { Json, pcn874_record_type } 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';
|
|
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;
|
|
34
33
|
export type Mutation = Pick<Types.Mutation, DefinedFields['Mutation']>;
|
|
35
34
|
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,7 +108,6 @@ export namespace LedgerModule {
|
|
|
108
108
|
'*'?: gm.Middleware[];
|
|
109
109
|
chargesWithLedgerChanges?: gm.Middleware[];
|
|
110
110
|
ledgerRecordsByDates?: gm.Middleware[];
|
|
111
|
-
ledgerRecordsByFinancialEntity?: gm.Middleware[];
|
|
112
111
|
};
|
|
113
112
|
Mutation?: {
|
|
114
113
|
'*'?: gm.Middleware[];
|
|
@@ -165,11 +165,6 @@ 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
|
-
},
|
|
173
168
|
},
|
|
174
169
|
Mutation: {
|
|
175
170
|
regenerateLedgerRecords: async (_, { chargeId }, context, info) => {
|
|
@@ -6,8 +6,6 @@ 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)
|
|
11
9
|
}
|
|
12
10
|
|
|
13
11
|
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';
|
|
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,7 +119,6 @@ export namespace TransactionsModule {
|
|
|
119
119
|
'*'?: gm.Middleware[];
|
|
120
120
|
similarTransactions?: gm.Middleware[];
|
|
121
121
|
transactionsByIDs?: gm.Middleware[];
|
|
122
|
-
transactionsByFinancialEntity?: gm.Middleware[];
|
|
123
122
|
};
|
|
124
123
|
CommonTransaction?: {
|
|
125
124
|
'*'?: gm.Middleware[];
|
|
@@ -43,16 +43,6 @@ 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
|
-
},
|
|
56
46
|
},
|
|
57
47
|
Mutation: {
|
|
58
48
|
updateTransaction: async (_, { transactionId, fields }, { injector }) => {
|
|
@@ -3,7 +3,6 @@ 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)
|
|
7
6
|
}
|
|
8
7
|
|
|
9
8
|
extend type Mutation {
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const adminBusinessUpdateSchema: z.ZodObject<{
|
|
3
|
-
id: z.ZodUUID;
|
|
4
|
-
businessRegistrationStartDate: z.ZodOptional<z.ZodISODate>;
|
|
5
|
-
companyTaxId: z.ZodOptional<z.ZodString>;
|
|
6
|
-
advanceTaxRates: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
7
|
-
date: z.ZodISODate;
|
|
8
|
-
rate: z.ZodNumber;
|
|
9
|
-
}, z.core.$strict>>>;
|
|
10
|
-
taxAdvancesIds: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
11
|
-
year: z.ZodNumber;
|
|
12
|
-
id: z.ZodString;
|
|
13
|
-
}, z.core.$strict>>>;
|
|
14
|
-
socialSecurityEmployerIds: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
15
|
-
year: z.ZodNumber;
|
|
16
|
-
id: z.ZodString;
|
|
17
|
-
}, z.core.$strict>>>;
|
|
18
|
-
withholdingTaxAnnualIds: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
19
|
-
year: z.ZodNumber;
|
|
20
|
-
id: z.ZodString;
|
|
21
|
-
}, z.core.$strict>>>;
|
|
22
|
-
}, z.core.$strict>;
|
|
23
|
-
export type AdminBusinessUpdateSchema = z.infer<typeof adminBusinessUpdateSchema>;
|
|
24
|
-
export declare const yearlyIdsSchema: z.ZodArray<z.ZodObject<{
|
|
25
|
-
year: z.ZodNumber;
|
|
26
|
-
id: z.ZodString;
|
|
27
|
-
}, z.core.$strict>>;
|
|
28
|
-
export declare const taxAdvancesRatesSchema: z.ZodArray<z.ZodObject<{
|
|
29
|
-
date: z.ZodISODate;
|
|
30
|
-
rate: z.ZodNumber;
|
|
31
|
-
}, z.core.$strict>>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
const yearlyIdSchema = z
|
|
3
|
-
.object({
|
|
4
|
-
year: z.number().min(2000).max(2100),
|
|
5
|
-
id: z.string().min(1, { message: 'ID is required' }),
|
|
6
|
-
})
|
|
7
|
-
.strict();
|
|
8
|
-
const taxAdvanceRateSchema = z
|
|
9
|
-
.object({
|
|
10
|
-
date: z.iso.date(),
|
|
11
|
-
rate: z.number().min(0).max(1),
|
|
12
|
-
})
|
|
13
|
-
.strict();
|
|
14
|
-
export const adminBusinessUpdateSchema = z
|
|
15
|
-
.object({
|
|
16
|
-
id: z.uuid(),
|
|
17
|
-
businessRegistrationStartDate: z.iso.date().optional(),
|
|
18
|
-
companyTaxId: z.string().optional(),
|
|
19
|
-
advanceTaxRates: z.array(taxAdvanceRateSchema).optional(),
|
|
20
|
-
taxAdvancesIds: z.array(yearlyIdSchema).optional(),
|
|
21
|
-
socialSecurityEmployerIds: z.array(yearlyIdSchema).optional(),
|
|
22
|
-
withholdingTaxAnnualIds: z.array(yearlyIdSchema).optional(),
|
|
23
|
-
})
|
|
24
|
-
.strict();
|
|
25
|
-
export const yearlyIdsSchema = z.array(yearlyIdSchema);
|
|
26
|
-
export const taxAdvancesRatesSchema = z.array(taxAdvanceRateSchema);
|
|
27
|
-
//# sourceMappingURL=admin-businesses.helper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"admin-businesses.helper.js","sourceRoot":"","sources":["../../../../../../src/modules/financial-entities/helpers/admin-businesses.helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,cAAc,GAAG,CAAC;KACrB,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC;IACpC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;CACrD,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,oBAAoB,GAAG,CAAC;KAC3B,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE;IAClB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;CAC/B,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC;KACvC,MAAM,CAAC;IACN,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE;IACZ,6BAA6B,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IACtD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,QAAQ,EAAE;IACzD,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE;IAClD,yBAAyB,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE;IAC7D,uBAAuB,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE;CAC5D,CAAC;KACD,MAAM,EAAE,CAAC;AAIZ,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;AAEvD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
const yearlyIdSchema = z
|
|
4
|
-
.object({
|
|
5
|
-
year: z.number().min(2000).max(2100),
|
|
6
|
-
id: z.string().min(1, { message: 'ID is required' }),
|
|
7
|
-
})
|
|
8
|
-
.strict();
|
|
9
|
-
|
|
10
|
-
const taxAdvanceRateSchema = z
|
|
11
|
-
.object({
|
|
12
|
-
date: z.iso.date(),
|
|
13
|
-
rate: z.number().min(0).max(1),
|
|
14
|
-
})
|
|
15
|
-
.strict();
|
|
16
|
-
|
|
17
|
-
export const adminBusinessUpdateSchema = z
|
|
18
|
-
.object({
|
|
19
|
-
id: z.uuid(),
|
|
20
|
-
businessRegistrationStartDate: z.iso.date().optional(),
|
|
21
|
-
companyTaxId: z.string().optional(),
|
|
22
|
-
advanceTaxRates: z.array(taxAdvanceRateSchema).optional(),
|
|
23
|
-
taxAdvancesIds: z.array(yearlyIdSchema).optional(),
|
|
24
|
-
socialSecurityEmployerIds: z.array(yearlyIdSchema).optional(),
|
|
25
|
-
withholdingTaxAnnualIds: z.array(yearlyIdSchema).optional(),
|
|
26
|
-
})
|
|
27
|
-
.strict();
|
|
28
|
-
|
|
29
|
-
export type AdminBusinessUpdateSchema = z.infer<typeof adminBusinessUpdateSchema>;
|
|
30
|
-
|
|
31
|
-
export const yearlyIdsSchema = z.array(yearlyIdSchema);
|
|
32
|
-
|
|
33
|
-
export const taxAdvancesRatesSchema = z.array(taxAdvanceRateSchema);
|