@mody-park-cha-raja/finance_common 4.31.0 → 4.32.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/dist/index.mjs CHANGED
@@ -411,6 +411,16 @@ var TransactionType = /* @__PURE__ */ ((TransactionType2) => {
411
411
  return TransactionType2;
412
412
  })(TransactionType || {});
413
413
 
414
+ // src/enums/vendor-bill-status.enum.ts
415
+ var VendorBillStatus = /* @__PURE__ */ ((VendorBillStatus2) => {
416
+ VendorBillStatus2["OPEN"] = "OPEN";
417
+ VendorBillStatus2["PARTIALLY_PAID"] = "PARTIALLY_PAID";
418
+ VendorBillStatus2["PAID"] = "PAID";
419
+ VendorBillStatus2["CLOSED"] = "CLOSED";
420
+ VendorBillStatus2["CANCELLED"] = "CANCELLED";
421
+ return VendorBillStatus2;
422
+ })(VendorBillStatus || {});
423
+
414
424
  // src/enums/vendor-type.enum.ts
415
425
  var VendorType = /* @__PURE__ */ ((VendorType2) => {
416
426
  VendorType2["SUPPLIER"] = "Supplier";
@@ -1177,6 +1187,14 @@ _ExpenseModel.relations = {
1177
1187
  ],
1178
1188
  searchProperty: "id",
1179
1189
  entity: "expense_head" /* EXPENSE_HEAD */
1190
+ },
1191
+ ["vendor_bill" /* VENDOR_BILL */]: {
1192
+ relationType: "ONE" /* ONE */,
1193
+ mappingProperties: [
1194
+ { sourceProperty: "vendorBillId", targetProperty: "vendorBill" }
1195
+ ],
1196
+ searchProperty: "id",
1197
+ entity: "vendor_bill" /* VENDOR_BILL */
1180
1198
  }
1181
1199
  };
1182
1200
  var ExpenseModel = _ExpenseModel;
@@ -1443,6 +1461,86 @@ _VendorModel.relations = {
1443
1461
  };
1444
1462
  var VendorModel = _VendorModel;
1445
1463
 
1464
+ // src/models/vendor-bill-history.entity.model.ts
1465
+ var _VendorBillHistoryModel = class _VendorBillHistoryModel extends BaseEntityModel {
1466
+ constructor() {
1467
+ super();
1468
+ this.id = 0;
1469
+ this.entityId = 0;
1470
+ this.data = "";
1471
+ this.operation = "CREATE" /* CREATE */;
1472
+ this.createdOn = 0;
1473
+ this.updatedOn = 0;
1474
+ this.createdBy = 0;
1475
+ this.updatedBy = 0;
1476
+ }
1477
+ static populateFromEntity(entity) {
1478
+ return Object.assign(new _VendorBillHistoryModel(), entity);
1479
+ }
1480
+ };
1481
+ _VendorBillHistoryModel.relations = {};
1482
+ var VendorBillHistoryModel = _VendorBillHistoryModel;
1483
+
1484
+ // src/models/vendor-bill.entity.model.ts
1485
+ var _VendorBillModel = class _VendorBillModel extends BaseEntityModel {
1486
+ constructor() {
1487
+ super();
1488
+ this.id = 0;
1489
+ this.vendorId = 0;
1490
+ this.expenseHeadId = 0;
1491
+ this.description = "";
1492
+ this.totalAmount = 0;
1493
+ this.balancePayable = 0;
1494
+ this.discountAmount = 0;
1495
+ this.billStatus = "OPEN" /* OPEN */;
1496
+ this.status = "Active" /* ACTIVE */;
1497
+ this.createdOn = 0;
1498
+ this.updatedOn = 0;
1499
+ this.createdBy = 0;
1500
+ this.updatedBy = 0;
1501
+ }
1502
+ static populateFromEntity(entity) {
1503
+ return Object.assign(new _VendorBillModel(), entity);
1504
+ }
1505
+ get totalAmountPaid() {
1506
+ return this.expenses?.reduce((total, expense) => total + expense.amount, 0);
1507
+ }
1508
+ };
1509
+ _VendorBillModel.relations = {
1510
+ ["user" /* USER */]: {
1511
+ relationType: "ONE" /* ONE */,
1512
+ mappingProperties: [
1513
+ { sourceProperty: "createdBy", targetProperty: "createdByUser" },
1514
+ { sourceProperty: "updatedBy", targetProperty: "updatedByUser" }
1515
+ ],
1516
+ searchProperty: "id",
1517
+ entity: "user" /* USER */
1518
+ },
1519
+ ["vendor" /* VENDOR */]: {
1520
+ relationType: "ONE" /* ONE */,
1521
+ mappingProperties: [
1522
+ { sourceProperty: "vendorId", targetProperty: "vendor" }
1523
+ ],
1524
+ searchProperty: "id",
1525
+ entity: "vendor" /* VENDOR */
1526
+ },
1527
+ ["expense_head" /* EXPENSE_HEAD */]: {
1528
+ relationType: "ONE" /* ONE */,
1529
+ mappingProperties: [
1530
+ { sourceProperty: "expenseHeadId", targetProperty: "expenseHead" }
1531
+ ],
1532
+ searchProperty: "id",
1533
+ entity: "expense_head" /* EXPENSE_HEAD */
1534
+ },
1535
+ ["expense" /* EXPENSE */]: {
1536
+ relationType: "MANY" /* MANY */,
1537
+ mappingProperties: [{ sourceProperty: "id", targetProperty: "expenses" }],
1538
+ searchProperty: "vendorBillId",
1539
+ entity: "expense" /* EXPENSE */
1540
+ }
1541
+ };
1542
+ var VendorBillModel = _VendorBillModel;
1543
+
1446
1544
  // src/models/configuration.entity.model.ts
