autosync_backend2 1.1.63 → 1.1.65

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.d.ts CHANGED
@@ -2484,6 +2484,7 @@ export declare const app: Elysia<"", {
2484
2484
  body: unknown;
2485
2485
  params: {};
2486
2486
  query: {
2487
+ companyId?: string | undefined;
2487
2488
  regNumber?: string | null | undefined;
2488
2489
  phone?: string | undefined;
2489
2490
  firstname?: string | undefined;
@@ -2971,6 +2972,7 @@ export declare const app: Elysia<"", {
2971
2972
  branchId?: string | undefined;
2972
2973
  kind?: "ADMIN" | "COMPANY_ADMIN" | "CUSTOMER" | "INSPECTION" | undefined;
2973
2974
  employeeId?: string | null | undefined;
2975
+ password?: string | undefined;
2974
2976
  permissions: never[];
2975
2977
  };
2976
2978
  params: {
package/dist/index.js CHANGED
@@ -151311,7 +151311,13 @@ var CompanyEmployeeModel;
151311
151311
  CompanyEmployeeModel.create = OmitBaseSchema(createSchema);
151312
151312
  CompanyEmployeeModel.update = OmitBaseSchema(updateSchema);
151313
151313
  CompanyEmployeeModel.select = t.Composite([
151314
- t.Partial(t.Pick(selectSchema, ["phone", "regNumber", "firstname", "lastname"])),
151314
+ t.Partial(t.Pick(selectSchema, [
151315
+ "phone",
151316
+ "regNumber",
151317
+ "firstname",
151318
+ "lastname",
151319
+ "companyId"
151320
+ ])),
151315
151321
  PaginationSchema
151316
151322
  ]);
151317
151323
  })(CompanyEmployeeModel ||= {});
@@ -151565,6 +151571,15 @@ var WarehouseProductLogic;
151565
151571
  key: "oen",
151566
151572
  header: "OEN",
151567
151573
  width: 20
151574
+ },
151575
+ {
151576
+ header: "\u0410\u044E\u0443\u043B\u0433\u04AF\u0439 \u04AF\u043B\u0434\u044D\u0433\u0434\u044D\u043B"
151577
+ },
151578
+ {
151579
+ header: "\u0422\u043E\u043E \u0448\u0438\u0440\u0445\u044D\u0433"
151580
+ },
151581
+ {
151582
+ header: "\u0422\u0430\u0432\u0438\u0443\u0440\u0438\u0439\u043D \u0434\u0443\u0433\u0430\u0430\u0440"
151568
151583
  }
151569
151584
  ];
151570
151585
  for (const row of rows) {
@@ -155025,9 +155040,10 @@ var CrmCpOrderLogic;
155025
155040
  const ad = appliedDiscounts.filter((i2) => i2.apply.cpOrderId === item.order.id);
155026
155041
  const totalDiscount = ad.map((i2) => i2.apply.valueApplied).reduce((a12, b) => a12 + b, 0);
155027
155042
  const packageAmount = packageAmounts.find((p) => p.cpOrderId === item.order.id);
155043
+ const ta = ((totalAmount?.amount ?? 0) + (packageAmount?.amount ?? 0)) * (totalAmount?.isNoat ? 1.1 : 1) - totalDiscount;
155028
155044
  return {
155029
155045
  ...item,
155030
- totalAmount: !totalAmount ? 0 : totalAmount.amount * (totalAmount.isNoat ? 1.1 : 1) - totalDiscount + (packageAmount ? packageAmount.amount : 0),
155046
+ totalAmount: ta,
155031
155047
  paidAmount: payments.filter((i2) => i2.cpOrderId === item.order.id).map((i2) => i2.amount).reduce((a12, b) => a12 + b, 0)
155032
155048
  };
155033
155049
  }),
@@ -156158,7 +156174,7 @@ var CrmSpPackageServiceLogic;
156158
156174
  CrmSpPackageServiceLogic.remove = async (id) => {
156159
156175
  await db_default.update(crmSpPackageServiceTable).set({
156160
156176
  deletedAt: nowSql_helper_default
156161
- }).where(and(eq(crmSpPackageServiceTable.id, id)));
156177
+ }).where(eq(crmSpPackageServiceTable.id, id));
156162
156178
  };
156163
156179
  })(CrmSpPackageServiceLogic ||= {});
156164
156180
  var logic_default15 = CrmSpPackageServiceLogic;
@@ -156862,6 +156878,13 @@ var UserLogic;
156862
156878
  return await db_default.transaction(async (db2) => {
156863
156879
  const isAdmin = user2.kind === "ADMIN";
156864
156880
  const [updatedUser] = await db2.update(user).set(body).where(and(eq(user.id, id), eq(user.companyId, user2.companyId).if(!isAdmin), eq(user.branchId, user2.branchId).if(!isAdmin))).returning();
156881
+ if (body.password) {
156882
+ await auth2.api.resetPassword({
156883
+ body: {
156884
+ newPassword: body.password
156885
+ }
156886
+ });
156887
+ }
156865
156888
  if (!updatedUser) {
156866
156889
  return status("Not Found", "\u0425\u044D\u0440\u044D\u0433\u043B\u044D\u0433\u0447 \u043E\u043B\u0434\u0441\u043E\u043D\u0433\u04AF\u0439.");
156867
156890
  }
@@ -156889,9 +156912,10 @@ var createUserSchema = t.Composite([
156889
156912
  })
156890
156913
  ]);
156891
156914
  var updateUserSchema = t.Composite([
156892
- t.Omit(update, ["password"]),
156915
+ update,
156893
156916
  t.Object({
156894
- permissions: t.Array(StringEnum(permissionList.map((permission) => permission.code)))
156917
+ permissions: t.Array(StringEnum(permissionList.map((permission) => permission.code))),
156918
+ password: t.Optional(t.String())
156895
156919
  })
156896
156920
  ]);
156897
156921
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autosync_backend2",
3
- "version": "1.1.63",
3
+ "version": "1.1.65",
4
4
  "module": "src/index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",