plac-micro-common 1.3.28 → 1.3.29
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/http/guards/index.d.ts +1 -1
- package/dist/http/guards/index.js +1 -1
- package/dist/http/guards/jwt_auth.guard.js +0 -1
- package/dist/models/core/finance/exchange_rate.entity.d.ts +14 -0
- package/dist/models/core/finance/exchange_rate.entity.js +72 -0
- package/dist/models/core/finance/exchange_rate_log.entity.d.ts +14 -0
- package/dist/models/core/finance/exchange_rate_log.entity.js +65 -0
- package/dist/models/core/finance/index.d.ts +4 -0
- package/dist/models/core/finance/index.js +11 -0
- package/dist/models/core/index.d.ts +2 -1
- package/dist/models/core/index.js +4 -0
- package/dist/types/finance.type.d.ts +6 -0
- package/dist/types/finance.type.js +10 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/utils/frontend/app.util.d.ts +6 -0
- package/dist/utils/frontend/app.util.js +44 -0
- package/dist/utils/frontend/data.util.d.ts +0 -5
- package/dist/utils/frontend/data.util.js +0 -39
- package/dist/utils/frontend/index.d.ts +3 -1
- package/dist/utils/frontend/index.js +26 -1
- package/package.json +1 -1
- /package/dist/http/guards/{org_context.guard.d.ts → org_staff_context.guard.d.ts} +0 -0
- /package/dist/http/guards/{org_context.guard.js → org_staff_context.guard.js} +0 -0
|
@@ -16,5 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./internal_service.guard"), exports);
|
|
18
18
|
__exportStar(require("./jwt_auth.guard"), exports);
|
|
19
|
-
__exportStar(require("./
|
|
19
|
+
__exportStar(require("./org_staff_context.guard"), exports);
|
|
20
20
|
__exportStar(require("./permission.guard"), exports);
|
|
@@ -10,7 +10,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.JwtAuthGuard = void 0;
|
|
13
|
-
// plac-micro-common/src/auth/jwt-auth.guard.ts
|
|
14
13
|
const common_1 = require("@nestjs/common");
|
|
15
14
|
const jwt_verifier_service_1 = require("../services/jwt_verifier.service");
|
|
16
15
|
let JwtAuthGuard = class JwtAuthGuard {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ExchangeRateSourceType } from "../../../types";
|
|
2
|
+
import { _BaseEntity } from "../../_base_entity";
|
|
3
|
+
import { ExchangeRateChangeLogEntity } from "./exchange_rate_log.entity";
|
|
4
|
+
export declare class ExchangeRateEntity extends _BaseEntity {
|
|
5
|
+
id: string;
|
|
6
|
+
base_currency_code: string;
|
|
7
|
+
quote_currency_code: string;
|
|
8
|
+
rate_date: string;
|
|
9
|
+
exchange_rate: string;
|
|
10
|
+
source_type: ExchangeRateSourceType;
|
|
11
|
+
remarks?: string | null;
|
|
12
|
+
is_active: boolean;
|
|
13
|
+
logs?: ExchangeRateChangeLogEntity[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ExchangeRateEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const types_1 = require("../../../types");
|
|
15
|
+
const utils_1 = require("../../../utils");
|
|
16
|
+
const _base_entity_1 = require("../../_base_entity");
|
|
17
|
+
const exchange_rate_log_entity_1 = require("./exchange_rate_log.entity");
|
|
18
|
+
let ExchangeRateEntity = class ExchangeRateEntity extends _base_entity_1._BaseEntity {
|
|
19
|
+
};
|
|
20
|
+
exports.ExchangeRateEntity = ExchangeRateEntity;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], ExchangeRateEntity.prototype, "id", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 5 }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], ExchangeRateEntity.prototype, "base_currency_code", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 5 }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], ExchangeRateEntity.prototype, "quote_currency_code", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ type: "date" }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], ExchangeRateEntity.prototype, "rate_date", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ type: "numeric", precision: 18, scale: 6 }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], ExchangeRateEntity.prototype, "exchange_rate", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({
|
|
43
|
+
type: "varchar",
|
|
44
|
+
length: 20,
|
|
45
|
+
comment: (0, utils_1.enumToCommentString)(types_1.ExchangeRateSourceType),
|
|
46
|
+
default: types_1.ExchangeRateSourceType.Manual,
|
|
47
|
+
}),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], ExchangeRateEntity.prototype, "source_type", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 500, nullable: true }),
|
|
52
|
+
__metadata("design:type", Object)
|
|
53
|
+
], ExchangeRateEntity.prototype, "remarks", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.Column)({ type: "boolean", default: true }),
|
|
56
|
+
__metadata("design:type", Boolean)
|
|
57
|
+
], ExchangeRateEntity.prototype, "is_active", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.OneToMany)(() => exchange_rate_log_entity_1.ExchangeRateChangeLogEntity, (log) => log.exchange_rate, {
|
|
60
|
+
nullable: true,
|
|
61
|
+
}),
|
|
62
|
+
__metadata("design:type", Array)
|
|
63
|
+
], ExchangeRateEntity.prototype, "logs", void 0);
|
|
64
|
+
exports.ExchangeRateEntity = ExchangeRateEntity = __decorate([
|
|
65
|
+
(0, typeorm_1.Entity)({ schema: "core", name: "exchange_rates" }),
|
|
66
|
+
(0, typeorm_1.Index)("ux_exchange_rates_base_quote_rate_date", ["base_currency_code", "quote_currency_code", "rate_date"], { unique: true }),
|
|
67
|
+
(0, typeorm_1.Index)("ix_exchange_rates_rate_date", ["rate_date"]),
|
|
68
|
+
(0, typeorm_1.Index)("ix_exchange_rates_base_quote", [
|
|
69
|
+
"base_currency_code",
|
|
70
|
+
"quote_currency_code",
|
|
71
|
+
])
|
|
72
|
+
], ExchangeRateEntity);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { _BaseEntity } from "../../_base_entity";
|
|
2
|
+
import { ExchangeRateEntity } from "./exchange_rate.entity";
|
|
3
|
+
export declare class ExchangeRateChangeLogEntity extends _BaseEntity {
|
|
4
|
+
id: string;
|
|
5
|
+
exchange_rate_id: string;
|
|
6
|
+
old_exchange_rate?: string | null;
|
|
7
|
+
new_exchange_rate?: string | null;
|
|
8
|
+
old_rate_date?: string | null;
|
|
9
|
+
new_rate_date?: string | null;
|
|
10
|
+
change_reason?: string | null;
|
|
11
|
+
old_data?: Record<string, any> | null;
|
|
12
|
+
new_data?: Record<string, any> | null;
|
|
13
|
+
exchange_rate: ExchangeRateEntity;
|
|
14
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ExchangeRateChangeLogEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const _base_entity_1 = require("../../_base_entity");
|
|
15
|
+
const exchange_rate_entity_1 = require("./exchange_rate.entity");
|
|
16
|
+
let ExchangeRateChangeLogEntity = class ExchangeRateChangeLogEntity extends _base_entity_1._BaseEntity {
|
|
17
|
+
};
|
|
18
|
+
exports.ExchangeRateChangeLogEntity = ExchangeRateChangeLogEntity;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], ExchangeRateChangeLogEntity.prototype, "id", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, typeorm_1.Column)({ type: "uuid" }),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], ExchangeRateChangeLogEntity.prototype, "exchange_rate_id", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.Column)({ type: "numeric", precision: 18, scale: 6, nullable: true }),
|
|
29
|
+
__metadata("design:type", Object)
|
|
30
|
+
], ExchangeRateChangeLogEntity.prototype, "old_exchange_rate", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)({ type: "numeric", precision: 18, scale: 6, nullable: true }),
|
|
33
|
+
__metadata("design:type", Object)
|
|
34
|
+
], ExchangeRateChangeLogEntity.prototype, "new_exchange_rate", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)({ type: "date", nullable: true }),
|
|
37
|
+
__metadata("design:type", Object)
|
|
38
|
+
], ExchangeRateChangeLogEntity.prototype, "old_rate_date", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({ type: "date", nullable: true }),
|
|
41
|
+
__metadata("design:type", Object)
|
|
42
|
+
], ExchangeRateChangeLogEntity.prototype, "new_rate_date", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 500, nullable: true }),
|
|
45
|
+
__metadata("design:type", Object)
|
|
46
|
+
], ExchangeRateChangeLogEntity.prototype, "change_reason", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Column)({ type: "jsonb", nullable: true }),
|
|
49
|
+
__metadata("design:type", Object)
|
|
50
|
+
], ExchangeRateChangeLogEntity.prototype, "old_data", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({ type: "jsonb", nullable: true }),
|
|
53
|
+
__metadata("design:type", Object)
|
|
54
|
+
], ExchangeRateChangeLogEntity.prototype, "new_data", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.ManyToOne)(() => exchange_rate_entity_1.ExchangeRateEntity, { onDelete: "CASCADE" }),
|
|
57
|
+
(0, typeorm_1.JoinColumn)({ name: "exchange_rate_id" }),
|
|
58
|
+
__metadata("design:type", exchange_rate_entity_1.ExchangeRateEntity)
|
|
59
|
+
], ExchangeRateChangeLogEntity.prototype, "exchange_rate", void 0);
|
|
60
|
+
exports.ExchangeRateChangeLogEntity = ExchangeRateChangeLogEntity = __decorate([
|
|
61
|
+
(0, typeorm_1.Entity)({ schema: "core", name: "exchange_rate_change_logs" }),
|
|
62
|
+
(0, typeorm_1.Index)("ix_exchange_rate_logs_exchange_rate_id", ["exchange_rate_id"]),
|
|
63
|
+
(0, typeorm_1.Index)("ix_exchange_rate_logs_changed_at", ["changed_at"]),
|
|
64
|
+
(0, typeorm_1.Index)("ix_exchange_rate_logs_changed_by_user_id", ["changed_by_user_id"])
|
|
65
|
+
], ExchangeRateChangeLogEntity);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ExchangeRateEntity } from "./exchange_rate.entity";
|
|
2
|
+
import { ExchangeRateChangeLogEntity } from "./exchange_rate_log.entity";
|
|
3
|
+
export declare const FINANCE_ENTITIES: readonly [typeof ExchangeRateEntity, typeof ExchangeRateChangeLogEntity];
|
|
4
|
+
export { ExchangeRateEntity, ExchangeRateChangeLogEntity };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExchangeRateChangeLogEntity = exports.ExchangeRateEntity = exports.FINANCE_ENTITIES = void 0;
|
|
4
|
+
const exchange_rate_entity_1 = require("./exchange_rate.entity");
|
|
5
|
+
Object.defineProperty(exports, "ExchangeRateEntity", { enumerable: true, get: function () { return exchange_rate_entity_1.ExchangeRateEntity; } });
|
|
6
|
+
const exchange_rate_log_entity_1 = require("./exchange_rate_log.entity");
|
|
7
|
+
Object.defineProperty(exports, "ExchangeRateChangeLogEntity", { enumerable: true, get: function () { return exchange_rate_log_entity_1.ExchangeRateChangeLogEntity; } });
|
|
8
|
+
exports.FINANCE_ENTITIES = [
|
|
9
|
+
exchange_rate_entity_1.ExchangeRateEntity,
|
|
10
|
+
exchange_rate_log_entity_1.ExchangeRateChangeLogEntity,
|
|
11
|
+
];
|
|
@@ -16,6 +16,7 @@ import { OrganizationStaffReportingLineEntity } from "./org_staff_reporting_line
|
|
|
16
16
|
import { RelationshipEntity } from "./relationship.entity";
|
|
17
17
|
import { StaffEntity } from "./staffs.entity";
|
|
18
18
|
import { PaymentMethodEntity } from "./payment_method.entity";
|
|
19
|
-
export declare const CORE_ENTITIES: readonly [typeof GeoProvinceEntity, typeof GeoDistrictEntity, typeof GeoCommuneEntity, typeof GeoVillageEntity, typeof MaritalStatusEntity, typeof NationalityEntity, typeof NumberSeriesEntity, typeof OrganizationEntity, typeof OrganizationBranchEntity, typeof OrganizationChannelEntity, typeof OrganizationDepartmentEntity, typeof OrganizationPositionEntity, typeof OrganizationStaffEntity, typeof OrganizationStaffBranchEntity, typeof OrganizationStaffReportingLineEntity, typeof PaymentMethodEntity, typeof RelationshipEntity, typeof StaffEntity, typeof import("./product").CashValueEntity, typeof import("./product").PaymentModeEntity, typeof import("./product").PremiumRateConditionEntity, typeof import("./product").PremiumRateValueEntity, typeof import("./product").ProductEntity, typeof import("./product").ProductOrgEntity, typeof import("./product").ProductTypeEntity, typeof import("./product").ProductPaymentModeEntity, typeof import("./product").ProductRiderEntity, typeof import("./product").ProductTermEntity, typeof import("./product").ProductPlanEntity, typeof import("./product").PromotionEntity, typeof import("./product").PromotionOrgEntity, typeof import("./product").PromotionProductEntity, typeof import("./product").RiderEntity, typeof import("./product").TermEntity];
|
|
19
|
+
export declare const CORE_ENTITIES: readonly [typeof GeoProvinceEntity, typeof GeoDistrictEntity, typeof GeoCommuneEntity, typeof GeoVillageEntity, typeof MaritalStatusEntity, typeof NationalityEntity, typeof NumberSeriesEntity, typeof OrganizationEntity, typeof OrganizationBranchEntity, typeof OrganizationChannelEntity, typeof OrganizationDepartmentEntity, typeof OrganizationPositionEntity, typeof OrganizationStaffEntity, typeof OrganizationStaffBranchEntity, typeof OrganizationStaffReportingLineEntity, typeof PaymentMethodEntity, typeof RelationshipEntity, typeof StaffEntity, typeof import("./product").CashValueEntity, typeof import("./product").PaymentModeEntity, typeof import("./product").PremiumRateConditionEntity, typeof import("./product").PremiumRateValueEntity, typeof import("./product").ProductEntity, typeof import("./product").ProductOrgEntity, typeof import("./product").ProductTypeEntity, typeof import("./product").ProductPaymentModeEntity, typeof import("./product").ProductRiderEntity, typeof import("./product").ProductTermEntity, typeof import("./product").ProductPlanEntity, typeof import("./product").PromotionEntity, typeof import("./product").PromotionOrgEntity, typeof import("./product").PromotionProductEntity, typeof import("./product").RiderEntity, typeof import("./product").TermEntity, typeof import("./finance").ExchangeRateEntity, typeof import("./finance").ExchangeRateChangeLogEntity];
|
|
20
20
|
export { GeoProvinceEntity, GeoDistrictEntity, GeoCommuneEntity, GeoVillageEntity, MaritalStatusEntity, NationalityEntity, NumberSeriesEntity, OrganizationEntity, OrganizationBranchEntity, OrganizationChannelEntity, OrganizationDepartmentEntity, OrganizationPositionEntity, OrganizationStaffEntity, OrganizationStaffBranchEntity, OrganizationStaffReportingLineEntity, PaymentMethodEntity, RelationshipEntity, StaffEntity, };
|
|
21
21
|
export * from "./product";
|
|
22
|
+
export * from "./finance";
|
|
@@ -52,6 +52,7 @@ Object.defineProperty(exports, "StaffEntity", { enumerable: true, get: function
|
|
|
52
52
|
const product_1 = require("./product");
|
|
53
53
|
const payment_method_entity_1 = require("./payment_method.entity");
|
|
54
54
|
Object.defineProperty(exports, "PaymentMethodEntity", { enumerable: true, get: function () { return payment_method_entity_1.PaymentMethodEntity; } });
|
|
55
|
+
const finance_1 = require("./finance");
|
|
55
56
|
exports.CORE_ENTITIES = [
|
|
56
57
|
geo_province_entity_1.GeoProvinceEntity,
|
|
57
58
|
geo_district_entity_1.GeoDistrictEntity,
|
|
@@ -76,6 +77,9 @@ exports.CORE_ENTITIES = [
|
|
|
76
77
|
relationship_entity_1.RelationshipEntity,
|
|
77
78
|
//
|
|
78
79
|
staffs_entity_1.StaffEntity,
|
|
80
|
+
//
|
|
79
81
|
...product_1.PRODUCT_ENTITIES,
|
|
82
|
+
...finance_1.FINANCE_ENTITIES,
|
|
80
83
|
];
|
|
81
84
|
__exportStar(require("./product"), exports);
|
|
85
|
+
__exportStar(require("./finance"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExchangeRateSourceType = void 0;
|
|
4
|
+
var ExchangeRateSourceType;
|
|
5
|
+
(function (ExchangeRateSourceType) {
|
|
6
|
+
ExchangeRateSourceType["Manual"] = "manual";
|
|
7
|
+
ExchangeRateSourceType["Api"] = "api";
|
|
8
|
+
ExchangeRateSourceType["NationalBank"] = "national_bank";
|
|
9
|
+
ExchangeRateSourceType["System"] = "system";
|
|
10
|
+
})(ExchangeRateSourceType || (exports.ExchangeRateSourceType = ExchangeRateSourceType = {}));
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./auth_info.type";
|
|
|
4
4
|
export * from "./application.type";
|
|
5
5
|
export * from "./business.type";
|
|
6
6
|
export * from "./customer.type";
|
|
7
|
+
export * from "./finance.type";
|
|
7
8
|
export * from "./general.type";
|
|
8
9
|
export * from "./http.type";
|
|
9
10
|
export * from "./pagination.type";
|
package/dist/types/index.js
CHANGED
|
@@ -20,6 +20,7 @@ __exportStar(require("./auth_info.type"), exports);
|
|
|
20
20
|
__exportStar(require("./application.type"), exports);
|
|
21
21
|
__exportStar(require("./business.type"), exports);
|
|
22
22
|
__exportStar(require("./customer.type"), exports);
|
|
23
|
+
__exportStar(require("./finance.type"), exports);
|
|
23
24
|
__exportStar(require("./general.type"), exports);
|
|
24
25
|
__exportStar(require("./http.type"), exports);
|
|
25
26
|
__exportStar(require("./pagination.type"), exports);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function delay(ms: number): Promise<unknown>;
|
|
2
|
+
export declare function buildFullName(first?: string | null, last?: string | null): string | null;
|
|
3
|
+
export declare function buildUserFullName(first?: string | null, last?: string | null): string | null;
|
|
4
|
+
export declare function buildFullNameKh(firstKh?: string | null, lastKh?: string | null): string | null;
|
|
5
|
+
export declare function displayDate(value?: Date | string | number | null, format?: string): string;
|
|
6
|
+
export declare function displayDateTime(value?: Date | string | number | null, format?: string): string;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.delay = delay;
|
|
7
|
+
exports.buildFullName = buildFullName;
|
|
8
|
+
exports.buildUserFullName = buildUserFullName;
|
|
9
|
+
exports.buildFullNameKh = buildFullNameKh;
|
|
10
|
+
exports.displayDate = displayDate;
|
|
11
|
+
exports.displayDateTime = displayDateTime;
|
|
12
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
13
|
+
const constants_1 = require("../../constants");
|
|
14
|
+
function delay(ms) {
|
|
15
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
16
|
+
}
|
|
17
|
+
function buildFullName(first, last) {
|
|
18
|
+
const v = `${last ?? ""} ${first ?? ""}`.trim();
|
|
19
|
+
return v.length ? v : null;
|
|
20
|
+
}
|
|
21
|
+
function buildUserFullName(first, last) {
|
|
22
|
+
const v = `${first ?? ""} ${last ?? ""}`.trim();
|
|
23
|
+
return v.length ? v : null;
|
|
24
|
+
}
|
|
25
|
+
function buildFullNameKh(firstKh, lastKh) {
|
|
26
|
+
const v = `${lastKh ?? ""} ${firstKh ?? ""}`.trim();
|
|
27
|
+
return v.length ? v : null;
|
|
28
|
+
}
|
|
29
|
+
function displayDate(value, format = constants_1.DISPLAY_DATE_FORMAT) {
|
|
30
|
+
if (!value)
|
|
31
|
+
return "-";
|
|
32
|
+
const date = (0, dayjs_1.default)(value);
|
|
33
|
+
if (!date.isValid())
|
|
34
|
+
return "-";
|
|
35
|
+
return date.format(format);
|
|
36
|
+
}
|
|
37
|
+
function displayDateTime(value, format = constants_1.DISPLAY_DATE_TIME_FORMAT) {
|
|
38
|
+
if (!value)
|
|
39
|
+
return "-";
|
|
40
|
+
const date = (0, dayjs_1.default)(value);
|
|
41
|
+
if (!date.isValid())
|
|
42
|
+
return "-";
|
|
43
|
+
return date.format(format);
|
|
44
|
+
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare function buildFullName(first?: string | null, last?: string | null): string | null;
|
|
2
|
-
export declare function buildUserFullName(first?: string | null, last?: string | null): string | null;
|
|
3
|
-
export declare function buildFullNameKh(firstKh?: string | null, lastKh?: string | null): string | null;
|
|
4
|
-
export declare function displayDate(value?: Date | string | number | null, format?: string): string;
|
|
5
|
-
export declare function displayDateTime(value?: Date | string | number | null, format?: string): string;
|
|
@@ -1,40 +1 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.buildFullName = buildFullName;
|
|
7
|
-
exports.buildUserFullName = buildUserFullName;
|
|
8
|
-
exports.buildFullNameKh = buildFullNameKh;
|
|
9
|
-
exports.displayDate = displayDate;
|
|
10
|
-
exports.displayDateTime = displayDateTime;
|
|
11
|
-
const dayjs_1 = __importDefault(require("dayjs"));
|
|
12
|
-
const constants_1 = require("../../constants");
|
|
13
|
-
function buildFullName(first, last) {
|
|
14
|
-
const v = `${last ?? ""} ${first ?? ""}`.trim();
|
|
15
|
-
return v.length ? v : null;
|
|
16
|
-
}
|
|
17
|
-
function buildUserFullName(first, last) {
|
|
18
|
-
const v = `${first ?? ""} ${last ?? ""}`.trim();
|
|
19
|
-
return v.length ? v : null;
|
|
20
|
-
}
|
|
21
|
-
function buildFullNameKh(firstKh, lastKh) {
|
|
22
|
-
const v = `${lastKh ?? ""} ${firstKh ?? ""}`.trim();
|
|
23
|
-
return v.length ? v : null;
|
|
24
|
-
}
|
|
25
|
-
function displayDate(value, format = constants_1.DISPLAY_DATE_FORMAT) {
|
|
26
|
-
if (!value)
|
|
27
|
-
return "-";
|
|
28
|
-
const date = (0, dayjs_1.default)(value);
|
|
29
|
-
if (!date.isValid())
|
|
30
|
-
return "-";
|
|
31
|
-
return date.format(format);
|
|
32
|
-
}
|
|
33
|
-
function displayDateTime(value, format = constants_1.DISPLAY_DATE_TIME_FORMAT) {
|
|
34
|
-
if (!value)
|
|
35
|
-
return "-";
|
|
36
|
-
const date = (0, dayjs_1.default)(value);
|
|
37
|
-
if (!date.isValid())
|
|
38
|
-
return "-";
|
|
39
|
-
return date.format(format);
|
|
40
|
-
}
|
|
@@ -10,8 +10,33 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
13
35
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
37
|
};
|
|
16
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
39
|
+
exports.AppUtil = void 0;
|
|
40
|
+
const AppUtil = __importStar(require("./app.util"));
|
|
41
|
+
exports.AppUtil = AppUtil;
|
|
42
|
+
__exportStar(require("./app.util"), exports);
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|