plac-micro-common 1.3.53 → 1.3.55
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/constants/index.d.ts +1 -0
- package/dist/constants/index.js +2 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/report/index.d.ts +5 -0
- package/dist/types/report/index.js +17 -0
- package/dist/types/report/rpt_cover_note.type.d.ts +19 -0
- package/dist/types/report/rpt_cover_note.type.js +2 -0
- package/dist/utils/frontend/app.util.d.ts +1 -0
- package/dist/utils/frontend/app.util.js +10 -1
- package/package.json +1 -1
package/dist/constants/index.js
CHANGED
|
@@ -14,7 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.APP_ERROR_CODES = exports.DISPLAY_DATE_TIME_FORMAT = exports.DISPLAY_DATE_FORMAT = void 0;
|
|
17
|
+
exports.APP_ERROR_CODES = exports.DISPLAY_DATE_TIME_FORMAT = exports.DISPLAY_DATE_FORMAT = exports.SERVER_DATE_FORMAT = void 0;
|
|
18
|
+
exports.SERVER_DATE_FORMAT = "YYYY-MM-DD";
|
|
18
19
|
exports.DISPLAY_DATE_FORMAT = "DD MMM YYYY";
|
|
19
20
|
exports.DISPLAY_DATE_TIME_FORMAT = "DD MMM YYYY hh:mm A";
|
|
20
21
|
exports.APP_ERROR_CODES = {
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./rpt_cover_note.type"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface ReportCoverNoteRow {
|
|
2
|
+
no: number;
|
|
3
|
+
receipt_no: string;
|
|
4
|
+
cover_note_no: string;
|
|
5
|
+
application_no: string;
|
|
6
|
+
ph_full_name: string;
|
|
7
|
+
la_full_name: string;
|
|
8
|
+
product_name: string;
|
|
9
|
+
sum_assured: number;
|
|
10
|
+
total_premium: number;
|
|
11
|
+
premium_paid_usd?: number | null;
|
|
12
|
+
premium_paid_khr?: number | null;
|
|
13
|
+
exchange_rate?: number | null;
|
|
14
|
+
issued_date: string;
|
|
15
|
+
issued_by: string;
|
|
16
|
+
branch_code?: string | null;
|
|
17
|
+
branch_name?: string | null;
|
|
18
|
+
remark?: string | null;
|
|
19
|
+
}
|
|
@@ -4,6 +4,7 @@ export declare function buildUserFullName(first?: string | null, last?: string |
|
|
|
4
4
|
export declare function buildFullNameKh(firstKh?: string | null, lastKh?: string | null): string | null;
|
|
5
5
|
export declare function formatDate(value?: Date | string | number | null, format?: string): string;
|
|
6
6
|
export declare function formatDateTime(value?: Date | string | number | null, format?: string): string;
|
|
7
|
+
export declare function formatServerDate(value?: Date | string | number | null): string | null;
|
|
7
8
|
export declare function formatAmount(amount: number | string, digits?: number, options?: {
|
|
8
9
|
locale?: string;
|
|
9
10
|
}): string;
|
|
@@ -9,6 +9,7 @@ exports.buildUserFullName = buildUserFullName;
|
|
|
9
9
|
exports.buildFullNameKh = buildFullNameKh;
|
|
10
10
|
exports.formatDate = formatDate;
|
|
11
11
|
exports.formatDateTime = formatDateTime;
|
|
12
|
+
exports.formatServerDate = formatServerDate;
|
|
12
13
|
exports.formatAmount = formatAmount;
|
|
13
14
|
exports.roundAmount = roundAmount;
|
|
14
15
|
exports.calculateAge = calculateAge;
|
|
@@ -29,7 +30,7 @@ function buildFullNameKh(firstKh, lastKh) {
|
|
|
29
30
|
const v = `${lastKh ?? ""} ${firstKh ?? ""}`.trim();
|
|
30
31
|
return v.length ? v : null;
|
|
31
32
|
}
|
|
32
|
-
//---
|
|
33
|
+
//--- FORMAT UTILITIES ---//
|
|
33
34
|
function formatDate(value, format = constants_1.DISPLAY_DATE_FORMAT) {
|
|
34
35
|
if (!value)
|
|
35
36
|
return "-";
|
|
@@ -46,6 +47,14 @@ function formatDateTime(value, format = constants_1.DISPLAY_DATE_TIME_FORMAT) {
|
|
|
46
47
|
return "-";
|
|
47
48
|
return date.format(format);
|
|
48
49
|
}
|
|
50
|
+
function formatServerDate(value) {
|
|
51
|
+
if (!value)
|
|
52
|
+
return null;
|
|
53
|
+
const date = (0, dayjs_1.default)(value);
|
|
54
|
+
if (!date.isValid())
|
|
55
|
+
return null;
|
|
56
|
+
return date.format(constants_1.SERVER_DATE_FORMAT);
|
|
57
|
+
}
|
|
49
58
|
function formatAmount(amount, digits = 0, options) {
|
|
50
59
|
const value = Number(amount);
|
|
51
60
|
if (!Number.isFinite(value))
|