@chenchaolong/plugin-trade-compliance-workbench 1.0.0 → 1.0.2
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/README.md +46 -1
- package/dist/assets/branding/yuneec-logo.png +0 -0
- package/dist/assets/templates/CI.xlsx +0 -0
- package/dist/assets/templates/CUSTOMS_DECLARATION.xlsx +0 -0
- package/dist/assets/templates/PI.xlsx +0 -0
- package/dist/assets/templates/PL.xlsx +0 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/adapters/file-storage.d.ts +4 -2
- package/dist/lib/adapters/file-storage.d.ts.map +1 -1
- package/dist/lib/adapters/file-storage.js +25 -10
- package/dist/lib/adapters/file-storage.js.map +1 -1
- package/dist/lib/adapters/hsbianma.provider.d.ts +1 -0
- package/dist/lib/adapters/hsbianma.provider.d.ts.map +1 -1
- package/dist/lib/adapters/hsbianma.provider.js +32 -3
- package/dist/lib/adapters/hsbianma.provider.js.map +1 -1
- package/dist/lib/adapters/translation.provider.d.ts +3 -0
- package/dist/lib/adapters/translation.provider.d.ts.map +1 -1
- package/dist/lib/adapters/translation.provider.js +15 -6
- package/dist/lib/adapters/translation.provider.js.map +1 -1
- package/dist/lib/constants.d.ts +3 -2
- package/dist/lib/constants.d.ts.map +1 -1
- package/dist/lib/constants.js +3 -2
- package/dist/lib/constants.js.map +1 -1
- package/dist/lib/demo-data.definitions.d.ts +28 -0
- package/dist/lib/demo-data.definitions.d.ts.map +1 -0
- package/dist/lib/demo-data.definitions.js +236 -0
- package/dist/lib/demo-data.definitions.js.map +1 -0
- package/dist/lib/demo-data.entity.d.ts +9 -0
- package/dist/lib/demo-data.entity.d.ts.map +1 -0
- package/dist/lib/demo-data.entity.js +24 -0
- package/dist/lib/demo-data.entity.js.map +1 -0
- package/dist/lib/demo-data.ids.d.ts +4 -0
- package/dist/lib/demo-data.ids.d.ts.map +1 -0
- package/dist/lib/demo-data.ids.js +19 -0
- package/dist/lib/demo-data.ids.js.map +1 -0
- package/dist/lib/demo-data.service.d.ts +26 -0
- package/dist/lib/demo-data.service.d.ts.map +1 -0
- package/dist/lib/demo-data.service.js +124 -0
- package/dist/lib/demo-data.service.js.map +1 -0
- package/dist/lib/domain/default-settings.d.ts +1 -0
- package/dist/lib/domain/default-settings.d.ts.map +1 -1
- package/dist/lib/domain/default-settings.js +1 -0
- package/dist/lib/domain/default-settings.js.map +1 -1
- package/dist/lib/domain/risk-notice.d.ts +59 -0
- package/dist/lib/domain/risk-notice.d.ts.map +1 -0
- package/dist/lib/domain/risk-notice.js +30 -0
- package/dist/lib/domain/risk-notice.js.map +1 -0
- package/dist/lib/entities/catalog.entity.d.ts.map +1 -1
- package/dist/lib/entities/catalog.entity.js +4 -2
- package/dist/lib/entities/catalog.entity.js.map +1 -1
- package/dist/lib/entities/customer.entity.d.ts +9 -2
- package/dist/lib/entities/customer.entity.d.ts.map +1 -1
- package/dist/lib/entities/customer.entity.js +29 -1
- package/dist/lib/entities/customer.entity.js.map +1 -1
- package/dist/lib/entities/index.d.ts +2 -2
- package/dist/lib/entities/index.d.ts.map +1 -1
- package/dist/lib/entities/index.js +2 -2
- package/dist/lib/entities/index.js.map +1 -1
- package/dist/lib/entities/procurement.entity.d.ts +6 -4
- package/dist/lib/entities/procurement.entity.d.ts.map +1 -1
- package/dist/lib/entities/procurement.entity.js +9 -1
- package/dist/lib/entities/procurement.entity.js.map +1 -1
- package/dist/lib/entities/settings.entity.d.ts +12 -2
- package/dist/lib/entities/settings.entity.d.ts.map +1 -1
- package/dist/lib/entities/settings.entity.js +40 -0
- package/dist/lib/entities/settings.entity.js.map +1 -1
- package/dist/lib/entities/shared.entity.d.ts +10 -5
- package/dist/lib/entities/shared.entity.d.ts.map +1 -1
- package/dist/lib/entities/shared.entity.js +22 -1
- package/dist/lib/entities/shared.entity.js.map +1 -1
- package/dist/lib/remote-components/trade-compliance-workbench/app.css +1 -0
- package/dist/lib/remote-components/trade-compliance-workbench/app.js +63 -277
- package/dist/lib/remote-ui/analytics-contracts.d.ts +106 -0
- package/dist/lib/remote-ui/analytics-contracts.d.ts.map +1 -0
- package/dist/lib/remote-ui/analytics-contracts.js +4 -0
- package/dist/lib/remote-ui/analytics-contracts.js.map +1 -0
- package/dist/lib/remote-ui/app-source.d.ts +2 -0
- package/dist/lib/remote-ui/app-source.d.ts.map +1 -0
- package/dist/lib/remote-ui/app-source.js +753 -0
- package/dist/lib/remote-ui/app-source.js.map +1 -0
- package/dist/lib/remote-ui/bridge.d.ts +36 -0
- package/dist/lib/remote-ui/bridge.d.ts.map +1 -0
- package/dist/lib/remote-ui/bridge.js +159 -0
- package/dist/lib/remote-ui/bridge.js.map +1 -0
- package/dist/lib/remote-ui/components/data-grid.d.ts +34 -0
- package/dist/lib/remote-ui/components/data-grid.d.ts.map +1 -0
- package/dist/lib/remote-ui/components/data-grid.js +59 -0
- package/dist/lib/remote-ui/components/data-grid.js.map +1 -0
- package/dist/lib/remote-ui/components/forms.d.ts +63 -0
- package/dist/lib/remote-ui/components/forms.d.ts.map +1 -0
- package/dist/lib/remote-ui/components/forms.js +117 -0
- package/dist/lib/remote-ui/components/forms.js.map +1 -0
- package/dist/lib/remote-ui/components/layout.d.ts +34 -0
- package/dist/lib/remote-ui/components/layout.d.ts.map +1 -0
- package/dist/lib/remote-ui/components/layout.js +89 -0
- package/dist/lib/remote-ui/components/layout.js.map +1 -0
- package/dist/lib/remote-ui/contract-import.d.ts +82 -0
- package/dist/lib/remote-ui/contract-import.d.ts.map +1 -0
- package/dist/lib/remote-ui/contract-import.js +102 -0
- package/dist/lib/remote-ui/contract-import.js.map +1 -0
- package/dist/lib/remote-ui/contracts.d.ts +257 -0
- package/dist/lib/remote-ui/contracts.d.ts.map +1 -0
- package/dist/lib/remote-ui/contracts.js +12 -0
- package/dist/lib/remote-ui/contracts.js.map +1 -0
- package/dist/lib/remote-ui/customer-contract-contracts.d.ts +227 -0
- package/dist/lib/remote-ui/customer-contract-contracts.d.ts.map +1 -0
- package/dist/lib/remote-ui/customer-contract-contracts.js +10 -0
- package/dist/lib/remote-ui/customer-contract-contracts.js.map +1 -0
- package/dist/lib/remote-ui/model.d.ts +31 -0
- package/dist/lib/remote-ui/model.d.ts.map +1 -0
- package/dist/lib/remote-ui/model.js +248 -0
- package/dist/lib/remote-ui/model.js.map +1 -0
- package/dist/lib/remote-ui/pages/analytics.d.ts +12 -0
- package/dist/lib/remote-ui/pages/analytics.d.ts.map +1 -0
- package/dist/lib/remote-ui/pages/analytics.js +123 -0
- package/dist/lib/remote-ui/pages/analytics.js.map +1 -0
- package/dist/lib/remote-ui/pages/catalogs.d.ts +225 -0
- package/dist/lib/remote-ui/pages/catalogs.d.ts.map +1 -0
- package/dist/lib/remote-ui/pages/catalogs.js +572 -0
- package/dist/lib/remote-ui/pages/catalogs.js.map +1 -0
- package/dist/lib/remote-ui/pages/contracts.d.ts +80 -0
- package/dist/lib/remote-ui/pages/contracts.d.ts.map +1 -0
- package/dist/lib/remote-ui/pages/contracts.js +396 -0
- package/dist/lib/remote-ui/pages/contracts.js.map +1 -0
- package/dist/lib/remote-ui/pages/files.d.ts +31 -0
- package/dist/lib/remote-ui/pages/files.d.ts.map +1 -0
- package/dist/lib/remote-ui/pages/files.js +64 -0
- package/dist/lib/remote-ui/pages/files.js.map +1 -0
- package/dist/lib/remote-ui/pages/home.d.ts +71 -0
- package/dist/lib/remote-ui/pages/home.d.ts.map +1 -0
- package/dist/lib/remote-ui/pages/home.js +136 -0
- package/dist/lib/remote-ui/pages/home.js.map +1 -0
- package/dist/lib/remote-ui/pages/procurement.d.ts +36 -0
- package/dist/lib/remote-ui/pages/procurement.d.ts.map +1 -0
- package/dist/lib/remote-ui/pages/procurement.js +370 -0
- package/dist/lib/remote-ui/pages/procurement.js.map +1 -0
- package/dist/lib/remote-ui/pages/sales.d.ts +12 -0
- package/dist/lib/remote-ui/pages/sales.d.ts.map +1 -0
- package/dist/lib/remote-ui/pages/sales.js +106 -0
- package/dist/lib/remote-ui/pages/sales.js.map +1 -0
- package/dist/lib/remote-ui/pages/settings.d.ts +34 -0
- package/dist/lib/remote-ui/pages/settings.d.ts.map +1 -0
- package/dist/lib/remote-ui/pages/settings.js +259 -0
- package/dist/lib/remote-ui/pages/settings.js.map +1 -0
- package/dist/lib/remote-ui/procurement-contracts.d.ts +177 -0
- package/dist/lib/remote-ui/procurement-contracts.d.ts.map +1 -0
- package/dist/lib/remote-ui/procurement-contracts.js +2 -0
- package/dist/lib/remote-ui/procurement-contracts.js.map +1 -0
- package/dist/lib/remote-ui/sales-contracts.d.ts +133 -0
- package/dist/lib/remote-ui/sales-contracts.d.ts.map +1 -0
- package/dist/lib/remote-ui/sales-contracts.js +2 -0
- package/dist/lib/remote-ui/sales-contracts.js.map +1 -0
- package/dist/lib/remote-ui/settings-contracts.d.ts +114 -0
- package/dist/lib/remote-ui/settings-contracts.d.ts.map +1 -0
- package/dist/lib/remote-ui/settings-contracts.js +6 -0
- package/dist/lib/remote-ui/settings-contracts.js.map +1 -0
- package/dist/lib/remote-ui/upload-policy.d.ts +18 -0
- package/dist/lib/remote-ui/upload-policy.d.ts.map +1 -0
- package/dist/lib/remote-ui/upload-policy.js +56 -0
- package/dist/lib/remote-ui/upload-policy.js.map +1 -0
- package/dist/lib/runtime-validation.d.ts +61 -0
- package/dist/lib/runtime-validation.d.ts.map +1 -0
- package/dist/lib/runtime-validation.js +243 -0
- package/dist/lib/runtime-validation.js.map +1 -0
- package/dist/lib/sales-file.service.d.ts +54 -6
- package/dist/lib/sales-file.service.d.ts.map +1 -1
- package/dist/lib/sales-file.service.js +278 -33
- package/dist/lib/sales-file.service.js.map +1 -1
- package/dist/lib/trade-compliance.config.d.ts +32 -0
- package/dist/lib/trade-compliance.config.d.ts.map +1 -1
- package/dist/lib/trade-compliance.config.js +16 -4
- package/dist/lib/trade-compliance.config.js.map +1 -1
- package/dist/lib/types.d.ts +253 -1
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/types.js +24 -0
- package/dist/lib/types.js.map +1 -1
- package/dist/lib/workbench-view.provider.d.ts +675 -38
- package/dist/lib/workbench-view.provider.d.ts.map +1 -1
- package/dist/lib/workbench-view.provider.js +411 -40
- package/dist/lib/workbench-view.provider.js.map +1 -1
- package/dist/lib/workbench.middleware.d.ts +70 -19
- package/dist/lib/workbench.middleware.d.ts.map +1 -1
- package/dist/lib/workbench.middleware.js +5 -1
- package/dist/lib/workbench.middleware.js.map +1 -1
- package/dist/lib/workbench.plugin.d.ts.map +1 -1
- package/dist/lib/workbench.plugin.js +6 -4
- package/dist/lib/workbench.plugin.js.map +1 -1
- package/dist/lib/workbench.service.d.ts +629 -48
- package/dist/lib/workbench.service.d.ts.map +1 -1
- package/dist/lib/workbench.service.js +1818 -300
- package/dist/lib/workbench.service.js.map +1 -1
- package/package.json +15 -4
- package/scripts/seed-demo-data.mjs +138 -0
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import { DataSource } from 'typeorm';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { DataSource, EntityManager, type ObjectLiteral } from 'typeorm';
|
|
2
|
+
import ExcelJS from 'exceljs';
|
|
3
|
+
import { type WriteStream } from 'node:fs';
|
|
4
|
+
import { BankAccountSettings, CompanySettings, ControlledCatalogBatch, ControlledGoodsRecord, Customer, CustomerContract, CustomerContractAnalysisRun, CustomerContractClause, CustomerContractClauseAnalysis, DerivedSalesOrderManualData, GeneratedSalesFile, ImportTask, ManagedAsset, MonthlySafeExchangeRate, ProfitRuleSettings, PurchaseOrder, PurchaseOrderLine, RiskNoticeSettings, SanctionCatalogBatch, SanctionedCompanyRecord, Supplier } from './entities/index.js';
|
|
5
|
+
import type { AnalyticsDetailRow, AnalyticsQuery, CatalogType, ClauseType, DeleteMonthlyRateInput, DerivedSalesOrder, ImportExecutionCommand, PageQuery, RequestScope, RestoreSettingsInput, SettingsType } from './types.js';
|
|
6
|
+
import { DEFAULT_RISK_NOTICE } from './domain/risk-notice.js';
|
|
7
|
+
import { TradeComplianceFileStorage } from './adapters/file-storage.js';
|
|
8
|
+
export { DEFAULT_RISK_NOTICE };
|
|
9
|
+
export declare function writeWorkbookFile(filePath: string, populate: (workbook: ExcelJS.stream.xlsx.WorkbookWriter) => Promise<void>, openOutput?: (path: string) => WriteStream): Promise<void>;
|
|
4
10
|
export interface CatalogImportRow {
|
|
5
11
|
productName?: string;
|
|
6
12
|
hsCode?: string;
|
|
@@ -21,14 +27,22 @@ export interface PurchaseDraft {
|
|
|
21
27
|
order: Partial<PurchaseOrder> & {
|
|
22
28
|
contractNo: string;
|
|
23
29
|
contractAmountCny: string;
|
|
30
|
+
amountMismatch?: boolean;
|
|
31
|
+
amountMismatchConfirmed?: boolean;
|
|
24
32
|
};
|
|
25
33
|
lines: Array<Partial<PurchaseOrderLine> & {
|
|
26
34
|
productName: string;
|
|
27
35
|
quantity: string;
|
|
28
36
|
unitPriceTaxIncluded: string;
|
|
29
37
|
lineAmountTaxIncluded: string;
|
|
38
|
+
amountMismatch?: boolean;
|
|
39
|
+
amountMismatchConfirmed?: boolean;
|
|
30
40
|
}>;
|
|
31
41
|
}
|
|
42
|
+
type DerivedSalesOrderIdentity = {
|
|
43
|
+
customerContractId: string;
|
|
44
|
+
purchaseOrderId: string;
|
|
45
|
+
};
|
|
32
46
|
export interface CustomerContractDraft {
|
|
33
47
|
customer: Partial<Customer> & {
|
|
34
48
|
name: string;
|
|
@@ -38,9 +52,9 @@ export interface CustomerContractDraft {
|
|
|
38
52
|
};
|
|
39
53
|
clauses: Array<{
|
|
40
54
|
clauseType: ClauseType;
|
|
41
|
-
extractionStatus
|
|
55
|
+
extractionStatus: 'FOUND' | 'NOT_FOUND';
|
|
42
56
|
sourceText?: string;
|
|
43
|
-
reviewedText?: string;
|
|
57
|
+
reviewedText?: string | null;
|
|
44
58
|
sourceLocation?: string;
|
|
45
59
|
sourceContent?: string;
|
|
46
60
|
}>;
|
|
@@ -51,15 +65,33 @@ export interface CustomerContractDraft {
|
|
|
51
65
|
suggestionZh: string;
|
|
52
66
|
}>;
|
|
53
67
|
}
|
|
68
|
+
export interface CustomerContractReviewUpdate {
|
|
69
|
+
customer?: Partial<Customer>;
|
|
70
|
+
contract?: Partial<Pick<CustomerContract, 'contractNo' | 'contractAmountReviewCny' | 'signedAt'>>;
|
|
71
|
+
clauses?: Array<Pick<CustomerContractClause, 'id' | 'clauseType' | 'reviewedText' | 'extractionStatus'>>;
|
|
72
|
+
customerTransferConfirmation?: {
|
|
73
|
+
type: 'CONFIRMED_CUSTOMER_TRANSFER';
|
|
74
|
+
targetNormalizedName: string;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export interface CustomerContractReanalysisItem {
|
|
78
|
+
clauseType: ClauseType;
|
|
79
|
+
riskLevel: 'LOW' | 'MEDIUM' | 'HIGH';
|
|
80
|
+
riskMessageZh: string;
|
|
81
|
+
suggestionZh: string;
|
|
82
|
+
}
|
|
54
83
|
export declare class TradeComplianceWorkbenchService {
|
|
55
84
|
private readonly dataSource;
|
|
56
|
-
|
|
85
|
+
private readonly storage?;
|
|
86
|
+
constructor(dataSource: DataSource, storage?: TradeComplianceFileStorage | undefined);
|
|
57
87
|
bootstrapSettings(scope: RequestScope): Promise<{
|
|
58
88
|
risk: RiskNoticeSettings;
|
|
59
89
|
profit: ProfitRuleSettings;
|
|
60
90
|
company: CompanySettings;
|
|
61
91
|
banks: BankAccountSettings[];
|
|
62
92
|
}>;
|
|
93
|
+
private ensureBuiltinCompanyLogo;
|
|
94
|
+
private ensureSettingsDefault;
|
|
63
95
|
dashboard(scope: RequestScope): Promise<{
|
|
64
96
|
riskNotice: RiskNoticeSettings;
|
|
65
97
|
controlledRiskCount: number;
|
|
@@ -68,7 +100,9 @@ export declare class TradeComplianceWorkbenchService {
|
|
|
68
100
|
unlinkedCustomerCount: number;
|
|
69
101
|
}>;
|
|
70
102
|
listControlledGoods(scope: RequestScope, query?: PageQuery): Promise<{
|
|
71
|
-
items: ControlledGoodsRecord
|
|
103
|
+
items: (ControlledGoodsRecord & {
|
|
104
|
+
sourceFileName: string | undefined;
|
|
105
|
+
})[];
|
|
72
106
|
total: number;
|
|
73
107
|
page: number;
|
|
74
108
|
pageSize: number;
|
|
@@ -105,7 +139,37 @@ export declare class TradeComplianceWorkbenchService {
|
|
|
105
139
|
rows: CatalogImportRow[];
|
|
106
140
|
}): Promise<ControlledCatalogBatch>;
|
|
107
141
|
listSanctionedCompanies(scope: RequestScope, query?: PageQuery): Promise<{
|
|
108
|
-
items: SanctionedCompanyRecord
|
|
142
|
+
items: (SanctionedCompanyRecord & {
|
|
143
|
+
sourceFileName: string | undefined;
|
|
144
|
+
})[];
|
|
145
|
+
total: number;
|
|
146
|
+
page: number;
|
|
147
|
+
pageSize: number;
|
|
148
|
+
}>;
|
|
149
|
+
getImportTaskResult(scope: RequestScope, taskId: string): Promise<{
|
|
150
|
+
commands: ImportExecutionCommand[];
|
|
151
|
+
polling: {
|
|
152
|
+
intervalMs: number;
|
|
153
|
+
timeoutMs: number;
|
|
154
|
+
};
|
|
155
|
+
task: ImportTask;
|
|
156
|
+
} | {
|
|
157
|
+
commands: ImportExecutionCommand[];
|
|
158
|
+
polling: {
|
|
159
|
+
intervalMs: number;
|
|
160
|
+
timeoutMs: number;
|
|
161
|
+
};
|
|
162
|
+
task: ImportTask;
|
|
163
|
+
batch: SanctionCatalogBatch | undefined;
|
|
164
|
+
}>;
|
|
165
|
+
listImportIssues(scope: RequestScope, query: {
|
|
166
|
+
documentType: 'CONTROLLED_CATALOG' | 'SANCTION_CATALOG';
|
|
167
|
+
batchId: string;
|
|
168
|
+
issueType: 'DUPLICATE' | 'INVALID';
|
|
169
|
+
page?: number;
|
|
170
|
+
pageSize?: number;
|
|
171
|
+
}): Promise<{
|
|
172
|
+
items: ObjectLiteral[];
|
|
109
173
|
total: number;
|
|
110
174
|
page: number;
|
|
111
175
|
pageSize: number;
|
|
@@ -126,27 +190,209 @@ export declare class TradeComplianceWorkbenchService {
|
|
|
126
190
|
rows: CatalogImportRow[];
|
|
127
191
|
}): Promise<SanctionCatalogBatch>;
|
|
128
192
|
createImportTask(scope: RequestScope, input: Pick<ImportTask, 'documentType' | 'sourceFileId' | 'sourceFileName' | 'sourceFileFormat'> & Partial<ImportTask>): Promise<ImportTask>;
|
|
193
|
+
saveImportTaskExecution(scope: RequestScope, id: string, command: ImportExecutionCommand): Promise<ImportTask>;
|
|
194
|
+
markImportCommandDispatched(scope: RequestScope, id: string): Promise<ImportTask>;
|
|
195
|
+
markImportTaskFailed(scope: RequestScope, id: string, failure: {
|
|
196
|
+
errorCode: string;
|
|
197
|
+
errorMessage: string;
|
|
198
|
+
}): Promise<ImportTask>;
|
|
199
|
+
createRetryImportTask(scope: RequestScope, sourceTaskId: string): Promise<ImportTask>;
|
|
129
200
|
updateImportTaskDraft(scope: RequestScope, id: string, payload: Record<string, unknown>, version?: string): Promise<ImportTask>;
|
|
130
201
|
markImportTaskParsing(scope: RequestScope, id: string): Promise<ImportTask>;
|
|
131
202
|
savePurchaseDraft(scope: RequestScope, importTaskId: string, draft: PurchaseDraft): Promise<PurchaseOrder>;
|
|
132
203
|
listSuppliers(scope: RequestScope, query?: PageQuery): Promise<{
|
|
133
|
-
items:
|
|
204
|
+
items: {
|
|
205
|
+
sanctionMatchCount: number;
|
|
206
|
+
sanctionStatus: "UNCHECKED" | "CLEAR" | "HIT";
|
|
207
|
+
code: string | null;
|
|
208
|
+
name: string;
|
|
209
|
+
normalizedName: string;
|
|
210
|
+
shortName: string | null;
|
|
211
|
+
address: string | null;
|
|
212
|
+
contactName: string | null;
|
|
213
|
+
phone: string | null;
|
|
214
|
+
wechat: string | null;
|
|
215
|
+
email: string | null;
|
|
216
|
+
taxNumber: string | null;
|
|
217
|
+
paymentAccount: string | null;
|
|
218
|
+
bankName: string | null;
|
|
219
|
+
taxpayerRating: string | null;
|
|
220
|
+
website: string | null;
|
|
221
|
+
businessProducts: string | null;
|
|
222
|
+
complianceCheckedAt: Date | null;
|
|
223
|
+
deletedAt: Date | null;
|
|
224
|
+
deletedById: string | null;
|
|
225
|
+
deleteOperation: import("./types.js").DeleteOperation | null;
|
|
226
|
+
createdById: string | null;
|
|
227
|
+
updatedById: string | null;
|
|
228
|
+
updatedAt: Date;
|
|
229
|
+
createdAt: Date;
|
|
230
|
+
id: string;
|
|
231
|
+
tenantId: string;
|
|
232
|
+
organizationId: string;
|
|
233
|
+
}[];
|
|
134
234
|
total: number;
|
|
135
235
|
page: number;
|
|
136
236
|
pageSize: number;
|
|
137
237
|
}>;
|
|
238
|
+
getSupplier(scope: RequestScope, id: string): Promise<{
|
|
239
|
+
sanctionMatchCount: number;
|
|
240
|
+
sanctionStatus: "UNCHECKED" | "CLEAR" | "HIT";
|
|
241
|
+
code: string | null;
|
|
242
|
+
name: string;
|
|
243
|
+
normalizedName: string;
|
|
244
|
+
shortName: string | null;
|
|
245
|
+
address: string | null;
|
|
246
|
+
contactName: string | null;
|
|
247
|
+
phone: string | null;
|
|
248
|
+
wechat: string | null;
|
|
249
|
+
email: string | null;
|
|
250
|
+
taxNumber: string | null;
|
|
251
|
+
paymentAccount: string | null;
|
|
252
|
+
bankName: string | null;
|
|
253
|
+
taxpayerRating: string | null;
|
|
254
|
+
website: string | null;
|
|
255
|
+
businessProducts: string | null;
|
|
256
|
+
complianceCheckedAt: Date | null;
|
|
257
|
+
deletedAt: Date | null;
|
|
258
|
+
deletedById: string | null;
|
|
259
|
+
deleteOperation: import("./types.js").DeleteOperation | null;
|
|
260
|
+
createdById: string | null;
|
|
261
|
+
updatedById: string | null;
|
|
262
|
+
updatedAt: Date;
|
|
263
|
+
createdAt: Date;
|
|
264
|
+
id: string;
|
|
265
|
+
tenantId: string;
|
|
266
|
+
organizationId: string;
|
|
267
|
+
}>;
|
|
138
268
|
listPurchaseOrders(scope: RequestScope, supplierId?: string, query?: PageQuery): Promise<{
|
|
139
|
-
items:
|
|
269
|
+
items: {
|
|
270
|
+
lineCount: number;
|
|
271
|
+
estimatedRefundAmountCny: string;
|
|
272
|
+
customerContractId: string | null;
|
|
273
|
+
customerContractNo: string | null;
|
|
274
|
+
customerContractLinkStatus: "LINKED" | "UNLINKED";
|
|
275
|
+
supplierId: string;
|
|
276
|
+
contractNo: string;
|
|
277
|
+
normalizedContractNo: string;
|
|
278
|
+
orderDate: string | null;
|
|
279
|
+
contractAmountCny: string;
|
|
280
|
+
paidAmountCny: string;
|
|
281
|
+
refundedAmountCny: string;
|
|
282
|
+
sourceFileId: string;
|
|
283
|
+
sourceFileName: string;
|
|
284
|
+
importTaskId: string;
|
|
285
|
+
amountMismatchConfirmedAt: Date | null;
|
|
286
|
+
amountMismatchConfirmedById: string | null;
|
|
287
|
+
deletedAt: Date | null;
|
|
288
|
+
deletedById: string | null;
|
|
289
|
+
deleteOperation: import("./types.js").DeleteOperation | null;
|
|
290
|
+
createdById: string | null;
|
|
291
|
+
updatedById: string | null;
|
|
292
|
+
updatedAt: Date;
|
|
293
|
+
createdAt: Date;
|
|
294
|
+
id: string;
|
|
295
|
+
tenantId: string;
|
|
296
|
+
organizationId: string;
|
|
297
|
+
}[];
|
|
140
298
|
total: number;
|
|
141
299
|
page: number;
|
|
142
300
|
pageSize: number;
|
|
143
301
|
}>;
|
|
302
|
+
getPurchaseOrder(scope: RequestScope, id: string): Promise<{
|
|
303
|
+
lineCount: number;
|
|
304
|
+
estimatedRefundAmountCny: string;
|
|
305
|
+
customerContractId: string | null;
|
|
306
|
+
customerContractNo: string | null;
|
|
307
|
+
customerContractLinkStatus: "LINKED" | "UNLINKED";
|
|
308
|
+
supplierId: string;
|
|
309
|
+
contractNo: string;
|
|
310
|
+
normalizedContractNo: string;
|
|
311
|
+
orderDate: string | null;
|
|
312
|
+
contractAmountCny: string;
|
|
313
|
+
paidAmountCny: string;
|
|
314
|
+
refundedAmountCny: string;
|
|
315
|
+
sourceFileId: string;
|
|
316
|
+
sourceFileName: string;
|
|
317
|
+
importTaskId: string;
|
|
318
|
+
amountMismatchConfirmedAt: Date | null;
|
|
319
|
+
amountMismatchConfirmedById: string | null;
|
|
320
|
+
deletedAt: Date | null;
|
|
321
|
+
deletedById: string | null;
|
|
322
|
+
deleteOperation: import("./types.js").DeleteOperation | null;
|
|
323
|
+
createdById: string | null;
|
|
324
|
+
updatedById: string | null;
|
|
325
|
+
updatedAt: Date;
|
|
326
|
+
createdAt: Date;
|
|
327
|
+
id: string;
|
|
328
|
+
tenantId: string;
|
|
329
|
+
organizationId: string;
|
|
330
|
+
}>;
|
|
144
331
|
listPurchaseLines(scope: RequestScope, purchaseOrderId?: string, query?: PageQuery): Promise<{
|
|
145
|
-
items:
|
|
332
|
+
items: {
|
|
333
|
+
sourceType: "CONTRACT_EXTRACTED" | "MANUAL_ENTRY";
|
|
334
|
+
hsCodeStatus: "UNCONFIRMED" | "AI_CONFIRMED" | "MANUALLY_CONFIRMED";
|
|
335
|
+
complianceCategories: ("DUAL_USE" | "OVERSEAS_SANCTION")[];
|
|
336
|
+
purchaseOrderId: string;
|
|
337
|
+
lineNumber: number;
|
|
338
|
+
productName: string;
|
|
339
|
+
normalizedProductName: string;
|
|
340
|
+
englishName: string | null;
|
|
341
|
+
englishNameSource: import("./types.js").EnglishNameSource | null;
|
|
342
|
+
productDescription: string | null;
|
|
343
|
+
modelSpecification: string | null;
|
|
344
|
+
unit: string | null;
|
|
345
|
+
quantity: string;
|
|
346
|
+
unitPriceTaxIncluded: string;
|
|
347
|
+
lineAmountTaxIncluded: string;
|
|
348
|
+
vatRate: string | null;
|
|
349
|
+
vatRateSource: import("./types.js").VatRateSource | null;
|
|
350
|
+
hsCode: string | null;
|
|
351
|
+
hsCodeSource: import("./types.js").HsCodeSource | null;
|
|
352
|
+
hsCodeReferenceSnapshotId: string | null;
|
|
353
|
+
originCountry: string | null;
|
|
354
|
+
domesticSourceLocation: string | null;
|
|
355
|
+
refundRate: string | null;
|
|
356
|
+
refundRateSource: import("./types.js").RefundRateSource | null;
|
|
357
|
+
refundPolicyReference: string | null;
|
|
358
|
+
refundPolicyDate: string | null;
|
|
359
|
+
refundValidationMethod: import("./types.js").RefundValidationMethod | null;
|
|
360
|
+
refundConfirmedAt: Date | null;
|
|
361
|
+
refundConfirmedById: string | null;
|
|
362
|
+
amountMismatchConfirmedAt: Date | null;
|
|
363
|
+
amountMismatchConfirmedById: string | null;
|
|
364
|
+
sourceLocation: string | null;
|
|
365
|
+
sourceContent: string | null;
|
|
366
|
+
complianceCheckedAt: Date | null;
|
|
367
|
+
deletedAt: Date | null;
|
|
368
|
+
deletedById: string | null;
|
|
369
|
+
deleteOperation: import("./types.js").DeleteOperation | null;
|
|
370
|
+
createdById: string | null;
|
|
371
|
+
updatedById: string | null;
|
|
372
|
+
updatedAt: Date;
|
|
373
|
+
createdAt: Date;
|
|
374
|
+
id: string;
|
|
375
|
+
tenantId: string;
|
|
376
|
+
organizationId: string;
|
|
377
|
+
}[];
|
|
146
378
|
total: number;
|
|
147
379
|
page: number;
|
|
148
380
|
pageSize: number;
|
|
149
381
|
}>;
|
|
382
|
+
getSupplierProcurementMetrics(scope: RequestScope, supplierId: string, currentYear?: number): Promise<{
|
|
383
|
+
totalOrderCount: number;
|
|
384
|
+
totalPurchaseAmountCny: number;
|
|
385
|
+
currentYearOrderCount: number;
|
|
386
|
+
currentYearPurchaseAmountCny: number;
|
|
387
|
+
topProducts: {
|
|
388
|
+
productName: string;
|
|
389
|
+
amountCny: number;
|
|
390
|
+
}[];
|
|
391
|
+
orderBalances: Record<string, {
|
|
392
|
+
unpaidAmountCny: number;
|
|
393
|
+
unrefundedAmountCny: number;
|
|
394
|
+
}>;
|
|
395
|
+
}>;
|
|
150
396
|
updateSupplier(scope: RequestScope, id: string, input: Partial<Supplier>): Promise<Supplier>;
|
|
151
397
|
updatePurchaseOrder(scope: RequestScope, id: string, input: Partial<PurchaseOrder>): Promise<PurchaseOrder>;
|
|
152
398
|
updatePurchaseLine(scope: RequestScope, id: string, input: Partial<PurchaseOrderLine>): Promise<PurchaseOrderLine>;
|
|
@@ -163,8 +409,273 @@ export declare class TradeComplianceWorkbenchService {
|
|
|
163
409
|
page: number;
|
|
164
410
|
pageSize: number;
|
|
165
411
|
}>;
|
|
412
|
+
listSalesCustomers(scope: RequestScope, query?: PageQuery): Promise<{
|
|
413
|
+
items: {
|
|
414
|
+
profitRateStatus: "MISSING" | "CONFIGURED";
|
|
415
|
+
sanctionMatchCount: number;
|
|
416
|
+
sanctionStatus: "UNCHECKED" | "CLEAR" | "HIT";
|
|
417
|
+
code: string | null;
|
|
418
|
+
name: string;
|
|
419
|
+
normalizedName: string;
|
|
420
|
+
shortName: string | null;
|
|
421
|
+
country: string | null;
|
|
422
|
+
address: string | null;
|
|
423
|
+
contactName: string | null;
|
|
424
|
+
phone: string | null;
|
|
425
|
+
wechat: string | null;
|
|
426
|
+
email: string | null;
|
|
427
|
+
taxNumber: string | null;
|
|
428
|
+
paymentAccount: string | null;
|
|
429
|
+
bankName: string | null;
|
|
430
|
+
taxpayerRating: string | null;
|
|
431
|
+
website: string | null;
|
|
432
|
+
businessProducts: string | null;
|
|
433
|
+
defaultPricingProfitRate: string | null;
|
|
434
|
+
pricingProfitRateStatus: import("./types.js").CustomerProfitRateStatus;
|
|
435
|
+
complianceCheckStatus: import("./types.js").ComplianceCheckStatus;
|
|
436
|
+
complianceCheckedAt: Date | null;
|
|
437
|
+
deletedAt: Date | null;
|
|
438
|
+
deletedById: string | null;
|
|
439
|
+
deleteOperation: import("./types.js").DeleteOperation | null;
|
|
440
|
+
createdById: string | null;
|
|
441
|
+
updatedById: string | null;
|
|
442
|
+
updatedAt: Date;
|
|
443
|
+
createdAt: Date;
|
|
444
|
+
id: string;
|
|
445
|
+
tenantId: string;
|
|
446
|
+
organizationId: string;
|
|
447
|
+
}[];
|
|
448
|
+
total: number;
|
|
449
|
+
page: number;
|
|
450
|
+
pageSize: number;
|
|
451
|
+
}>;
|
|
452
|
+
listSalesOrders(scope: RequestScope, customerId: string, query?: PageQuery): Promise<{
|
|
453
|
+
items: {
|
|
454
|
+
customerName: string;
|
|
455
|
+
supplierName: string;
|
|
456
|
+
pricingProfitRateStatus: "CONFIGURED";
|
|
457
|
+
paymentStatus: "UNPAID" | "PARTIAL" | "PAID";
|
|
458
|
+
lines: {
|
|
459
|
+
complianceCategories: ("DUAL_USE" | "OVERSEAS_SANCTION")[];
|
|
460
|
+
purchaseOrderLineId: string;
|
|
461
|
+
productName: string;
|
|
462
|
+
englishName?: string | null;
|
|
463
|
+
productDescription?: string | null;
|
|
464
|
+
modelSpecification?: string | null;
|
|
465
|
+
unit?: string | null;
|
|
466
|
+
quantity: string;
|
|
467
|
+
hsCode?: string | null;
|
|
468
|
+
hsCodeStatus: import("./types.js").HsCodeStatus;
|
|
469
|
+
vatRate?: string | null;
|
|
470
|
+
refundRate?: string | null;
|
|
471
|
+
originCountry?: string | null;
|
|
472
|
+
domesticSourceLocation?: string | null;
|
|
473
|
+
salesUnitPriceCny: string;
|
|
474
|
+
salesLineAmountCny: string;
|
|
475
|
+
complianceMatches: import("./types.js").DerivedSalesComplianceMatch[];
|
|
476
|
+
}[];
|
|
477
|
+
customerContractId: string;
|
|
478
|
+
purchaseOrderId: string;
|
|
479
|
+
customerId: string;
|
|
480
|
+
salesOrderNo: string;
|
|
481
|
+
customerContractNo: string;
|
|
482
|
+
purchaseContractNo: string;
|
|
483
|
+
orderDate?: string | null;
|
|
484
|
+
currencyCode: "CNY";
|
|
485
|
+
pricingProfitRateSource: import("./types.js").PricingProfitRateSource;
|
|
486
|
+
effectivePricingProfitRate: string;
|
|
487
|
+
orderAmountCny: string;
|
|
488
|
+
receivedAmountCny: string;
|
|
489
|
+
unreceivedAmountCny: string;
|
|
490
|
+
}[];
|
|
491
|
+
customer: {
|
|
492
|
+
profitRateStatus: "MISSING" | "CONFIGURED";
|
|
493
|
+
sanctionMatchCount: number;
|
|
494
|
+
sanctionStatus: "UNCHECKED" | "CLEAR" | "HIT";
|
|
495
|
+
code: string | null;
|
|
496
|
+
name: string;
|
|
497
|
+
normalizedName: string;
|
|
498
|
+
shortName: string | null;
|
|
499
|
+
country: string | null;
|
|
500
|
+
address: string | null;
|
|
501
|
+
contactName: string | null;
|
|
502
|
+
phone: string | null;
|
|
503
|
+
wechat: string | null;
|
|
504
|
+
email: string | null;
|
|
505
|
+
taxNumber: string | null;
|
|
506
|
+
paymentAccount: string | null;
|
|
507
|
+
bankName: string | null;
|
|
508
|
+
taxpayerRating: string | null;
|
|
509
|
+
website: string | null;
|
|
510
|
+
businessProducts: string | null;
|
|
511
|
+
defaultPricingProfitRate: string | null;
|
|
512
|
+
pricingProfitRateStatus: import("./types.js").CustomerProfitRateStatus;
|
|
513
|
+
complianceCheckStatus: import("./types.js").ComplianceCheckStatus;
|
|
514
|
+
complianceCheckedAt: Date | null;
|
|
515
|
+
deletedAt: Date | null;
|
|
516
|
+
deletedById: string | null;
|
|
517
|
+
deleteOperation: import("./types.js").DeleteOperation | null;
|
|
518
|
+
createdById: string | null;
|
|
519
|
+
updatedById: string | null;
|
|
520
|
+
updatedAt: Date;
|
|
521
|
+
createdAt: Date;
|
|
522
|
+
id: string;
|
|
523
|
+
tenantId: string;
|
|
524
|
+
organizationId: string;
|
|
525
|
+
};
|
|
526
|
+
metrics: {
|
|
527
|
+
orderCount: number;
|
|
528
|
+
salesAmountCny: any;
|
|
529
|
+
receivedAmountCny: any;
|
|
530
|
+
unreceivedAmountCny: any;
|
|
531
|
+
currentYearOrderCount: number;
|
|
532
|
+
currentYearSalesAmountCny: any;
|
|
533
|
+
topProducts: {
|
|
534
|
+
productName: string;
|
|
535
|
+
amountCny: string;
|
|
536
|
+
}[];
|
|
537
|
+
};
|
|
538
|
+
total: number;
|
|
539
|
+
page: number;
|
|
540
|
+
pageSize: number;
|
|
541
|
+
}>;
|
|
542
|
+
listSalesLines(scope: RequestScope, query: PageQuery & {
|
|
543
|
+
customerId: string;
|
|
544
|
+
customerContractId: string;
|
|
545
|
+
purchaseOrderId: string;
|
|
546
|
+
}): Promise<{
|
|
547
|
+
order: {
|
|
548
|
+
customerName: string;
|
|
549
|
+
supplierName: string;
|
|
550
|
+
pricingProfitRateStatus: "CONFIGURED";
|
|
551
|
+
paymentStatus: "UNPAID" | "PARTIAL" | "PAID";
|
|
552
|
+
lines: {
|
|
553
|
+
complianceCategories: ("DUAL_USE" | "OVERSEAS_SANCTION")[];
|
|
554
|
+
purchaseOrderLineId: string;
|
|
555
|
+
productName: string;
|
|
556
|
+
englishName?: string | null;
|
|
557
|
+
productDescription?: string | null;
|
|
558
|
+
modelSpecification?: string | null;
|
|
559
|
+
unit?: string | null;
|
|
560
|
+
quantity: string;
|
|
561
|
+
hsCode?: string | null;
|
|
562
|
+
hsCodeStatus: import("./types.js").HsCodeStatus;
|
|
563
|
+
vatRate?: string | null;
|
|
564
|
+
refundRate?: string | null;
|
|
565
|
+
originCountry?: string | null;
|
|
566
|
+
domesticSourceLocation?: string | null;
|
|
567
|
+
salesUnitPriceCny: string;
|
|
568
|
+
salesLineAmountCny: string;
|
|
569
|
+
complianceMatches: import("./types.js").DerivedSalesComplianceMatch[];
|
|
570
|
+
}[];
|
|
571
|
+
customerContractId: string;
|
|
572
|
+
purchaseOrderId: string;
|
|
573
|
+
customerId: string;
|
|
574
|
+
salesOrderNo: string;
|
|
575
|
+
customerContractNo: string;
|
|
576
|
+
purchaseContractNo: string;
|
|
577
|
+
orderDate?: string | null;
|
|
578
|
+
currencyCode: "CNY";
|
|
579
|
+
pricingProfitRateSource: import("./types.js").PricingProfitRateSource;
|
|
580
|
+
effectivePricingProfitRate: string;
|
|
581
|
+
orderAmountCny: string;
|
|
582
|
+
receivedAmountCny: string;
|
|
583
|
+
unreceivedAmountCny: string;
|
|
584
|
+
};
|
|
585
|
+
items: {
|
|
586
|
+
complianceCategories: ("DUAL_USE" | "OVERSEAS_SANCTION")[];
|
|
587
|
+
purchaseOrderLineId: string;
|
|
588
|
+
productName: string;
|
|
589
|
+
englishName?: string | null;
|
|
590
|
+
productDescription?: string | null;
|
|
591
|
+
modelSpecification?: string | null;
|
|
592
|
+
unit?: string | null;
|
|
593
|
+
quantity: string;
|
|
594
|
+
hsCode?: string | null;
|
|
595
|
+
hsCodeStatus: import("./types.js").HsCodeStatus;
|
|
596
|
+
vatRate?: string | null;
|
|
597
|
+
refundRate?: string | null;
|
|
598
|
+
originCountry?: string | null;
|
|
599
|
+
domesticSourceLocation?: string | null;
|
|
600
|
+
salesUnitPriceCny: string;
|
|
601
|
+
salesLineAmountCny: string;
|
|
602
|
+
complianceMatches: import("./types.js").DerivedSalesComplianceMatch[];
|
|
603
|
+
}[];
|
|
604
|
+
total: number;
|
|
605
|
+
page: number;
|
|
606
|
+
pageSize: number;
|
|
607
|
+
}>;
|
|
608
|
+
listSalesFileOrders(scope: RequestScope, query?: PageQuery): Promise<{
|
|
609
|
+
items: {
|
|
610
|
+
customerName: string;
|
|
611
|
+
supplierName: string;
|
|
612
|
+
pricingProfitRateStatus: "CONFIGURED";
|
|
613
|
+
paymentStatus: "UNPAID" | "PARTIAL" | "PAID";
|
|
614
|
+
lines: {
|
|
615
|
+
complianceCategories: ("DUAL_USE" | "OVERSEAS_SANCTION")[];
|
|
616
|
+
purchaseOrderLineId: string;
|
|
617
|
+
productName: string;
|
|
618
|
+
englishName?: string | null;
|
|
619
|
+
productDescription?: string | null;
|
|
620
|
+
modelSpecification?: string | null;
|
|
621
|
+
unit?: string | null;
|
|
622
|
+
quantity: string;
|
|
623
|
+
hsCode?: string | null;
|
|
624
|
+
hsCodeStatus: import("./types.js").HsCodeStatus;
|
|
625
|
+
vatRate?: string | null;
|
|
626
|
+
refundRate?: string | null;
|
|
627
|
+
originCountry?: string | null;
|
|
628
|
+
domesticSourceLocation?: string | null;
|
|
629
|
+
salesUnitPriceCny: string;
|
|
630
|
+
salesLineAmountCny: string;
|
|
631
|
+
complianceMatches: import("./types.js").DerivedSalesComplianceMatch[];
|
|
632
|
+
}[];
|
|
633
|
+
customerContractId: string;
|
|
634
|
+
purchaseOrderId: string;
|
|
635
|
+
customerId: string;
|
|
636
|
+
salesOrderNo: string;
|
|
637
|
+
customerContractNo: string;
|
|
638
|
+
purchaseContractNo: string;
|
|
639
|
+
orderDate?: string | null;
|
|
640
|
+
currencyCode: "CNY";
|
|
641
|
+
pricingProfitRateSource: import("./types.js").PricingProfitRateSource;
|
|
642
|
+
effectivePricingProfitRate: string;
|
|
643
|
+
orderAmountCny: string;
|
|
644
|
+
receivedAmountCny: string;
|
|
645
|
+
unreceivedAmountCny: string;
|
|
646
|
+
}[];
|
|
647
|
+
total: number;
|
|
648
|
+
page: number;
|
|
649
|
+
pageSize: number;
|
|
650
|
+
}>;
|
|
166
651
|
listCustomerContracts(scope: RequestScope, query?: PageQuery): Promise<{
|
|
167
|
-
items:
|
|
652
|
+
items: {
|
|
653
|
+
contractAmountReviewCny: string | null;
|
|
654
|
+
customerName: string;
|
|
655
|
+
customerCode: string | null;
|
|
656
|
+
sanctionStatus: string;
|
|
657
|
+
latestAnalysisAt: Date | null;
|
|
658
|
+
customerId: string;
|
|
659
|
+
contractNo: string;
|
|
660
|
+
normalizedContractNo: string;
|
|
661
|
+
signedAt: string | null;
|
|
662
|
+
overallRiskLevel: import("./types.js").RiskLevel | null;
|
|
663
|
+
latestAnalysisRunId: string | null;
|
|
664
|
+
currentReanalysisRunId: string | null;
|
|
665
|
+
sourceFileId: string;
|
|
666
|
+
sourceFileName: string;
|
|
667
|
+
importTaskId: string;
|
|
668
|
+
deletedAt: Date | null;
|
|
669
|
+
deletedById: string | null;
|
|
670
|
+
deleteOperation: import("./types.js").DeleteOperation | null;
|
|
671
|
+
createdById: string | null;
|
|
672
|
+
updatedById: string | null;
|
|
673
|
+
updatedAt: Date;
|
|
674
|
+
createdAt: Date;
|
|
675
|
+
id: string;
|
|
676
|
+
tenantId: string;
|
|
677
|
+
organizationId: string;
|
|
678
|
+
}[];
|
|
168
679
|
total: number;
|
|
169
680
|
page: number;
|
|
170
681
|
pageSize: number;
|
|
@@ -174,24 +685,67 @@ export declare class TradeComplianceWorkbenchService {
|
|
|
174
685
|
customer: Customer | null;
|
|
175
686
|
clauses: CustomerContractClause[];
|
|
176
687
|
analyses: CustomerContractClauseAnalysis[];
|
|
177
|
-
latestRun: CustomerContractAnalysisRun;
|
|
688
|
+
latestRun: CustomerContractAnalysisRun | null;
|
|
689
|
+
analysisRuns: CustomerContractAnalysisRun[];
|
|
690
|
+
sanctionStatus: string;
|
|
178
691
|
}>;
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
692
|
+
startCustomerContractReanalysis(scope: RequestScope, input: {
|
|
693
|
+
reviewSource: 'IMPORT_DRAFT' | 'EXISTING_CONTRACT';
|
|
694
|
+
id?: string;
|
|
695
|
+
importTaskId?: string;
|
|
183
696
|
}): Promise<{
|
|
697
|
+
run: CustomerContractAnalysisRun;
|
|
698
|
+
resumed: boolean;
|
|
699
|
+
reviewSource: "IMPORT_DRAFT" | "EXISTING_CONTRACT";
|
|
700
|
+
clauses: import("./types.js").CustomerContractReanalysisClauseInput[];
|
|
701
|
+
}>;
|
|
702
|
+
saveCustomerContractReanalysisExecution(scope: RequestScope, id: string, command: ImportExecutionCommand): Promise<CustomerContractAnalysisRun>;
|
|
703
|
+
markCustomerContractReanalysisDispatched(scope: RequestScope, id: string): Promise<CustomerContractAnalysisRun>;
|
|
704
|
+
markCustomerContractReanalysisFailed(scope: RequestScope, id: string, input: {
|
|
705
|
+
errorCode: string;
|
|
706
|
+
errorMessage: string;
|
|
707
|
+
}): Promise<CustomerContractAnalysisRun>;
|
|
708
|
+
getCustomerContractReanalysisResult(scope: RequestScope, id: string): Promise<{
|
|
709
|
+
run: CustomerContractAnalysisRun;
|
|
710
|
+
review?: undefined;
|
|
711
|
+
task?: undefined;
|
|
712
|
+
} | {
|
|
713
|
+
run: CustomerContractAnalysisRun;
|
|
714
|
+
review: {
|
|
715
|
+
contract: CustomerContract;
|
|
716
|
+
customer: Customer | null;
|
|
717
|
+
clauses: CustomerContractClause[];
|
|
718
|
+
analyses: CustomerContractClauseAnalysis[];
|
|
719
|
+
latestRun: CustomerContractAnalysisRun | null;
|
|
720
|
+
analysisRuns: CustomerContractAnalysisRun[];
|
|
721
|
+
sanctionStatus: string;
|
|
722
|
+
};
|
|
723
|
+
task?: undefined;
|
|
724
|
+
} | {
|
|
725
|
+
run: CustomerContractAnalysisRun;
|
|
726
|
+
task: ImportTask;
|
|
727
|
+
review?: undefined;
|
|
728
|
+
}>;
|
|
729
|
+
saveCustomerContractReanalysis(scope: RequestScope, analysisRunId: string, analyses: CustomerContractReanalysisItem[]): Promise<CustomerContractAnalysisRun>;
|
|
730
|
+
getSourceFileDescriptor(scope: RequestScope, sourceFileId: string): Promise<{
|
|
731
|
+
sourceFileId: string;
|
|
732
|
+
sourceFileName: string;
|
|
733
|
+
}>;
|
|
734
|
+
updateCustomerContractReview(scope: RequestScope, id: string, input: CustomerContractReviewUpdate): Promise<{
|
|
184
735
|
contract: CustomerContract;
|
|
185
736
|
customer: Customer;
|
|
186
737
|
}>;
|
|
187
|
-
listDerivedSalesOrders(scope: RequestScope, customerId?: string): Promise<DerivedSalesOrder[]>;
|
|
738
|
+
listDerivedSalesOrders(scope: RequestScope, customerId?: string, selectedIdentities?: DerivedSalesOrderIdentity[]): Promise<DerivedSalesOrder[]>;
|
|
739
|
+
private derivedSalesIdentityQuery;
|
|
740
|
+
private selectAllDerivedSalesOrderIdentities;
|
|
741
|
+
private selectDerivedSalesOrderIdentities;
|
|
188
742
|
saveCustomerProfitRate(scope: RequestScope, customerId: string, rate: string): Promise<Customer>;
|
|
189
743
|
updateCustomer(scope: RequestScope, id: string, input: Partial<Customer>): Promise<Customer>;
|
|
190
744
|
saveDerivedManualData(scope: RequestScope, customerContractId: string, purchaseOrderId: string, input: {
|
|
191
745
|
pricingProfitRateOverride?: string | null;
|
|
192
746
|
receivedAmountCny?: string;
|
|
193
747
|
}): Promise<DerivedSalesOrderManualData>;
|
|
194
|
-
softDelete(scope: RequestScope, entityType: string, id: string): Promise<
|
|
748
|
+
softDelete(scope: RequestScope, entityType: string, id: string): Promise<PurchaseOrderLine | ObjectLiteral>;
|
|
195
749
|
listGeneratedFiles(scope: RequestScope, query?: PageQuery): Promise<{
|
|
196
750
|
items: GeneratedSalesFile[];
|
|
197
751
|
total: number;
|
|
@@ -199,40 +753,60 @@ export declare class TradeComplianceWorkbenchService {
|
|
|
199
753
|
pageSize: number;
|
|
200
754
|
}>;
|
|
201
755
|
settings(scope: RequestScope): Promise<{
|
|
202
|
-
risk: RiskNoticeSettings;
|
|
756
|
+
risk: RiskNoticeSettings | null;
|
|
203
757
|
company: CompanySettings | null;
|
|
204
758
|
banks: BankAccountSettings[];
|
|
205
|
-
profit: ProfitRuleSettings;
|
|
759
|
+
profit: ProfitRuleSettings | null;
|
|
206
760
|
rates: MonthlySafeExchangeRate[];
|
|
207
761
|
}>;
|
|
208
|
-
saveSettings(scope: RequestScope, type:
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
762
|
+
saveSettings(scope: RequestScope, type: SettingsType, input: Record<string, unknown>, expectedRevision: number): Promise<RiskNoticeSettings | CompanySettings | BankAccountSettings | ProfitRuleSettings | MonthlySafeExchangeRate>;
|
|
763
|
+
restoreSettingsDefault(scope: RequestScope, input: RestoreSettingsInput): Promise<RiskNoticeSettings | CompanySettings | BankAccountSettings | ProfitRuleSettings>;
|
|
764
|
+
deleteMonthlyRate(scope: RequestScope, input: DeleteMonthlyRateInput): Promise<MonthlySafeExchangeRate>;
|
|
765
|
+
private persistSettings;
|
|
766
|
+
private persistCompanySettings;
|
|
767
|
+
createCompanyLogoDraft(scope: RequestScope, buffer: Buffer, fileName: string): Promise<ManagedAsset>;
|
|
768
|
+
discardCompanyLogoDraft(scope: RequestScope, assetId: string): Promise<ManagedAsset>;
|
|
769
|
+
readCompanyLogo(scope: RequestScope, assetId: string): Promise<Buffer<ArrayBufferLike> | undefined>;
|
|
770
|
+
private persistMonthlyRate;
|
|
771
|
+
analytics(scope: RequestScope, query: AnalyticsQuery, source?: DataSource | EntityManager): Promise<{
|
|
772
|
+
mode: "PURCHASE" | "SALES";
|
|
773
|
+
currentYear: number;
|
|
774
|
+
dimension: "SUPPLIER" | "CUSTOMER" | "PRODUCT";
|
|
775
|
+
metrics: {
|
|
776
|
+
orderTotalCny: string;
|
|
777
|
+
paidCny: string;
|
|
778
|
+
unpaidCny: string;
|
|
779
|
+
refundedCny: string;
|
|
780
|
+
unrefundedCny: string;
|
|
781
|
+
receivedCny?: undefined;
|
|
782
|
+
unreceivedCny?: undefined;
|
|
783
|
+
} | {
|
|
784
|
+
orderTotalCny: string;
|
|
785
|
+
receivedCny: string;
|
|
786
|
+
unreceivedCny: string;
|
|
787
|
+
paidCny?: undefined;
|
|
788
|
+
unpaidCny?: undefined;
|
|
789
|
+
refundedCny?: undefined;
|
|
790
|
+
unrefundedCny?: undefined;
|
|
216
791
|
};
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
paidCny: any;
|
|
221
|
-
unpaidCny: any;
|
|
222
|
-
rows: Record<string, any>[];
|
|
223
|
-
};
|
|
224
|
-
annualPurchaseCount: number;
|
|
225
|
-
annualSalesCount: number;
|
|
226
|
-
purchaseTop5: {
|
|
227
|
-
name: string;
|
|
228
|
-
amountCny: string;
|
|
229
|
-
}[];
|
|
230
|
-
salesTop5: {
|
|
231
|
-
name: string;
|
|
792
|
+
top5: {
|
|
793
|
+
key: string;
|
|
794
|
+
label: string;
|
|
232
795
|
amountCny: string;
|
|
233
796
|
}[];
|
|
234
|
-
|
|
797
|
+
details: {
|
|
798
|
+
items: AnalyticsDetailRow[];
|
|
799
|
+
page: number;
|
|
800
|
+
pageSize: number;
|
|
801
|
+
total: number;
|
|
802
|
+
pageCount: number;
|
|
803
|
+
};
|
|
804
|
+
}>;
|
|
805
|
+
exportAnalytics(scope: RequestScope, query: AnalyticsQuery): Promise<{
|
|
806
|
+
fileName: string;
|
|
807
|
+
buffer: NonSharedBuffer;
|
|
235
808
|
}>;
|
|
809
|
+
private withAnalyticsSnapshot;
|
|
236
810
|
recalculateProductRisks(scope: RequestScope, reason: 'SOURCE_CHANGED' | 'CATALOG_CHANGED'): Promise<{
|
|
237
811
|
scanned: number;
|
|
238
812
|
matches: number;
|
|
@@ -242,11 +816,18 @@ export declare class TradeComplianceWorkbenchService {
|
|
|
242
816
|
matches: number;
|
|
243
817
|
}>;
|
|
244
818
|
private pagedQuery;
|
|
819
|
+
private pagedCatalogQuery;
|
|
245
820
|
private upsertSupplier;
|
|
821
|
+
private supplierDtos;
|
|
822
|
+
private salesCustomerDtos;
|
|
823
|
+
private salesOrderDtos;
|
|
824
|
+
private purchaseOrderDtos;
|
|
246
825
|
private upsertCustomer;
|
|
247
|
-
private
|
|
248
|
-
private
|
|
249
|
-
private
|
|
826
|
+
private lockCustomerName;
|
|
827
|
+
private lockAndAssertPartyCodeAvailable;
|
|
828
|
+
private withLockedPurchaseLines;
|
|
829
|
+
private assertLockedPurchaseReceipts;
|
|
830
|
+
private deletePurchaseLine;
|
|
250
831
|
private cascadePurchaseOrder;
|
|
251
832
|
private cascadeCustomerContract;
|
|
252
833
|
private expireStaleImportTasks;
|