@kipicore/dbcore 1.1.614 → 1.1.615

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.
Files changed (77) hide show
  1. package/dist/constants/app.d.ts +162 -0
  2. package/dist/constants/app.js +187 -1
  3. package/dist/constants/errorMessages.d.ts +48 -0
  4. package/dist/constants/errorMessages.js +57 -1
  5. package/dist/constants/successMessages.d.ts +48 -0
  6. package/dist/constants/successMessages.js +57 -1
  7. package/dist/db/psql/migrations/20260626000001-create_account_financial_years.d.ts +2 -0
  8. package/dist/db/psql/migrations/20260626000001-create_account_financial_years.js +68 -0
  9. package/dist/db/psql/migrations/20260626000002-create_account_period_locks.d.ts +2 -0
  10. package/dist/db/psql/migrations/20260626000002-create_account_period_locks.js +71 -0
  11. package/dist/db/psql/migrations/20260626000003-create_account_number_sequences.d.ts +2 -0
  12. package/dist/db/psql/migrations/20260626000003-create_account_number_sequences.js +66 -0
  13. package/dist/db/psql/migrations/20260626000004-create_account_groups.d.ts +2 -0
  14. package/dist/db/psql/migrations/20260626000004-create_account_groups.js +72 -0
  15. package/dist/db/psql/migrations/20260626000005-create_account_ledgers.d.ts +2 -0
  16. package/dist/db/psql/migrations/20260626000005-create_account_ledgers.js +84 -0
  17. package/dist/db/psql/migrations/20260626000006-create_account_ledger_openings.d.ts +2 -0
  18. package/dist/db/psql/migrations/20260626000006-create_account_ledger_openings.js +66 -0
  19. package/dist/db/psql/migrations/20260626000007-create_account_cost_centers.d.ts +2 -0
  20. package/dist/db/psql/migrations/20260626000007-create_account_cost_centers.js +73 -0
  21. package/dist/db/psql/migrations/20260626000008-create_account_voucher_types.d.ts +2 -0
  22. package/dist/db/psql/migrations/20260626000008-create_account_voucher_types.js +70 -0
  23. package/dist/interfaces/accountCostCenterInterface.d.ts +13 -0
  24. package/dist/interfaces/accountCostCenterInterface.js +2 -0
  25. package/dist/interfaces/accountFinancialYearInterface.d.ts +13 -0
  26. package/dist/interfaces/accountFinancialYearInterface.js +2 -0
  27. package/dist/interfaces/accountGroupInterface.d.ts +13 -0
  28. package/dist/interfaces/accountGroupInterface.js +2 -0
  29. package/dist/interfaces/accountLedgerInterface.d.ts +16 -0
  30. package/dist/interfaces/accountLedgerInterface.js +2 -0
  31. package/dist/interfaces/accountLedgerOpeningInterface.d.ts +12 -0
  32. package/dist/interfaces/accountLedgerOpeningInterface.js +2 -0
  33. package/dist/interfaces/accountNumberSequenceInterface.d.ts +11 -0
  34. package/dist/interfaces/accountNumberSequenceInterface.js +2 -0
  35. package/dist/interfaces/accountPeriodLockInterface.d.ts +11 -0
  36. package/dist/interfaces/accountPeriodLockInterface.js +2 -0
  37. package/dist/interfaces/accountVoucherTypeInterface.d.ts +12 -0
  38. package/dist/interfaces/accountVoucherTypeInterface.js +2 -0
  39. package/dist/interfaces/index.d.ts +10 -0
  40. package/dist/interfaces/index.js +10 -0
  41. package/dist/models/psql/accountCostCenterModel.d.ts +23 -0
  42. package/dist/models/psql/accountCostCenterModel.js +86 -0
  43. package/dist/models/psql/accountFinancialYearModel.d.ts +23 -0
  44. package/dist/models/psql/accountFinancialYearModel.js +81 -0
  45. package/dist/models/psql/accountGroupModel.d.ts +23 -0
  46. package/dist/models/psql/accountGroupModel.js +83 -0
  47. package/dist/models/psql/accountLedgerModel.d.ts +26 -0
  48. package/dist/models/psql/accountLedgerModel.js +98 -0
  49. package/dist/models/psql/accountLedgerOpeningModel.d.ts +22 -0
  50. package/dist/models/psql/accountLedgerOpeningModel.js +77 -0
  51. package/dist/models/psql/accountNumberSequenceModel.d.ts +21 -0
  52. package/dist/models/psql/accountNumberSequenceModel.js +74 -0
  53. package/dist/models/psql/accountPeriodLockModel.d.ts +21 -0
  54. package/dist/models/psql/accountPeriodLockModel.js +73 -0
  55. package/dist/models/psql/accountVoucherTypeModel.d.ts +22 -0
  56. package/dist/models/psql/accountVoucherTypeModel.js +69 -0
  57. package/dist/models/psql/index.d.ts +8 -0
  58. package/dist/models/psql/index.js +17 -1
  59. package/dist/types/accountCostCenterType.d.ts +3 -0
  60. package/dist/types/accountCostCenterType.js +2 -0
  61. package/dist/types/accountFinancialYearType.d.ts +3 -0
  62. package/dist/types/accountFinancialYearType.js +2 -0
  63. package/dist/types/accountGroupType.d.ts +3 -0
  64. package/dist/types/accountGroupType.js +2 -0
  65. package/dist/types/accountLedgerOpeningType.d.ts +3 -0
  66. package/dist/types/accountLedgerOpeningType.js +2 -0
  67. package/dist/types/accountLedgerType.d.ts +3 -0
  68. package/dist/types/accountLedgerType.js +2 -0
  69. package/dist/types/accountNumberSequenceType.d.ts +3 -0
  70. package/dist/types/accountNumberSequenceType.js +2 -0
  71. package/dist/types/accountPeriodLockType.d.ts +3 -0
  72. package/dist/types/accountPeriodLockType.js +2 -0
  73. package/dist/types/accountVoucherTypeType.d.ts +3 -0
  74. package/dist/types/accountVoucherTypeType.js +2 -0
  75. package/dist/types/index.d.ts +10 -0
  76. package/dist/types/index.js +10 -0
  77. package/package.json +1 -1
