@kipicore/dbcore 1.1.477 → 1.1.478

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.
@@ -9,6 +9,14 @@ module.exports = {
9
9
  allowNull: true,
10
10
  defaultValue: [],
11
11
  }, { transaction });
12
+ await queryInterface.addColumn('user_payouts', 'start_date', {
13
+ type: Sequelize.DATE,
14
+ allowNull: true,
15
+ }, { transaction });
16
+ await queryInterface.addColumn('user_payouts', 'end_date', {
17
+ type: Sequelize.DATE,
18
+ allowNull: true,
19
+ }, { transaction });
12
20
  await queryInterface.dropTable('user_payout_details', { transaction });
13
21
  await transaction.commit();
14
22
  }
@@ -20,8 +28,10 @@ module.exports = {
20
28
  down: async (queryInterface) => {
21
29
  const transaction = await queryInterface.sequelize.transaction();
22
30
  try {
23
- // Remove payout_details from user_payouts
31
+ // Remove columns from user_payouts
24
32
  await queryInterface.removeColumn('user_payouts', 'payout_details', { transaction });
33
+ await queryInterface.removeColumn('user_payouts', 'start_date', { transaction });
34
+ await queryInterface.removeColumn('user_payouts', 'end_date', { transaction });
25
35
  await transaction.commit();
26
36
  }
27
37
  catch (error) {
@@ -18,5 +18,7 @@ export interface IUserPayoutModelAttributes extends IDefaultAttributes {
18
18
  totalPaidAmount?: number;
19
19
  type: USER_PAYOUT_TYPE;
20
20
  payoutDetails?: IUserPayoutDetails[];
21
+ startDate?: Date;
22
+ endDate?: Date;
21
23
  lastCalculatedAt: Date;
22
24
  }
@@ -12,6 +12,8 @@ declare class UserPayoutModel extends Model<IUserPayoutModelAttributes, TUserPay
12
12
  totalPaidAmount: number;
13
13
  type: USER_PAYOUT_TYPE;
14
14
  payoutDetails: IUserPayoutDetails[];
15
+ startDate: Date;
16
+ endDate: Date;
15
17
  createdBy: string;
16
18
  updatedBy: string;
17
19
  deletedBy: string;
@@ -88,6 +88,16 @@ UserPayoutModel.init({
88
88
  defaultValue: [],
89
89
  field: 'payout_details',
90
90
  },
91
+ startDate: {
92
+ type: sequelize_1.DataTypes.DATE,
93
+ allowNull: true,
94
+ field: 'start_date',
95
+ },
96
+ endDate: {
97
+ type: sequelize_1.DataTypes.DATE,
98
+ allowNull: true,
99
+ field: 'end_date',
100
+ },
91
101
  lastCalculatedAt: {
92
102
  type: sequelize_1.DataTypes.DATE,
93
103
  defaultValue: (0, date_fns_1.startOfToday)(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.477",
3
+ "version": "1.1.478",
4
4
  "description": "Reusable DB core package with Postgres, MongoDB, models, services, interfaces, and types",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",