@silexpert/core 1.3.94-8 → 1.3.94-9
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/dist/cjs/api/resources/BankDedup.d.ts +2 -2
- package/dist/cjs/api/resources/BankDedup.d.ts.map +1 -1
- package/dist/cjs/api/resources/BankDedup.js.map +1 -1
- package/dist/cjs/types/Interface/{models/IBankDedup.d.ts → api/bankDedup/BankDedup.d.ts} +28 -37
- package/dist/cjs/types/Interface/api/bankDedup/BankDedup.d.ts.map +1 -0
- package/dist/cjs/types/Interface/api/bankDedup/BankDedup.js +301 -0
- package/dist/cjs/types/Interface/api/bankDedup/BankDedup.js.map +1 -0
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/cjs/types/index.js +1 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/mjs/api/resources/BankDedup.d.ts +2 -2
- package/dist/mjs/api/resources/BankDedup.d.ts.map +1 -1
- package/dist/mjs/api/resources/BankDedup.js.map +1 -1
- package/dist/mjs/types/Interface/{models/IBankDedup.d.ts → api/bankDedup/BankDedup.d.ts} +28 -37
- package/dist/mjs/types/Interface/api/bankDedup/BankDedup.d.ts.map +1 -0
- package/dist/mjs/types/Interface/api/bankDedup/BankDedup.js +340 -0
- package/dist/mjs/types/Interface/api/bankDedup/BankDedup.js.map +1 -0
- package/dist/mjs/types/index.d.ts +1 -0
- package/dist/mjs/types/index.d.ts.map +1 -1
- package/dist/mjs/types/index.js +1 -0
- package/dist/mjs/types/index.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/BankDedup.ts +2 -2
- package/ts/types/Interface/api/bankDedup/BankDedup.ts +264 -0
- package/ts/types/index.ts +1 -0
- package/dist/cjs/types/Interface/models/IBankDedup.d.ts.map +0 -1
- package/dist/cjs/types/Interface/models/IBankDedup.js +0 -3
- package/dist/cjs/types/Interface/models/IBankDedup.js.map +0 -1
- package/dist/mjs/types/Interface/models/IBankDedup.d.ts.map +0 -1
- package/dist/mjs/types/Interface/models/IBankDedup.js +0 -2
- package/dist/mjs/types/Interface/models/IBankDedup.js.map +0 -1
- package/ts/types/Interface/models/IBankDedup.ts +0 -97
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
import {
|
|
3
|
+
IsString,
|
|
4
|
+
IsNumber,
|
|
5
|
+
IsArray,
|
|
6
|
+
ValidateNested,
|
|
7
|
+
IsBoolean,
|
|
8
|
+
IsIn,
|
|
9
|
+
IsOptional,
|
|
10
|
+
Min,
|
|
11
|
+
Max,
|
|
12
|
+
IsInstance,
|
|
13
|
+
} from 'class-validator';
|
|
14
|
+
import { Transform, Type } from 'class-transformer';
|
|
15
|
+
|
|
16
|
+
export class BankDedupRequest {
|
|
17
|
+
@ApiProperty()
|
|
18
|
+
@IsString()
|
|
19
|
+
csv: string; // CSV en string (avec header: label,dateValue,credit,debit)
|
|
20
|
+
|
|
21
|
+
@ApiProperty()
|
|
22
|
+
@IsNumber()
|
|
23
|
+
initial: number; // solde initial
|
|
24
|
+
|
|
25
|
+
@ApiProperty()
|
|
26
|
+
@IsNumber()
|
|
27
|
+
target: number; // solde cible
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export class BankDedupFileUploadBody {
|
|
31
|
+
@ApiProperty()
|
|
32
|
+
@IsNumber()
|
|
33
|
+
initial: number; // solde initial
|
|
34
|
+
|
|
35
|
+
@ApiProperty()
|
|
36
|
+
@IsNumber()
|
|
37
|
+
target: number; // solde cible
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export class BankTx {
|
|
41
|
+
@ApiProperty()
|
|
42
|
+
@IsString()
|
|
43
|
+
id: string; // id interne généré
|
|
44
|
+
|
|
45
|
+
@ApiProperty()
|
|
46
|
+
@IsString()
|
|
47
|
+
label: string;
|
|
48
|
+
|
|
49
|
+
@ApiProperty()
|
|
50
|
+
@IsString()
|
|
51
|
+
dateValue: string; // YYYY-MM-DD
|
|
52
|
+
|
|
53
|
+
@ApiProperty()
|
|
54
|
+
@IsNumber()
|
|
55
|
+
credit: number;
|
|
56
|
+
|
|
57
|
+
@ApiProperty()
|
|
58
|
+
@IsNumber()
|
|
59
|
+
debit: number;
|
|
60
|
+
|
|
61
|
+
@ApiProperty()
|
|
62
|
+
@IsIn([1, -1])
|
|
63
|
+
sign: 1 | -1; // 1 = crédit net, -1 = débit net
|
|
64
|
+
|
|
65
|
+
@ApiProperty()
|
|
66
|
+
@IsNumber()
|
|
67
|
+
@Min(0)
|
|
68
|
+
amount: number; // valeur absolue du mouvement (en positif)
|
|
69
|
+
|
|
70
|
+
@ApiProperty()
|
|
71
|
+
@IsNumber()
|
|
72
|
+
cents: number; // montant en centimes pour calculs exacts
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export class DuplicateGroup {
|
|
76
|
+
@ApiProperty()
|
|
77
|
+
@IsString()
|
|
78
|
+
id: string;
|
|
79
|
+
|
|
80
|
+
@ApiProperty({ type: [BankTx] })
|
|
81
|
+
@IsArray()
|
|
82
|
+
@ValidateNested({ each: true })
|
|
83
|
+
@Type(() => BankTx)
|
|
84
|
+
transactions: BankTx[];
|
|
85
|
+
|
|
86
|
+
@ApiProperty()
|
|
87
|
+
@IsNumber()
|
|
88
|
+
amount: number; // montant commun
|
|
89
|
+
|
|
90
|
+
@ApiProperty()
|
|
91
|
+
@IsNumber()
|
|
92
|
+
cents: number; // montant en centimes
|
|
93
|
+
|
|
94
|
+
@ApiProperty()
|
|
95
|
+
@IsIn([1, -1])
|
|
96
|
+
sign: 1 | -1; // signe commun
|
|
97
|
+
|
|
98
|
+
@ApiProperty()
|
|
99
|
+
@IsNumber()
|
|
100
|
+
@Min(0)
|
|
101
|
+
@Max(1)
|
|
102
|
+
confidence: number; // score de confiance [0 - 1]
|
|
103
|
+
|
|
104
|
+
@ApiProperty()
|
|
105
|
+
@IsIn(['exact', 'fuzzy_high', 'fuzzy_medium', 'fuzzy_low'])
|
|
106
|
+
method: 'exact' | 'fuzzy_high' | 'fuzzy_medium' | 'fuzzy_low'; // méthode de détection
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export class BankDedupResult {
|
|
110
|
+
@ApiProperty()
|
|
111
|
+
@IsBoolean()
|
|
112
|
+
success: true;
|
|
113
|
+
|
|
114
|
+
@ApiProperty()
|
|
115
|
+
@IsNumber()
|
|
116
|
+
initial: number;
|
|
117
|
+
|
|
118
|
+
@ApiProperty()
|
|
119
|
+
@IsNumber()
|
|
120
|
+
target: number;
|
|
121
|
+
|
|
122
|
+
@ApiProperty()
|
|
123
|
+
@IsNumber()
|
|
124
|
+
finalRaw: number;
|
|
125
|
+
|
|
126
|
+
@ApiProperty()
|
|
127
|
+
@IsNumber()
|
|
128
|
+
finalAfterDedup: number;
|
|
129
|
+
|
|
130
|
+
@ApiProperty()
|
|
131
|
+
@IsNumber()
|
|
132
|
+
diffBefore: number; // target - finalRaw
|
|
133
|
+
|
|
134
|
+
@ApiProperty()
|
|
135
|
+
@IsNumber()
|
|
136
|
+
diffAfter: number; // target - finalAfterDedup (DOIT être exactement 0, aucune tolérance)
|
|
137
|
+
|
|
138
|
+
@ApiProperty()
|
|
139
|
+
@IsArray()
|
|
140
|
+
@ValidateNested({ each: true })
|
|
141
|
+
@Type(() => BankDedupGroup)
|
|
142
|
+
removedGroups: BankDedupGroup[];
|
|
143
|
+
|
|
144
|
+
@ApiProperty()
|
|
145
|
+
@IsNumber()
|
|
146
|
+
removedCount: number;
|
|
147
|
+
|
|
148
|
+
@ApiProperty()
|
|
149
|
+
@IsNumber()
|
|
150
|
+
keptCount: number;
|
|
151
|
+
|
|
152
|
+
@ApiProperty()
|
|
153
|
+
@IsString()
|
|
154
|
+
csvDeduped: string;
|
|
155
|
+
|
|
156
|
+
@ApiProperty()
|
|
157
|
+
@IsArray()
|
|
158
|
+
@ValidateNested({ each: true })
|
|
159
|
+
@Type(() => BankDedupGroup)
|
|
160
|
+
allGroups: BankDedupGroup[];
|
|
161
|
+
|
|
162
|
+
@ApiProperty()
|
|
163
|
+
debug: {
|
|
164
|
+
totalGroups: number;
|
|
165
|
+
selectedGroups: number;
|
|
166
|
+
iterations: number;
|
|
167
|
+
strategiesUsed: string[];
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export class BankDedupGroup {
|
|
172
|
+
@ApiProperty()
|
|
173
|
+
@IsString()
|
|
174
|
+
id: string;
|
|
175
|
+
|
|
176
|
+
@ApiProperty()
|
|
177
|
+
@IsBoolean()
|
|
178
|
+
isSelected: boolean;
|
|
179
|
+
|
|
180
|
+
@ApiProperty()
|
|
181
|
+
@IsOptional()
|
|
182
|
+
@IsNumber()
|
|
183
|
+
@Min(0)
|
|
184
|
+
@Max(1)
|
|
185
|
+
confidence?: number;
|
|
186
|
+
|
|
187
|
+
@ApiProperty()
|
|
188
|
+
@IsOptional()
|
|
189
|
+
@IsString()
|
|
190
|
+
method?: string;
|
|
191
|
+
|
|
192
|
+
@ApiProperty()
|
|
193
|
+
@IsOptional()
|
|
194
|
+
@IsNumber()
|
|
195
|
+
amount?: number;
|
|
196
|
+
|
|
197
|
+
@ApiProperty()
|
|
198
|
+
@IsOptional()
|
|
199
|
+
@IsNumber()
|
|
200
|
+
transactionCount?: number;
|
|
201
|
+
|
|
202
|
+
@ApiProperty()
|
|
203
|
+
@IsOptional()
|
|
204
|
+
@IsArray()
|
|
205
|
+
transactions?: {
|
|
206
|
+
id: string;
|
|
207
|
+
label: string;
|
|
208
|
+
dateValue: string;
|
|
209
|
+
isKept: boolean;
|
|
210
|
+
isCredit: boolean;
|
|
211
|
+
}[];
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export class BankDedupImpossible {
|
|
215
|
+
@ApiProperty()
|
|
216
|
+
@IsBoolean()
|
|
217
|
+
success: false;
|
|
218
|
+
|
|
219
|
+
@ApiProperty()
|
|
220
|
+
@IsIn(['NO_EXACT_COMBINATION', 'CSV_PARSE_ERROR', 'INVALID_INPUT', 'INSUFFICIENT_DUPLICATES'])
|
|
221
|
+
reason: 'NO_EXACT_COMBINATION' | 'CSV_PARSE_ERROR' | 'INVALID_INPUT' | 'INSUFFICIENT_DUPLICATES';
|
|
222
|
+
|
|
223
|
+
@ApiProperty()
|
|
224
|
+
@IsString()
|
|
225
|
+
message: string;
|
|
226
|
+
|
|
227
|
+
@ApiProperty()
|
|
228
|
+
@IsOptional()
|
|
229
|
+
@IsNumber()
|
|
230
|
+
initial?: number;
|
|
231
|
+
|
|
232
|
+
@ApiProperty()
|
|
233
|
+
@IsOptional()
|
|
234
|
+
@IsNumber()
|
|
235
|
+
target?: number;
|
|
236
|
+
|
|
237
|
+
@ApiProperty()
|
|
238
|
+
@IsOptional()
|
|
239
|
+
@IsNumber()
|
|
240
|
+
finalRaw?: number;
|
|
241
|
+
|
|
242
|
+
@ApiProperty()
|
|
243
|
+
@IsOptional()
|
|
244
|
+
@IsNumber()
|
|
245
|
+
diffBefore?: number;
|
|
246
|
+
|
|
247
|
+
@ApiProperty()
|
|
248
|
+
@IsOptional()
|
|
249
|
+
bestAttempt?: {
|
|
250
|
+
finalAfterDedup: number;
|
|
251
|
+
diffAfter: number;
|
|
252
|
+
removedCount: number;
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
@ApiProperty()
|
|
256
|
+
@IsOptional()
|
|
257
|
+
stats?: {
|
|
258
|
+
totalTx?: number;
|
|
259
|
+
totalGroups?: number;
|
|
260
|
+
strategiesTried?: string[];
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export type BankDedupResponse = BankDedupResult | BankDedupImpossible;
|
package/ts/types/index.ts
CHANGED
|
@@ -735,6 +735,7 @@ export * from './Interface/api/webmail/ExportEmails';
|
|
|
735
735
|
export * from './Interface/api/webmail/PostAttachmentEmailFromLambdaParams';
|
|
736
736
|
export * from './Interface/api/webmail/GetPaginatedWhereObjectParams';
|
|
737
737
|
export * from './Interface/api/bankAccount/Delete';
|
|
738
|
+
export * from './Interface/api/bankDedup/BankDedup';
|
|
738
739
|
export * from './Interface/api/log/QueryLogPagination';
|
|
739
740
|
export * from './Interface/api/employee/QueryEmployeeSearch';
|
|
740
741
|
export * from './Interface/api/employee/QueryCreateEmployee';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IBankDedup.d.ts","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/IBankDedup.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,GAAG,YAAY,GAAG,cAAc,GAAG,WAAW,CAAC;CAC/D;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,IAAI,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,aA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;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE;QACZ,eAAe,EAAE,MAAM,CAAC;QACxB,SAAS,EAAE,MAAM,CAAC;QAClB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,KAAK,CAAC,EAAE;QACN,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;KAC5B,CAAC;CACH;AAED,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,GAAG,oBAAoB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IBankDedup.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/IBankDedup.ts"],"names":[],"mappings":"","sourcesContent":["export interface IBankDedupRequest {\n csv: string; // CSV en string (avec header: label,dateValue,credit,debit)\n initial: number; // solde initial\n target: number; // solde cible\n}\n\nexport interface BankTx {\n id: string; // id interne généré\n label: string;\n dateValue: string; // YYYY-MM-DD\n credit: number;\n debit: number;\n sign: 1 | -1; // 1 = crédit net, -1 = débit net\n amount: number; // valeur absolue du mouvement (en positif)\n cents: number; // montant en centimes pour calculs exacts\n}\n\nexport interface DuplicateGroup {\n id: string;\n transactions: BankTx[];\n amount: number; // montant commun\n cents: number; // montant en centimes\n sign: 1 | -1; // signe commun\n confidence: number; // score de confiance [0 - 1]\n method: 'exact' | 'fuzzy_high' | 'fuzzy_medium' | 'fuzzy_low'; // méthode de détection\n}\n\nexport interface IBankDedupResult {\n success: true;\n initial: number;\n target: number;\n finalRaw: number;\n finalAfterDedup: number;\n diffBefore: number; // target - finalRaw\n diffAfter: number; // target - finalAfterDedup (DOIT être exactement 0, aucune tolérance)\n removedGroups: {\n id: string;\n confidence: number;\n method: string;\n amount: number;\n transactionCount: number;\n isSelected: boolean;\n transactions: {\n id: string;\n label: string;\n dateValue: string;\n isKept: boolean;\n isCredit: boolean;\n }[];\n }[];\n removedCount: number;\n keptCount: number;\n csvDeduped: string;\n allGroups: {\n id: string;\n confidence: number;\n method: string;\n amount: number;\n transactionCount: number;\n isSelected: boolean;\n transactions: {\n id: string;\n label: string;\n dateValue: string;\n isKept: boolean;\n isCredit: boolean;\n }[];\n }[];\n debug: {\n totalGroups: number;\n selectedGroups: number;\n iterations: number;\n strategiesUsed: string[];\n };\n}\n\nexport interface IBankDedupImpossible {\n success: false;\n reason: 'NO_EXACT_COMBINATION' | 'CSV_PARSE_ERROR' | 'INVALID_INPUT' | 'INSUFFICIENT_DUPLICATES';\n message: string;\n initial?: number;\n target?: number;\n finalRaw?: number;\n diffBefore?: number;\n bestAttempt?: {\n finalAfterDedup: number;\n diffAfter: number;\n removedCount: number;\n };\n stats?: {\n totalTx?: number;\n totalGroups?: number;\n strategiesTried?: string[];\n };\n}\n\nexport type IBankDedupResponse = IBankDedupResult | IBankDedupImpossible;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IBankDedup.d.ts","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/IBankDedup.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,Y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C;YACd,SAAS,EAAE,MAAM,CAAC;YAClB,MAAM,EAAE,OAAO,CAAC;YAChB,QAAQ,EAAE,OAAO,CAAC;SACnB,EAAE,CAAC;KACL,EAAE,CAAC;IACJ,KAAK,EAAE;QACL,WAAW,EAAE,MAAM,CAAC;QACpB,cAAc,EAAE,MAAM,CAAC;QACvB,UAAU,EAAE,MAAM,CAAC;QACnB,cAAc,EAAE,MAAM,EAAE,CAAC;KAC1B,CAAC;CACH;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,KAAK,CAAC;IACf,MAAM,EAAE,sBAAsB,GAAG,iBAAiB,GAAG,eAAe,GAAG,yBAAyB,CAAC;IACjG,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE;QACZ,eAAe,EAAE,MAAM,CAAC;QACxB,SAAS,EAAE,MAAM,CAAC;QAClB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,KAAK,CAAC,EAAE;QACN,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;KAC5B,CAAC;CACH;AAED,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,GAAG,oBAAoB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IBankDedup.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/IBankDedup.ts"],"names":[],"mappings":"","sourcesContent":["export interface IBankDedupRequest {\n csv: string; // CSV en string (avec header: label,dateValue,credit,debit)\n initial: number; // solde initial\n target: number; // solde cible\n}\n\nexport interface BankTx {\n id: string; // id interne généré\n label: string;\n dateValue: string; // YYYY-MM-DD\n credit: number;\n debit: number;\n sign: 1 | -1; // 1 = crédit net, -1 = débit net\n amount: number; // valeur absolue du mouvement (en positif)\n cents: number; // montant en centimes pour calculs exacts\n}\n\nexport interface DuplicateGroup {\n id: string;\n transactions: BankTx[];\n amount: number; // montant commun\n cents: number; // montant en centimes\n sign: 1 | -1; // signe commun\n confidence: number; // score de confiance [0 - 1]\n method: 'exact' | 'fuzzy_high' | 'fuzzy_medium' | 'fuzzy_low'; // méthode de détection\n}\n\nexport interface IBankDedupResult {\n success: true;\n initial: number;\n target: number;\n finalRaw: number;\n finalAfterDedup: number;\n diffBefore: number; // target - finalRaw\n diffAfter: number; // target - finalAfterDedup (DOIT être exactement 0, aucune tolérance)\n removedGroups: {\n id: string;\n confidence: number;\n method: string;\n amount: number;\n transactionCount: number;\n isSelected: boolean;\n transactions: {\n id: string;\n label: string;\n dateValue: string;\n isKept: boolean;\n isCredit: boolean;\n }[];\n }[];\n removedCount: number;\n keptCount: number;\n csvDeduped: string;\n allGroups: {\n id: string;\n confidence: number;\n method: string;\n amount: number;\n transactionCount: number;\n isSelected: boolean;\n transactions: {\n id: string;\n label: string;\n dateValue: string;\n isKept: boolean;\n isCredit: boolean;\n }[];\n }[];\n debug: {\n totalGroups: number;\n selectedGroups: number;\n iterations: number;\n strategiesUsed: string[];\n };\n}\n\nexport interface IBankDedupImpossible {\n success: false;\n reason: 'NO_EXACT_COMBINATION' | 'CSV_PARSE_ERROR' | 'INVALID_INPUT' | 'INSUFFICIENT_DUPLICATES';\n message: string;\n initial?: number;\n target?: number;\n finalRaw?: number;\n diffBefore?: number;\n bestAttempt?: {\n finalAfterDedup: number;\n diffAfter: number;\n removedCount: number;\n };\n stats?: {\n totalTx?: number;\n totalGroups?: number;\n strategiesTried?: string[];\n };\n}\n\nexport type IBankDedupResponse = IBankDedupResult | IBankDedupImpossible;\n"]}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
export interface IBankDedupRequest {
|
|
2
|
-
csv: string; // CSV en string (avec header: label,dateValue,credit,debit)
|
|
3
|
-
initial: number; // solde initial
|
|
4
|
-
target: number; // solde cible
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export interface BankTx {
|
|
8
|
-
id: string; // id interne généré
|
|
9
|
-
label: string;
|
|
10
|
-
dateValue: string; // YYYY-MM-DD
|
|
11
|
-
credit: number;
|
|
12
|
-
debit: number;
|
|
13
|
-
sign: 1 | -1; // 1 = crédit net, -1 = débit net
|
|
14
|
-
amount: number; // valeur absolue du mouvement (en positif)
|
|
15
|
-
cents: number; // montant en centimes pour calculs exacts
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface DuplicateGroup {
|
|
19
|
-
id: string;
|
|
20
|
-
transactions: BankTx[];
|
|
21
|
-
amount: number; // montant commun
|
|
22
|
-
cents: number; // montant en centimes
|
|
23
|
-
sign: 1 | -1; // signe commun
|
|
24
|
-
confidence: number; // score de confiance [0 - 1]
|
|
25
|
-
method: 'exact' | 'fuzzy_high' | 'fuzzy_medium' | 'fuzzy_low'; // méthode de détection
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface IBankDedupResult {
|
|
29
|
-
success: true;
|
|
30
|
-
initial: number;
|
|
31
|
-
target: number;
|
|
32
|
-
finalRaw: number;
|
|
33
|
-
finalAfterDedup: number;
|
|
34
|
-
diffBefore: number; // target - finalRaw
|
|
35
|
-
diffAfter: number; // target - finalAfterDedup (DOIT être exactement 0, aucune tolérance)
|
|
36
|
-
removedGroups: {
|
|
37
|
-
id: string;
|
|
38
|
-
confidence: number;
|
|
39
|
-
method: string;
|
|
40
|
-
amount: number;
|
|
41
|
-
transactionCount: number;
|
|
42
|
-
isSelected: boolean;
|
|
43
|
-
transactions: {
|
|
44
|
-
id: string;
|
|
45
|
-
label: string;
|
|
46
|
-
dateValue: string;
|
|
47
|
-
isKept: boolean;
|
|
48
|
-
isCredit: boolean;
|
|
49
|
-
}[];
|
|
50
|
-
}[];
|
|
51
|
-
removedCount: number;
|
|
52
|
-
keptCount: number;
|
|
53
|
-
csvDeduped: string;
|
|
54
|
-
allGroups: {
|
|
55
|
-
id: string;
|
|
56
|
-
confidence: number;
|
|
57
|
-
method: string;
|
|
58
|
-
amount: number;
|
|
59
|
-
transactionCount: number;
|
|
60
|
-
isSelected: boolean;
|
|
61
|
-
transactions: {
|
|
62
|
-
id: string;
|
|
63
|
-
label: string;
|
|
64
|
-
dateValue: string;
|
|
65
|
-
isKept: boolean;
|
|
66
|
-
isCredit: boolean;
|
|
67
|
-
}[];
|
|
68
|
-
}[];
|
|
69
|
-
debug: {
|
|
70
|
-
totalGroups: number;
|
|
71
|
-
selectedGroups: number;
|
|
72
|
-
iterations: number;
|
|
73
|
-
strategiesUsed: string[];
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export interface IBankDedupImpossible {
|
|
78
|
-
success: false;
|
|
79
|
-
reason: 'NO_EXACT_COMBINATION' | 'CSV_PARSE_ERROR' | 'INVALID_INPUT' | 'INSUFFICIENT_DUPLICATES';
|
|
80
|
-
message: string;
|
|
81
|
-
initial?: number;
|
|
82
|
-
target?: number;
|
|
83
|
-
finalRaw?: number;
|
|
84
|
-
diffBefore?: number;
|
|
85
|
-
bestAttempt?: {
|
|
86
|
-
finalAfterDedup: number;
|
|
87
|
-
diffAfter: number;
|
|
88
|
-
removedCount: number;
|
|
89
|
-
};
|
|
90
|
-
stats?: {
|
|
91
|
-
totalTx?: number;
|
|
92
|
-
totalGroups?: number;
|
|
93
|
-
strategiesTried?: string[];
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export type IBankDedupResponse = IBankDedupResult | IBankDedupImpossible;
|