law-common 10.0.1-beta.0 → 10.0.1-beta.1
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.
|
@@ -104,7 +104,7 @@ export type IBaseEntityApiResponse<T extends {
|
|
|
104
104
|
[K in EntityEnum]?: IBaseEntityApiResponse<EnumEntityType<K>>;
|
|
105
105
|
};
|
|
106
106
|
};
|
|
107
|
-
export type EnumEntityType<T extends EntityEnum> = (T extends EntityEnum.BILLING ? IBillingEntity : T extends EntityEnum.BILLING_TIMESHEET ? IBillingTimesheetEntity : T extends EntityEnum.TIMESHEET ? ITimesheetEntity : T extends EntityEnum.USER ? IUserEntity : T extends EntityEnum.PROJECT ? IProjectEntity : T extends EntityEnum.CLIENT ? IClientEntity : T extends EntityEnum.LEAVE ? ILeaveEntity : T extends EntityEnum.BANK ? IBankEntity : T extends EntityEnum.BANK_HISTORY ? IBankHistoryEntity : T extends EntityEnum.BILLING_PAYMENT ? IBillingPaymentEntity : T extends EntityEnum.BILLING_TRANSACTION ? IBillingTransactionEntity : T extends EntityEnum.CLIENT_AFFILIATE ? IClientAffiliateEntity : T extends EntityEnum.CONFIGURATION ?
|
|
107
|
+
export type EnumEntityType<T extends EntityEnum> = (T extends EntityEnum.BILLING ? IBillingEntity : T extends EntityEnum.BILLING_TIMESHEET ? IBillingTimesheetEntity : T extends EntityEnum.TIMESHEET ? ITimesheetEntity : T extends EntityEnum.USER ? IUserEntity : T extends EntityEnum.PROJECT ? IProjectEntity : T extends EntityEnum.CLIENT ? IClientEntity : T extends EntityEnum.LEAVE ? ILeaveEntity : T extends EntityEnum.BANK ? IBankEntity : T extends EntityEnum.BANK_HISTORY ? IBankHistoryEntity : T extends EntityEnum.BILLING_PAYMENT ? IBillingPaymentEntity : T extends EntityEnum.BILLING_TRANSACTION ? IBillingTransactionEntity : T extends EntityEnum.CLIENT_AFFILIATE ? IClientAffiliateEntity : T extends EntityEnum.CONFIGURATION ? IConfigurationEntity : T extends EntityEnum.HOLIDAY ? IHolidayEntity : T extends EntityEnum.HOLIDAY_LIST ? IHolidayListEntity : T extends EntityEnum.COUNTRY ? ICountryEntity : T extends EntityEnum.EXPENSE_TYPE ? IExpenseTypeEntity : T extends EntityEnum.INDUSTRY ? IIndustryEntity : T extends EntityEnum.INTERMEDIARY_BANK ? IIntermediaryBankEntity : T extends EntityEnum.OFFICE_LOCATION ? IOfficeLocationEntity : T extends EntityEnum.PERMISSION ? IPermissionEntity : T extends EntityEnum.ROLE ? IRoleEntity : T extends EntityEnum.TASK ? ITaskEntity : T extends EntityEnum.DESIGNATION ? IDesignationEntity : T extends EntityEnum.RATE ? IRateEntity : T extends EntityEnum.REIMBURSEMENT ? IReimbursementEntity : T extends EntityEnum.REIMBURSEMENT_EXPENSE ? IReimbursementExpenseEntity : T extends EntityEnum.WORK_FROM_HOME ? IWorkFromHomeEntity : T extends EntityEnum.ORGANIZATION ? IOrganizationEntity : T extends EntityEnum.PROJECT_USER_MAPPING ? IProjectUserMappingEntity : T extends EntityEnum.CLIENT_USER_MAPPING ? IClientUserMappingEntity : T extends EntityEnum.ROLE_PERMISSION_MAPPING ? IRolePermissionMappingEntity : never) & {
|
|
108
108
|
id: number;
|
|
109
109
|
};
|
|
110
110
|
export type EntityRelationConfig<T extends EntityEnum> = {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EntityEnum, EnumEntityType, IEntityFilterData } from "../entities";
|
|
2
|
+
import { DateCodeModel } from "./models/date-code.model.util";
|
|
2
3
|
export declare function groupByFunction<T, K>(list: T[], keyGetter: (input: T) => K): Map<K, T[]>;
|
|
3
4
|
export declare function groupByOneToOneFunction<T, K>(list: T[], keyGetter: (input: T) => K): Map<K, T>;
|
|
4
5
|
export declare function convertMapToObject<K, T>(map: Map<K, T>): {
|
|
@@ -167,3 +168,7 @@ export declare function numberToWordsIndian(numStr: string): string;
|
|
|
167
168
|
*/
|
|
168
169
|
export declare function minutesToHoursMinutes(totalMinutes: number): string;
|
|
169
170
|
export declare function createKeyLabelMap<Entity>(): Record<keyof Entity, string>;
|
|
171
|
+
export declare function getFinancialYearRange(dateCodeModel: DateCodeModel): {
|
|
172
|
+
startDate: string;
|
|
173
|
+
endDate: string;
|
|
174
|
+
};
|
|
@@ -30,7 +30,9 @@ exports.setResponseValue = setResponseValue;
|
|
|
30
30
|
exports.numberToWordsIndian = numberToWordsIndian;
|
|
31
31
|
exports.minutesToHoursMinutes = minutesToHoursMinutes;
|
|
32
32
|
exports.createKeyLabelMap = createKeyLabelMap;
|
|
33
|
+
exports.getFinancialYearRange = getFinancialYearRange;
|
|
33
34
|
const util_constants_1 = require("../constants/util.constants");
|
|
35
|
+
const date_code_model_util_1 = require("./models/date-code.model.util");
|
|
34
36
|
function groupByFunction(list, keyGetter) {
|
|
35
37
|
const map = new Map();
|
|
36
38
|
list.forEach((item) => {
|
|
@@ -367,3 +369,16 @@ function createKeyLabelMap() {
|
|
|
367
369
|
},
|
|
368
370
|
});
|
|
369
371
|
}
|
|
372
|
+
function getFinancialYearRange(dateCodeModel) {
|
|
373
|
+
const date = dateCodeModel.getDate();
|
|
374
|
+
const year = date.getFullYear();
|
|
375
|
+
const month = date.getMonth() + 1; // 1-based
|
|
376
|
+
const fyStartYear = month < 4 ? year - 1 : year;
|
|
377
|
+
const fyEndYear = month < 4 ? year : year + 1;
|
|
378
|
+
const start = new Date(fyStartYear, 3, 1); // April 1
|
|
379
|
+
const end = new Date(fyEndYear, 2, 31); // March 31
|
|
380
|
+
return {
|
|
381
|
+
startDate: date_code_model_util_1.DateCodeModel.fromDate(start),
|
|
382
|
+
endDate: date_code_model_util_1.DateCodeModel.fromDate(end),
|
|
383
|
+
};
|
|
384
|
+
}
|