@@ -0,0 +1,12 @@
1
+ import { AccountBalanceType } from '../constants/app';
2
+ import { IDefaultAttributes } from './commonInterface';
3
+ export interface IAccountLedgerOpeningModelAttributes extends IDefaultAttributes {
4
+ id: string;
5
+ instituteId: string;
6
+ academicCalendarId: string;
7
+ ledgerId: string;
8
+ financialYearId: string;
9
+ openingBalance: number;
10
+ balanceType: AccountBalanceType;
11
+ openingDate: Date;
12
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import { IDefaultAttributes } from './commonInterface';
2
+ export interface IAccountNumberSequenceModelAttributes extends IDefaultAttributes {
3
+ id: string;
4
+ instituteId: string;
5
+ academicCalendarId: string;
6
+ financialYearId: string;
7
+ sequenceKey: string;
8
+ prefix: string;
9
+ currentNumber: number;
10
+ padding: number;
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import { IDefaultAttributes } from './commonInterface';
2
+ export interface IAccountPeriodLockModelAttributes extends IDefaultAttributes {
3
+ id: string;
4
+ instituteId: string;
5
+ academicCalendarId: string;
6
+ financialYearId: string;
7
+ periodStart: Date;
8
+ periodEnd: Date;
9
+ lockedBy: string;
10
+ reason: string;
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ import { AccountVoucherTypeCode } from '../constants/app';
2
+ import { IDefaultAttributes } from './commonInterface';
3
+ export interface IAccountVoucherTypeModelAttributes extends IDefaultAttributes {
4
+ id: string;
5
+ instituteId: string;
6
+ academicCalendarId: string;
7
+ code: AccountVoucherTypeCode;
8
+ name: string;
9
+ prefix: string | null;
10
+ numberingPattern: string | null;
11
+ requiresApproval: boolean;
12
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,6 @@
1
1
  export * from './academicCalendarInterface';
2
+ export * from './accountFinancialYearInterface';
3
+ export * from './accountPeriodLockInterface';
2
4
  export * from './accountHasReceiptDetailsInterface';
3
5
  export * from './announcementInterface';
4
6
  export * from './approvalRequestInterface';
@@ -241,3 +243,11 @@ export * from './rmsResourceDetailsInterface';
241
243
  export * from './userFinalResultInterface';
242
244
  export * from './refundInterface';
243
245
  export * from './kipiverseContactFormInterface';
246
+ export * from './accountFinancialYearInterface';
247
+ export * from './accountPeriodLockInterface';
248
+ export * from './accountNumberSequenceInterface';
249
+ export * from './accountGroupInterface';
250
+ export * from './accountLedgerInterface';
251
+ export * from './accountLedgerOpeningInterface';
252
+ export * from './accountCostCenterInterface';
253
+ export * from './accountVoucherTypeInterface';
@@ -15,6 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./academicCalendarInterface"), exports);
18
+ __exportStar(require("./accountFinancialYearInterface"), exports);
19
+ __exportStar(require("./accountPeriodLockInterface"), exports);
18
20
  __exportStar(require("./accountHasReceiptDetailsInterface"), exports);
19
21
  __exportStar(require("./announcementInterface"), exports);
20
22
  __exportStar(require("./approvalRequestInterface"), exports);
@@ -257,3 +259,11 @@ __exportStar(require("./rmsResourceDetailsInterface"), exports);
257
259
  __exportStar(require("./userFinalResultInterface"), exports);
258
260
  __exportStar(require("./refundInterface"), exports);
259
261
  __exportStar(require("./kipiverseContactFormInterface"), exports);
262
+ __exportStar(require("./accountFinancialYearInterface"), exports);
263
+ __exportStar(require("./accountPeriodLockInterface"), exports);
264
+ __exportStar(require("./accountNumberSequenceInterface"), exports);
265
+ __exportStar(require("./accountGroupInterface"), exports);
266
+ __exportStar(require("./accountLedgerInterface"), exports);
267
+ __exportStar(require("./accountLedgerOpeningInterface"), exports);
268
+ __exportStar(require("./accountCostCenterInterface"), exports);
269
+ __exportStar(require("./accountVoucherTypeInterface"), exports);
@@ -0,0 +1,23 @@
1
+ import { Model } from 'sequelize';
2
+ import { IAccountCostCenterModelAttributes } from '../../interfaces/accountCostCenterInterface';
3
+ import { TAccountCostCenterModelCreationAttributes } from '../../types/accountCostCenterType';
4
+ import { AccountCostCenterType } from '../../constants/app';
5
+ declare class AccountCostCenterModel extends Model<IAccountCostCenterModelAttributes, TAccountCostCenterModelCreationAttributes> implements IAccountCostCenterModelAttributes {
6
+ id: string;
7
+ instituteId: string;
8
+ academicCalendarId: string;
9
+ parentCostCenterId: string | null;
10
+ code: string;
11
+ name: string;
12
+ type: AccountCostCenterType;
13
+ refType: string | null;
14
+ refId: string | null;
15
+ createdBy?: string;
16
+ updatedBy?: string;
17
+ deletedBy?: string;
18
+ readonly createdAt: Date;
19
+ readonly updatedAt: Date;
20
+ readonly deletedAt?: Date;
21
+ static associate(models: any): void;
22
+ }
23
+ export default AccountCostCenterModel;
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sequelize_1 = require("sequelize");
4
+ const index_1 = require("./index");
5
+ class AccountCostCenterModel extends sequelize_1.Model {
6
+ static associate(models) {
7
+ const { InstituteModel, AcademicCalendarModel } = models;
8
+ AccountCostCenterModel.belongsTo(models.AccountCostCenterModel, {
9
+ foreignKey: 'parentCostCenterId',
10
+ as: 'parentCostCenter',
11
+ });
12
+ if (InstituteModel) {
13
+ AccountCostCenterModel.belongsTo(InstituteModel, { foreignKey: 'instituteId', as: 'institute' });
14
+ }
15
+ if (AcademicCalendarModel) {
16
+ AccountCostCenterModel.belongsTo(AcademicCalendarModel, { foreignKey: 'academicCalendarId', as: 'academicCalendar' });
17
+ }
18
+ const { UserModel } = models;
19
+ if (UserModel) {
20
+ AccountCostCenterModel.belongsTo(UserModel, {
21
+ foreignKey: { name: 'createdBy', allowNull: true, field: 'created_by' },
22
+ as: 'createdByUser',
23
+ });
24
+ AccountCostCenterModel.belongsTo(UserModel, {
25
+ foreignKey: { name: 'updatedBy', allowNull: true, field: 'updated_by' },
26
+ as: 'updatedByUser',
27
+ });
28
+ AccountCostCenterModel.belongsTo(UserModel, {
29
+ foreignKey: { name: 'deletedBy', allowNull: true, field: 'deleted_by' },
30
+ as: 'deletedByUser',
31
+ });
32
+ }
33
+ }
34
+ }
35
+ AccountCostCenterModel.init({
36
+ id: {
37
+ type: sequelize_1.DataTypes.UUID,
38
+ defaultValue: sequelize_1.DataTypes.UUIDV4,
39
+ primaryKey: true,
40
+ allowNull: false,
41
+ },
42
+ instituteId: {
43
+ type: sequelize_1.DataTypes.UUID,
44
+ allowNull: true,
45
+ field: 'institute_id',
46
+ },
47
+ academicCalendarId: {
48
+ type: sequelize_1.DataTypes.UUID,
49
+ allowNull: true,
50
+ field: 'academic_calendar_id',
51
+ },
52
+ parentCostCenterId: {
53
+ type: sequelize_1.DataTypes.UUID,
54
+ allowNull: true,
55
+ field: 'parent_cost_center_id',
56
+ },
57
+ code: {
58
+ type: sequelize_1.DataTypes.STRING,
59
+ allowNull: true,
60
+ },
61
+ name: {
62
+ type: sequelize_1.DataTypes.STRING,
63
+ allowNull: true,
64
+ },
65
+ type: {
66
+ type: sequelize_1.DataTypes.STRING,
67
+ allowNull: true,
68
+ },
69
+ refType: {
70
+ type: sequelize_1.DataTypes.STRING,
71
+ allowNull: true,
72
+ field: 'ref_type',
73
+ },
74
+ refId: {
75
+ type: sequelize_1.DataTypes.UUID,
76
+ allowNull: true,
77
+ field: 'ref_id',
78
+ },
79
+ }, {
80
+ sequelize: index_1.sequelize,
81
+ modelName: 'AccountCostCenterModel',
82
+ tableName: 'account_cost_centers',
83
+ timestamps: true,
84
+ paranoid: true,
85
+ });
86
+ exports.default = AccountCostCenterModel;
@@ -0,0 +1,23 @@
1
+ import { Model } from 'sequelize';
2
+ import { IAccountFinancialYearModelAttributes } from '../../interfaces/accountFinancialYearInterface';
3
+ import { TAccountFinancialYearModelCreationAttributes } from '../../types/accountFinancialYearType';
4
+ import { COMMAN_STATUS } from '../../constants/app';
5
+ declare class AccountFinancialYearModel extends Model<IAccountFinancialYearModelAttributes, TAccountFinancialYearModelCreationAttributes> {
6
+ id: string;
7
+ instituteId: string;
8
+ academicCalendarId: string;
9
+ name: string;
10
+ startDate: Date;
11
+ endDate: Date;
12
+ isActive: boolean;
13
+ isClosed: boolean;
14
+ status: COMMAN_STATUS;
15
+ createdBy?: string;
16
+ updatedBy?: string;
17
+ deletedBy?: string;
18
+ createdAt?: Date;
19
+ updatedAt?: Date;
20
+ deletedAt?: Date;
21
+ static associate(models: any): void;
22
+ }
23
+ export default AccountFinancialYearModel;
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sequelize_1 = require("sequelize");
4
+ const index_1 = require("./index");
5
+ const app_1 = require("../../constants/app");
6
+ class AccountFinancialYearModel extends sequelize_1.Model {
7
+ static associate(models) {
8
+ const { AccountPeriodLockModel, InstituteModel, AcademicCalendarModel } = models;
9
+ if (AccountPeriodLockModel) {
10
+ AccountFinancialYearModel.hasMany(AccountPeriodLockModel, { foreignKey: { name: 'financialYearId', field: 'financial_year_id' }, as: 'periodLocks' });
11
+ }
12
+ if (InstituteModel) {
13
+ AccountFinancialYearModel.belongsTo(InstituteModel, { foreignKey: 'instituteId', as: 'institute' });
14
+ }
15
+ if (AcademicCalendarModel) {
16
+ AccountFinancialYearModel.belongsTo(AcademicCalendarModel, { foreignKey: 'academicCalendarId', as: 'academicCalendar' });
17
+ }
18
+ const { UserModel } = models;
19
+ if (UserModel) {
20
+ AccountFinancialYearModel.belongsTo(UserModel, { foreignKey: { name: 'createdBy', allowNull: true, field: 'created_by' }, as: 'createdByUser' });
21
+ AccountFinancialYearModel.belongsTo(UserModel, { foreignKey: { name: 'updatedBy', allowNull: true, field: 'updated_by' }, as: 'updatedByUser' });
22
+ AccountFinancialYearModel.belongsTo(UserModel, { foreignKey: { name: 'deletedBy', allowNull: true, field: 'deleted_by' }, as: 'deletedByUser' });
23
+ }
24
+ }
25
+ }
26
+ AccountFinancialYearModel.init({
27
+ id: {
28
+ type: sequelize_1.DataTypes.UUID,
29
+ defaultValue: sequelize_1.DataTypes.UUIDV4,
30
+ primaryKey: true,
31
+ allowNull: false,
32
+ },
33
+ instituteId: {
34
+ type: sequelize_1.DataTypes.UUID,
35
+ allowNull: true,
36
+ field: 'institute_id',
37
+ },
38
+ academicCalendarId: {
39
+ type: sequelize_1.DataTypes.UUID,
40
+ allowNull: true,
41
+ field: 'academic_calendar_id',
42
+ },
43
+ name: {
44
+ type: sequelize_1.DataTypes.STRING(255),
45
+ allowNull: true,
46
+ },
47
+ startDate: {
48
+ type: sequelize_1.DataTypes.DATE,
49
+ allowNull: true,
50
+ field: 'start_date',
51
+ },
52
+ endDate: {
53
+ type: sequelize_1.DataTypes.DATE,
54
+ allowNull: true,
55
+ field: 'end_date',
56
+ },
57
+ isActive: {
58
+ type: sequelize_1.DataTypes.BOOLEAN,
59
+ allowNull: true,
60
+ defaultValue: true,
61
+ field: 'is_active',
62
+ },
63
+ isClosed: {
64
+ type: sequelize_1.DataTypes.BOOLEAN,
65
+ allowNull: true,
66
+ defaultValue: false,
67
+ field: 'is_closed',
68
+ },
69
+ status: {
70
+ type: sequelize_1.DataTypes.STRING(50),
71
+ allowNull: true,
72
+ defaultValue: app_1.COMMAN_STATUS.ACTIVE,
73
+ },
74
+ }, {
75
+ modelName: 'AccountFinancialYearModel',
76
+ tableName: 'account_financial_years',
77
+ timestamps: true,
78
+ paranoid: true,
79
+ sequelize: index_1.sequelize,
80
+ });
81
+ exports.default = AccountFinancialYearModel;
@@ -0,0 +1,23 @@
1
+ import { Model } from 'sequelize';
2
+ import { IAccountGroupModelAttributes } from '../../interfaces/accountGroupInterface';
3
+ import { TAccountGroupModelCreationAttributes } from '../../types/accountGroupType';
4
+ import { AccountNature, AccountNormalBalance } from '../../constants/app';
5
+ declare class AccountGroupModel extends Model<IAccountGroupModelAttributes, TAccountGroupModelCreationAttributes> {
6
+ id: string;
7
+ instituteId: string;
8
+ academicCalendarId: string;
9
+ parentGroupId: string | null;
10
+ groupCode: string;
11
+ groupName: string;
12
+ nature: AccountNature;
13
+ normalBalance: AccountNormalBalance;
14
+ isSystem: boolean;
15
+ createdBy?: string;
16
+ updatedBy?: string;
17
+ deletedBy?: string;
18
+ readonly createdAt: Date;
19
+ readonly updatedAt: Date;
20
+ readonly deletedAt?: Date;
21
+ static associate(models: any): void;
22
+ }
23
+ export default AccountGroupModel;
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sequelize_1 = require("sequelize");
4
+ const index_1 = require("./index");
5
+ class AccountGroupModel extends sequelize_1.Model {
6
+ static associate(models) {
7
+ const { AccountLedgerModel, InstituteModel, AcademicCalendarModel } = models;
8
+ AccountGroupModel.belongsTo(models.AccountGroupModel, {
9
+ foreignKey: 'parentGroupId',
10
+ as: 'parentGroup',
11
+ });
12
+ if (AccountLedgerModel) {
13
+ AccountGroupModel.hasMany(AccountLedgerModel, { foreignKey: 'groupId', as: 'ledgers' });
14
+ }
15
+ if (InstituteModel) {
16
+ AccountGroupModel.belongsTo(InstituteModel, { foreignKey: 'instituteId', as: 'institute' });
17
+ }
18
+ if (AcademicCalendarModel) {
19
+ AccountGroupModel.belongsTo(AcademicCalendarModel, { foreignKey: 'academicCalendarId', as: 'academicCalendar' });
20
+ }
21
+ const { UserModel } = models;
22
+ if (UserModel) {
23
+ AccountGroupModel.belongsTo(UserModel, { foreignKey: { name: 'createdBy', allowNull: true, field: 'created_by' }, as: 'createdByUser' });
24
+ AccountGroupModel.belongsTo(UserModel, { foreignKey: { name: 'updatedBy', allowNull: true, field: 'updated_by' }, as: 'updatedByUser' });
25
+ AccountGroupModel.belongsTo(UserModel, { foreignKey: { name: 'deletedBy', allowNull: true, field: 'deleted_by' }, as: 'deletedByUser' });
26
+ }
27
+ }
28
+ }
29
+ AccountGroupModel.init({
30
+ id: {
31
+ type: sequelize_1.DataTypes.UUID,
32
+ defaultValue: sequelize_1.DataTypes.UUIDV4,
33
+ primaryKey: true,
34
+ allowNull: false,
35
+ },
36
+ instituteId: {
37
+ type: sequelize_1.DataTypes.UUID,
38
+ allowNull: true,
39
+ field: 'institute_id',
40
+ },
41
+ academicCalendarId: {
42
+ type: sequelize_1.DataTypes.UUID,
43
+ allowNull: true,
44
+ field: 'academic_calendar_id',
45
+ },
46
+ parentGroupId: {
47
+ type: sequelize_1.DataTypes.UUID,
48
+ allowNull: true,
49
+ field: 'parent_group_id',
50
+ },
51
+ groupCode: {
52
+ type: sequelize_1.DataTypes.STRING,
53
+ allowNull: true,
54
+ field: 'group_code',
55
+ },
56
+ groupName: {
57
+ type: sequelize_1.DataTypes.STRING,
58
+ allowNull: true,
59
+ field: 'group_name',
60
+ },
61
+ nature: {
62
+ type: sequelize_1.DataTypes.STRING,
63
+ allowNull: true,
64
+ },
65
+ normalBalance: {
66
+ type: sequelize_1.DataTypes.STRING,
67
+ allowNull: true,
68
+ field: 'normal_balance',
69
+ },
70
+ isSystem: {
71
+ type: sequelize_1.DataTypes.BOOLEAN,
72
+ allowNull: true,
73
+ defaultValue: false,
74
+ field: 'is_system',
75
+ },
76
+ }, {
77
+ sequelize: index_1.sequelize,
78
+ modelName: 'AccountGroupModel',
79
+ tableName: 'account_groups',
80
+ timestamps: true,
81
+ paranoid: true,
82
+ });
83
+ exports.default = AccountGroupModel;
@@ -0,0 +1,26 @@
1
+ import { Model } from 'sequelize';
2
+ import { IAccountLedgerModelAttributes } from '../../interfaces/accountLedgerInterface';
3
+ import { TAccountLedgerModelCreationAttributes } from '../../types/accountLedgerType';
4
+ import { AccountLedgerType, AccountNormalBalance } from '../../constants/app';
5
+ declare class AccountLedgerModel extends Model<IAccountLedgerModelAttributes, TAccountLedgerModelCreationAttributes> implements IAccountLedgerModelAttributes {
6
+ id: string;
7
+ instituteId: string;
8
+ academicCalendarId: string;
9
+ groupId: string;
10
+ ledgerCode: string;
11
+ ledgerName: string;
12
+ ledgerType: AccountLedgerType;
13
+ normalBalance: AccountNormalBalance;
14
+ entityType?: string | null;
15
+ entityId?: string | null;
16
+ bankAccountId?: string | null;
17
+ allowManualPosting: boolean;
18
+ createdBy?: string;
19
+ updatedBy?: string;
20
+ deletedBy?: string;
21
+ readonly createdAt: Date;
22
+ readonly updatedAt: Date;
23
+ readonly deletedAt?: Date;
24
+ static associate(models: any): void;
25
+ }
26
+ export default AccountLedgerModel;
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sequelize_1 = require("sequelize");
4
+ const index_1 = require("./index");
5
+ class AccountLedgerModel extends sequelize_1.Model {
6
+ static associate(models) {
7
+ const { AccountGroupModel, AccountLedgerOpeningModel, InstituteModel, AcademicCalendarModel } = models;
8
+ if (AccountGroupModel) {
9
+ AccountLedgerModel.belongsTo(AccountGroupModel, { foreignKey: 'groupId', as: 'group' });
10
+ }
11
+ if (AccountLedgerOpeningModel) {
12
+ AccountLedgerModel.hasMany(AccountLedgerOpeningModel, { foreignKey: 'ledgerId', as: 'openings' });
13
+ }
14
+ if (InstituteModel) {
15
+ AccountLedgerModel.belongsTo(InstituteModel, { foreignKey: 'instituteId', as: 'institute' });
16
+ }
17
+ if (AcademicCalendarModel) {
18
+ AccountLedgerModel.belongsTo(AcademicCalendarModel, { foreignKey: 'academicCalendarId', as: 'academicCalendar' });
19
+ }
20
+ const { UserModel } = models;
21
+ if (UserModel) {
22
+ AccountLedgerModel.belongsTo(UserModel, { foreignKey: { name: 'createdBy', allowNull: true, field: 'created_by' }, as: 'createdByUser' });
23
+ AccountLedgerModel.belongsTo(UserModel, { foreignKey: { name: 'updatedBy', allowNull: true, field: 'updated_by' }, as: 'updatedByUser' });
24
+ AccountLedgerModel.belongsTo(UserModel, { foreignKey: { name: 'deletedBy', allowNull: true, field: 'deleted_by' }, as: 'deletedByUser' });
25
+ }
26
+ }
27
+ }
28
+ AccountLedgerModel.init({
29
+ id: {
30
+ type: sequelize_1.DataTypes.UUID,
31
+ defaultValue: sequelize_1.DataTypes.UUIDV4,
32
+ primaryKey: true,
33
+ allowNull: false,
34
+ },
35
+ instituteId: {
36
+ type: sequelize_1.DataTypes.UUID,
37
+ allowNull: true,
38
+ field: 'institute_id',
39
+ },
40
+ academicCalendarId: {
41
+ type: sequelize_1.DataTypes.UUID,
42
+ allowNull: true,
43
+ field: 'academic_calendar_id',
44
+ },
45
+ groupId: {
46
+ type: sequelize_1.DataTypes.UUID,
47
+ allowNull: true,
48
+ field: 'group_id',
49
+ },
50
+ ledgerCode: {
51
+ type: sequelize_1.DataTypes.STRING,
52
+ allowNull: true,
53
+ field: 'ledger_code',
54
+ },
55
+ ledgerName: {
56
+ type: sequelize_1.DataTypes.STRING,
57
+ allowNull: true,
58
+ field: 'ledger_name',
59
+ },
60
+ ledgerType: {
61
+ type: sequelize_1.DataTypes.STRING,
62
+ allowNull: true,
63
+ field: 'ledger_type',
64
+ },
65
+ normalBalance: {
66
+ type: sequelize_1.DataTypes.STRING,
67
+ allowNull: true,
68
+ field: 'normal_balance',
69
+ },
70
+ entityType: {
71
+ type: sequelize_1.DataTypes.STRING,
72
+ allowNull: true,
73
+ field: 'entity_type',
74
+ },
75
+ entityId: {
76
+ type: sequelize_1.DataTypes.UUID,
77
+ allowNull: true,
78
+ field: 'entity_id',
79
+ },
80
+ bankAccountId: {
81
+ type: sequelize_1.DataTypes.UUID,
82
+ allowNull: true,
83
+ field: 'bank_account_id',
84
+ },
85
+ allowManualPosting: {
86
+ type: sequelize_1.DataTypes.BOOLEAN,
87
+ allowNull: true,
88
+ defaultValue: true,
89
+ field: 'allow_manual_posting',
90
+ },
91
+ }, {
92
+ sequelize: index_1.sequelize,
93
+ modelName: 'AccountLedgerModel',
94
+ tableName: 'account_ledgers',
95
+ timestamps: true,
96
+ paranoid: true,
97
+ });
98
+ exports.default = AccountLedgerModel;
@@ -0,0 +1,22 @@
1
+ import { Model } from 'sequelize';
2
+ import { IAccountLedgerOpeningModelAttributes } from '../../interfaces/accountLedgerOpeningInterface';
3
+ import { TAccountLedgerOpeningModelCreationAttributes } from '../../types/accountLedgerOpeningType';
4
+ import { AccountBalanceType } from '../../constants/app';
5
+ declare class AccountLedgerOpeningModel extends Model<IAccountLedgerOpeningModelAttributes, TAccountLedgerOpeningModelCreationAttributes> implements IAccountLedgerOpeningModelAttributes {
6
+ id: string;
7
+ instituteId: string;
8
+ academicCalendarId: string;
9
+ ledgerId: string;
10
+ financialYearId: string;
11
+ openingBalance: number;
12
+ balanceType: AccountBalanceType;
13
+ openingDate: Date;
14
+ createdBy?: string;
15
+ updatedBy?: string;
16
+ deletedBy?: string;
17
+ readonly createdAt: Date;
18
+ readonly updatedAt: Date;
19
+ readonly deletedAt?: Date;
20
+ static associate(models: any): void;
21
+ }
22
+ export default AccountLedgerOpeningModel;
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sequelize_1 = require("sequelize");
4
+ const index_1 = require("./index");
5
+ class AccountLedgerOpeningModel extends sequelize_1.Model {
6
+ static associate(models) {
7
+ const { AccountLedgerModel, InstituteModel, AcademicCalendarModel, AccountFinancialYearModel } = models;
8
+ if (AccountLedgerModel) {
9
+ AccountLedgerOpeningModel.belongsTo(AccountLedgerModel, { foreignKey: 'ledgerId', as: 'ledger' });
10
+ }
11
+ if (InstituteModel) {
12
+ AccountLedgerOpeningModel.belongsTo(InstituteModel, { foreignKey: 'instituteId', as: 'institute' });
13
+ }
14
+ if (AcademicCalendarModel) {
15
+ AccountLedgerOpeningModel.belongsTo(AcademicCalendarModel, { foreignKey: 'academicCalendarId', as: 'academicCalendar' });
16
+ }
17
+ if (AccountFinancialYearModel) {
18
+ AccountLedgerOpeningModel.belongsTo(AccountFinancialYearModel, { foreignKey: 'financialYearId', as: 'financialYear' });
19
+ }
20
+ const { UserModel } = models;
21
+ if (UserModel) {
22
+ AccountLedgerOpeningModel.belongsTo(UserModel, { foreignKey: { name: 'createdBy', allowNull: true, field: 'created_by' }, as: 'createdByUser' });
23
+ AccountLedgerOpeningModel.belongsTo(UserModel, { foreignKey: { name: 'updatedBy', allowNull: true, field: 'updated_by' }, as: 'updatedByUser' });
24
+ AccountLedgerOpeningModel.belongsTo(UserModel, { foreignKey: { name: 'deletedBy', allowNull: true, field: 'deleted_by' }, as: 'deletedByUser' });
25
+ }
26
+ }
27
+ }
28
+ AccountLedgerOpeningModel.init({
29
+ id: {
30
+ type: sequelize_1.DataTypes.UUID,
31
+ defaultValue: sequelize_1.DataTypes.UUIDV4,
32
+ primaryKey: true,
33
+ allowNull: false,
34
+ },
35
+ instituteId: {
36
+ type: sequelize_1.DataTypes.UUID,
37
+ allowNull: true,
38
+ field: 'institute_id',
39
+ },
40
+ academicCalendarId: {
41
+ type: sequelize_1.DataTypes.UUID,
42
+ allowNull: true,
43
+ field: 'academic_calendar_id',
44
+ },
45
+ ledgerId: {
46
+ type: sequelize_1.DataTypes.UUID,
47
+ allowNull: true,
48
+ field: 'ledger_id',
49
+ },
50
+ financialYearId: {
51
+ type: sequelize_1.DataTypes.UUID,
52
+ allowNull: true,
53
+ field: 'financial_year_id',
54
+ },
55
+ openingBalance: {
56
+ type: sequelize_1.DataTypes.DECIMAL(15, 2),
57
+ allowNull: true,
58
+ field: 'opening_balance',
59
+ },
60
+ balanceType: {
61
+ type: sequelize_1.DataTypes.STRING,
62
+ allowNull: true,
63
+ field: 'balance_type',
64
+ },
65
+ openingDate: {
66
+ type: sequelize_1.DataTypes.DATE,
67
+ allowNull: true,
68
+ field: 'opening_date',
69
+ },
70
+ }, {
71
+ sequelize: index_1.sequelize,
72
+ modelName: 'AccountLedgerOpeningModel',
73
+ tableName: 'account_ledger_openings',
74
+ timestamps: true,
75
+ paranoid: true,
76
+ });
77
+ exports.default = AccountLedgerOpeningModel;