law-common 10.73.1 → 10.75.0
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/entities/enums/configuration-key.enum.d.ts +8 -2
- package/dist/src/entities/enums/configuration-key.enum.js +7 -0
- package/dist/src/entities/enums/cron-jobs-name.enum.d.ts +2 -1
- package/dist/src/entities/enums/cron-jobs-name.enum.js +1 -0
- package/dist/src/entities/interface/configuration.entity.interface.d.ts +2 -1
- package/dist/src/entities/interface/project.entity.interface.d.ts +10 -2
- package/dist/src/entities/interface/project.entity.interface.js +8 -0
- package/dist/src/entities/model/client_quote.entity.model.d.ts +3 -2
- package/dist/src/entities/model/client_quote.entity.model.js +7 -1
- package/dist/src/entities/model/client_quote_rate.entity.model.d.ts +4 -2
- package/dist/src/entities/model/client_quote_rate.entity.model.js +12 -1
- package/dist/src/entities/model/project.entity.model.d.ts +8 -2
- package/dist/src/entities/model/project.entity.model.js +16 -0
- package/dist/src/utils/models/date-code.model.util.d.ts +4 -0
- package/dist/src/utils/models/date-code.model.util.js +13 -0
- package/package.json +41 -41
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
# law-common
|
|
1
|
+
# law-common
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { CronJobNames } from "./cron-jobs-name.enum";
|
|
2
2
|
export declare enum ConfigurationKeyEnum {
|
|
3
|
-
PENDING_APPROVAL_TIMESHEET_REMINDER = "pendingApprovalTimesheetReminder"
|
|
3
|
+
PENDING_APPROVAL_TIMESHEET_REMINDER = "pendingApprovalTimesheetReminder",
|
|
4
|
+
TIMESHEET_VIEW_RANGE = "timesheetViewRange",
|
|
5
|
+
TIMESHEET_VIEW_THRESHOLD = "timesheetViewThreshold",
|
|
6
|
+
TIMESHEET_THRESHOLD = "timesheetThreshold",
|
|
7
|
+
TIMESHEET_ENTER_THRESHOLD = "timesheetEnterThreshold",
|
|
8
|
+
ORGANIZATION_BILLING_OVERDUE_THRESHOLD = "organization_billing_overdue_threshold",
|
|
9
|
+
PROJECT_ENTITY_USAGE_NOTIFICATION_SENT_PERCENTAGE_RESET = "projectEntityUsageNotificationSentPercentageReset"
|
|
4
10
|
}
|
|
5
11
|
export declare namespace ConfigurationKeyEnum {
|
|
6
12
|
function IsCronJobConfigurationKey(key: ConfigurationKeyEnum): boolean;
|
|
7
|
-
function getCronJobName(configurationKey: ConfigurationKeyEnum): CronJobNames;
|
|
13
|
+
function getCronJobName(configurationKey: ConfigurationKeyEnum): CronJobNames | undefined;
|
|
8
14
|
}
|
|
@@ -5,6 +5,12 @@ const cron_jobs_name_enum_1 = require("./cron-jobs-name.enum");
|
|
|
5
5
|
var ConfigurationKeyEnum;
|
|
6
6
|
(function (ConfigurationKeyEnum) {
|
|
7
7
|
ConfigurationKeyEnum["PENDING_APPROVAL_TIMESHEET_REMINDER"] = "pendingApprovalTimesheetReminder";
|
|
8
|
+
ConfigurationKeyEnum["TIMESHEET_VIEW_RANGE"] = "timesheetViewRange";
|
|
9
|
+
ConfigurationKeyEnum["TIMESHEET_VIEW_THRESHOLD"] = "timesheetViewThreshold";
|
|
10
|
+
ConfigurationKeyEnum["TIMESHEET_THRESHOLD"] = "timesheetThreshold";
|
|
11
|
+
ConfigurationKeyEnum["TIMESHEET_ENTER_THRESHOLD"] = "timesheetEnterThreshold";
|
|
12
|
+
ConfigurationKeyEnum["ORGANIZATION_BILLING_OVERDUE_THRESHOLD"] = "organization_billing_overdue_threshold";
|
|
13
|
+
ConfigurationKeyEnum["PROJECT_ENTITY_USAGE_NOTIFICATION_SENT_PERCENTAGE_RESET"] = "projectEntityUsageNotificationSentPercentageReset";
|
|
8
14
|
})(ConfigurationKeyEnum || (exports.ConfigurationKeyEnum = ConfigurationKeyEnum = {}));
|
|
9
15
|
(function (ConfigurationKeyEnum) {
|
|
10
16
|
function IsCronJobConfigurationKey(key) {
|
|
@@ -16,6 +22,7 @@ var ConfigurationKeyEnum;
|
|
|
16
22
|
function getCronJobName(configurationKey) {
|
|
17
23
|
const cronJobConfigurationKeyMapping = {
|
|
18
24
|
[ConfigurationKeyEnum.PENDING_APPROVAL_TIMESHEET_REMINDER]: cron_jobs_name_enum_1.CronJobNames.PENDING_APPROVAL_TIMESHEET_REMINDER,
|
|
25
|
+
[ConfigurationKeyEnum.PROJECT_ENTITY_USAGE_NOTIFICATION_SENT_PERCENTAGE_RESET]: cron_jobs_name_enum_1.CronJobNames.PROJECT_ENTITY_USAGE_NOTIFICATION_SENT_PERCENTAGE_RESET,
|
|
19
26
|
};
|
|
20
27
|
return cronJobConfigurationKeyMapping[configurationKey];
|
|
21
28
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare enum CronJobNames {
|
|
2
|
-
PENDING_APPROVAL_TIMESHEET_REMINDER = "pending_approval_timesheet_reminder"
|
|
2
|
+
PENDING_APPROVAL_TIMESHEET_REMINDER = "pending_approval_timesheet_reminder",
|
|
3
|
+
PROJECT_ENTITY_USAGE_NOTIFICATION_SENT_PERCENTAGE_RESET = "project_entity_usage_notification_sent_percentage_reset"
|
|
3
4
|
}
|
|
@@ -4,4 +4,5 @@ exports.CronJobNames = void 0;
|
|
|
4
4
|
var CronJobNames;
|
|
5
5
|
(function (CronJobNames) {
|
|
6
6
|
CronJobNames["PENDING_APPROVAL_TIMESHEET_REMINDER"] = "pending_approval_timesheet_reminder";
|
|
7
|
+
CronJobNames["PROJECT_ENTITY_USAGE_NOTIFICATION_SENT_PERCENTAGE_RESET"] = "project_entity_usage_notification_sent_percentage_reset";
|
|
7
8
|
})(CronJobNames || (exports.CronJobNames = CronJobNames = {}));
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { ConfigurationKeyEnum } from "../enums/configuration-key.enum";
|
|
1
2
|
import { ConfigurationTypeEnum } from "../enums/configuration.type.enum";
|
|
2
3
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
3
4
|
import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
|
|
4
5
|
export interface IConfigurationEntity extends IEntityAuditColumn {
|
|
5
6
|
id: number;
|
|
6
|
-
key:
|
|
7
|
+
key: ConfigurationKeyEnum;
|
|
7
8
|
value: string;
|
|
8
9
|
organizationId: number;
|
|
9
10
|
label: string;
|
|
@@ -6,7 +6,7 @@ import { ProjectUserStatusEnum } from "../enums/project_user_status.enum";
|
|
|
6
6
|
import { UserRoleEnum } from "../enums/user.entity.enum";
|
|
7
7
|
import { IClientEntity } from "./client.entity.interface";
|
|
8
8
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
9
|
-
import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
|
|
9
|
+
import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto, Nullable } from "./entity.utils.interface";
|
|
10
10
|
import { IProjectRevenueSplitMappingEntity } from "./project-revenue-split-mapping.entity";
|
|
11
11
|
import { IUserEntity } from "./user.entity.interface";
|
|
12
12
|
export interface IProjectEntity extends IEntityAuditColumn {
|
|
@@ -25,6 +25,14 @@ export interface IProjectEntity extends IEntityAuditColumn {
|
|
|
25
25
|
billingOverdueDays?: number;
|
|
26
26
|
billToClientAffiliateId?: number | null;
|
|
27
27
|
revenueSplit: ProjectRevenueSplit;
|
|
28
|
+
usageNotificationSentPercentage?: Nullable<UsageNotificationThresholdEnum>;
|
|
29
|
+
clientQuoteId?: Nullable<number>;
|
|
30
|
+
}
|
|
31
|
+
export declare enum UsageNotificationThresholdEnum {
|
|
32
|
+
SEVENTY_FIVE = "75",
|
|
33
|
+
NINETY = "90",
|
|
34
|
+
NINETY_FIVE = "95",
|
|
35
|
+
ONE_HUNDRED = "100"
|
|
28
36
|
}
|
|
29
37
|
export interface IProjectUserDto {
|
|
30
38
|
id: number;
|
|
@@ -35,7 +43,7 @@ export interface IProjectEntityDependent {
|
|
|
35
43
|
users: IProjectUserDto[];
|
|
36
44
|
revenueSplitData: IProjectRevenueSplitData[];
|
|
37
45
|
}
|
|
38
|
-
export type IProjectExclude = "organizationId" | "billingRate";
|
|
46
|
+
export type IProjectExclude = "organizationId" | "billingRate" | "usageNotificationSentPercentage";
|
|
39
47
|
export interface IProjectExcludeT extends Pick<IProjectEntity, IProjectExclude> {
|
|
40
48
|
}
|
|
41
49
|
export interface IProjectHourlyRate {
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UsageNotificationThresholdEnum = void 0;
|
|
4
|
+
var UsageNotificationThresholdEnum;
|
|
5
|
+
(function (UsageNotificationThresholdEnum) {
|
|
6
|
+
UsageNotificationThresholdEnum["SEVENTY_FIVE"] = "75";
|
|
7
|
+
UsageNotificationThresholdEnum["NINETY"] = "90";
|
|
8
|
+
UsageNotificationThresholdEnum["NINETY_FIVE"] = "95";
|
|
9
|
+
UsageNotificationThresholdEnum["ONE_HUNDRED"] = "100";
|
|
10
|
+
})(UsageNotificationThresholdEnum || (exports.UsageNotificationThresholdEnum = UsageNotificationThresholdEnum = {}));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
2
|
-
import { BaseEntityModel } from "./base.entity.model";
|
|
3
2
|
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
4
|
-
import {
|
|
3
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
5
4
|
import { ClientQuoteCurrencyEnum } from "../enums/client_quote_currency_enum";
|
|
6
5
|
import { ClientQuoteStatusEnum } from "../enums/client_quote_status_enum";
|
|
6
|
+
import { IClientQuoteEntity } from "../interface/client_quote.entity.interface";
|
|
7
7
|
import { ClientQuoteRateEntityModel } from "./client_quote_rate.entity.model";
|
|
8
8
|
export declare class ClientQuoteEntityModel extends BaseEntityModel<EntityEnum.CLIENT_QUOTE> implements IClientQuoteEntity {
|
|
9
9
|
id: number;
|
|
@@ -26,4 +26,5 @@ export declare class ClientQuoteEntityModel extends BaseEntityModel<EntityEnum.C
|
|
|
26
26
|
static relationConfigs: RelationConfigs<[EntityEnum.CLIENT_QUOTE_RATE], EntityEnum.CLIENT_QUOTE>;
|
|
27
27
|
static fromEntity(entity: IClientQuoteEntity): ClientQuoteEntityModel;
|
|
28
28
|
getRelationConfigs(): any[];
|
|
29
|
+
get maxEstimatedHours(): number;
|
|
29
30
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ClientQuoteEntityModel = 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
|
|
7
|
+
const utils_1 = require("../../utils");
|
|
7
8
|
const client_quote_currency_enum_1 = require("../enums/client_quote_currency_enum");
|
|
8
9
|
const client_quote_status_enum_1 = require("../enums/client_quote_status_enum");
|
|
9
10
|
class ClientQuoteEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
@@ -33,6 +34,11 @@ class ClientQuoteEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
33
34
|
getRelationConfigs() {
|
|
34
35
|
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
35
36
|
}
|
|
37
|
+
get maxEstimatedHours() {
|
|
38
|
+
if (!this.clientQuoteRates)
|
|
39
|
+
return 0;
|
|
40
|
+
return (0, utils_1.sumNormalised)(this.clientQuoteRates, "maxHour");
|
|
41
|
+
}
|
|
36
42
|
}
|
|
37
43
|
exports.ClientQuoteEntityModel = ClientQuoteEntityModel;
|
|
38
44
|
ClientQuoteEntityModel.relationConfigs = [
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
2
|
-
import { BaseEntityModel } from "./base.entity.model";
|
|
3
2
|
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
3
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
4
4
|
import { IClientQuoteRateEntity } from "../interface/client_quote_rate.entity.interface";
|
|
5
|
+
import { ClientAffiliateEntityModel } from "./client-affiliate.entity.model";
|
|
5
6
|
export declare class ClientQuoteRateEntityModel extends BaseEntityModel<EntityEnum.CLIENT_QUOTE_RATE> implements IClientQuoteRateEntity {
|
|
6
7
|
id: number;
|
|
7
8
|
clientQuoteId: number;
|
|
@@ -19,7 +20,8 @@ export declare class ClientQuoteRateEntityModel extends BaseEntityModel<EntityEn
|
|
|
19
20
|
updatedOn: number;
|
|
20
21
|
createdBy: number;
|
|
21
22
|
updatedBy: number;
|
|
22
|
-
|
|
23
|
+
clientQuote?: ClientAffiliateEntityModel;
|
|
24
|
+
static relationConfigs: RelationConfigs<[EntityEnum.CLIENT_QUOTE], EntityEnum.CLIENT_QUOTE_RATE>;
|
|
23
25
|
static fromEntity(entity: IClientQuoteRateEntity): ClientQuoteRateEntityModel;
|
|
24
26
|
getRelationConfigs(): any[];
|
|
25
27
|
}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ClientQuoteRateEntityModel = void 0;
|
|
4
4
|
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
5
5
|
const base_entity_model_1 = require("./base.entity.model");
|
|
6
|
+
const relation_type_enum_1 = require("../enums/relation-type.enum");
|
|
6
7
|
class ClientQuoteRateEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
7
8
|
constructor() {
|
|
8
9
|
super(...arguments);
|
|
@@ -33,4 +34,14 @@ class ClientQuoteRateEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
exports.ClientQuoteRateEntityModel = ClientQuoteRateEntityModel;
|
|
36
|
-
ClientQuoteRateEntityModel.relationConfigs = [
|
|
37
|
+
ClientQuoteRateEntityModel.relationConfigs = [
|
|
38
|
+
{
|
|
39
|
+
name: entity_utils_interface_1.EntityEnum.CLIENT_QUOTE,
|
|
40
|
+
relation: relation_type_enum_1.RelationType.ONE,
|
|
41
|
+
key: "clientQuote",
|
|
42
|
+
mapKeyConfig: {
|
|
43
|
+
relationKey: "id",
|
|
44
|
+
key: "clientQuoteId",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CurrencyEnum } from "../../enums";
|
|
2
2
|
import { ProjectRevenueSplit } from "../enums/project-revenue-split.enum";
|
|
3
3
|
import { ProjectBillingTypeEnum, ProjectStatusEnum } from "../enums/project.entity.enum";
|
|
4
|
-
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
5
|
-
import { IProjectEntity, IProjectUserDto } from "../interface/project.entity.interface";
|
|
4
|
+
import { EntityEnum, Nullable } from "../interface/entity.utils.interface";
|
|
5
|
+
import { IProjectEntity, IProjectUserDto, UsageNotificationThresholdEnum } from "../interface/project.entity.interface";
|
|
6
6
|
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
7
7
|
import { BaseEntityModel } from "./base.entity.model";
|
|
8
8
|
import { ClientEntityModel } from "./client.entity.model";
|
|
@@ -27,6 +27,8 @@ export declare class ProjectEntityModel extends BaseEntityModel<EntityEnum.PROJE
|
|
|
27
27
|
updatedOn: number;
|
|
28
28
|
billToClientAffiliateId?: number | null;
|
|
29
29
|
revenueSplit: ProjectRevenueSplit;
|
|
30
|
+
usageNotificationSentPercentage?: Nullable<UsageNotificationThresholdEnum>;
|
|
31
|
+
clientQuoteId?: Nullable<number>;
|
|
30
32
|
users?: IProjectUserDto[];
|
|
31
33
|
billingOverdueDays?: number;
|
|
32
34
|
userMappings?: (UserEntityModel & ProjectUserMappingEntityModel)[];
|
|
@@ -37,4 +39,8 @@ export declare class ProjectEntityModel extends BaseEntityModel<EntityEnum.PROJE
|
|
|
37
39
|
populateUsers(users: UserEntityModel[], projectUserMapping: ProjectUserMappingEntityModel[]): void;
|
|
38
40
|
getRelationConfigs(): [import("../interface/relation-config.interface").IRelationConfig<EntityEnum.PROJECT_USER_MAPPING, EntityEnum.PROJECT>, import("../interface/relation-config.interface").IRelationConfig<EntityEnum.CLIENT, EntityEnum.PROJECT>];
|
|
39
41
|
isForeignCurrencyProjoect(): boolean;
|
|
42
|
+
get parsedBillingRate(): any;
|
|
43
|
+
isHourlyProject(): boolean;
|
|
44
|
+
isFixedProject(): boolean;
|
|
45
|
+
isAdhocProject(): boolean;
|
|
40
46
|
}
|
|
@@ -25,6 +25,8 @@ class ProjectEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
25
25
|
this.updatedOn = 0;
|
|
26
26
|
this.billToClientAffiliateId = null;
|
|
27
27
|
this.revenueSplit = project_revenue_split_enum_1.ProjectRevenueSplit.NO;
|
|
28
|
+
this.usageNotificationSentPercentage = null;
|
|
29
|
+
this.clientQuoteId = null;
|
|
28
30
|
this.users = [];
|
|
29
31
|
this.client = {};
|
|
30
32
|
}
|
|
@@ -49,6 +51,8 @@ class ProjectEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
49
51
|
result.billingOverdueDays = entity.billingOverdueDays;
|
|
50
52
|
result.billToClientAffiliateId = entity.billingOverdueDays;
|
|
51
53
|
result.revenueSplit = entity.revenueSplit;
|
|
54
|
+
result.usageNotificationSentPercentage = entity.usageNotificationSentPercentage;
|
|
55
|
+
result.clientQuoteId = result.clientQuoteId;
|
|
52
56
|
return result;
|
|
53
57
|
}
|
|
54
58
|
populateUsers(users, projectUserMapping) {
|
|
@@ -89,6 +93,18 @@ class ProjectEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
89
93
|
isForeignCurrencyProjoect() {
|
|
90
94
|
return this.currency !== enums_1.CurrencyEnum.INR;
|
|
91
95
|
}
|
|
96
|
+
get parsedBillingRate() {
|
|
97
|
+
return this.billingRate ? JSON.parse(this.billingRate) : null;
|
|
98
|
+
}
|
|
99
|
+
isHourlyProject() {
|
|
100
|
+
return this.billingType === project_entity_enum_1.ProjectBillingTypeEnum.HOURLY;
|
|
101
|
+
}
|
|
102
|
+
isFixedProject() {
|
|
103
|
+
return this.billingType === project_entity_enum_1.ProjectBillingTypeEnum.FIXED;
|
|
104
|
+
}
|
|
105
|
+
isAdhocProject() {
|
|
106
|
+
return this.billingType === project_entity_enum_1.ProjectBillingTypeEnum.ADHOC;
|
|
107
|
+
}
|
|
92
108
|
}
|
|
93
109
|
exports.ProjectEntityModel = ProjectEntityModel;
|
|
94
110
|
ProjectEntityModel.relationConfigs = [
|
|
@@ -25,6 +25,10 @@ export declare class DateCodeModel {
|
|
|
25
25
|
};
|
|
26
26
|
getRange(dateCodeModel: DateCodeModel): DateCodeModel[];
|
|
27
27
|
static diffInDays(startModel: DateCodeModel, endModel: DateCodeModel, excludeDays?: Weekday[], excludeDateCodes?: DateCodeModel[]): number;
|
|
28
|
+
getMonthStartDateCodeEndDateCodeIST(): {
|
|
29
|
+
startDate: DateCodeModel;
|
|
30
|
+
endDate: DateCodeModel;
|
|
31
|
+
};
|
|
28
32
|
static getByPredicates(models: DateCodeModel[], includePredicates: ((dateModel: DateCodeModel) => boolean)[], excludePredicates: ((dateModel: DateCodeModel) => boolean)[]): DateCodeModel[];
|
|
29
33
|
static getWeekdaysPredicate(weekdays: Weekday[]): (dateModel: DateCodeModel) => boolean;
|
|
30
34
|
static getDateCodesPredicate(dateCodes: DateCodeModel[]): (dateModel: DateCodeModel) => boolean;
|
|
@@ -103,6 +103,19 @@ class DateCodeModel {
|
|
|
103
103
|
const excludeDatePredicates = (dateModel) => !excludeDateCodes.some((d) => d.isSame(dateModel));
|
|
104
104
|
return dateRange.filter((dateModel) => excludeDayPredicates(dateModel) && excludeDatePredicates(dateModel)).length;
|
|
105
105
|
}
|
|
106
|
+
getMonthStartDateCodeEndDateCodeIST() {
|
|
107
|
+
const date = this.getDate();
|
|
108
|
+
// Convert to IST
|
|
109
|
+
const istDate = new Date(date.toLocaleString("en-US", { timeZone: "Asia/Kolkata" }));
|
|
110
|
+
const year = istDate.getFullYear();
|
|
111
|
+
const month = istDate.getMonth();
|
|
112
|
+
const startDate = new Date(year, month, 1);
|
|
113
|
+
const endDate = new Date(year, month + 1, 0);
|
|
114
|
+
return {
|
|
115
|
+
startDate: new DateCodeModel(DateCodeModel.fromDate(startDate)),
|
|
116
|
+
endDate: new DateCodeModel(DateCodeModel.fromDate(endDate)),
|
|
117
|
+
};
|
|
118
|
+
}
|
|
106
119
|
static getByPredicates(models, includePredicates, excludePredicates) {
|
|
107
120
|
return models.filter((model) => includePredicates.every((predicate) => predicate(model)) && excludePredicates.every((predicate) => !predicate(model)));
|
|
108
121
|
}
|
package/package.json
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "law-common",
|
|
3
|
-
"version": "10.
|
|
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.75.0",
|
|
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
|
+
}
|