autosync_backend2 1.1.62 → 1.1.64
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 +2 -0
- package/dist/index.js +31 -6
- package/package.json +1 -1
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, [
|
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) {
|
@@ -154219,7 +154234,8 @@ var CrmVehicleLogic;
|
|
154219
154234
|
CrmVehicleLogic.create = async (body, user2) => {
|
154220
154235
|
const vehicle = await CrmVehicleLogic.findOrCreate(body);
|
154221
154236
|
await db_default.update(crmVehicleTable).set({
|
154222
|
-
companyId: user2.companyId
|
154237
|
+
companyId: user2.companyId,
|
154238
|
+
deletedAt: null
|
154223
154239
|
});
|
154224
154240
|
return vehicle;
|
154225
154241
|
};
|
@@ -155024,9 +155040,10 @@ var CrmCpOrderLogic;
|
|
155024
155040
|
const ad = appliedDiscounts.filter((i2) => i2.apply.cpOrderId === item.order.id);
|
155025
155041
|
const totalDiscount = ad.map((i2) => i2.apply.valueApplied).reduce((a12, b) => a12 + b, 0);
|
155026
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;
|
155027
155044
|
return {
|
155028
155045
|
...item,
|
155029
|
-
totalAmount:
|
155046
|
+
totalAmount: ta,
|
155030
155047
|
paidAmount: payments.filter((i2) => i2.cpOrderId === item.order.id).map((i2) => i2.amount).reduce((a12, b) => a12 + b, 0)
|
155031
155048
|
};
|
155032
155049
|
}),
|
@@ -156157,7 +156174,7 @@ var CrmSpPackageServiceLogic;
|
|
156157
156174
|
CrmSpPackageServiceLogic.remove = async (id) => {
|
156158
156175
|
await db_default.update(crmSpPackageServiceTable).set({
|
156159
156176
|
deletedAt: nowSql_helper_default
|
156160
|
-
}).where(
|
156177
|
+
}).where(eq(crmSpPackageServiceTable.id, id));
|
156161
156178
|
};
|
156162
156179
|
})(CrmSpPackageServiceLogic ||= {});
|
156163
156180
|
var logic_default15 = CrmSpPackageServiceLogic;
|
@@ -156861,6 +156878,13 @@ var UserLogic;
|
|
156861
156878
|
return await db_default.transaction(async (db2) => {
|
156862
156879
|
const isAdmin = user2.kind === "ADMIN";
|
156863
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
|
+
}
|
156864
156888
|
if (!updatedUser) {
|
156865
156889
|
return status("Not Found", "\u0425\u044D\u0440\u044D\u0433\u043B\u044D\u0433\u0447 \u043E\u043B\u0434\u0441\u043E\u043D\u0433\u04AF\u0439.");
|
156866
156890
|
}
|
@@ -156888,9 +156912,10 @@ var createUserSchema = t.Composite([
|
|
156888
156912
|
})
|
156889
156913
|
]);
|
156890
156914
|
var updateUserSchema = t.Composite([
|
156891
|
-
|
156915
|
+
update,
|
156892
156916
|
t.Object({
|
156893
|
-
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())
|
156894
156919
|
})
|
156895
156920
|
]);
|
156896
156921
|
|