ionic-vhframeworks 4.1.3 → 4.1.6
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/bundles/ionic-vhframeworks.umd.js +1 -1
- package/bundles/ionic-vhframeworks.umd.js.map +1 -1
- package/bundles/ionic-vhframeworks.umd.min.js +1 -1
- package/bundles/ionic-vhframeworks.umd.min.js.map +1 -1
- package/fesm2015/ionic-vhframeworks.js.map +1 -1
- package/ionic-vhframeworks.metadata.json +1 -1
- package/lib/ionic-vhframeworks.service.d.ts +98 -28
- package/package.json +1 -1
|
@@ -29,6 +29,16 @@ export declare class VhAlgorithm {
|
|
|
29
29
|
private papa;
|
|
30
30
|
private dom;
|
|
31
31
|
constructor(platform: Platform, file: File, socialSharing: SocialSharing, papa: Papa, dom: DomSanitizer);
|
|
32
|
+
/**
|
|
33
|
+
* Hàm này kiểm tra ngày trên bill có phải là ngày hiện tại của thiết bị không
|
|
34
|
+
* @Example :
|
|
35
|
+
* if(this.vhAlgorithm.isToday(date)){
|
|
36
|
+
* //Your code
|
|
37
|
+
* }
|
|
38
|
+
* @param date : ngày trên bill
|
|
39
|
+
* @returns true: nếu ngày trên bill trùng với ngày của thiết bị; false: nếu ngày trên bill khác với ngày của thiết bị
|
|
40
|
+
*/
|
|
41
|
+
isToday(date: any): boolean;
|
|
32
42
|
/**
|
|
33
43
|
* Hàm này so sanh sâu 2 object bằng nhau
|
|
34
44
|
* @param object1
|
|
@@ -42,6 +52,11 @@ export declare class VhAlgorithm {
|
|
|
42
52
|
* @returns
|
|
43
53
|
*/
|
|
44
54
|
isObject(object: any): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Hàm này tạo chuỗi số, ký tự ngẫy nhiên có chiều dài là length
|
|
57
|
+
* @param length
|
|
58
|
+
* @returns
|
|
59
|
+
*/
|
|
45
60
|
ObjectId(length?: number): string;
|
|
46
61
|
/**
|
|
47
62
|
* @example:
|
|
@@ -85,7 +100,17 @@ export declare class VhAlgorithm {
|
|
|
85
100
|
*/
|
|
86
101
|
exportCSV(headerRow: any, csvData: any, filename: any): void;
|
|
87
102
|
waitingStack(): Promise<unknown>;
|
|
103
|
+
/**
|
|
104
|
+
* Hàm trả về mảng có đối tượng trong array_list thỏa điều kiện tìm kiếm
|
|
105
|
+
* @param value : giá trị cần search
|
|
106
|
+
* @param array_list : mảng các đối tượng
|
|
107
|
+
* @param array_field : mảng các trường của đối tượng sẽ đc search
|
|
108
|
+
* @returns Array
|
|
109
|
+
*/
|
|
88
110
|
searchList(value: any, array_list: any, array_field: any): any[];
|
|
111
|
+
/**
|
|
112
|
+
* Ham đổi chuỗi alias có dấu thành không dấu
|
|
113
|
+
*/
|
|
89
114
|
changeAlias(alias: any): any;
|
|
90
115
|
/**
|
|
91
116
|
* @example
|
|
@@ -139,13 +164,14 @@ export declare class VhAlgorithm {
|
|
|
139
164
|
sortNumberbyASC(array: any, field: any): any;
|
|
140
165
|
sortNumberbyDESC(array: any, field: any): any;
|
|
141
166
|
/**
|
|
142
|
-
*
|
|
167
|
+
* Hàm trả về số ngày trong tháng của một thời gian
|
|
143
168
|
* @param year
|
|
144
169
|
* @param month
|
|
145
170
|
*/
|
|
146
171
|
getNumberOfDaysInMonth(year: number, month: number): 31 | 29 | 28 | 30;
|
|
147
172
|
Compare(field: any, condition: any, value: any): boolean;
|
|
148
173
|
/**
|
|
174
|
+
* Hàm đổi chuỗi sang object
|
|
149
175
|
* @example: data = "{"field":1, "field2": "val"}";
|
|
150
176
|
* => data = {
|
|
151
177
|
* field1: 1,
|
|
@@ -156,6 +182,7 @@ export declare class VhAlgorithm {
|
|
|
156
182
|
*/
|
|
157
183
|
convert_STRING2OBJECT(string: any): any;
|
|
158
184
|
/**
|
|
185
|
+
* Hàm đổi object sang chuỗi
|
|
159
186
|
* @example:
|
|
160
187
|
* data = {
|
|
161
188
|
* field1: 1,
|
|
@@ -495,18 +522,41 @@ export declare class VhAuth {
|
|
|
495
522
|
* @return Promise => member={}
|
|
496
523
|
*/
|
|
497
524
|
signUpEndUser(email: string, password: string, phoneNumber: string, info: object): Promise<unknown>;
|
|
498
|
-
private
|
|
525
|
+
private getLocalMyPermission;
|
|
526
|
+
/**
|
|
527
|
+
* Hàm này chỉ dùng cho FW, Dev không dùng nhé
|
|
528
|
+
* @returns
|
|
529
|
+
*/
|
|
499
530
|
refreshLocalMyPermission(): Promise<unknown>;
|
|
500
531
|
/**
|
|
501
532
|
* @example:
|
|
502
533
|
if(this.VhQuerySales.checkMyPermission('login_enable_login')){
|
|
503
534
|
this.login();
|
|
504
535
|
}
|
|
505
|
-
* @param
|
|
536
|
+
* @param permission_name
|
|
506
537
|
* @param message
|
|
507
538
|
* @return Boolean => true or false
|
|
508
539
|
*/
|
|
509
|
-
checkMyPermission(
|
|
540
|
+
checkMyPermission(permission_name: any): boolean;
|
|
541
|
+
/**
|
|
542
|
+
* Hàm này chỉ trả về kết quả chính xác khi mà các permission_name có giá trị trả về là kiểu boolean
|
|
543
|
+
* @example:
|
|
544
|
+
if(this.VhQuerySales.checkLocalMyPermissionName('login_enable_login')){
|
|
545
|
+
this.login();
|
|
546
|
+
}
|
|
547
|
+
* @param permission_name
|
|
548
|
+
* @param message
|
|
549
|
+
* @return Boolean => true or false
|
|
550
|
+
*/
|
|
551
|
+
checkLocalMyPermissionName(permission_name: any): boolean;
|
|
552
|
+
/**
|
|
553
|
+
* Hàm này chỉ trả về kết quả khi mà permission_name mà có giá trị không phải kiểu boolean, nếu là kiểu boolean hàm sẽ không trả kết quả về
|
|
554
|
+
* @example:
|
|
555
|
+
* let mypermissionname = this.VhQuerySales.getLocalMyPermissionName('default_display_page');
|
|
556
|
+
* @param permission_name
|
|
557
|
+
* @return number/string/object
|
|
558
|
+
*/
|
|
559
|
+
getLocalMyPermissionName(permission_name: any): any;
|
|
510
560
|
/**
|
|
511
561
|
* @example:
|
|
512
562
|
this.VhQuerySales.updatePermission('2rVieBQTubQ2hjUnpwU4w7qSlD83',{login_enable_login: false})
|
|
@@ -519,15 +569,17 @@ export declare class VhAuth {
|
|
|
519
569
|
*/
|
|
520
570
|
updatePermission(id_employee: any, value: any): Promise<unknown>;
|
|
521
571
|
/**
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
console.log('
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
572
|
+
* Hàm này lấy về phân quyền của nhân viên
|
|
573
|
+
* Lưu ý không dùng hàm này cho Boss, vì Boss không bị giới hạn phân quyền
|
|
574
|
+
* @example:
|
|
575
|
+
this.vhAuth.getPermission('5fccf8b675b75a1fc84342e9')
|
|
576
|
+
.then((permission)=>{
|
|
577
|
+
console.log('permission', permission)
|
|
578
|
+
},error => {
|
|
579
|
+
console.log('error', error);
|
|
580
|
+
});
|
|
581
|
+
* @return Promise => permission = {} or null
|
|
582
|
+
*/
|
|
531
583
|
getPermission(id_employee: any): any;
|
|
532
584
|
publishObservableEventEmployees(): void;
|
|
533
585
|
private observableLocalEmployees;
|
|
@@ -3400,6 +3452,21 @@ export declare class VhQueryCafe {
|
|
|
3400
3452
|
* @return — Array -> array = [{},{},...]
|
|
3401
3453
|
*/
|
|
3402
3454
|
getBills(query: object, projection?: object, sort?: object, limit?: number): Promise<unknown>;
|
|
3455
|
+
/**
|
|
3456
|
+
* @example:
|
|
3457
|
+
* let time = new Date();
|
|
3458
|
+
* time.setDate(time.getDate()-7);
|
|
3459
|
+
* this.vhQueryCafe.getBills_byFields({date:{$gte:time}, {bill_type:{$eq:5}}, {},{date:1},0)
|
|
3460
|
+
.then((bills)=>{
|
|
3461
|
+
console.log('getBills', bills);
|
|
3462
|
+
})
|
|
3463
|
+
* @param query
|
|
3464
|
+
* @param projection — đang tìm hiểu, tạm thời để giá trị là {}
|
|
3465
|
+
* @param sort — null hoặc {}:không sắp xếp; {date:1}: sắp xếp theo ASC; {date:-1}: sắp xếp theo DESC
|
|
3466
|
+
* @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
|
|
3467
|
+
* @return — Array -> array = [{},{},...]
|
|
3468
|
+
*/
|
|
3469
|
+
getBills_byFields(query: object, projection?: object, sort?: object, limit?: number): Promise<unknown>;
|
|
3403
3470
|
/**
|
|
3404
3471
|
* @example:
|
|
3405
3472
|
* this.vhQueryCafe.createBill({name:'Cuối tuần vui vẻ', type:2, active:true, date_start:new Date(), date_end: new Date()})
|
|
@@ -10859,6 +10926,21 @@ export declare class VhQuerySales {
|
|
|
10859
10926
|
* @return — Array -> array = [{},{},...]
|
|
10860
10927
|
*/
|
|
10861
10928
|
getBills(query: object, projection?: object, sort?: object, limit?: number): Promise<unknown>;
|
|
10929
|
+
/**
|
|
10930
|
+
* @example:
|
|
10931
|
+
* let time = new Date();
|
|
10932
|
+
* time.setDate(time.getDate()-7);
|
|
10933
|
+
* this.vhQuerySales.getBills_byFields({date:{$gte:time}, {bill_type:{$eq:5}}, {},{date:1},0)
|
|
10934
|
+
.then((bills)=>{
|
|
10935
|
+
console.log('getBills', bills);
|
|
10936
|
+
})
|
|
10937
|
+
* @param query
|
|
10938
|
+
* @param projection — đang tìm hiểu, tạm thời để giá trị là {}
|
|
10939
|
+
* @param sort — null hoặc {}:không sắp xếp; {date:1}: sắp xếp theo ASC; {date:-1}: sắp xếp theo DESC
|
|
10940
|
+
* @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
|
|
10941
|
+
* @return — Array -> array = [{},{},...]
|
|
10942
|
+
*/
|
|
10943
|
+
getBills_byFields(query: object, projection?: object, sort?: object, limit?: number): Promise<unknown>;
|
|
10862
10944
|
/**
|
|
10863
10945
|
* @example:
|
|
10864
10946
|
* this.vhQuerySales.createBill({name:'Cuối tuần vui vẻ', type:2, active:true, date_start:new Date(), date_end: new Date()})
|
|
@@ -12829,7 +12911,9 @@ export declare class VhQuerySales {
|
|
|
12829
12911
|
*/
|
|
12830
12912
|
getCoupon_Code_Name_Release(id_coupon_code: any): Promise<unknown>;
|
|
12831
12913
|
/**
|
|
12832
|
-
*
|
|
12914
|
+
* hàm này để đổi phiếu từ điểm của khách hàng. Đổi thành công tự động tạo lịch sử đổi điểm của khách hàng
|
|
12915
|
+
* hàm này đã cập nhật lại trường status, id_customer, date_points_exchanged cho coupon_codes
|
|
12916
|
+
* hàm này đã cập nhật lại trường earned_points, id_customer, branch_earned_points cho customers
|
|
12833
12917
|
* @example:
|
|
12834
12918
|
* this.vhQuerySales.exchangeCouponCode_byEarningPoints(['OUIYWGUDBYWUHEDW0512','1984QIHBSYGWDIOUHIQFE'], 'INBIFDYWUGUHNI65498', 1000})
|
|
12835
12919
|
.then((bool)=>{
|
|
@@ -13175,20 +13259,6 @@ export declare class VhQuerySales {
|
|
|
13175
13259
|
* @return Promise => obj ={} or null
|
|
13176
13260
|
*/
|
|
13177
13261
|
getVoucher_Code_Name_Release(id_voucher_code: any): Promise<unknown>;
|
|
13178
|
-
/** Hàm này để đổi voucher từ điểm của khách hàng. Đổi thành công tự động tạo lịch sử đổi điểm của khách hàng
|
|
13179
|
-
* @example:
|
|
13180
|
-
* let data = [id_voucher_code]
|
|
13181
|
-
* this.vhQuerySales.exchangeVoucherCode_byEarningPoints(data, "fuMS21I6othUm34385WV", 10)
|
|
13182
|
-
.then((bool)=>{
|
|
13183
|
-
console.log('exchangeVoucherCode_byEarningPoints', bool);
|
|
13184
|
-
}, error=>{
|
|
13185
|
-
console.log('error', error);
|
|
13186
|
-
})
|
|
13187
|
-
* @param array_id_voucher_code
|
|
13188
|
-
* @param id_customer
|
|
13189
|
-
* @param points
|
|
13190
|
-
* @return Promise Boolean => true or false
|
|
13191
|
-
*/
|
|
13192
13262
|
exchangeVoucherCode_byEarningPoints(array_id_voucher_code: any, id_customer: any, points: any): Promise<unknown>;
|
|
13193
13263
|
/**
|
|
13194
13264
|
* @example:
|