@accounter/server 0.0.8-alpha-20251029234818-bb69914cb7aaa4859296baa4a256c251158fd15b → 0.0.8-alpha-20251029235231-f14290dbb5dedec255de3cef292d3b4c5c71298e
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 +26 -20
- package/dist/green-invoice-graphql/src/mesh-artifacts/index.d.ts +1 -1
- package/dist/server/src/__generated__/types.d.ts +18 -70
- package/dist/server/src/__generated__/types.js.map +1 -1
- package/dist/server/src/modules/contracts/__generated__/contracts.types.d.ts +0 -5
- 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 -46
- 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/package.json +6 -6
- package/src/__generated__/types.ts +18 -76
- package/src/modules/contracts/__generated__/contracts.types.ts +0 -5
- 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 -53
- package/src/modules/financial-entities/typeDefs/admin-businesses.graphql.ts +16 -49
- package/src/modules/financial-entities/types.ts +1 -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
|
@@ -4,9 +4,7 @@ export namespace FinancialEntitiesModule {
|
|
|
4
4
|
interface DefinedFields {
|
|
5
5
|
Query: 'adminBusiness' | 'allAdminBusinesses' | 'businessTransactionsSumFromLedgerRecords' | 'businessTransactionsFromLedgerRecords' | 'business' | 'businesses' | 'allBusinesses' | 'client' | 'allClients' | 'financialEntity' | 'allFinancialEntities' | 'taxCategories' | 'taxCategory' | 'taxCategoryByBusinessId';
|
|
6
6
|
Mutation: 'createAdminBusiness' | 'updateAdminBusiness' | 'deleteAdminBusiness' | 'updateBusiness' | 'insertNewBusiness' | 'mergeBusinesses' | 'batchGenerateBusinessesOutOfTransactions' | 'updateClient' | 'insertClient' | 'updateTaxCategory' | 'insertTaxCategory';
|
|
7
|
-
AdminBusiness: 'id' | 'name' | 'governmentId' | '
|
|
8
|
-
AnnualId: 'year' | 'id';
|
|
9
|
-
TaxAdvancesRate: 'date' | 'rate';
|
|
7
|
+
AdminBusiness: 'id' | 'name' | 'governmentId' | 'business' | 'withholdingTaxBookNumber' | 'withholdingTaxFileNumber' | 'socialSecurityEmployerId' | 'taxAdvancesRate' | 'taxAdvancesId' | 'registrationDate';
|
|
10
8
|
BusinessTransactionsSumFromLedgerRecordsSuccessfulResult: 'businessTransactionsSum';
|
|
11
9
|
BusinessTransactionSum: 'business' | 'credit' | 'debit' | 'total' | 'foreignCurrenciesSum';
|
|
12
10
|
ForeignCurrencySum: 'credit' | 'debit' | 'total' | 'currency';
|
|
@@ -52,10 +50,8 @@ export namespace FinancialEntitiesModule {
|
|
|
52
50
|
};
|
|
53
51
|
|
|
54
52
|
interface DefinedInputFields {
|
|
55
|
-
CreateAdminBusinessInput: 'businessId' | '
|
|
56
|
-
UpdateAdminBusinessInput: '
|
|
57
|
-
AnnualIdInput: 'year' | 'id';
|
|
58
|
-
TaxAdvancesRateInput: 'date' | 'rate';
|
|
53
|
+
CreateAdminBusinessInput: 'businessId' | 'withholdingTaxBookNumber' | 'withholdingTaxFileNumber' | 'socialSecurityEmployerId' | 'taxAdvancesRate' | 'taxAdvancesId' | 'registrationDate';
|
|
54
|
+
UpdateAdminBusinessInput: 'withholdingTaxBookNumber' | 'withholdingTaxFileNumber' | 'socialSecurityEmployerId' | 'taxAdvancesRate' | 'taxAdvancesId' | 'registrationDate';
|
|
59
55
|
BusinessTransactionsFilter: 'businessIDs' | 'ownerIds' | 'type' | 'fromDate' | 'toDate' | 'includeRevaluation';
|
|
60
56
|
UpdateBusinessInput: 'name' | 'sortCode' | 'country' | 'hebrewName' | 'address' | 'email' | 'website' | 'phoneNumber' | 'governmentId' | 'taxCategory' | 'exemptDealer' | 'suggestions' | 'optionalVAT' | 'isReceiptEnough' | 'isDocumentsOptional' | 'pcn874RecordType' | 'irsCode' | 'isActive';
|
|
61
57
|
InsertNewBusinessInput: 'name' | 'sortCode' | 'country' | 'hebrewName' | 'address' | 'email' | 'website' | 'phoneNumber' | 'governmentId' | 'taxCategory' | 'exemptDealer' | 'suggestions' | 'optionalVAT' | 'isReceiptEnough' | 'isDocumentsOptional' | 'pcn874RecordType' | 'irsCode' | 'isActive';
|
|
@@ -74,12 +70,8 @@ export namespace FinancialEntitiesModule {
|
|
|
74
70
|
export type Mutation = Pick<Types.Mutation, DefinedFields['Mutation']>;
|
|
75
71
|
export type CreateAdminBusinessInput = Pick<Types.CreateAdminBusinessInput, DefinedInputFields['CreateAdminBusinessInput']>;
|
|
76
72
|
export type UpdateAdminBusinessInput = Pick<Types.UpdateAdminBusinessInput, DefinedInputFields['UpdateAdminBusinessInput']>;
|
|
77
|
-
export type TimelessDate = Types.TimelessDate;
|
|
78
73
|
export type LtdFinancialEntity = Pick<Types.LtdFinancialEntity, DefinedFields['LtdFinancialEntity']>;
|
|
79
|
-
export type
|
|
80
|
-
export type TaxAdvancesRate = Pick<Types.TaxAdvancesRate, DefinedFields['TaxAdvancesRate']>;
|
|
81
|
-
export type AnnualIdInput = Pick<Types.AnnualIdInput, DefinedInputFields['AnnualIdInput']>;
|
|
82
|
-
export type TaxAdvancesRateInput = Pick<Types.TaxAdvancesRateInput, DefinedInputFields['TaxAdvancesRateInput']>;
|
|
74
|
+
export type TimelessDate = Types.TimelessDate;
|
|
83
75
|
export type BusinessTransactionsSumFromLedgerRecordsResult = Types.BusinessTransactionsSumFromLedgerRecordsResult;
|
|
84
76
|
export type BusinessTransactionsFilter = Pick<Types.BusinessTransactionsFilter, DefinedInputFields['BusinessTransactionsFilter']>;
|
|
85
77
|
export type BusinessTransactionsFromLedgerRecordsResult = Types.BusinessTransactionsFromLedgerRecordsResult;
|
|
@@ -147,8 +139,6 @@ export namespace FinancialEntitiesModule {
|
|
|
147
139
|
export type QueryResolvers = Pick<Types.QueryResolvers, DefinedFields['Query']>;
|
|
148
140
|
export type MutationResolvers = Pick<Types.MutationResolvers, DefinedFields['Mutation']>;
|
|
149
141
|
export type AdminBusinessResolvers = Pick<Types.AdminBusinessResolvers, DefinedFields['AdminBusiness']>;
|
|
150
|
-
export type AnnualIdResolvers = Pick<Types.AnnualIdResolvers, DefinedFields['AnnualId']>;
|
|
151
|
-
export type TaxAdvancesRateResolvers = Pick<Types.TaxAdvancesRateResolvers, DefinedFields['TaxAdvancesRate']>;
|
|
152
142
|
export type BusinessTransactionsSumFromLedgerRecordsSuccessfulResultResolvers = Pick<Types.BusinessTransactionsSumFromLedgerRecordsSuccessfulResultResolvers, DefinedFields['BusinessTransactionsSumFromLedgerRecordsSuccessfulResult'] | '__isTypeOf'>;
|
|
153
143
|
export type BusinessTransactionSumResolvers = Pick<Types.BusinessTransactionSumResolvers, DefinedFields['BusinessTransactionSum']>;
|
|
154
144
|
export type ForeignCurrencySumResolvers = Pick<Types.ForeignCurrencySumResolvers, DefinedFields['ForeignCurrencySum']>;
|
|
@@ -191,8 +181,6 @@ export namespace FinancialEntitiesModule {
|
|
|
191
181
|
Query?: QueryResolvers;
|
|
192
182
|
Mutation?: MutationResolvers;
|
|
193
183
|
AdminBusiness?: AdminBusinessResolvers;
|
|
194
|
-
AnnualId?: AnnualIdResolvers;
|
|
195
|
-
TaxAdvancesRate?: TaxAdvancesRateResolvers;
|
|
196
184
|
BusinessTransactionsSumFromLedgerRecordsSuccessfulResult?: BusinessTransactionsSumFromLedgerRecordsSuccessfulResultResolvers;
|
|
197
185
|
BusinessTransactionSum?: BusinessTransactionSumResolvers;
|
|
198
186
|
ForeignCurrencySum?: ForeignCurrencySumResolvers;
|
|
@@ -267,24 +255,13 @@ export namespace FinancialEntitiesModule {
|
|
|
267
255
|
id?: gm.Middleware[];
|
|
268
256
|
name?: gm.Middleware[];
|
|
269
257
|
governmentId?: gm.Middleware[];
|
|
270
|
-
registrationDate?: gm.Middleware[];
|
|
271
258
|
business?: gm.Middleware[];
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
};
|
|
279
|
-
AnnualId?: {
|
|
280
|
-
'*'?: gm.Middleware[];
|
|
281
|
-
year?: gm.Middleware[];
|
|
282
|
-
id?: gm.Middleware[];
|
|
283
|
-
};
|
|
284
|
-
TaxAdvancesRate?: {
|
|
285
|
-
'*'?: gm.Middleware[];
|
|
286
|
-
date?: gm.Middleware[];
|
|
287
|
-
rate?: gm.Middleware[];
|
|
259
|
+
withholdingTaxBookNumber?: gm.Middleware[];
|
|
260
|
+
withholdingTaxFileNumber?: gm.Middleware[];
|
|
261
|
+
socialSecurityEmployerId?: gm.Middleware[];
|
|
262
|
+
taxAdvancesRate?: gm.Middleware[];
|
|
263
|
+
taxAdvancesId?: gm.Middleware[];
|
|
264
|
+
registrationDate?: gm.Middleware[];
|
|
288
265
|
};
|
|
289
266
|
LtdFinancialEntity?: {
|
|
290
267
|
'*'?: gm.Middleware[];
|
|
@@ -3,14 +3,10 @@ import { Injectable, Scope } from 'graphql-modules';
|
|
|
3
3
|
import { DBProvider } from '@modules/app-providers/db.provider.js';
|
|
4
4
|
import { sql } from '@pgtyped/runtime';
|
|
5
5
|
import { getCacheInstance } from '@shared/helpers';
|
|
6
|
-
import { adminBusinessUpdateSchema } from '../helpers/admin-businesses.helper.js';
|
|
7
6
|
import type {
|
|
8
7
|
IGetAdminBusinessesByIdsQuery,
|
|
9
8
|
IGetAllAdminBusinessesQuery,
|
|
10
9
|
IGetAllAdminBusinessesResult,
|
|
11
|
-
IUpdateAdminBusinessesParams,
|
|
12
|
-
IUpdateAdminBusinessesQuery,
|
|
13
|
-
IUpdateAdminBusinessesResult,
|
|
14
10
|
} from '../types.js';
|
|
15
11
|
|
|
16
12
|
const getAdminBusinessesByIds = sql<IGetAdminBusinessesByIdsQuery>`
|
|
@@ -32,37 +28,6 @@ const getAllAdminBusinesses = sql<IGetAllAdminBusinessesQuery>`
|
|
|
32
28
|
INNER JOIN accounter_schema.financial_entities fe
|
|
33
29
|
USING (id);`;
|
|
34
30
|
|
|
35
|
-
const updateAdminBusinesses = sql<IUpdateAdminBusinessesQuery>`
|
|
36
|
-
UPDATE accounter_schema.businesses_admin
|
|
37
|
-
SET
|
|
38
|
-
business_registration_start_date = COALESCE(
|
|
39
|
-
$businessRegistrationStartDate,
|
|
40
|
-
business_registration_start_date
|
|
41
|
-
),
|
|
42
|
-
company_tax_id = COALESCE(
|
|
43
|
-
$companyTaxId,
|
|
44
|
-
company_tax_id
|
|
45
|
-
),
|
|
46
|
-
advance_tax_rates = COALESCE(
|
|
47
|
-
$advanceTaxRates,
|
|
48
|
-
advance_tax_rates
|
|
49
|
-
),
|
|
50
|
-
tax_advances_ids = COALESCE(
|
|
51
|
-
$taxAdvancesIds,
|
|
52
|
-
tax_advances_ids
|
|
53
|
-
),
|
|
54
|
-
social_security_employer_ids = COALESCE(
|
|
55
|
-
$socialSecurityEmployerIds,
|
|
56
|
-
social_security_employer_ids
|
|
57
|
-
),
|
|
58
|
-
withholding_tax_annual_ids = COALESCE(
|
|
59
|
-
$withholdingTaxAnnualIds,
|
|
60
|
-
withholding_tax_annual_ids
|
|
61
|
-
)
|
|
62
|
-
WHERE
|
|
63
|
-
id = $id
|
|
64
|
-
RETURNING *;`;
|
|
65
|
-
|
|
66
31
|
@Injectable({
|
|
67
32
|
scope: Scope.Operation,
|
|
68
33
|
global: true,
|
|
@@ -104,15 +69,6 @@ export class AdminBusinessesProvider {
|
|
|
104
69
|
});
|
|
105
70
|
}
|
|
106
71
|
|
|
107
|
-
public async updateAdminBusiness(
|
|
108
|
-
params: IUpdateAdminBusinessesParams,
|
|
109
|
-
): Promise<IUpdateAdminBusinessesResult> {
|
|
110
|
-
const inputParams = adminBusinessUpdateSchema.parse(params);
|
|
111
|
-
const [result] = await updateAdminBusinesses.run(inputParams, this.dbProvider);
|
|
112
|
-
this.clearCache();
|
|
113
|
-
return result;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
72
|
public clearCache() {
|
|
117
73
|
this.cache.clear();
|
|
118
74
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { GraphQLError } from 'graphql';
|
|
2
2
|
import { dateToTimelessDateString } from '@shared/helpers';
|
|
3
|
-
import { TimelessDateString } from '@shared/types';
|
|
4
|
-
import { taxAdvancesRatesSchema, yearlyIdsSchema } from '../helpers/admin-businesses.helper.js';
|
|
5
3
|
import { AdminBusinessesProvider } from '../providers/admin-businesses.provider.js';
|
|
6
4
|
import { BusinessesProvider } from '../providers/businesses.provider.js';
|
|
7
5
|
import type { FinancialEntitiesModule } from '../types.js';
|
|
@@ -24,41 +22,6 @@ export const adminBusinessesResolvers: FinancialEntitiesModule.Resolvers = {
|
|
|
24
22
|
return adminBusinesses;
|
|
25
23
|
},
|
|
26
24
|
},
|
|
27
|
-
Mutation: {
|
|
28
|
-
updateAdminBusiness: async (_, { businessId, fields }, { injector }) => {
|
|
29
|
-
try {
|
|
30
|
-
await injector.get(AdminBusinessesProvider).updateAdminBusiness({
|
|
31
|
-
id: businessId,
|
|
32
|
-
businessRegistrationStartDate: fields.registrationDate,
|
|
33
|
-
companyTaxId: fields.withholdingTaxCompanyId,
|
|
34
|
-
taxAdvancesIds: fields.taxAdvancesAnnualIds
|
|
35
|
-
? [...fields.taxAdvancesAnnualIds]
|
|
36
|
-
: undefined,
|
|
37
|
-
advanceTaxRates: fields.taxAdvancesRates ? [...fields.taxAdvancesRates] : undefined,
|
|
38
|
-
withholdingTaxAnnualIds: fields.withholdingTaxAnnualIds
|
|
39
|
-
? [...fields.withholdingTaxAnnualIds]
|
|
40
|
-
: undefined,
|
|
41
|
-
socialSecurityEmployerIds: fields.socialSecurityEmployerIds
|
|
42
|
-
? [...fields.socialSecurityEmployerIds]
|
|
43
|
-
: undefined,
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
const updatedAdminBusiness = await injector
|
|
47
|
-
.get(AdminBusinessesProvider)
|
|
48
|
-
.getAdminBusinessByIdLoader.load(businessId);
|
|
49
|
-
|
|
50
|
-
if (!updatedAdminBusiness) {
|
|
51
|
-
throw new GraphQLError(`Error updating Admin business ID="${businessId}"`);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return updatedAdminBusiness;
|
|
55
|
-
} catch (error) {
|
|
56
|
-
const message = `Error updating Admin business ID="${businessId}"`;
|
|
57
|
-
console.error(message, error);
|
|
58
|
-
throw new GraphQLError(message);
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
25
|
AdminBusiness: {
|
|
63
26
|
id: admin => admin.id,
|
|
64
27
|
name: admin => admin.name,
|
|
@@ -68,12 +31,6 @@ export const adminBusinessesResolvers: FinancialEntitiesModule.Resolvers = {
|
|
|
68
31
|
}
|
|
69
32
|
return admin.vat_number;
|
|
70
33
|
},
|
|
71
|
-
registrationDate: admin => {
|
|
72
|
-
if (!admin.registration_date) {
|
|
73
|
-
throw new GraphQLError(`Admin business ID="${admin.id}" has no registration date`);
|
|
74
|
-
}
|
|
75
|
-
return dateToTimelessDateString(admin.registration_date);
|
|
76
|
-
},
|
|
77
34
|
business: async (admin, _, { injector }) => {
|
|
78
35
|
const business = await injector.get(BusinessesProvider).getBusinessByIdLoader.load(admin.id);
|
|
79
36
|
if (!business) {
|
|
@@ -81,16 +38,17 @@ export const adminBusinessesResolvers: FinancialEntitiesModule.Resolvers = {
|
|
|
81
38
|
}
|
|
82
39
|
return business;
|
|
83
40
|
},
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
41
|
+
withholdingTaxBookNumber: admin => admin.tax_nikuim_pinkas_number,
|
|
42
|
+
withholdingTaxFileNumber: admin => admin.nikuim,
|
|
43
|
+
socialSecurityEmployerId: admin => admin.pinkas_social_security_2022,
|
|
44
|
+
taxAdvancesRate: admin => admin.advance_tax_rate,
|
|
45
|
+
taxAdvancesId: admin => admin.tax_siduri_number_2022,
|
|
46
|
+
registrationDate: admin => {
|
|
47
|
+
if (!admin.registration_date) {
|
|
48
|
+
throw new GraphQLError(`Admin business ID="${admin.id}" has no registration date`);
|
|
49
|
+
}
|
|
50
|
+
return dateToTimelessDateString(admin.registration_date);
|
|
51
|
+
},
|
|
94
52
|
},
|
|
95
53
|
LtdFinancialEntity: {
|
|
96
54
|
adminInfo: async (parentBusiness, _, { injector }) => {
|
|
@@ -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';
|
|
@@ -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);
|