@kipicore/dbcore 1.1.651 → 1.1.652
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 +2 -1
- package/dist/constants/app.js +1 -0
- package/dist/db/psql/migrations/20260717095051-add_status_to_users.d.ts +2 -0
- package/dist/db/psql/migrations/20260717095051-add_status_to_users.js +19 -0
- package/dist/interfaces/userInterface.d.ts +2 -1
- package/dist/models/psql/userModel.d.ts +2 -1
- package/dist/models/psql/userModel.js +1 -0
- package/package.json +1 -1
package/dist/constants/app.d.ts
CHANGED
|
@@ -27,7 +27,8 @@ export declare enum PDF_MICRO_SERVICE_END_POINT {
|
|
|
27
27
|
export declare enum USER_STATUS {
|
|
28
28
|
OTP_VERIFICATION_PENDING = "OTP_VERIFICATION_PENDING",
|
|
29
29
|
ACTIVE = "ACTIVE",
|
|
30
|
-
INACTIVE = "INACTIVE"
|
|
30
|
+
INACTIVE = "INACTIVE",
|
|
31
|
+
BLOCKED = "BLOCKED"
|
|
31
32
|
}
|
|
32
33
|
export declare enum INVENTORY_TYPE {
|
|
33
34
|
INVENTORY = "INVENTORY",
|
package/dist/constants/app.js
CHANGED
|
@@ -41,6 +41,7 @@ var USER_STATUS;
|
|
|
41
41
|
USER_STATUS["OTP_VERIFICATION_PENDING"] = "OTP_VERIFICATION_PENDING";
|
|
42
42
|
USER_STATUS["ACTIVE"] = "ACTIVE";
|
|
43
43
|
USER_STATUS["INACTIVE"] = "INACTIVE";
|
|
44
|
+
USER_STATUS["BLOCKED"] = "BLOCKED";
|
|
44
45
|
})(USER_STATUS || (exports.USER_STATUS = USER_STATUS = {}));
|
|
45
46
|
var INVENTORY_TYPE;
|
|
46
47
|
(function (INVENTORY_TYPE) {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
module.exports = {
|
|
3
|
+
up: async (queryInterface, Sequelize) => {
|
|
4
|
+
const table = await queryInterface.describeTable('users');
|
|
5
|
+
if (!table.status) {
|
|
6
|
+
await queryInterface.addColumn('users', 'status', {
|
|
7
|
+
type: Sequelize.STRING,
|
|
8
|
+
allowNull: true,
|
|
9
|
+
defaultValue: 'ACTIVE',
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
down: async (queryInterface, Sequelize) => {
|
|
14
|
+
const table = await queryInterface.describeTable('users');
|
|
15
|
+
if (table.status) {
|
|
16
|
+
await queryInterface.removeColumn('users', 'status');
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { APP_TYPE, EMAIL_VERIFICATION, MOBILE_VERIFICATION, USER_TYPES } from '../constants/app';
|
|
1
|
+
import { APP_TYPE, EMAIL_VERIFICATION, MOBILE_VERIFICATION, USER_STATUS, USER_TYPES } from '../constants/app';
|
|
2
2
|
import { IDefaultAttributes } from './commonInterface';
|
|
3
3
|
export interface IUserAttributes extends IDefaultAttributes {
|
|
4
4
|
id: string;
|
|
@@ -42,4 +42,5 @@ export interface IUserAttributes extends IDefaultAttributes {
|
|
|
42
42
|
district?: string;
|
|
43
43
|
area?: string;
|
|
44
44
|
taluka?: string;
|
|
45
|
+
status?: USER_STATUS;
|
|
45
46
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Model } from 'sequelize';
|
|
2
|
-
import { APP_TYPE, EMAIL_VERIFICATION, MOBILE_VERIFICATION, USER_TYPES } from '../../constants/app';
|
|
2
|
+
import { APP_TYPE, EMAIL_VERIFICATION, MOBILE_VERIFICATION, USER_STATUS, USER_TYPES } from '../../constants/app';
|
|
3
3
|
import { IUserAttributes } from '../../interfaces/userInterface';
|
|
4
4
|
import { TUserCreationAttributes } from '../../types/userType';
|
|
5
5
|
declare class UserModel extends Model<IUserAttributes, TUserCreationAttributes> implements IUserAttributes {
|
|
@@ -44,6 +44,7 @@ declare class UserModel extends Model<IUserAttributes, TUserCreationAttributes>
|
|
|
44
44
|
district?: string;
|
|
45
45
|
area?: string;
|
|
46
46
|
taluka?: string;
|
|
47
|
+
status?: USER_STATUS;
|
|
47
48
|
readonly createdAt: Date;
|
|
48
49
|
readonly deletedAt: string;
|
|
49
50
|
readonly updatedAt: Date;
|
|
@@ -186,6 +186,7 @@ UserModel.init({
|
|
|
186
186
|
medications: { type: sequelize_1.DataTypes.STRING, allowNull: true, field: 'medications' },
|
|
187
187
|
relation: { type: sequelize_1.DataTypes.STRING, allowNull: true },
|
|
188
188
|
taluka: { type: sequelize_1.DataTypes.STRING, allowNull: true },
|
|
189
|
+
status: { type: sequelize_1.DataTypes.STRING, allowNull: true, defaultValue: app_1.USER_STATUS.ACTIVE },
|
|
189
190
|
}, {
|
|
190
191
|
modelName: 'UserModel',
|
|
191
192
|
tableName: 'users',
|
package/package.json
CHANGED