plac-micro-common 1.3.59 → 1.3.61
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/models/core/finance/exchange_rate_sync_log.entity.d.ts +10 -0
- package/dist/models/core/finance/exchange_rate_sync_log.entity.js +57 -0
- package/dist/models/core/finance/index.d.ts +3 -2
- package/dist/models/core/finance/index.js +4 -1
- package/dist/models/core/index.d.ts +1 -1
- package/dist/types/finance.type.d.ts +4 -0
- package/dist/types/finance.type.js +6 -1
- package/dist/utils/frontend/data.util.d.ts +3 -1
- package/dist/utils/frontend/data.util.js +30 -0
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ExchangeRateSourceType, ExchangeRateSyncStatus } from "../../../types";
|
|
2
|
+
import { _BaseEntity } from "../../_base_entity";
|
|
3
|
+
export declare class ExchangeRateSyncLogEntity extends _BaseEntity {
|
|
4
|
+
id: string;
|
|
5
|
+
source: ExchangeRateSourceType;
|
|
6
|
+
status: ExchangeRateSyncStatus;
|
|
7
|
+
synced_at: Date;
|
|
8
|
+
raw_response?: Record<string, any> | null;
|
|
9
|
+
error_message?: string | null;
|
|
10
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
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.ExchangeRateSyncLogEntity = 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
|
+
let ExchangeRateSyncLogEntity = class ExchangeRateSyncLogEntity extends _base_entity_1._BaseEntity {
|
|
18
|
+
};
|
|
19
|
+
exports.ExchangeRateSyncLogEntity = ExchangeRateSyncLogEntity;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], ExchangeRateSyncLogEntity.prototype, "id", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.Column)({
|
|
26
|
+
type: "varchar",
|
|
27
|
+
length: 20,
|
|
28
|
+
comment: (0, utils_1.enumToCommentString)(types_1.ExchangeRateSourceType),
|
|
29
|
+
}),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], ExchangeRateSyncLogEntity.prototype, "source", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({
|
|
34
|
+
type: "varchar",
|
|
35
|
+
length: 20,
|
|
36
|
+
comment: (0, utils_1.enumToCommentString)(types_1.ExchangeRateSyncStatus),
|
|
37
|
+
}),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], ExchangeRateSyncLogEntity.prototype, "status", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Column)({ type: "timestamptz" }),
|
|
42
|
+
__metadata("design:type", Date)
|
|
43
|
+
], ExchangeRateSyncLogEntity.prototype, "synced_at", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ type: "jsonb", nullable: true }),
|
|
46
|
+
__metadata("design:type", Object)
|
|
47
|
+
], ExchangeRateSyncLogEntity.prototype, "raw_response", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 1000, nullable: true }),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], ExchangeRateSyncLogEntity.prototype, "error_message", void 0);
|
|
52
|
+
exports.ExchangeRateSyncLogEntity = ExchangeRateSyncLogEntity = __decorate([
|
|
53
|
+
(0, typeorm_1.Entity)({ schema: "core", name: "exchange_rate_sync_logs" }),
|
|
54
|
+
(0, typeorm_1.Index)("ix_exchange_rate_sync_logs_source", ["source"]),
|
|
55
|
+
(0, typeorm_1.Index)("ix_exchange_rate_sync_logs_synced_at", ["synced_at"]),
|
|
56
|
+
(0, typeorm_1.Index)("ix_exchange_rate_sync_logs_status", ["status"])
|
|
57
|
+
], ExchangeRateSyncLogEntity);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ExchangeRateEntity } from "./exchange_rate.entity";
|
|
2
2
|
import { ExchangeRateLogEntity } from "./exchange_rate_log.entity";
|
|
3
|
-
|
|
4
|
-
export
|
|
3
|
+
import { ExchangeRateSyncLogEntity } from "./exchange_rate_sync_log.entity";
|
|
4
|
+
export declare const FINANCE_ENTITIES: readonly [typeof ExchangeRateEntity, typeof ExchangeRateLogEntity, typeof ExchangeRateSyncLogEntity];
|
|
5
|
+
export { ExchangeRateEntity, ExchangeRateLogEntity, ExchangeRateSyncLogEntity };
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ExchangeRateLogEntity = exports.ExchangeRateEntity = exports.FINANCE_ENTITIES = void 0;
|
|
3
|
+
exports.ExchangeRateSyncLogEntity = exports.ExchangeRateLogEntity = exports.ExchangeRateEntity = exports.FINANCE_ENTITIES = void 0;
|
|
4
4
|
const exchange_rate_entity_1 = require("./exchange_rate.entity");
|
|
5
5
|
Object.defineProperty(exports, "ExchangeRateEntity", { enumerable: true, get: function () { return exchange_rate_entity_1.ExchangeRateEntity; } });
|
|
6
6
|
const exchange_rate_log_entity_1 = require("./exchange_rate_log.entity");
|
|
7
7
|
Object.defineProperty(exports, "ExchangeRateLogEntity", { enumerable: true, get: function () { return exchange_rate_log_entity_1.ExchangeRateLogEntity; } });
|
|
8
|
+
const exchange_rate_sync_log_entity_1 = require("./exchange_rate_sync_log.entity");
|
|
9
|
+
Object.defineProperty(exports, "ExchangeRateSyncLogEntity", { enumerable: true, get: function () { return exchange_rate_sync_log_entity_1.ExchangeRateSyncLogEntity; } });
|
|
8
10
|
exports.FINANCE_ENTITIES = [
|
|
9
11
|
exchange_rate_entity_1.ExchangeRateEntity,
|
|
10
12
|
exchange_rate_log_entity_1.ExchangeRateLogEntity,
|
|
13
|
+
exchange_rate_sync_log_entity_1.ExchangeRateSyncLogEntity,
|
|
11
14
|
];
|
|
@@ -18,7 +18,7 @@ import { RelationshipEntity } from "./relationship.entity";
|
|
|
18
18
|
import { StaffEntity } from "./staffs.entity";
|
|
19
19
|
import { PaymentMethodEntity } from "./payment_method.entity";
|
|
20
20
|
import { OrgReferralEntity } from "./org_referral.entity";
|
|
21
|
-
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 OrgReferralEntity, typeof OccupationEntity, 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").ExchangeRateLogEntity];
|
|
21
|
+
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 OrgReferralEntity, typeof OccupationEntity, 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").ExchangeRateLogEntity, typeof import("./finance").ExchangeRateSyncLogEntity];
|
|
22
22
|
export { GeoProvinceEntity, GeoDistrictEntity, GeoCommuneEntity, GeoVillageEntity, MaritalStatusEntity, NationalityEntity, NumberSeriesEntity, OrganizationEntity, OrganizationBranchEntity, OrganizationChannelEntity, OrganizationDepartmentEntity, OrganizationPositionEntity, OrganizationStaffEntity, OrganizationStaffBranchEntity, OrganizationStaffReportingLineEntity, OrgReferralEntity, OccupationEntity, PaymentMethodEntity, RelationshipEntity, StaffEntity, };
|
|
23
23
|
export * from "./product";
|
|
24
24
|
export * from "./finance";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ExchangeRateSourceType = void 0;
|
|
3
|
+
exports.ExchangeRateSyncStatus = exports.ExchangeRateSourceType = void 0;
|
|
4
4
|
var ExchangeRateSourceType;
|
|
5
5
|
(function (ExchangeRateSourceType) {
|
|
6
6
|
ExchangeRateSourceType["Manual"] = "manual";
|
|
@@ -8,3 +8,8 @@ var ExchangeRateSourceType;
|
|
|
8
8
|
ExchangeRateSourceType["NationalBank"] = "national_bank";
|
|
9
9
|
ExchangeRateSourceType["System"] = "system";
|
|
10
10
|
})(ExchangeRateSourceType || (exports.ExchangeRateSourceType = ExchangeRateSourceType = {}));
|
|
11
|
+
var ExchangeRateSyncStatus;
|
|
12
|
+
(function (ExchangeRateSyncStatus) {
|
|
13
|
+
ExchangeRateSyncStatus["Success"] = "success";
|
|
14
|
+
ExchangeRateSyncStatus["Failed"] = "failed";
|
|
15
|
+
})(ExchangeRateSyncStatus || (exports.ExchangeRateSyncStatus = ExchangeRateSyncStatus = {}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AddressType, AppDocumentType, ApplicationActionType, AppPhLaRelation, ChannelType, ContactType, Gender, IdentifierType, OrgType } from "../../types";
|
|
1
|
+
import { AddressType, AppDocumentType, ApplicationActionType, AppPhLaRelation, ChannelType, ContactType, Gender, IdentifierType, OrgType, StaffStatus, StaffType } from "../../types";
|
|
2
2
|
export declare function getGenderDesc(val: Gender): "Male" | "Female";
|
|
3
3
|
export declare function getAppPhLaRelationDesc(val: AppPhLaRelation): "PH = LA" | "PH != LA";
|
|
4
4
|
export declare function getIdentifierTypeDesc(val: IdentifierType): "Other" | "National ID" | "Passport" | "Birth Certificate" | "Tax ID" | "Company Registration";
|
|
@@ -8,3 +8,5 @@ export declare function getAppDocumentTypeDesc(val: AppDocumentType): "Other" |
|
|
|
8
8
|
export declare function getAppActionTypeDesc(val: ApplicationActionType): ApplicationActionType.Created | ApplicationActionType.DraftSaved | ApplicationActionType.Completed | ApplicationActionType.EditCompleted | ApplicationActionType.TakenForReview | ApplicationActionType.Assigned | ApplicationActionType.Unassigned | ApplicationActionType.DocumentRemoved | ApplicationActionType.DataUpdated | "Submit" | "Re-Submit" | "Approve" | "Reject" | "Request Edit" | "Request More Documents" | "Cancel" | "Transfer" | "Add Note" | "Upload Document";
|
|
9
9
|
export declare function getOrgTypeDesc(val: OrgType): "Internal" | "Bank" | "Micro Finance" | "Agency" | "Broker";
|
|
10
10
|
export declare function getChannelTypeDesc(val: ChannelType): "Other" | "Bank" | "Agency" | "Broker" | "Direct" | "Online" | "Partner" | "Telesales";
|
|
11
|
+
export declare function getStaffTypeDesc(val: StaffType): "Other" | "Employee" | "Contractor" | "Intern";
|
|
12
|
+
export declare function getStaffStatusDesc(val: StaffStatus): "Active" | "Suspended" | "Resigned" | "Terminated";
|
|
@@ -9,6 +9,8 @@ exports.getAppDocumentTypeDesc = getAppDocumentTypeDesc;
|
|
|
9
9
|
exports.getAppActionTypeDesc = getAppActionTypeDesc;
|
|
10
10
|
exports.getOrgTypeDesc = getOrgTypeDesc;
|
|
11
11
|
exports.getChannelTypeDesc = getChannelTypeDesc;
|
|
12
|
+
exports.getStaffTypeDesc = getStaffTypeDesc;
|
|
13
|
+
exports.getStaffStatusDesc = getStaffStatusDesc;
|
|
12
14
|
const types_1 = require("../../types");
|
|
13
15
|
function getGenderDesc(val) {
|
|
14
16
|
switch (val) {
|
|
@@ -160,3 +162,31 @@ function getChannelTypeDesc(val) {
|
|
|
160
162
|
return val;
|
|
161
163
|
}
|
|
162
164
|
}
|
|
165
|
+
function getStaffTypeDesc(val) {
|
|
166
|
+
switch (val) {
|
|
167
|
+
case types_1.StaffType.Employee:
|
|
168
|
+
return "Employee";
|
|
169
|
+
case types_1.StaffType.Contractor:
|
|
170
|
+
return "Contractor";
|
|
171
|
+
case types_1.StaffType.Intern:
|
|
172
|
+
return "Intern";
|
|
173
|
+
case types_1.StaffType.Other:
|
|
174
|
+
return "Other";
|
|
175
|
+
default:
|
|
176
|
+
return val;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
function getStaffStatusDesc(val) {
|
|
180
|
+
switch (val) {
|
|
181
|
+
case types_1.StaffStatus.Active:
|
|
182
|
+
return "Active";
|
|
183
|
+
case types_1.StaffStatus.Suspended:
|
|
184
|
+
return "Suspended";
|
|
185
|
+
case types_1.StaffStatus.Resigned:
|
|
186
|
+
return "Resigned";
|
|
187
|
+
case types_1.StaffStatus.Terminated:
|
|
188
|
+
return "Terminated";
|
|
189
|
+
default:
|
|
190
|
+
return val;
|
|
191
|
+
}
|
|
192
|
+
}
|