1447
1545
  var ConfigurationModel = class _ConfigurationModel extends BaseEntityModel {
1448
1546
  constructor() {
@@ -1480,6 +1578,8 @@ var EntityList = /* @__PURE__ */ ((EntityList2) => {
1480
1578
  EntityList2["EXPENSE_HEAD_HISTORY"] = "expense_head_history";
1481
1579
  EntityList2["VENDOR"] = "vendor";
1482
1580
  EntityList2["VENDOR_HISTORY"] = "vendor_history";
1581
+ EntityList2["VENDOR_BILL"] = "vendor_bill";
1582
+ EntityList2["VENDOR_BILL_HISTORY"] = "vendor_bill_history";
1483
1583
  EntityList2["TRANSACTION"] = "transaction";
1484
1584
  EntityList2["TRANSACTION_HISTORY"] = "transaction_history";
1485
1585
  EntityList2["SPONSOR"] = "sponsor";
@@ -1502,6 +1602,8 @@ var entityListEntityModelMap = {
1502
1602
  ["expense_head_history" /* EXPENSE_HEAD_HISTORY */]: ExpenseHeadHistoryModel.populateFromEntity,
1503
1603
  ["vendor" /* VENDOR */]: VendorModel.populateFromEntity,
1504
1604
  ["vendor_history" /* VENDOR_HISTORY */]: VendorHistoryModel.populateFromEntity,
1605
+ ["vendor_bill" /* VENDOR_BILL */]: VendorBillModel.populateFromEntity,
1606
+ ["vendor_bill_history" /* VENDOR_BILL_HISTORY */]: VendorBillHistoryModel.populateFromEntity,
1505
1607
  ["transaction" /* TRANSACTION */]: TransactionModel.populateFromEntity,
1506
1608
  ["transaction_history" /* TRANSACTION_HISTORY */]: TransactionHistoryModel.populateFromEntity,
1507
1609
  ["sponsor" /* SPONSOR */]: SponsorModel.populateFromEntity,
@@ -2251,6 +2353,9 @@ export {
2251
2353
  UnauthorizedException,
2252
2354
  UserHistoryModel,
2253
2355
  UserModel,
2356
+ VendorBillHistoryModel,
2357
+ VendorBillModel,
2358
+ VendorBillStatus,
2254
2359
  VendorHistoryModel,
2255
2360
  VendorModel,
2256
2361
  VendorType,