law-common 10.57.0 → 10.57.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.
package/README.md CHANGED
@@ -1 +1 @@
1
- # law-common
1
+ # law-common
@@ -1,4 +1,5 @@
1
1
  import { BillingImpactEnum, BillingReimbursementExpenseChangedStatusEnum, BillingStatusEnum, IBillingEntity, IBillingTimesheetEntity, IEntityCreateDto, IProjectEntity, ITimesheetEntity, Nullable } from "../../entities";
2
+ import { IAppFileConfig } from "../../misc";
2
3
  export type IBillingCreateExclude = "paymentStatus" | "status" | "writeoffAmount" | "tdsAmount" | "totalAmountPaid" | "creditNoteAmount" | "refundAmount" | "invoicePdfUrl" | "startDate" | "endDate" | "invoiceNumber" | "draftInvoiceNumber";
3
4
  export interface IBillingCreateDto extends Omit<IEntityCreateDto<IBillingEntity>, IBillingCreateExclude | "particulars"> {
4
5
  timesheets?: IBillingTimesheetsDto;
@@ -55,3 +56,4 @@ export interface IBillingReimbursementExpenseCreateDtoDetails {
55
56
  changedStatus: BillingReimbursementExpenseChangedStatusEnum;
56
57
  amendmentPurpose: string;
57
58
  }
59
+ export declare const billingDocumentFileUploadConfig: IAppFileConfig[];
@@ -1,2 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.billingDocumentFileUploadConfig = void 0;
4
+ const entities_1 = require("../../entities");
5
+ exports.billingDocumentFileUploadConfig = [
6
+ {
7
+ name: "invoiceDocument",
8
+ size: entities_1.FileFormatEnum.defaultSize(entities_1.FileFormatEnum.PDF),
9
+ count: 1,
10
+ isRequired: false,
11
+ format: entities_1.FileFormatEnum.getAllowedMimeTypesFromFormats([entities_1.FileFormatEnum.JPEG, entities_1.FileFormatEnum.PDF]),
12
+ },
13
+ ];
@@ -25,7 +25,7 @@ export interface IBillingEntity extends IEntityAuditColumn {
25
25
  refundAmount: number;
26
26
  invoiceEntityId: number;
27
27
  invoiceEntityType: BillingInvoiceTypeEnum;
28
- invoicePdfUrl?: string | null;
28
+ invoiceDocument?: Nullable<string>;
29
29
  invoiceContactName: string;
30
30
  bankId: number;
31
31
  conversionRate?: number;
@@ -1,5 +1,7 @@
1
1
  import { IBillingFlowConfig } from "../../api";
2
2
  import { CurrencyEnum } from "../../enums";
3
+ import { IDtoValidationError, Result } from "../../misc";
4
+ import { DeleteDocumentDetails, DocumentFields } from "../../utils";
3
5
  import { BillingStatusCategoryEnum } from "../enums/billing-status-category.enum";
4
6
  import { BillingTypeEnum } from "../enums/billing-type.enum";
5
7
  import { BillingActionsEnum } from "../enums/billing.action.enum";
@@ -40,7 +42,7 @@ export declare class BillingEntityModel extends BaseEntityModel<EntityEnum.BILLI
40
42
  refundAmount: number;
41
43
  invoiceEntityId: number;
42
44
  invoiceEntityType: BillingInvoiceTypeEnum;
43
- invoicePdfUrl?: string | null;
45
+ invoiceDocument?: Nullable<string>;
44
46
  invoiceContactName: string;
45
47
  bankId: number;
46
48
  conversionRate?: number;
@@ -61,6 +63,8 @@ export declare class BillingEntityModel extends BaseEntityModel<EntityEnum.BILLI
61
63
  billingTimesheets?: BillingTimesheetEntityModel[];
62
64
  billingTransactions?: BillingTransactionEntityModel[];
63
65
  isProjectComplete?: boolean;
66
+ static readonly BILLING_ENTITY_DOCUMENT_TYPES: readonly ["invoice"];
67
+ static validateDocumentNoDocumentFile(data: DocumentFields<typeof BillingEntityModel.BILLING_ENTITY_DOCUMENT_TYPES>, deleteDetails?: DeleteDocumentDetails<typeof BillingEntityModel.BILLING_ENTITY_DOCUMENT_TYPES>): Result<void, IDtoValidationError[]>;
64
68
  get intermediaryBanks(): import("./intermediary-bank.entity.model").IntermediaryBankEntityModel[] | undefined;
65
69
  get summarryFolderName(): string;
66
70
  static relationConfigs: RelationConfigs<[
@@ -48,6 +48,9 @@ class BillingEntityModel extends base_entity_model_1.BaseEntityModel {
48
48
  this.updatedOn = 0;
49
49
  this.type = billing_type_enum_1.BillingTypeEnum.INVOICE;
50
50
  }
51
+ static validateDocumentNoDocumentFile(data, deleteDetails) {
52
+ return (0, utils_1.validateDocumentPairs)(BillingEntityModel.BILLING_ENTITY_DOCUMENT_TYPES, data, deleteDetails);
53
+ }
51
54
  get intermediaryBanks() {
52
55
  const thisBank = this.bank;
53
56
  if (thisBank)
@@ -394,6 +397,7 @@ class BillingEntityModel extends base_entity_model_1.BaseEntityModel {
394
397
  }
395
398
  }
396
399
  exports.BillingEntityModel = BillingEntityModel;
400
+ BillingEntityModel.BILLING_ENTITY_DOCUMENT_TYPES = ["invoice"];
397
401
  BillingEntityModel.relationConfigs = [
398
402
  {
399
403
  name: entity_utils_interface_1.EntityEnum.PROJECT,
package/package.json CHANGED
@@ -1,40 +1,40 @@
1
- {
2
- "name": "law-common",
3
- "version": "10.57.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
- },
21
- "keywords": [],
22
- "author": "",
23
- "license": "ISC",
24
- "devDependencies": {
25
- "@types/jest": "^29.5.13",
26
- "@types/lodash": "^4.17.21",
27
- "@types/node": "^22.6.1",
28
- "jest": "^29.7.0",
29
- "prettier": "3.8.1",
30
- "ts-jest": "^29.2.5",
31
- "ts-node": "^10.9.2",
32
- "typescript": "^5.6.2"
33
- },
34
- "dependencies": {
35
- "@types/express": "^5.0.0",
36
- "@types/multer": "^1.4.12",
37
- "date-fns": "^4.1.0",
38
- "lodash": "4.17.21"
39
- }
40
- }
1
+ {
2
+ "name": "law-common",
3
+ "version": "10.57.1-beta.1",
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
+ },
21
+ "keywords": [],
22
+ "author": "",
23
+ "license": "ISC",
24
+ "devDependencies": {
25
+ "@types/jest": "^29.5.13",
26
+ "@types/lodash": "^4.17.21",
27
+ "@types/node": "^22.6.1",
28
+ "jest": "^29.7.0",
29
+ "prettier": "3.8.1",
30
+ "ts-jest": "^29.2.5",
31
+ "ts-node": "^10.9.2",
32
+ "typescript": "^5.6.2"
33
+ },
34
+ "dependencies": {
35
+ "@types/express": "^5.0.0",
36
+ "@types/multer": "^1.4.12",
37
+ "date-fns": "^4.1.0",
38
+ "lodash": "4.17.21"
39
+ }
40
+ }