autosync_backend2 1.1.29 → 1.1.30

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
@@ -3403,6 +3403,71 @@ export declare const app: Elysia<"", {
3403
3403
  };
3404
3404
  };
3405
3405
  };
3406
+ } & {
3407
+ payment: {
3408
+ post: {
3409
+ body: {
3410
+ paymentPackageId?: string | null | undefined;
3411
+ state: "NOT_PAID" | "PENDING" | "FAILED" | "EXPIRED" | "PAID" | "DECLINED" | "CANCELED" | "REFUNDING" | "REFUNDED";
3412
+ cpOrderId: string;
3413
+ paymentMethod: "CASH" | "BANK_TRANSFER" | "POS_TERMINAL" | "PAYMENT_PACKAGE";
3414
+ paymentChannel: string;
3415
+ amount: number;
3416
+ };
3417
+ params: {};
3418
+ query: unknown;
3419
+ headers: unknown;
3420
+ response: {
3421
+ 200: {
3422
+ id: string;
3423
+ createdAt: string;
3424
+ updatedAt: string;
3425
+ deletedAt: string | null;
3426
+ state: "NOT_PAID" | "PENDING" | "FAILED" | "EXPIRED" | "PAID" | "DECLINED" | "CANCELED" | "REFUNDING" | "REFUNDED";
3427
+ cpOrderId: string;
3428
+ paymentPackageId: string | null;
3429
+ paymentMethod: "CASH" | "BANK_TRANSFER" | "POS_TERMINAL" | "PAYMENT_PACKAGE";
3430
+ paymentChannel: string;
3431
+ amount: number;
3432
+ invoiceNumber: string | null;
3433
+ };
3434
+ 422: {
3435
+ type: "validation";
3436
+ on: string;
3437
+ summary?: string;
3438
+ message?: string;
3439
+ found?: unknown;
3440
+ property?: string;
3441
+ expected?: string;
3442
+ };
3443
+ };
3444
+ };
3445
+ };
3446
+ } & {
3447
+ payment: {
3448
+ ":id": {
3449
+ delete: {
3450
+ body: unknown;
3451
+ params: {
3452
+ id: string;
3453
+ };
3454
+ query: unknown;
3455
+ headers: unknown;
3456
+ response: {
3457
+ 200: void;
3458
+ 422: {
3459
+ type: "validation";
3460
+ on: string;
3461
+ summary?: string;
3462
+ message?: string;
3463
+ found?: unknown;
3464
+ property?: string;
3465
+ expected?: string;
3466
+ };
3467
+ };
3468
+ };
3469
+ };
3470
+ };
3406
3471
  } & {
3407
3472
  payment: {
3408
3473
  storepay: {
package/dist/index.js CHANGED
@@ -143968,10 +143968,19 @@ var CrmCpOrderPaymentLogic;
143968
143968
  CrmCpOrderPaymentLogic.removePaymentInfo = async (id) => {
143969
143969
  await db_default.delete(crmPaymentTable).where(eq(crmPaymentTable.id, id));
143970
143970
  };
143971
+ CrmCpOrderPaymentLogic.selectByCpOrderId = async (cpOrderId) => {
143972
+ const result = await db_default.select().from(crmCpOrderPaymentTable).where(and(eq(crmCpOrderPaymentTable.cpOrderId, cpOrderId), softDeletedFilter(crmCpOrderPaymentTable)));
143973
+ return result;
143974
+ };
143971
143975
  CrmCpOrderPaymentLogic.create = async (body) => {
143972
143976
  const [payment] = await db_default.insert(crmCpOrderPaymentTable).values(body).returning();
143973
143977
  return payment;
143974
143978
  };
143979
+ CrmCpOrderPaymentLogic.remove = async (id) => {
143980
+ await db_default.update(crmCpOrderPaymentTable).set({
143981
+ deletedAt: nowSql_helper_default
143982
+ }).where(eq(crmCpOrderPaymentTable.id, id));
143983
+ };
143975
143984
  CrmCpOrderPaymentLogic.createQpay = async (body, user2) => {
143976
143985
  let paymentInfo = await getPaymentInfo("Qpay", user2);
143977
143986
  if ("code" in paymentInfo) {
@@ -144146,10 +144155,6 @@ var CrmCpOrderPaymentLogic;
144146
144155
  branchId: payment.cp_order.companyBranchId
144147
144156
  });
144148
144157
  };
144149
- CrmCpOrderPaymentLogic.selectByCpOrderId = async (cpOrderId) => {
144150
- const result = await db_default.select().from(crmCpOrderPaymentTable).where(eq(crmCpOrderPaymentTable.cpOrderId, cpOrderId));
144151
- return result;
144152
- };
144153
144158
  })(CrmCpOrderPaymentLogic ||= {});
144154
144159
  var logic_default7 = CrmCpOrderPaymentLogic;
144155
144160
 
@@ -144668,6 +144673,11 @@ var paymentRoutes = new Elysia({
144668
144673
  },
144669
144674
  query: "CrmCpOrderPaymentModel.wsQuery",
144670
144675
  body: "CrmCpOrderPaymentModel.wsBody"
144676
+ }).post("/", async ({ body }) => logic_default7.create(body), {
144677
+ body: "CrmCpOrderPaymentModel.create",
144678
+ auth: true
144679
+ }).delete("/:id", async ({ params: { id } }) => logic_default7.remove(id), {
144680
+ auth: true
144671
144681
  }).post("/storepay", async ({ body, user: user2 }) => logic_default7.createStorepay(body, user2), { body: "CrmCpOrderPaymentModel.storepay", auth: true }).get("/storepay/:id", async ({ params: { id } }) => logic_default7.checkStorePay(id)).post("/ubpay", async ({ body, user: user2 }) => logic_default7.createUbPay(body, user2), {
144672
144682
  body: "CrmCpOrderPaymentModel.create",
144673
144683
  auth: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autosync_backend2",
3
- "version": "1.1.29",
3
+ "version": "1.1.30",
4
4
  "module": "src/index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",