@kipicore/dbcore 1.1.613 → 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.
- package/dist/constants/app.d.ts +169 -0
- package/dist/constants/app.js +196 -2
- package/dist/constants/errorMessages.d.ts +48 -0
- package/dist/constants/errorMessages.js +57 -1
- package/dist/constants/successMessages.d.ts +48 -0
- package/dist/constants/successMessages.js +57 -1
- package/dist/db/psql/migrations/20260626000001-create_account_financial_years.d.ts +2 -0
- package/dist/db/psql/migrations/20260626000001-create_account_financial_years.js +68 -0
- package/dist/db/psql/migrations/20260626000002-create_account_period_locks.d.ts +2 -0
- package/dist/db/psql/migrations/20260626000002-create_account_period_locks.js +71 -0
- package/dist/db/psql/migrations/20260626000003-create_account_number_sequences.d.ts +2 -0
- package/dist/db/psql/migrations/20260626000003-create_account_number_sequences.js +66 -0
- package/dist/db/psql/migrations/20260626000004-create_account_groups.d.ts +2 -0
- package/dist/db/psql/migrations/20260626000004-create_account_groups.js +72 -0
- package/dist/db/psql/migrations/20260626000005-create_account_ledgers.d.ts +2 -0
- package/dist/db/psql/migrations/20260626000005-create_account_ledgers.js +84 -0
- package/dist/db/psql/migrations/20260626000006-create_account_ledger_openings.d.ts +2 -0
- package/dist/db/psql/migrations/20260626000006-create_account_ledger_openings.js +66 -0
- package/dist/db/psql/migrations/20260626000007-create_account_cost_centers.d.ts +2 -0
- package/dist/db/psql/migrations/20260626000007-create_account_cost_centers.js +73 -0
- package/dist/db/psql/migrations/20260626000008-create_account_voucher_types.d.ts +2 -0
- package/dist/db/psql/migrations/20260626000008-create_account_voucher_types.js +70 -0
- package/dist/interfaces/accountCostCenterInterface.d.ts +13 -0
- package/dist/interfaces/accountCostCenterInterface.js +2 -0
- package/dist/interfaces/accountFinancialYearInterface.d.ts +13 -0
- package/dist/interfaces/accountFinancialYearInterface.js +2 -0
- package/dist/interfaces/accountGroupInterface.d.ts +13 -0
- package/dist/interfaces/accountGroupInterface.js +2 -0
- package/dist/interfaces/accountLedgerInterface.d.ts +16 -0
- package/dist/interfaces/accountLedgerInterface.js +2 -0
- package/dist/interfaces/accountLedgerOpeningInterface.d.ts +12 -0
- package/dist/interfaces/accountLedgerOpeningInterface.js +2 -0
- package/dist/interfaces/accountNumberSequenceInterface.d.ts +11 -0
- package/dist/interfaces/accountNumberSequenceInterface.js +2 -0
- package/dist/interfaces/accountPeriodLockInterface.d.ts +11 -0
- package/dist/interfaces/accountPeriodLockInterface.js +2 -0
- package/dist/interfaces/accountVoucherTypeInterface.d.ts +12 -0
- package/dist/interfaces/accountVoucherTypeInterface.js +2 -0
- package/dist/interfaces/index.d.ts +10 -0
- package/dist/interfaces/index.js +10 -0
- package/dist/models/psql/accountCostCenterModel.d.ts +23 -0
- package/dist/models/psql/accountCostCenterModel.js +86 -0
- package/dist/models/psql/accountFinancialYearModel.d.ts +23 -0
- package/dist/models/psql/accountFinancialYearModel.js +81 -0
- package/dist/models/psql/accountGroupModel.d.ts +23 -0
- package/dist/models/psql/accountGroupModel.js +83 -0
- package/dist/models/psql/accountLedgerModel.d.ts +26 -0
- package/dist/models/psql/accountLedgerModel.js +98 -0
- package/dist/models/psql/accountLedgerOpeningModel.d.ts +22 -0
- package/dist/models/psql/accountLedgerOpeningModel.js +77 -0
- package/dist/models/psql/accountNumberSequenceModel.d.ts +21 -0
- package/dist/models/psql/accountNumberSequenceModel.js +74 -0
- package/dist/models/psql/accountPeriodLockModel.d.ts +21 -0
- package/dist/models/psql/accountPeriodLockModel.js +73 -0
- package/dist/models/psql/accountVoucherTypeModel.d.ts +22 -0
- package/dist/models/psql/accountVoucherTypeModel.js +69 -0
- package/dist/models/psql/index.d.ts +8 -0
- package/dist/models/psql/index.js +17 -1
- package/dist/types/accountCostCenterType.d.ts +3 -0
- package/dist/types/accountCostCenterType.js +2 -0
- package/dist/types/accountFinancialYearType.d.ts +3 -0
- package/dist/types/accountFinancialYearType.js +2 -0
- package/dist/types/accountGroupType.d.ts +3 -0
- package/dist/types/accountGroupType.js +2 -0
- package/dist/types/accountLedgerOpeningType.d.ts +3 -0
- package/dist/types/accountLedgerOpeningType.js +2 -0
- package/dist/types/accountLedgerType.d.ts +3 -0
- package/dist/types/accountLedgerType.js +2 -0
- package/dist/types/accountNumberSequenceType.d.ts +3 -0
- package/dist/types/accountNumberSequenceType.js +2 -0
- package/dist/types/accountPeriodLockType.d.ts +3 -0
- package/dist/types/accountPeriodLockType.js +2 -0
- package/dist/types/accountVoucherTypeType.d.ts +3 -0
- package/dist/types/accountVoucherTypeType.js +2 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.js +10 -0
- package/package.json +1 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/** @type {import('sequelize-cli').Migration} */
|
|
3
|
+
module.exports = {
|
|
4
|
+
async up(queryInterface, Sequelize) {
|
|
5
|
+
await queryInterface.createTable('account_voucher_types', {
|
|
6
|
+
id: {
|
|
7
|
+
type: Sequelize.UUID,
|
|
8
|
+
defaultValue: Sequelize.UUIDV4,
|
|
9
|
+
primaryKey: true,
|
|
10
|
+
allowNull: false,
|
|
11
|
+
},
|
|
12
|
+
institute_id: {
|
|
13
|
+
type: Sequelize.UUID,
|
|
14
|
+
allowNull: true,
|
|
15
|
+
},
|
|
16
|
+
academic_calendar_id: {
|
|
17
|
+
type: Sequelize.UUID,
|
|
18
|
+
allowNull: true,
|
|
19
|
+
},
|
|
20
|
+
code: {
|
|
21
|
+
type: Sequelize.STRING,
|
|
22
|
+
allowNull: true,
|
|
23
|
+
},
|
|
24
|
+
name: {
|
|
25
|
+
type: Sequelize.STRING,
|
|
26
|
+
allowNull: true,
|
|
27
|
+
},
|
|
28
|
+
prefix: {
|
|
29
|
+
type: Sequelize.STRING,
|
|
30
|
+
allowNull: true,
|
|
31
|
+
},
|
|
32
|
+
numbering_pattern: {
|
|
33
|
+
type: Sequelize.STRING,
|
|
34
|
+
allowNull: true,
|
|
35
|
+
},
|
|
36
|
+
requires_approval: {
|
|
37
|
+
type: Sequelize.BOOLEAN,
|
|
38
|
+
allowNull: true,
|
|
39
|
+
defaultValue: false,
|
|
40
|
+
},
|
|
41
|
+
created_by: {
|
|
42
|
+
type: Sequelize.UUID,
|
|
43
|
+
allowNull: true,
|
|
44
|
+
},
|
|
45
|
+
updated_by: {
|
|
46
|
+
type: Sequelize.UUID,
|
|
47
|
+
allowNull: true,
|
|
48
|
+
},
|
|
49
|
+
deleted_by: {
|
|
50
|
+
type: Sequelize.UUID,
|
|
51
|
+
allowNull: true,
|
|
52
|
+
},
|
|
53
|
+
created_at: {
|
|
54
|
+
allowNull: false,
|
|
55
|
+
type: Sequelize.DATE,
|
|
56
|
+
},
|
|
57
|
+
updated_at: {
|
|
58
|
+
allowNull: false,
|
|
59
|
+
type: Sequelize.DATE,
|
|
60
|
+
},
|
|
61
|
+
deleted_at: {
|
|
62
|
+
allowNull: true,
|
|
63
|
+
type: Sequelize.DATE,
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
async down(queryInterface, Sequelize) {
|
|
68
|
+
await queryInterface.dropTable('account_voucher_types');
|
|
69
|
+
}
|
|
70
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AccountCostCenterType } from '../constants/app';
|
|
2
|
+
import { IDefaultAttributes } from './commonInterface';
|
|
3
|
+
export interface IAccountCostCenterModelAttributes extends IDefaultAttributes {
|
|
4
|
+
id: string;
|
|
5
|
+
instituteId: string;
|
|
6
|
+
academicCalendarId: string;
|
|
7
|
+
parentCostCenterId: string | null;
|
|
8
|
+
code: string;
|
|
9
|
+
name: string;
|
|
10
|
+
type: AccountCostCenterType;
|
|
11
|
+
refType: string | null;
|
|
12
|
+
refId: string | null;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IDefaultAttributes } from './commonInterface';
|
|
2
|
+
import { COMMAN_STATUS } from '../constants/app';
|
|
3
|
+
export interface IAccountFinancialYearModelAttributes extends IDefaultAttributes {
|
|
4
|
+
id: string;
|
|
5
|
+
instituteId: string;
|
|
6
|
+
academicCalendarId: string;
|
|
7
|
+
name: string;
|
|
8
|
+
startDate: Date;
|
|
9
|
+
endDate: Date;
|
|
10
|
+
isActive: boolean;
|
|
11
|
+
isClosed: boolean;
|
|
12
|
+
status: COMMAN_STATUS;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AccountNature, AccountNormalBalance } from '../constants/app';
|
|
2
|
+
import { IDefaultAttributes } from './commonInterface';
|
|
3
|
+
export interface IAccountGroupModelAttributes extends IDefaultAttributes {
|
|
4
|
+
id: string;
|
|
5
|
+
instituteId: string;
|
|
6
|
+
academicCalendarId: string;
|
|
7
|
+
parentGroupId?: string | null;
|
|
8
|
+
groupCode: string;
|
|
9
|
+
groupName: string;
|
|
10
|
+
nature: AccountNature;
|
|
11
|
+
normalBalance: AccountNormalBalance;
|
|
12
|
+
isSystem: boolean;
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AccountLedgerType, AccountNormalBalance } from '../constants/app';
|
|
2
|
+
import { IDefaultAttributes } from './commonInterface';
|
|
3
|
+
export interface IAccountLedgerModelAttributes extends IDefaultAttributes {
|
|
4
|
+
id: string;
|
|
5
|
+
instituteId: string;
|
|
6
|
+
academicCalendarId: string;
|
|
7
|
+
groupId: string;
|
|
8
|
+
ledgerCode: string;
|
|
9
|
+
ledgerName: string;
|
|
10
|
+
ledgerType: AccountLedgerType;
|
|
11
|
+
normalBalance: AccountNormalBalance;
|
|
12
|
+
entityType?: string | null;
|
|
13
|
+
entityId?: string | null;
|
|
14
|
+
bankAccountId?: string | null;
|
|
15
|
+
allowManualPosting: boolean;
|
|
16
|
+
}
|
|
@@ -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,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,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,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
|
+
}
|
|
@@ -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';
|
package/dist/interfaces/index.js
CHANGED
|
@@ -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;
|