hvp-shared 6.96.0 → 6.97.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.
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Types for the duplicate client detection and audit system.
|
|
5
5
|
* Detects potential duplicate client records using scoring-based matching
|
|
6
|
-
* on phone, email, and
|
|
6
|
+
* on phone, email, name similarity, and shared pets.
|
|
7
7
|
*
|
|
8
8
|
* @example GET /api/qvet/clients/duplicates?branch=MAT&confidence=HIGH
|
|
9
9
|
*/
|
|
@@ -24,6 +24,8 @@ export interface DuplicateClientInfo {
|
|
|
24
24
|
petCount: number;
|
|
25
25
|
visitCount: number;
|
|
26
26
|
salesTotalAmount: number;
|
|
27
|
+
/** Pet names for quick visual comparison */
|
|
28
|
+
petNames: string[];
|
|
27
29
|
}
|
|
28
30
|
/**
|
|
29
31
|
* A pair of clients detected as potential duplicates.
|
|
@@ -31,11 +33,12 @@ export interface DuplicateClientInfo {
|
|
|
31
33
|
* Scoring:
|
|
32
34
|
* - Same phone (last 7 digits): 60 pts
|
|
33
35
|
* - Same email: 60 pts
|
|
36
|
+
* - Same pet name: 40 pts
|
|
34
37
|
* - Exact name match: +30 pts
|
|
35
38
|
* - Name contained: +25 pts
|
|
36
39
|
* - Name similarity >= 50%: +1 to +25 pts
|
|
37
40
|
* - Same branch: +5 pts
|
|
38
|
-
* - Name-only match (no
|
|
41
|
+
* - Name-only match (no other signal): 40 pts
|
|
39
42
|
*
|
|
40
43
|
* Confidence: HIGH >= 80, MEDIUM 60-79, LOW < 60
|
|
41
44
|
*/
|
|
@@ -45,12 +48,15 @@ export interface DuplicateClientPair {
|
|
|
45
48
|
reasons: string[];
|
|
46
49
|
clientA: DuplicateClientInfo;
|
|
47
50
|
clientB: DuplicateClientInfo;
|
|
51
|
+
/** Groups pairs sharing clients (e.g., A-B, A-C, B-C all get same groupId) */
|
|
52
|
+
groupId: number;
|
|
48
53
|
}
|
|
49
54
|
/**
|
|
50
55
|
* Summary statistics for duplicate detection results.
|
|
51
56
|
*/
|
|
52
57
|
export interface DuplicateClientsSummary {
|
|
53
58
|
totalPairs: number;
|
|
59
|
+
totalGroups: number;
|
|
54
60
|
highConfidence: number;
|
|
55
61
|
mediumConfidence: number;
|
|
56
62
|
lowConfidence: number;
|
|
@@ -72,4 +78,6 @@ export interface DuplicateClientsQueryParams {
|
|
|
72
78
|
branch?: string;
|
|
73
79
|
minScore?: number;
|
|
74
80
|
confidence?: DuplicateClientConfidence;
|
|
81
|
+
/** Include inactive clients in detection (default: false, only active) */
|
|
82
|
+
includeInactive?: boolean;
|
|
75
83
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Types for the duplicate client detection and audit system.
|
|
6
6
|
* Detects potential duplicate client records using scoring-based matching
|
|
7
|
-
* on phone, email, and
|
|
7
|
+
* on phone, email, name similarity, and shared pets.
|
|
8
8
|
*
|
|
9
9
|
* @example GET /api/qvet/clients/duplicates?branch=MAT&confidence=HIGH
|
|
10
10
|
*/
|