autosync_backend2 1.2.8 → 1.2.9

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
@@ -784,10 +784,6 @@ export declare const app: Elysia<"", {
784
784
  productId?: string | undefined;
785
785
  priceSell?: number | undefined;
786
786
  ids?: string[] | undefined;
787
- pagination: {
788
- size: number;
789
- page: number;
790
- };
791
787
  };
792
788
  headers: unknown;
793
789
  response: {
@@ -2195,6 +2191,7 @@ export declare const app: Elysia<"", {
2195
2191
  query: {
2196
2192
  search?: string | undefined;
2197
2193
  companyId?: string | undefined;
2194
+ branchId?: string | null | undefined;
2198
2195
  pagination: {
2199
2196
  size: number;
2200
2197
  page: number;
@@ -3509,6 +3506,35 @@ export declare const app: Elysia<"", {
3509
3506
  };
3510
3507
  };
3511
3508
  };
3509
+ } & {
3510
+ payment: {
3511
+ ubpay: {
3512
+ test: {
3513
+ ":id": {
3514
+ post: {
3515
+ body: unknown;
3516
+ params: {
3517
+ id: string;
3518
+ };
3519
+ query: unknown;
3520
+ headers: unknown;
3521
+ response: {
3522
+ 200: string;
3523
+ 422: {
3524
+ type: "validation";
3525
+ on: string;
3526
+ summary?: string;
3527
+ message?: string;
3528
+ found?: unknown;
3529
+ property?: string;
3530
+ expected?: string;
3531
+ };
3532
+ };
3533
+ };
3534
+ };
3535
+ };
3536
+ };
3537
+ };
3512
3538
  } & {
3513
3539
  payment: {
3514
3540
  ubpay: {
package/dist/index.js CHANGED
@@ -1924,8 +1924,8 @@ var import_debug, debug, syncBufferSize, ddSignatureArray, eocdSignatureBytes;
1924
1924
  var init_lib3 = __esm(() => {
1925
1925
  init_lib2();
1926
1926
  init_esm();
1927
- import_debug = __toESM(require_src(), 1);
1928
1927
  init_ZipToken();
1928
+ import_debug = __toESM(require_src(), 1);
1929
1929
  debug = import_debug.default("tokenizer:inflate");
1930
1930
  syncBufferSize = 256 * 1024;
1931
1931
  ddSignatureArray = signatureToArray(Signature.DataDescriptor);
@@ -17019,10 +17019,12 @@ var init_infer_result = () => {};
17019
17019
 
17020
17020
  // node_modules/kysely/dist/esm/index.js
17021
17021
  var init_esm2 = __esm(() => {
17022
+ init_expression_builder();
17023
+ init_log_once();
17024
+ init_query_id();
17022
17025
  init_kysely();
17023
17026
  init_query_creator();
17024
17027
  init_expression();
17025
- init_expression_builder();
17026
17028
  init_expression_wrapper();
17027
17029
  init_where_interface();
17028
17030
  init_returning_interface();
@@ -17218,8 +17220,6 @@ var init_esm2 = __esm(() => {
17218
17220
  init_streamable();
17219
17221
  init_log();
17220
17222
  init_infer_result();
17221
- init_log_once();
17222
- init_query_id();
17223
17223
  });
17224
17224
 
17225
17225
  // node_modules/better-auth/dist/chunks/bun-sqlite-dialect.mjs
@@ -146420,7 +146420,7 @@ var CompanyEmployeeModel;
146420
146420
  CompanyEmployeeModel.create = OmitBaseSchema(createSchema);
146421
146421
  CompanyEmployeeModel.update = OmitBaseSchema(updateSchema);
146422
146422
  CompanyEmployeeModel.select = t.Composite([
146423
- t.Partial(t.Pick(selectSchema, ["companyId"])),
146423
+ t.Partial(t.Pick(selectSchema, ["companyId", "branchId"])),
146424
146424
  t.Partial(t.Object({
146425
146425
  search: t.String()
146426
146426
  })),
@@ -146453,7 +146453,7 @@ var CompanyEmployeeLogic;
146453
146453
  };
146454
146454
  CompanyEmployeeLogic.select = async (query, user2) => {
146455
146455
  const columns = getTableColumns(companyEmployeeTable);
146456
- const filter = and(eq(companyEmployeeTable.companyId, user2.companyId), or(isNull2(companyEmployeeTable.branchId), eq(companyEmployeeTable.branchId, user2.branchId))?.if(user2.kind === "CUSTOMER"), or(ilike(companyEmployeeTable.firstname, `%${query.search}%`), ilike(companyEmployeeTable.lastname, `%${query.search}%`), ilike(companyEmployeeTable.phone, `%${query.search}%`), ilike(companyEmployeeTable.regNumber, `%${query.search}%`))?.if(query.search), eq(companyEmployeeTable.companyId, query.companyId ?? "").if(query.companyId && user2.kind === "ADMIN"), softDeletedFilter(companyEmployeeTable));
146456
+ const filter = and(eq(companyEmployeeTable.companyId, user2.companyId), eq(companyEmployeeTable.branchId, query.branchId).if(query.branchId && user2.kind !== "CUSTOMER"), or(isNull2(companyEmployeeTable.branchId), eq(companyEmployeeTable.branchId, user2.branchId))?.if(user2.kind === "CUSTOMER"), or(ilike(companyEmployeeTable.firstname, `%${query.search}%`), ilike(companyEmployeeTable.lastname, `%${query.search}%`), ilike(companyEmployeeTable.phone, `%${query.search}%`), ilike(companyEmployeeTable.regNumber, `%${query.search}%`))?.if(query.search), eq(companyEmployeeTable.companyId, query.companyId ?? "").if(query.companyId && user2.kind === "ADMIN"), softDeletedFilter(companyEmployeeTable));
146457
146457
  const baseQuery = db_default.select({
146458
146458
  ...columns,
146459
146459
  totalCount: totalCountSql
@@ -149965,7 +149965,9 @@ class UbPayGateway extends PaymentGateway {
149965
149965
  const invoice = await this.ubPay.createInvoice({
149966
149966
  amount: payment.amount,
149967
149967
  description: "Autosync",
149968
- customData: undefined,
149968
+ customData: {
149969
+ bnplProductId: 2
149970
+ },
149969
149971
  callbackUrl: `${CALLBACK_URL}/ubpay/${payment.id}`
149970
149972
  }, this.token);
149971
149973
  if (invoice.data.success === false) {
@@ -150987,6 +150989,9 @@ var paymentRoutes = new Elysia({
150987
150989
  }).post("/storepay", async ({ body, user: user2 }) => logic_default12.createStorepay(body, user2), { body: model_default10.storepay, auth: true }).get("/storepay/:id", async ({ params: { id } }) => logic_default12.checkStorePay(id)).post("/ubpay", async ({ body, user: user2 }) => logic_default12.createUbPay(body, user2), {
150988
150990
  body: model_default10.create,
150989
150991
  auth: true
150992
+ }).post("/ubpay/test/:id", async ({ params: { id } }) => {
150993
+ app.server?.publish(`cp_order_payment:${id}`, "Testing web socket");
150994
+ return "ok";
150990
150995
  }).post("/ubpay/:id", async ({ params: { id } }) => logic_default12.checkUbPay(id)).get("/qpay/:id", async ({ params: { id } }) => logic_default12.checkQpay(id)).post("/qpay", async ({ body, user: user2 }) => logic_default12.createQpay(body, user2), {
150991
150996
  body: model_default10.create,
150992
150997
  auth: true
@@ -151127,8 +151132,8 @@ var CrmDashboardLogic;
151127
151132
  CrmDashboardLogic.getCpOrderTotalAmountByDay = async (user2) => {
151128
151133
  const result = await db_default.select({
151129
151134
  amount: sum(crmCpOrderItemTable.priceTotal).mapWith(Number),
151130
- date: sql3`date_trunc('day', CURRENT_DATE)`.as("day")
151131
- }).from(crmCpOrderTable).where(and(eq(crmCpOrderTable.companyId, user2.companyId), eq(crmCpOrderTable.companyBranchId, user2.branchId).if(user2.kind === "CUSTOMER"), sql3`${crmCpOrderTable.createdAt} >= date_trunc('month', CURRENT_DATE) - interval '1 month'`)).leftJoin(crmCpOrderItemTable, eq(crmCpOrderItemTable.cpOrderId, crmCpOrderTable.id)).groupBy((t2) => t2.date);
151135
+ date: sql3`date_trunc('day', ${crmCpOrderTable.createdAt})`.as("day")
151136
+ }).from(crmCpOrderTable).where(and(eq(crmCpOrderTable.companyId, user2.companyId), eq(crmCpOrderTable.companyBranchId, user2.branchId).if(user2.kind === "CUSTOMER"), sql3`${crmCpOrderTable.createdAt} >= date_trunc('month', CURRENT_DATE) - interval '1 month'`)).leftJoin(crmCpOrderItemTable, eq(crmCpOrderItemTable.cpOrderId, crmCpOrderTable.id)).groupBy((t2) => t2.date).orderBy((t2) => t2.date);
151132
151137
  return result;
151133
151138
  };
151134
151139
  })(CrmDashboardLogic ||= {});
@@ -152957,7 +152962,7 @@ var productRoutes3 = new Elysia({
152957
152962
  body: model_default22.create
152958
152963
  }).post("/many", async ({ body, user: user2 }) => logic_default5.createMany(body, user2), {
152959
152964
  body: t.Array(model_default22.create)
152960
- }).post("/download", async ({ query, user: user2 }) => logic_default5.downloadExcel(query, user2), { query: model_default22.select }).guard({
152965
+ }).post("/download", async ({ query, user: user2 }) => logic_default5.downloadExcel(query, user2), { query: t.Omit(model_default22.select, ["pagination"]) }).guard({
152961
152966
  params: IdSchema
152962
152967
  }).put("/:id", async ({ params: { id }, body, user: user2 }) => logic_default5.update(id, body, user2), { body: model_default22.update });
152963
152968
  var product_default3 = productRoutes3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autosync_backend2",
3
- "version": "1.2.8",
3
+ "version": "1.2.9",
4
4
  "module": "src/index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",