law-common 10.72.2-beta.2 → 10.72.2
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/README.md +1 -1
- package/dist/src/api/interface/leave.api.d.ts +11 -2
- package/dist/src/api/interface/vendor.create.dto.interface.autocode.js +3 -12
- package/dist/src/api/interface/vendor.entity.response.d.ts +10 -4
- package/dist/src/entities/flow-configs/flow-config.type.d.ts +10 -10
- package/dist/src/entities/flow-configs/leave.flow.config.d.ts +1 -1
- package/dist/src/entities/flow-configs/vendor-flow.config.js +15 -15
- package/dist/src/entities/interface/entity.utils.interface.d.ts +2 -2
- package/dist/src/entities/interface/reimbursement.entity.interface.d.ts +3 -0
- package/dist/src/entities/model/leave.entity.model.js +1 -1
- package/dist/src/entities/model/organization_type.entity.model.d.ts +5 -21
- package/dist/src/entities/model/organization_type.entity.model.js +14 -113
- package/dist/src/entities/model/reimbursement.entity.model.d.ts +1 -0
- package/dist/src/entities/model/reimbursement.entity.model.js +1 -0
- package/dist/src/entities/model/tds_rate.entity.model.d.ts +3 -27
- package/dist/src/entities/model/tds_rate.entity.model.js +2 -114
- package/dist/src/entities/model/vendor.entity.model.d.ts +32 -44
- package/dist/src/entities/model/vendor.entity.model.js +53 -132
- package/dist/src/entities/model/vendor_invoice_item.entity.model.autocode.js +0 -40
- package/dist/src/entities/model/vendor_invoice_item.entity.model.d.ts +15 -24
- package/dist/src/entities/model/vendor_invoice_item.entity.model.js +5 -44
- package/dist/src/entities/model/voucher_type.entity.model.d.ts +5 -25
- package/dist/src/entities/model/voucher_type.entity.model.js +2 -102
- package/dist/src/utils/entity.flow.util.d.ts +40 -40
- package/package.json +41 -41
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VendorInvoiceItemEntityModel = void 0;
|
|
4
|
+
const relation_type_enum_1 = require("../enums/relation-type.enum");
|
|
4
5
|
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
5
6
|
const base_entity_model_1 = require("./base.entity.model");
|
|
6
|
-
const relation_type_enum_1 = require("../enums/relation-type.enum");
|
|
7
7
|
const vendor_pan_type_enum_1 = require("../enums/vendor_pan_type_enum");
|
|
8
8
|
class VendorInvoiceItemEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
9
9
|
constructor() {
|
|
@@ -20,13 +20,14 @@ class VendorInvoiceItemEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
20
20
|
this.netAmount = 0;
|
|
21
21
|
this.quantity = 0;
|
|
22
22
|
this.rate = 0;
|
|
23
|
+
// status: VendorInvoiceItemStatus = VendorInvoiceItemStatus.PENDING;
|
|
24
|
+
this.remark = null;
|
|
25
|
+
this.gstAmount = 0;
|
|
26
|
+
this.tdsAmount = 0;
|
|
23
27
|
this.createdOn = 0;
|
|
24
28
|
this.updatedOn = 0;
|
|
25
29
|
this.createdBy = 0;
|
|
26
30
|
this.updatedBy = 0;
|
|
27
|
-
this.remark = null;
|
|
28
|
-
this.gstAmount = 0;
|
|
29
|
-
this.tdsAmount = 0;
|
|
30
31
|
// getAvailableActions(
|
|
31
32
|
// currentUser: UserEntityModel,
|
|
32
33
|
// config?: {
|
|
@@ -64,46 +65,6 @@ class VendorInvoiceItemEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
64
65
|
getRelationConfigs() {
|
|
65
66
|
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
66
67
|
}
|
|
67
|
-
get vendor() {
|
|
68
|
-
// many_to_one -> many_to_one verified
|
|
69
|
-
// {'vendor_invoice_item->vendor_invoice': 'many_to_one', 'vendor_invoice->vendor': 'many_to_one'}
|
|
70
|
-
// ['vendor_invoice_item', 'vendor_invoice'] -> many_to_one
|
|
71
|
-
// ['vendor_invoice', 'vendor'] -> many_to_one
|
|
72
|
-
var _a;
|
|
73
|
-
return (_a = this.vendorInvoice) === null || _a === void 0 ? void 0 : _a.vendor;
|
|
74
|
-
}
|
|
75
|
-
get state() {
|
|
76
|
-
// many_to_one -> many_to_one verified
|
|
77
|
-
// {'vendor_invoice_item->vendor_invoice': 'many_to_one', 'vendor_invoice->vendor': 'many_to_one', 'vendor->state': 'many_to_one'}
|
|
78
|
-
// ['vendor_invoice', 'vendor'] -> many_to_one
|
|
79
|
-
// ['vendor', 'state'] -> many_to_one
|
|
80
|
-
var _a;
|
|
81
|
-
return (_a = this.vendor) === null || _a === void 0 ? void 0 : _a.stateModel;
|
|
82
|
-
}
|
|
83
|
-
get country() {
|
|
84
|
-
// many_to_one -> many_to_one verified
|
|
85
|
-
// {'vendor_invoice_item->vendor_invoice': 'many_to_one', 'vendor_invoice->vendor': 'many_to_one', 'vendor->country': 'many_to_one'}
|
|
86
|
-
// ['vendor_invoice', 'vendor'] -> many_to_one
|
|
87
|
-
// ['vendor', 'country'] -> many_to_one
|
|
88
|
-
throw new Error("Relation 'country' is not defined in VendorEntityModel. Please define the relation to access country from VendorInvoiceItemEntityModel.");
|
|
89
|
-
// return this.vendor?.country;
|
|
90
|
-
}
|
|
91
|
-
get organizationType() {
|
|
92
|
-
// many_to_one -> many_to_one verified
|
|
93
|
-
// {'vendor_invoice_item->vendor_invoice': 'many_to_one', 'vendor_invoice->vendor': 'many_to_one', 'vendor->organization_type': 'many_to_one'}
|
|
94
|
-
// ['vendor_invoice', 'vendor'] -> many_to_one
|
|
95
|
-
// ['vendor', 'organization_type'] -> many_to_one
|
|
96
|
-
var _a;
|
|
97
|
-
return (_a = this.vendor) === null || _a === void 0 ? void 0 : _a.organizationType;
|
|
98
|
-
}
|
|
99
|
-
get officeLocation() {
|
|
100
|
-
// many_to_one -> many_to_one verified
|
|
101
|
-
// {'vendor_invoice_item->vendor_invoice': 'many_to_one', 'vendor_invoice->office_location': 'many_to_one'}
|
|
102
|
-
// ['vendor_invoice_item', 'vendor_invoice'] -> many_to_one
|
|
103
|
-
// ['vendor_invoice', 'office_location'] -> many_to_one
|
|
104
|
-
var _a;
|
|
105
|
-
return (_a = this.vendorInvoice) === null || _a === void 0 ? void 0 : _a.officeLocation;
|
|
106
|
-
}
|
|
107
68
|
// getNextStatus(dto: IVendorInvoiceItemUpdateDto, currentUser: IUserEntity): VendorInvoiceItemStatus {
|
|
108
69
|
// // const flow = vendorInvoiceConfigFlow as FlowConfig<
|
|
109
70
|
// // VendorInvoiceActionStatusEnum,
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
+
import { VoucherTypeStatusEnum } from "../enums/voucher_type_status_enum";
|
|
1
2
|
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
2
|
-
import { BaseEntityModel } from "./base.entity.model";
|
|
3
3
|
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
4
4
|
import { IVoucherTypeEntity } from "../interface/voucher_type.entity.interface";
|
|
5
|
-
import {
|
|
6
|
-
import { TdsRateVoucherTypeMappingEntityModel } from "./tds_rate_voucher_type_mapping.entity.model";
|
|
7
|
-
import { TdsRateEntityModel } from "./tds_rate.entity.model";
|
|
5
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
8
6
|
import { ExpenseHeadEntityModel } from "./expense_head.entity.model";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { VendorEntityModel } from "./vendor.entity.model";
|
|
12
|
-
import { StateEntityModel } from "./state.entity.model";
|
|
13
|
-
import { CountryEntityModel } from "./country.entity.model";
|
|
14
|
-
import { VendorInvoiceEntityModel } from "./vendor_invoice.entity.model";
|
|
15
|
-
import { OfficeLocationEntityModel } from "./office_location.entity.model";
|
|
16
|
-
import { GstRateEntityModel } from "./gst_rate.entity.model";
|
|
7
|
+
import { TdsRateEntityModel } from "./tds_rate.entity.model";
|
|
8
|
+
import { TdsRateVoucherTypeMappingEntityModel } from "./tds_rate_voucher_type_mapping.entity.model";
|
|
17
9
|
export declare class VoucherTypeEntityModel extends BaseEntityModel<EntityEnum.VOUCHER_TYPE> implements IVoucherTypeEntity {
|
|
18
10
|
id: number;
|
|
19
11
|
name: string;
|
|
@@ -24,20 +16,8 @@ export declare class VoucherTypeEntityModel extends BaseEntityModel<EntityEnum.V
|
|
|
24
16
|
updatedBy: number;
|
|
25
17
|
tdsRateVoucherTypeMappings?: TdsRateVoucherTypeMappingEntityModel[];
|
|
26
18
|
expenseHeads?: ExpenseHeadEntityModel[];
|
|
27
|
-
|
|
28
|
-
static relationConfigs: RelationConfigs<[
|
|
29
|
-
EntityEnum.TDS_RATE_VOUCHER_TYPE_MAPPING,
|
|
30
|
-
EntityEnum.EXPENSE_HEAD,
|
|
31
|
-
EntityEnum.VENDOR_INVOICE_ITEM
|
|
32
|
-
], EntityEnum.VOUCHER_TYPE>;
|
|
19
|
+
static relationConfigs: RelationConfigs<[EntityEnum.TDS_RATE_VOUCHER_TYPE_MAPPING, EntityEnum.EXPENSE_HEAD], EntityEnum.VOUCHER_TYPE>;
|
|
33
20
|
static fromEntity(entity: IVoucherTypeEntity): VoucherTypeEntityModel;
|
|
34
21
|
getRelationConfigs(): any[];
|
|
35
22
|
get tdsRates(): TdsRateEntityModel[];
|
|
36
|
-
get organizationTypes(): OrganizationTypeEntityModel[] | undefined;
|
|
37
|
-
get vendors(): VendorEntityModel[] | undefined;
|
|
38
|
-
get states(): StateEntityModel[] | undefined;
|
|
39
|
-
get countrys(): CountryEntityModel[] | undefined;
|
|
40
|
-
get vendorInvoices(): VendorInvoiceEntityModel[] | undefined;
|
|
41
|
-
get officeLocations(): OfficeLocationEntityModel[] | undefined;
|
|
42
|
-
get gstRates(): GstRateEntityModel[] | undefined;
|
|
43
23
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VoucherTypeEntityModel = void 0;
|
|
4
|
-
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
5
|
-
const base_entity_model_1 = require("./base.entity.model");
|
|
6
4
|
const relation_type_enum_1 = require("../enums/relation-type.enum");
|
|
7
5
|
const voucher_type_status_enum_1 = require("../enums/voucher_type_status_enum");
|
|
6
|
+
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
7
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
8
8
|
class VoucherTypeEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
@@ -30,97 +30,6 @@ class VoucherTypeEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
30
30
|
}
|
|
31
31
|
return [];
|
|
32
32
|
}
|
|
33
|
-
get organizationTypes() {
|
|
34
|
-
// many_to_many -> many_to_many verified
|
|
35
|
-
// {'voucher_type->tds_rate': 'many_to_many', 'tds_rate->organization_type': 'many_to_many'}
|
|
36
|
-
// ['voucher_type', 'tds_rate'] -> many_to_many
|
|
37
|
-
// ['tds_rate', 'organization_type'] -> many_to_many
|
|
38
|
-
var _a;
|
|
39
|
-
return (_a = this.tdsRates) === null || _a === void 0 ? void 0 : _a.flatMap((tdsRate) => tdsRate.organizationTypes).filter((organizationType) => !!organizationType).reduce((accumulator, current) => {
|
|
40
|
-
if (!accumulator.some((organizationType) => organizationType.id === current.id)) {
|
|
41
|
-
accumulator.push(current);
|
|
42
|
-
}
|
|
43
|
-
return accumulator;
|
|
44
|
-
}, []);
|
|
45
|
-
}
|
|
46
|
-
get vendors() {
|
|
47
|
-
// many_to_many -> many_to_many verified
|
|
48
|
-
// {'voucher_type->tds_rate': 'many_to_many', 'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many'}
|
|
49
|
-
// ['tds_rate', 'organization_type'] -> many_to_many
|
|
50
|
-
// ['organization_type', 'vendor'] -> one_to_many
|
|
51
|
-
var _a;
|
|
52
|
-
return (_a = this.organizationTypes) === null || _a === void 0 ? void 0 : _a.flatMap((organizationType) => organizationType.vendors).filter((vendor) => !!vendor).reduce((accumulator, current) => {
|
|
53
|
-
if (!accumulator.some((vendor) => vendor.id === current.id)) {
|
|
54
|
-
accumulator.push(current);
|
|
55
|
-
}
|
|
56
|
-
return accumulator;
|
|
57
|
-
}, []);
|
|
58
|
-
}
|
|
59
|
-
get states() {
|
|
60
|
-
// many_to_many -> many_to_many verified
|
|
61
|
-
// {'voucher_type->tds_rate': 'many_to_many', 'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many', 'vendor->state': 'many_to_one'}
|
|
62
|
-
// ['organization_type', 'vendor'] -> one_to_many
|
|
63
|
-
// ['vendor', 'state'] -> many_to_one
|
|
64
|
-
var _a;
|
|
65
|
-
return (_a = this.vendors) === null || _a === void 0 ? void 0 : _a.flatMap((vendor) => vendor.stateModel).filter((state) => !!state).reduce((accumulator, current) => {
|
|
66
|
-
if (!accumulator.some((state) => state.id === current.id)) {
|
|
67
|
-
accumulator.push(current);
|
|
68
|
-
}
|
|
69
|
-
return accumulator;
|
|
70
|
-
}, []);
|
|
71
|
-
}
|
|
72
|
-
get countrys() {
|
|
73
|
-
// many_to_many -> many_to_many verified
|
|
74
|
-
// {'voucher_type->tds_rate': 'many_to_many', 'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many', 'vendor->country': 'many_to_one'}
|
|
75
|
-
// ['organization_type', 'vendor'] -> one_to_many
|
|
76
|
-
// ['vendor', 'country'] -> many_to_one
|
|
77
|
-
var _a;
|
|
78
|
-
return (_a = this.vendors) === null || _a === void 0 ? void 0 : _a.flatMap((vendor) => vendor.countryModel).filter((country) => !!country).reduce((accumulator, current) => {
|
|
79
|
-
if (!accumulator.some((country) => country.id === current.id)) {
|
|
80
|
-
accumulator.push(current);
|
|
81
|
-
}
|
|
82
|
-
return accumulator;
|
|
83
|
-
}, []);
|
|
84
|
-
}
|
|
85
|
-
get vendorInvoices() {
|
|
86
|
-
// one_to_many -> many_to_many mismatch
|
|
87
|
-
// {'voucher_type->tds_rate': 'many_to_many', 'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many', 'vendor->vendor_invoice': 'one_to_many'}
|
|
88
|
-
// ['organization_type', 'vendor'] -> one_to_many
|
|
89
|
-
// ['vendor', 'vendor_invoice'] -> one_to_many
|
|
90
|
-
var _a;
|
|
91
|
-
return (_a = this.vendors) === null || _a === void 0 ? void 0 : _a.flatMap((vendor) => vendor.vendorInvoices).filter((vendorInvoice) => !!vendorInvoice).reduce((accumulator, current) => {
|
|
92
|
-
if (!accumulator.some((vendorInvoice) => vendorInvoice.id === current.id)) {
|
|
93
|
-
accumulator.push(current);
|
|
94
|
-
}
|
|
95
|
-
return accumulator;
|
|
96
|
-
}, []);
|
|
97
|
-
}
|
|
98
|
-
get officeLocations() {
|
|
99
|
-
// many_to_many -> many_to_many verified
|
|
100
|
-
// {'voucher_type->tds_rate': 'many_to_many', 'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many', 'vendor->vendor_invoice': 'one_to_many', 'vendor_invoice->office_location': 'many_to_one'}
|
|
101
|
-
// ['vendor', 'vendor_invoice'] -> one_to_many
|
|
102
|
-
// ['vendor_invoice', 'office_location'] -> many_to_one
|
|
103
|
-
var _a;
|
|
104
|
-
return (_a = this.vendorInvoices) === null || _a === void 0 ? void 0 : _a.flatMap((vendorInvoice) => vendorInvoice.officeLocation).filter((officeLocation) => !!officeLocation).reduce((accumulator, current) => {
|
|
105
|
-
if (!accumulator.some((officeLocation) => officeLocation.id === current.id)) {
|
|
106
|
-
accumulator.push(current);
|
|
107
|
-
}
|
|
108
|
-
return accumulator;
|
|
109
|
-
}, []);
|
|
110
|
-
}
|
|
111
|
-
get gstRates() {
|
|
112
|
-
// many_to_many -> many_to_many verified
|
|
113
|
-
// {'voucher_type->vendor_invoice_item': 'one_to_many', 'vendor_invoice_item->gst_rate': 'many_to_one'}
|
|
114
|
-
// ['voucher_type', 'vendor_invoice_item'] -> one_to_many
|
|
115
|
-
// ['vendor_invoice_item', 'gst_rate'] -> many_to_one
|
|
116
|
-
var _a;
|
|
117
|
-
return (_a = this.vendorInvoiceItems) === null || _a === void 0 ? void 0 : _a.flatMap((vendorInvoiceItem) => vendorInvoiceItem.gstRate).filter((gstRate) => !!gstRate).reduce((accumulator, current) => {
|
|
118
|
-
if (!accumulator.some((gstRate) => gstRate.id === current.id)) {
|
|
119
|
-
accumulator.push(current);
|
|
120
|
-
}
|
|
121
|
-
return accumulator;
|
|
122
|
-
}, []);
|
|
123
|
-
}
|
|
124
33
|
}
|
|
125
34
|
exports.VoucherTypeEntityModel = VoucherTypeEntityModel;
|
|
126
35
|
VoucherTypeEntityModel.relationConfigs = [
|
|
@@ -142,13 +51,4 @@ VoucherTypeEntityModel.relationConfigs = [
|
|
|
142
51
|
key: "id",
|
|
143
52
|
},
|
|
144
53
|
},
|
|
145
|
-
{
|
|
146
|
-
name: entity_utils_interface_1.EntityEnum.VENDOR_INVOICE_ITEM,
|
|
147
|
-
relation: relation_type_enum_1.RelationType.MANY,
|
|
148
|
-
key: "vendorInvoiceItems",
|
|
149
|
-
mapKeyConfig: {
|
|
150
|
-
relationKey: "voucherTypeId",
|
|
151
|
-
key: "id",
|
|
152
|
-
},
|
|
153
|
-
},
|
|
154
54
|
];
|
|
@@ -30,7 +30,7 @@ export declare function getPermittedActionsOld<T extends LeaveStatusActionPair,
|
|
|
30
30
|
}, currentStatus: T["status"] | null, userPermissions: string[], combineActions?: T["action"][], actionLabels?: {
|
|
31
31
|
[key in T["action"]]?: string;
|
|
32
32
|
}, data?: (a: E) => {
|
|
33
|
-
[
|
|
33
|
+
[key: string]: () => boolean;
|
|
34
34
|
}): {
|
|
35
35
|
label: string;
|
|
36
36
|
value: T["action"] | string;
|
|
@@ -73,91 +73,91 @@ export declare function getPermittedActions<T extends LeaveStatusActionPair, E>(
|
|
|
73
73
|
}, currentStatus: T["status"] | null, userPermissions: string[], data?: (a: E) => {
|
|
74
74
|
[key: string]: () => boolean;
|
|
75
75
|
}): T["action"][];
|
|
76
|
-
export declare class EntityActionFlowResolver<E extends EntityEnum,
|
|
76
|
+
export declare class EntityActionFlowResolver<E extends EntityEnum, S extends string, A extends string> {
|
|
77
77
|
getPermittedActions(entityFlowConfig: {
|
|
78
|
-
[key in
|
|
78
|
+
[key in S]?: {
|
|
79
79
|
actions: {
|
|
80
|
-
[key in
|
|
80
|
+
[key in A]?: {
|
|
81
81
|
permissions: string[];
|
|
82
|
-
next: (
|
|
82
|
+
next: () => S;
|
|
83
83
|
};
|
|
84
84
|
};
|
|
85
85
|
};
|
|
86
|
-
}, currentStatus:
|
|
86
|
+
}, currentStatus: S | null, userPermissions: string[], data?: (a: E) => {
|
|
87
87
|
[key: string]: () => boolean;
|
|
88
|
-
}):
|
|
88
|
+
}): A[];
|
|
89
89
|
_getPermittedActions(actionConfig: {
|
|
90
|
-
[key in
|
|
90
|
+
[key in A]?: {
|
|
91
91
|
permissions: string[];
|
|
92
|
-
next: (
|
|
92
|
+
next: () => S;
|
|
93
93
|
};
|
|
94
94
|
}, userPermissions: string[], data: (a: E) => {
|
|
95
95
|
[key: string]: () => boolean;
|
|
96
|
-
}): (
|
|
97
|
-
combinePermittedActions(permittedActions: readonly
|
|
98
|
-
combineActions: readonly
|
|
96
|
+
}): (A | string)[];
|
|
97
|
+
combinePermittedActions(permittedActions: readonly A[], combinedActions?: Record<string, {
|
|
98
|
+
combineActions: readonly A[];
|
|
99
99
|
label: string;
|
|
100
|
-
}>): Map<
|
|
101
|
-
applyActionLabels(result: Map<
|
|
102
|
-
getAvailableActionsLabelValue(availableActionsFromModel: Map<
|
|
100
|
+
}>): Map<A | string, string>;
|
|
101
|
+
applyActionLabels(result: Map<A | string, string>, customLabels?: Partial<Record<A, string>>): Map<A | string, string>;
|
|
102
|
+
getAvailableActionsLabelValue(availableActionsFromModel: Map<A | string, string>): {
|
|
103
103
|
label: string;
|
|
104
104
|
value: string;
|
|
105
105
|
}[];
|
|
106
106
|
getAvailableActionsData(params: {
|
|
107
|
-
flowConfig: FlowConfig<
|
|
108
|
-
currentStatus:
|
|
107
|
+
flowConfig: FlowConfig<S, A>;
|
|
108
|
+
currentStatus: S | null;
|
|
109
109
|
userPermissions: string[];
|
|
110
110
|
visibilityData?: (e: E) => {
|
|
111
111
|
[key: string]: () => boolean;
|
|
112
112
|
};
|
|
113
113
|
combinedActions?: Record<string, {
|
|
114
|
-
combineActions: readonly
|
|
114
|
+
combineActions: readonly A[];
|
|
115
115
|
label: string;
|
|
116
116
|
}>;
|
|
117
|
-
customLabels?: Partial<Record<
|
|
117
|
+
customLabels?: Partial<Record<A, string>>;
|
|
118
118
|
}): IRowActions<E>[];
|
|
119
119
|
}
|
|
120
120
|
export declare class EntityActionFlowResolverV2 {
|
|
121
|
-
static getPermittedActions<E extends EntityEnum,
|
|
122
|
-
[key in
|
|
121
|
+
static getPermittedActions<E extends EntityEnum, S extends string, A extends string>(entityFlowConfig: {
|
|
122
|
+
[key in S]?: {
|
|
123
123
|
actions: {
|
|
124
|
-
[key in
|
|
124
|
+
[key in A]?: {
|
|
125
125
|
permissions: string[];
|
|
126
|
-
next: (
|
|
126
|
+
next: () => S;
|
|
127
127
|
};
|
|
128
128
|
};
|
|
129
129
|
};
|
|
130
|
-
}, currentStatus:
|
|
130
|
+
}, currentStatus: S | null, userPermissions: string[], data?: (a: E) => {
|
|
131
131
|
[key: string]: () => boolean;
|
|
132
|
-
}):
|
|
133
|
-
static _getPermittedActions<E extends EntityEnum,
|
|
134
|
-
[key in
|
|
132
|
+
}): A[];
|
|
133
|
+
static _getPermittedActions<E extends EntityEnum, S extends string, A extends string>(actionConfig: {
|
|
134
|
+
[key in A]?: {
|
|
135
135
|
permissions: string[];
|
|
136
|
-
next: (
|
|
136
|
+
next: () => S;
|
|
137
137
|
};
|
|
138
138
|
}, userPermissions: string[], data: (a: E) => {
|
|
139
|
-
[
|
|
140
|
-
}): (
|
|
141
|
-
static combinePermittedActions<
|
|
142
|
-
combineActions: readonly
|
|
139
|
+
[key: string]: () => boolean;
|
|
140
|
+
}): (A | string)[];
|
|
141
|
+
static combinePermittedActions<A extends string>(permittedActions: readonly A[], combinedActions?: Record<string, {
|
|
142
|
+
combineActions: readonly A[];
|
|
143
143
|
label: string;
|
|
144
|
-
}>): Map<
|
|
145
|
-
static applyActionLabels<
|
|
146
|
-
static getAvailableActionsLabelValue<
|
|
144
|
+
}>): Map<A | string, string>;
|
|
145
|
+
static applyActionLabels<A extends string>(result: Map<A | string, string>, customLabels?: Partial<Record<A, string>>): Map<A | string, string>;
|
|
146
|
+
static getAvailableActionsLabelValue<A extends string>(availableActionsFromModel: Map<A | string, string>): {
|
|
147
147
|
label: string;
|
|
148
148
|
value: string;
|
|
149
149
|
}[];
|
|
150
|
-
static getAvailableActionsData<E extends EntityEnum,
|
|
151
|
-
flowConfig: FlowConfig<
|
|
152
|
-
currentStatus:
|
|
150
|
+
static getAvailableActionsData<E extends EntityEnum, S extends string, A extends string>(params: {
|
|
151
|
+
flowConfig: FlowConfig<S, A>;
|
|
152
|
+
currentStatus: S | null;
|
|
153
153
|
userPermissions: string[];
|
|
154
154
|
visibilityData?: (e: E) => {
|
|
155
155
|
[key: string]: () => boolean;
|
|
156
156
|
};
|
|
157
157
|
combinedActions?: Record<string, {
|
|
158
|
-
combineActions: readonly
|
|
158
|
+
combineActions: readonly A[];
|
|
159
159
|
label: string;
|
|
160
160
|
}>;
|
|
161
|
-
customLabels?: Partial<Record<
|
|
161
|
+
customLabels?: Partial<Record<A, string>>;
|
|
162
162
|
}): IRowActions<E>[];
|
|
163
163
|
}
|
package/package.json
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "law-common",
|
|
3
|
-
"version": "10.72.2
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"files": [
|
|
7
|
-
"dist/**/*"
|
|
8
|
-
],
|
|
9
|
-
"scripts": {
|
|
10
|
-
"clean": "rm -rf dist",
|
|
11
|
-
"build": "npm run clean && tsc",
|
|
12
|
-
"publish:beta": "npm version prerelease --preid beta && git push && npm run build && npm publish --tag beta && npm run link",
|
|
13
|
-
"publish:patch": "npm version patch && git push && npm run build && npm publish",
|
|
14
|
-
"publish:minor": "npm version minor && git push && npm run build && npm publish",
|
|
15
|
-
"publish:major": "npm version major && git push && npm run build && npm publish",
|
|
16
|
-
"link": "npm run build && npm link",
|
|
17
|
-
"test": "jest",
|
|
18
|
-
"format": "prettier --write .",
|
|
19
|
-
"check-format": "prettier --check .",
|
|
20
|
-
"pull:link": "git pull && npm run link"
|
|
21
|
-
},
|
|
22
|
-
"keywords": [],
|
|
23
|
-
"author": "",
|
|
24
|
-
"license": "ISC",
|
|
25
|
-
"devDependencies": {
|
|
26
|
-
"@types/jest": "^29.5.13",
|
|
27
|
-
"@types/lodash": "^4.17.21",
|
|
28
|
-
"@types/node": "^22.6.1",
|
|
29
|
-
"jest": "^29.7.0",
|
|
30
|
-
"prettier": "3.8.1",
|
|
31
|
-
"ts-jest": "^29.2.5",
|
|
32
|
-
"ts-node": "^10.9.2",
|
|
33
|
-
"typescript": "^5.6.2"
|
|
34
|
-
},
|
|
35
|
-
"dependencies": {
|
|
36
|
-
"@types/express": "^5.0.0",
|
|
37
|
-
"@types/multer": "^1.4.12",
|
|
38
|
-
"date-fns": "^4.1.0",
|
|
39
|
-
"lodash": "4.17.21"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "law-common",
|
|
3
|
+
"version": "10.72.2",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist/**/*"
|
|
8
|
+
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"clean": "rm -rf dist",
|
|
11
|
+
"build": "npm run clean && tsc",
|
|
12
|
+
"publish:beta": "npm version prerelease --preid beta && git push && npm run build && npm publish --tag beta && npm run link",
|
|
13
|
+
"publish:patch": "npm version patch && git push && npm run build && npm publish",
|
|
14
|
+
"publish:minor": "npm version minor && git push && npm run build && npm publish",
|
|
15
|
+
"publish:major": "npm version major && git push && npm run build && npm publish",
|
|
16
|
+
"link": "npm run build && npm link",
|
|
17
|
+
"test": "jest",
|
|
18
|
+
"format": "prettier --write .",
|
|
19
|
+
"check-format": "prettier --check .",
|
|
20
|
+
"pull:link": "git pull && npm run link"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [],
|
|
23
|
+
"author": "",
|
|
24
|
+
"license": "ISC",
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@types/jest": "^29.5.13",
|
|
27
|
+
"@types/lodash": "^4.17.21",
|
|
28
|
+
"@types/node": "^22.6.1",
|
|
29
|
+
"jest": "^29.7.0",
|
|
30
|
+
"prettier": "3.8.1",
|
|
31
|
+
"ts-jest": "^29.2.5",
|
|
32
|
+
"ts-node": "^10.9.2",
|
|
33
|
+
"typescript": "^5.6.2"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@types/express": "^5.0.0",
|
|
37
|
+
"@types/multer": "^1.4.12",
|
|
38
|
+
"date-fns": "^4.1.0",
|
|
39
|
+
"lodash": "4.17.21"
|
|
40
|
+
}
|
|
41
|
+
}
|