hvp-shared 6.97.0 → 6.99.0
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.
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
* QVET Client Duplicate Detection Contracts
|
|
3
3
|
*
|
|
4
4
|
* Types for the duplicate client detection and audit system.
|
|
5
|
-
*
|
|
6
|
-
* on phone, email, name
|
|
5
|
+
* Returns groups of clients (2 or more) detected as potential duplicates
|
|
6
|
+
* using scoring-based matching on phone, email, name, and pet data.
|
|
7
7
|
*
|
|
8
|
-
* @example GET /api/qvet/clients/duplicates?branch=
|
|
8
|
+
* @example GET /api/qvet/clients/duplicates?branch=URBAN&confidence=HIGH
|
|
9
9
|
*/
|
|
10
10
|
export type DuplicateClientConfidence = 'HIGH' | 'MEDIUM' | 'LOW';
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
* Includes enrichment data
|
|
12
|
+
* A single client within a duplicate group.
|
|
13
|
+
* Includes enrichment data to help decide which record to keep.
|
|
14
14
|
*/
|
|
15
15
|
export interface DuplicateClientInfo {
|
|
16
16
|
qvetClientId: number;
|
|
@@ -19,43 +19,31 @@ export interface DuplicateClientInfo {
|
|
|
19
19
|
isActive: boolean;
|
|
20
20
|
phone1: string;
|
|
21
21
|
phone2: string;
|
|
22
|
+
phoneSms: string;
|
|
22
23
|
email: string;
|
|
23
24
|
lastActivityAt: string | null;
|
|
24
25
|
petCount: number;
|
|
25
26
|
visitCount: number;
|
|
26
27
|
salesTotalAmount: number;
|
|
27
|
-
/** Pet names for quick visual comparison */
|
|
28
28
|
petNames: string[];
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
|
-
* A
|
|
31
|
+
* A group of 2+ clients detected as potential duplicates.
|
|
32
32
|
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* - Same email: 60 pts
|
|
36
|
-
* - Same pet name: 40 pts
|
|
37
|
-
* - Exact name match: +30 pts
|
|
38
|
-
* - Name contained: +25 pts
|
|
39
|
-
* - Name similarity >= 50%: +1 to +25 pts
|
|
40
|
-
* - Same branch: +5 pts
|
|
41
|
-
* - Name-only match (no other signal): 40 pts
|
|
42
|
-
*
|
|
43
|
-
* Confidence: HIGH >= 80, MEDIUM 60-79, LOW < 60
|
|
33
|
+
* The score reflects the strongest link between any two clients in the group.
|
|
34
|
+
* Reasons are deduplicated across all links.
|
|
44
35
|
*/
|
|
45
|
-
export interface
|
|
36
|
+
export interface DuplicateClientGroup {
|
|
37
|
+
groupId: number;
|
|
46
38
|
score: number;
|
|
47
39
|
confidence: DuplicateClientConfidence;
|
|
48
40
|
reasons: string[];
|
|
49
|
-
|
|
50
|
-
clientB: DuplicateClientInfo;
|
|
51
|
-
/** Groups pairs sharing clients (e.g., A-B, A-C, B-C all get same groupId) */
|
|
52
|
-
groupId: number;
|
|
41
|
+
clients: DuplicateClientInfo[];
|
|
53
42
|
}
|
|
54
43
|
/**
|
|
55
44
|
* Summary statistics for duplicate detection results.
|
|
56
45
|
*/
|
|
57
46
|
export interface DuplicateClientsSummary {
|
|
58
|
-
totalPairs: number;
|
|
59
47
|
totalGroups: number;
|
|
60
48
|
highConfidence: number;
|
|
61
49
|
mediumConfidence: number;
|
|
@@ -69,7 +57,7 @@ export interface DuplicateClientsSummary {
|
|
|
69
57
|
*/
|
|
70
58
|
export interface DuplicateClientsResponse {
|
|
71
59
|
summary: DuplicateClientsSummary;
|
|
72
|
-
|
|
60
|
+
groups: DuplicateClientGroup[];
|
|
73
61
|
}
|
|
74
62
|
/**
|
|
75
63
|
* Query parameters for filtering duplicate detection results.
|
|
@@ -78,6 +66,5 @@ export interface DuplicateClientsQueryParams {
|
|
|
78
66
|
branch?: string;
|
|
79
67
|
minScore?: number;
|
|
80
68
|
confidence?: DuplicateClientConfidence;
|
|
81
|
-
/** Include inactive clients in detection (default: false, only active) */
|
|
82
69
|
includeInactive?: boolean;
|
|
83
70
|
}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* QVET Client Duplicate Detection Contracts
|
|
4
4
|
*
|
|
5
5
|
* Types for the duplicate client detection and audit system.
|
|
6
|
-
*
|
|
7
|
-
* on phone, email, name
|
|
6
|
+
* Returns groups of clients (2 or more) detected as potential duplicates
|
|
7
|
+
* using scoring-based matching on phone, email, name, and pet data.
|
|
8
8
|
*
|
|
9
|
-
* @example GET /api/qvet/clients/duplicates?branch=
|
|
9
|
+
* @example GET /api/qvet/clients/duplicates?branch=URBAN&confidence=HIGH
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|