@experts_hub/shared 1.0.460 → 1.0.462

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.
@@ -10,33 +10,37 @@ export declare enum StripeTransactionTypeEnum {
10
10
  export declare enum StripeTransactionStatusEnum {
11
11
  PENDING = "PENDING",
12
12
  PROCESSING = "PROCESSING",
13
- SUCCESS = "SUCCESS",
13
+ COMPLETED = "COMPLETED",
14
14
  FAILED = "FAILED",
15
- EXPIRED = "EXPIRED"
15
+ EXPIRED = "EXPIRED",
16
+ CANCELLED = "CANCELLED"
16
17
  }
17
18
  export declare class StripeTransaction extends BaseEntity {
18
19
  userId: number;
19
20
  user: User;
20
- amount: number;
21
- currency: string;
22
- type: StripeTransactionTypeEnum;
23
- status: StripeTransactionStatusEnum;
24
21
  stripeSessionId: string;
25
22
  stripePaymentIntentId: string;
26
- description: string;
27
- depositAmountCents: number;
28
- platformFeeCents: number;
29
- taxCents: number;
30
- stripeFeeCents: number;
31
- totalPaidCents: number;
32
- netReceivedCents: number;
33
23
  stripeChargeId: string;
34
24
  stripeReceiptUrl: string;
35
25
  stripeBalanceTransactionId: string;
26
+ stripePaymentMethod: string | null;
27
+ stripePaymentStatus: string | null;
28
+ type: StripeTransactionTypeEnum;
29
+ currency: string;
30
+ desiredDepositCents: number;
31
+ platformFeeCents: number;
32
+ taxCents: number | null;
33
+ estimatedStripeFee: number | null;
34
+ estimatedTotalCents: number | null;
35
+ actualStripeFee: number | null;
36
+ actualTotalPaidCents: number | null;
37
+ netReceivedCents: number | null;
38
+ description: string;
39
+ status: StripeTransactionStatusEnum;
36
40
  checkoutSessionCompletedAt: Date;
37
41
  completedAt: Date;
38
- rawSessionPayload: Record<string, any> | null;
39
- rawSessionResponse: Record<string, any> | null;
40
42
  billingDetails: Record<string, any> | null;
41
43
  paymentMethodDetails: Record<string, any> | null;
44
+ rawSessionPayload: Record<string, any> | null;
45
+ rawSessionResponse: Record<string, any> | null;
42
46
  }
package/dist/index.d.mts CHANGED
@@ -1637,35 +1637,39 @@ declare enum StripeTransactionTypeEnum {
1637
1637
  declare enum StripeTransactionStatusEnum {
1638
1638
  PENDING = "PENDING",
1639
1639
  PROCESSING = "PROCESSING",
1640
- SUCCESS = "SUCCESS",
1640
+ COMPLETED = "COMPLETED",
1641
1641
  FAILED = "FAILED",
1642
- EXPIRED = "EXPIRED"
1642
+ EXPIRED = "EXPIRED",
1643
+ CANCELLED = "CANCELLED"
1643
1644
  }
1644
1645
  declare class StripeTransaction extends BaseEntity {
1645
1646
  userId: number;
1646
1647
  user: User;
1647
- amount: number;
1648
- currency: string;
1649
- type: StripeTransactionTypeEnum;
1650
- status: StripeTransactionStatusEnum;
1651
1648
  stripeSessionId: string;
1652
1649
  stripePaymentIntentId: string;
1653
- description: string;
1654
- depositAmountCents: number;
1655
- platformFeeCents: number;
1656
- taxCents: number;
1657
- stripeFeeCents: number;
1658
- totalPaidCents: number;
1659
- netReceivedCents: number;
1660
1650
  stripeChargeId: string;
1661
1651
  stripeReceiptUrl: string;
1662
1652
  stripeBalanceTransactionId: string;
1653
+ stripePaymentMethod: string | null;
1654
+ stripePaymentStatus: string | null;
1655
+ type: StripeTransactionTypeEnum;
1656
+ currency: string;
1657
+ desiredDepositCents: number;
1658
+ platformFeeCents: number;
1659
+ taxCents: number | null;
1660
+ estimatedStripeFee: number | null;
1661
+ estimatedTotalCents: number | null;
1662
+ actualStripeFee: number | null;
1663
+ actualTotalPaidCents: number | null;
1664
+ netReceivedCents: number | null;
1665
+ description: string;
1666
+ status: StripeTransactionStatusEnum;
1663
1667
  checkoutSessionCompletedAt: Date;
1664
1668
  completedAt: Date;
1665
- rawSessionPayload: Record<string, any> | null;
1666
- rawSessionResponse: Record<string, any> | null;
1667
1669
  billingDetails: Record<string, any> | null;
1668
1670
  paymentMethodDetails: Record<string, any> | null;
1671
+ rawSessionPayload: Record<string, any> | null;
1672
+ rawSessionResponse: Record<string, any> | null;
1669
1673
  }
1670
1674
 
1671
1675
  declare enum WalletTransactionTypeEnum {
package/dist/index.d.ts CHANGED
@@ -1637,35 +1637,39 @@ declare enum StripeTransactionTypeEnum {
1637
1637
  declare enum StripeTransactionStatusEnum {
1638
1638
  PENDING = "PENDING",
1639
1639
  PROCESSING = "PROCESSING",
1640
- SUCCESS = "SUCCESS",
1640
+ COMPLETED = "COMPLETED",
1641
1641
  FAILED = "FAILED",
1642
- EXPIRED = "EXPIRED"
1642
+ EXPIRED = "EXPIRED",
1643
+ CANCELLED = "CANCELLED"
1643
1644
  }
1644
1645
  declare class StripeTransaction extends BaseEntity {
1645
1646
  userId: number;
1646
1647
  user: User;
1647
- amount: number;
1648
- currency: string;
1649
- type: StripeTransactionTypeEnum;
1650
- status: StripeTransactionStatusEnum;
1651
1648
  stripeSessionId: string;
1652
1649
  stripePaymentIntentId: string;
1653
- description: string;
1654
- depositAmountCents: number;
1655
- platformFeeCents: number;
1656
- taxCents: number;
1657
- stripeFeeCents: number;
1658
- totalPaidCents: number;
1659
- netReceivedCents: number;
1660
1650
  stripeChargeId: string;
1661
1651
  stripeReceiptUrl: string;
1662
1652
  stripeBalanceTransactionId: string;
1653
+ stripePaymentMethod: string | null;
1654
+ stripePaymentStatus: string | null;
1655
+ type: StripeTransactionTypeEnum;
1656
+ currency: string;
1657
+ desiredDepositCents: number;
1658
+ platformFeeCents: number;
1659
+ taxCents: number | null;
1660
+ estimatedStripeFee: number | null;
1661
+ estimatedTotalCents: number | null;
1662
+ actualStripeFee: number | null;
1663
+ actualTotalPaidCents: number | null;
1664
+ netReceivedCents: number | null;
1665
+ description: string;
1666
+ status: StripeTransactionStatusEnum;
1663
1667
  checkoutSessionCompletedAt: Date;
1664
1668
  completedAt: Date;
1665
- rawSessionPayload: Record<string, any> | null;
1666
- rawSessionResponse: Record<string, any> | null;
1667
1669
  billingDetails: Record<string, any> | null;
1668
1670
  paymentMethodDetails: Record<string, any> | null;
1671
+ rawSessionPayload: Record<string, any> | null;
1672
+ rawSessionResponse: Record<string, any> | null;
1669
1673
  }
1670
1674
 
1671
1675
  declare enum WalletTransactionTypeEnum {
package/dist/index.js CHANGED
@@ -1246,17 +1246,17 @@ __decorateClass([
1246
1246
  })
1247
1247
  ], JobBasicInformationDto.prototype, "location", 2);
1248
1248
  __decorateClass([
1249
- (0, import_class_validator33.ValidateIf)((o) => !o.isDraft),
1249
+ (0, import_class_validator33.ValidateIf)((o) => !o.isDraft && (o.location === "ONSITE" /* ONSITE */ || o.location === "HYBRID" /* HYBRID */)),
1250
1250
  (0, import_class_validator33.IsNumber)({}, { message: "Country id must be a number" }),
1251
1251
  (0, import_class_transformer2.Type)(() => Number)
1252
1252
  ], JobBasicInformationDto.prototype, "countryId", 2);
1253
1253
  __decorateClass([
1254
- (0, import_class_validator33.ValidateIf)((o) => !o.isDraft),
1254
+ (0, import_class_validator33.ValidateIf)((o) => !o.isDraft && (o.location === "ONSITE" /* ONSITE */ || o.location === "HYBRID" /* HYBRID */)),
1255
1255
  (0, import_class_validator33.IsNumber)({}, { message: "State id must be a number" }),
1256
1256
  (0, import_class_transformer2.Type)(() => Number)
1257
1257
  ], JobBasicInformationDto.prototype, "stateId", 2);
1258
1258
  __decorateClass([
1259
- (0, import_class_validator33.ValidateIf)((o) => !o.isDraft),
1259
+ (0, import_class_validator33.ValidateIf)((o) => !o.isDraft && (o.location === "ONSITE" /* ONSITE */ || o.location === "HYBRID" /* HYBRID */)),
1260
1260
  (0, import_class_validator33.IsNumber)({}, { message: "City id must be a number" }),
1261
1261
  (0, import_class_transformer2.Type)(() => Number)
1262
1262
  ], JobBasicInformationDto.prototype, "cityId", 2);
@@ -4873,13 +4873,14 @@ var StripeTransactionTypeEnum = /* @__PURE__ */ ((StripeTransactionTypeEnum2) =>
4873
4873
  var StripeTransactionStatusEnum = /* @__PURE__ */ ((StripeTransactionStatusEnum2) => {
4874
4874
  StripeTransactionStatusEnum2["PENDING"] = "PENDING";
4875
4875
  StripeTransactionStatusEnum2["PROCESSING"] = "PROCESSING";
4876
- StripeTransactionStatusEnum2["SUCCESS"] = "SUCCESS";
4876
+ StripeTransactionStatusEnum2["COMPLETED"] = "COMPLETED";
4877
4877
  StripeTransactionStatusEnum2["FAILED"] = "FAILED";
4878
4878
  StripeTransactionStatusEnum2["EXPIRED"] = "EXPIRED";
4879
+ StripeTransactionStatusEnum2["CANCELLED"] = "CANCELLED";
4879
4880
  return StripeTransactionStatusEnum2;
4880
4881
  })(StripeTransactionStatusEnum || {});
4881
4882
  var StripeTransaction = class extends BaseEntity {
4882
- // Full Stripe payment method details response
4883
+ // Full Stripe session response
4883
4884
  };
4884
4885
  __decorateClass([
4885
4886
  (0, import_typeorm55.Column)({ name: "user_id", type: "integer", nullable: true }),
@@ -4889,18 +4890,6 @@ __decorateClass([
4889
4890
  (0, import_typeorm55.ManyToOne)(() => User, (user) => user.stripeTransactions),
4890
4891
  (0, import_typeorm55.JoinColumn)({ name: "user_id" })
4891
4892
  ], StripeTransaction.prototype, "user", 2);
4892
- __decorateClass([
4893
- (0, import_typeorm55.Column)({ name: "amount", type: "bigint", nullable: true })
4894
- ], StripeTransaction.prototype, "amount", 2);
4895
- __decorateClass([
4896
- (0, import_typeorm55.Column)({ name: "currency", type: "varchar", nullable: true })
4897
- ], StripeTransaction.prototype, "currency", 2);
4898
- __decorateClass([
4899
- (0, import_typeorm55.Column)({ name: "type", type: "enum", enum: StripeTransactionTypeEnum })
4900
- ], StripeTransaction.prototype, "type", 2);
4901
- __decorateClass([
4902
- (0, import_typeorm55.Column)({ name: "status", type: "enum", enum: StripeTransactionStatusEnum, default: "PENDING" /* PENDING */ })
4903
- ], StripeTransaction.prototype, "status", 2);
4904
4893
  __decorateClass([
4905
4894
  (0, import_typeorm55.Column)({ name: "stripe_session_id", type: "varchar", nullable: true })
4906
4895
  ], StripeTransaction.prototype, "stripeSessionId", 2);
@@ -4908,53 +4897,74 @@ __decorateClass([
4908
4897
  (0, import_typeorm55.Column)({ name: "stripe_payment_intent_id", type: "varchar", nullable: true })
4909
4898
  ], StripeTransaction.prototype, "stripePaymentIntentId", 2);
4910
4899
  __decorateClass([
4911
- (0, import_typeorm55.Column)({ name: "description", type: "text", nullable: true })
4912
- ], StripeTransaction.prototype, "description", 2);
4900
+ (0, import_typeorm55.Column)({ name: "stripe_charge_id", type: "varchar", nullable: true })
4901
+ ], StripeTransaction.prototype, "stripeChargeId", 2);
4902
+ __decorateClass([
4903
+ (0, import_typeorm55.Column)({ name: "stripe_receipt_url", type: "varchar", nullable: true })
4904
+ ], StripeTransaction.prototype, "stripeReceiptUrl", 2);
4905
+ __decorateClass([
4906
+ (0, import_typeorm55.Column)({ name: "stripe_balance_transaction_id", type: "varchar", nullable: true })
4907
+ ], StripeTransaction.prototype, "stripeBalanceTransactionId", 2);
4908
+ __decorateClass([
4909
+ (0, import_typeorm55.Column)({ name: "stripe_payment_method", type: "varchar", nullable: true })
4910
+ ], StripeTransaction.prototype, "stripePaymentMethod", 2);
4911
+ __decorateClass([
4912
+ (0, import_typeorm55.Column)({ name: "stripe_payment_status", type: "varchar", nullable: true })
4913
+ ], StripeTransaction.prototype, "stripePaymentStatus", 2);
4914
+ __decorateClass([
4915
+ (0, import_typeorm55.Column)({ name: "type", type: "enum", enum: StripeTransactionTypeEnum })
4916
+ ], StripeTransaction.prototype, "type", 2);
4913
4917
  __decorateClass([
4914
- (0, import_typeorm55.Column)({ name: "deposit_amount_cents", type: "bigint", default: 0 })
4915
- ], StripeTransaction.prototype, "depositAmountCents", 2);
4918
+ (0, import_typeorm55.Column)({ name: "currency", type: "varchar", nullable: true })
4919
+ ], StripeTransaction.prototype, "currency", 2);
4916
4920
  __decorateClass([
4917
- (0, import_typeorm55.Column)({ name: "platform_fee_cents", type: "bigint", default: 0 })
4921
+ (0, import_typeorm55.Column)({ name: "desired_deposit_cents", type: "bigint", nullable: true, comment: "Amount user wants in their wallet. Example: 10000 cents = $100.00. This is what gets credited to wallet" })
4922
+ ], StripeTransaction.prototype, "desiredDepositCents", 2);
4923
+ __decorateClass([
4924
+ (0, import_typeorm55.Column)({ name: "platform_fee_cents", type: "bigint", default: 0, comment: "Your platform commission Example: 500 cents = $5.00 (5% of $100)" })
4918
4925
  ], StripeTransaction.prototype, "platformFeeCents", 2);
4919
4926
  __decorateClass([
4920
- (0, import_typeorm55.Column)({ name: "tax_cents", type: "bigint", default: 0 })
4927
+ (0, import_typeorm55.Column)({ name: "tax_cents", type: "bigint", nullable: true, comment: "Sales tax collected by Stripe" })
4921
4928
  ], StripeTransaction.prototype, "taxCents", 2);
4922
4929
  __decorateClass([
4923
- (0, import_typeorm55.Column)({ name: "stripe_fee_cents", type: "bigint", default: 0 })
4924
- ], StripeTransaction.prototype, "stripeFeeCents", 2);
4930
+ (0, import_typeorm55.Column)({ name: "estimated_stripe_fee_cents", type: "bigint", nullable: true, comment: "Your calculated estimate of Stripe fee, Example: 371 cents = $3.71" })
4931
+ ], StripeTransaction.prototype, "estimatedStripeFee", 2);
4925
4932
  __decorateClass([
4926
- (0, import_typeorm55.Column)({ name: "total_paid_cents", type: "bigint", default: 0 })
4927
- ], StripeTransaction.prototype, "totalPaidCents", 2);
4933
+ (0, import_typeorm55.Column)({ name: "estimated_total_cents", type: "bigint", nullable: true, comment: "Your calculated total to charge, Example: 11386 cents = $113.86, desired_deposit_cents + platform_fee_cents + estimated_stripe_fee" })
4934
+ ], StripeTransaction.prototype, "estimatedTotalCents", 2);
4928
4935
  __decorateClass([
4929
- (0, import_typeorm55.Column)({ name: "net_received_cents", type: "bigint", default: 0 })
4930
- ], StripeTransaction.prototype, "netReceivedCents", 2);
4936
+ (0, import_typeorm55.Column)({ name: "actual_stripe_fee_cents", type: "bigint", nullable: true, comment: "ACTUAL Stripe fee charged, Example: 371 cents = $3.71" })
4937
+ ], StripeTransaction.prototype, "actualStripeFee", 2);
4931
4938
  __decorateClass([
4932
- (0, import_typeorm55.Column)({ name: "stripe_charge_id", type: "varchar", nullable: true })
4933
- ], StripeTransaction.prototype, "stripeChargeId", 2);
4939
+ (0, import_typeorm55.Column)({ name: "actual_total_paid_cents", type: "bigint", nullable: true, comment: "What customer ACTUALLY paid, Example: 11757 cents = $117.57, May differ from estimate" })
4940
+ ], StripeTransaction.prototype, "actualTotalPaidCents", 2);
4934
4941
  __decorateClass([
4935
- (0, import_typeorm55.Column)({ name: "stripe_receipt_url", type: "varchar", nullable: true })
4936
- ], StripeTransaction.prototype, "stripeReceiptUrl", 2);
4942
+ (0, import_typeorm55.Column)({ name: "net_received_cents", type: "bigint", nullable: true, comment: "What customer ACTUALLY paid, Example: 11757 cents = $117.57, May differ from estimate" })
4943
+ ], StripeTransaction.prototype, "netReceivedCents", 2);
4937
4944
  __decorateClass([
4938
- (0, import_typeorm55.Column)({ name: "stripe_balance_transaction_id", type: "varchar", nullable: true })
4939
- ], StripeTransaction.prototype, "stripeBalanceTransactionId", 2);
4945
+ (0, import_typeorm55.Column)({ name: "description", type: "text", nullable: true })
4946
+ ], StripeTransaction.prototype, "description", 2);
4947
+ __decorateClass([
4948
+ (0, import_typeorm55.Column)({ name: "status", type: "enum", enum: StripeTransactionStatusEnum, default: "PENDING" /* PENDING */ })
4949
+ ], StripeTransaction.prototype, "status", 2);
4940
4950
  __decorateClass([
4941
4951
  (0, import_typeorm55.Column)({ name: "checkout_session_completed_at", type: "timestamptz", nullable: true })
4942
4952
  ], StripeTransaction.prototype, "checkoutSessionCompletedAt", 2);
4943
4953
  __decorateClass([
4944
4954
  (0, import_typeorm55.Column)({ name: "completed_at", type: "timestamptz", nullable: true })
4945
4955
  ], StripeTransaction.prototype, "completedAt", 2);
4946
- __decorateClass([
4947
- (0, import_typeorm55.Column)({ name: "raw_session_payload", type: "jsonb", nullable: true })
4948
- ], StripeTransaction.prototype, "rawSessionPayload", 2);
4949
- __decorateClass([
4950
- (0, import_typeorm55.Column)({ name: "raw_session_response", type: "jsonb", nullable: true })
4951
- ], StripeTransaction.prototype, "rawSessionResponse", 2);
4952
4956
  __decorateClass([
4953
4957
  (0, import_typeorm55.Column)({ name: "billing_details", type: "jsonb", nullable: true })
4954
4958
  ], StripeTransaction.prototype, "billingDetails", 2);
4955
4959
  __decorateClass([
4956
4960
  (0, import_typeorm55.Column)({ name: "payment_method_details", type: "jsonb", nullable: true })
4957
4961
  ], StripeTransaction.prototype, "paymentMethodDetails", 2);
4962
+ __decorateClass([
4963
+ (0, import_typeorm55.Column)({ name: "raw_session_payload", type: "jsonb", nullable: true })
4964
+ ], StripeTransaction.prototype, "rawSessionPayload", 2);
4965
+ __decorateClass([
4966
+ (0, import_typeorm55.Column)({ name: "raw_session_response", type: "jsonb", nullable: true })
4967
+ ], StripeTransaction.prototype, "rawSessionResponse", 2);
4958
4968
  StripeTransaction = __decorateClass([
4959
4969
  (0, import_typeorm55.Entity)("stripe_transactions")
4960
4970
  ], StripeTransaction);
package/dist/index.mjs CHANGED
@@ -1034,17 +1034,17 @@ __decorateClass([
1034
1034
  })
1035
1035
  ], JobBasicInformationDto.prototype, "location", 2);
1036
1036
  __decorateClass([
1037
- ValidateIf3((o) => !o.isDraft),
1037
+ ValidateIf3((o) => !o.isDraft && (o.location === "ONSITE" /* ONSITE */ || o.location === "HYBRID" /* HYBRID */)),
1038
1038
  IsNumber({}, { message: "Country id must be a number" }),
1039
1039
  Type(() => Number)
1040
1040
  ], JobBasicInformationDto.prototype, "countryId", 2);
1041
1041
  __decorateClass([
1042
- ValidateIf3((o) => !o.isDraft),
1042
+ ValidateIf3((o) => !o.isDraft && (o.location === "ONSITE" /* ONSITE */ || o.location === "HYBRID" /* HYBRID */)),
1043
1043
  IsNumber({}, { message: "State id must be a number" }),
1044
1044
  Type(() => Number)
1045
1045
  ], JobBasicInformationDto.prototype, "stateId", 2);
1046
1046
  __decorateClass([
1047
- ValidateIf3((o) => !o.isDraft),
1047
+ ValidateIf3((o) => !o.isDraft && (o.location === "ONSITE" /* ONSITE */ || o.location === "HYBRID" /* HYBRID */)),
1048
1048
  IsNumber({}, { message: "City id must be a number" }),
1049
1049
  Type(() => Number)
1050
1050
  ], JobBasicInformationDto.prototype, "cityId", 2);
@@ -4900,13 +4900,14 @@ var StripeTransactionTypeEnum = /* @__PURE__ */ ((StripeTransactionTypeEnum2) =>
4900
4900
  var StripeTransactionStatusEnum = /* @__PURE__ */ ((StripeTransactionStatusEnum2) => {
4901
4901
  StripeTransactionStatusEnum2["PENDING"] = "PENDING";
4902
4902
  StripeTransactionStatusEnum2["PROCESSING"] = "PROCESSING";
4903
- StripeTransactionStatusEnum2["SUCCESS"] = "SUCCESS";
4903
+ StripeTransactionStatusEnum2["COMPLETED"] = "COMPLETED";
4904
4904
  StripeTransactionStatusEnum2["FAILED"] = "FAILED";
4905
4905
  StripeTransactionStatusEnum2["EXPIRED"] = "EXPIRED";
4906
+ StripeTransactionStatusEnum2["CANCELLED"] = "CANCELLED";
4906
4907
  return StripeTransactionStatusEnum2;
4907
4908
  })(StripeTransactionStatusEnum || {});
4908
4909
  var StripeTransaction = class extends BaseEntity {
4909
- // Full Stripe payment method details response
4910
+ // Full Stripe session response
4910
4911
  };
4911
4912
  __decorateClass([
4912
4913
  Column55({ name: "user_id", type: "integer", nullable: true }),
@@ -4916,18 +4917,6 @@ __decorateClass([
4916
4917
  ManyToOne49(() => User, (user) => user.stripeTransactions),
4917
4918
  JoinColumn49({ name: "user_id" })
4918
4919
  ], StripeTransaction.prototype, "user", 2);
4919
- __decorateClass([
4920
- Column55({ name: "amount", type: "bigint", nullable: true })
4921
- ], StripeTransaction.prototype, "amount", 2);
4922
- __decorateClass([
4923
- Column55({ name: "currency", type: "varchar", nullable: true })
4924
- ], StripeTransaction.prototype, "currency", 2);
4925
- __decorateClass([
4926
- Column55({ name: "type", type: "enum", enum: StripeTransactionTypeEnum })
4927
- ], StripeTransaction.prototype, "type", 2);
4928
- __decorateClass([
4929
- Column55({ name: "status", type: "enum", enum: StripeTransactionStatusEnum, default: "PENDING" /* PENDING */ })
4930
- ], StripeTransaction.prototype, "status", 2);
4931
4920
  __decorateClass([
4932
4921
  Column55({ name: "stripe_session_id", type: "varchar", nullable: true })
4933
4922
  ], StripeTransaction.prototype, "stripeSessionId", 2);
@@ -4935,53 +4924,74 @@ __decorateClass([
4935
4924
  Column55({ name: "stripe_payment_intent_id", type: "varchar", nullable: true })
4936
4925
  ], StripeTransaction.prototype, "stripePaymentIntentId", 2);
4937
4926
  __decorateClass([
4938
- Column55({ name: "description", type: "text", nullable: true })
4939
- ], StripeTransaction.prototype, "description", 2);
4927
+ Column55({ name: "stripe_charge_id", type: "varchar", nullable: true })
4928
+ ], StripeTransaction.prototype, "stripeChargeId", 2);
4929
+ __decorateClass([
4930
+ Column55({ name: "stripe_receipt_url", type: "varchar", nullable: true })
4931
+ ], StripeTransaction.prototype, "stripeReceiptUrl", 2);
4932
+ __decorateClass([
4933
+ Column55({ name: "stripe_balance_transaction_id", type: "varchar", nullable: true })
4934
+ ], StripeTransaction.prototype, "stripeBalanceTransactionId", 2);
4935
+ __decorateClass([
4936
+ Column55({ name: "stripe_payment_method", type: "varchar", nullable: true })
4937
+ ], StripeTransaction.prototype, "stripePaymentMethod", 2);
4938
+ __decorateClass([
4939
+ Column55({ name: "stripe_payment_status", type: "varchar", nullable: true })
4940
+ ], StripeTransaction.prototype, "stripePaymentStatus", 2);
4941
+ __decorateClass([
4942
+ Column55({ name: "type", type: "enum", enum: StripeTransactionTypeEnum })
4943
+ ], StripeTransaction.prototype, "type", 2);
4940
4944
  __decorateClass([
4941
- Column55({ name: "deposit_amount_cents", type: "bigint", default: 0 })
4942
- ], StripeTransaction.prototype, "depositAmountCents", 2);
4945
+ Column55({ name: "currency", type: "varchar", nullable: true })
4946
+ ], StripeTransaction.prototype, "currency", 2);
4943
4947
  __decorateClass([
4944
- Column55({ name: "platform_fee_cents", type: "bigint", default: 0 })
4948
+ Column55({ name: "desired_deposit_cents", type: "bigint", nullable: true, comment: "Amount user wants in their wallet. Example: 10000 cents = $100.00. This is what gets credited to wallet" })
4949
+ ], StripeTransaction.prototype, "desiredDepositCents", 2);
4950
+ __decorateClass([
4951
+ Column55({ name: "platform_fee_cents", type: "bigint", default: 0, comment: "Your platform commission Example: 500 cents = $5.00 (5% of $100)" })
4945
4952
  ], StripeTransaction.prototype, "platformFeeCents", 2);
4946
4953
  __decorateClass([
4947
- Column55({ name: "tax_cents", type: "bigint", default: 0 })
4954
+ Column55({ name: "tax_cents", type: "bigint", nullable: true, comment: "Sales tax collected by Stripe" })
4948
4955
  ], StripeTransaction.prototype, "taxCents", 2);
4949
4956
  __decorateClass([
4950
- Column55({ name: "stripe_fee_cents", type: "bigint", default: 0 })
4951
- ], StripeTransaction.prototype, "stripeFeeCents", 2);
4957
+ Column55({ name: "estimated_stripe_fee_cents", type: "bigint", nullable: true, comment: "Your calculated estimate of Stripe fee, Example: 371 cents = $3.71" })
4958
+ ], StripeTransaction.prototype, "estimatedStripeFee", 2);
4952
4959
  __decorateClass([
4953
- Column55({ name: "total_paid_cents", type: "bigint", default: 0 })
4954
- ], StripeTransaction.prototype, "totalPaidCents", 2);
4960
+ Column55({ name: "estimated_total_cents", type: "bigint", nullable: true, comment: "Your calculated total to charge, Example: 11386 cents = $113.86, desired_deposit_cents + platform_fee_cents + estimated_stripe_fee" })
4961
+ ], StripeTransaction.prototype, "estimatedTotalCents", 2);
4955
4962
  __decorateClass([
4956
- Column55({ name: "net_received_cents", type: "bigint", default: 0 })
4957
- ], StripeTransaction.prototype, "netReceivedCents", 2);
4963
+ Column55({ name: "actual_stripe_fee_cents", type: "bigint", nullable: true, comment: "ACTUAL Stripe fee charged, Example: 371 cents = $3.71" })
4964
+ ], StripeTransaction.prototype, "actualStripeFee", 2);
4958
4965
  __decorateClass([
4959
- Column55({ name: "stripe_charge_id", type: "varchar", nullable: true })
4960
- ], StripeTransaction.prototype, "stripeChargeId", 2);
4966
+ Column55({ name: "actual_total_paid_cents", type: "bigint", nullable: true, comment: "What customer ACTUALLY paid, Example: 11757 cents = $117.57, May differ from estimate" })
4967
+ ], StripeTransaction.prototype, "actualTotalPaidCents", 2);
4961
4968
  __decorateClass([
4962
- Column55({ name: "stripe_receipt_url", type: "varchar", nullable: true })
4963
- ], StripeTransaction.prototype, "stripeReceiptUrl", 2);
4969
+ Column55({ name: "net_received_cents", type: "bigint", nullable: true, comment: "What customer ACTUALLY paid, Example: 11757 cents = $117.57, May differ from estimate" })
4970
+ ], StripeTransaction.prototype, "netReceivedCents", 2);
4964
4971
  __decorateClass([
4965
- Column55({ name: "stripe_balance_transaction_id", type: "varchar", nullable: true })
4966
- ], StripeTransaction.prototype, "stripeBalanceTransactionId", 2);
4972
+ Column55({ name: "description", type: "text", nullable: true })
4973
+ ], StripeTransaction.prototype, "description", 2);
4974
+ __decorateClass([
4975
+ Column55({ name: "status", type: "enum", enum: StripeTransactionStatusEnum, default: "PENDING" /* PENDING */ })
4976
+ ], StripeTransaction.prototype, "status", 2);
4967
4977
  __decorateClass([
4968
4978
  Column55({ name: "checkout_session_completed_at", type: "timestamptz", nullable: true })
4969
4979
  ], StripeTransaction.prototype, "checkoutSessionCompletedAt", 2);
4970
4980
  __decorateClass([
4971
4981
  Column55({ name: "completed_at", type: "timestamptz", nullable: true })
4972
4982
  ], StripeTransaction.prototype, "completedAt", 2);
4973
- __decorateClass([
4974
- Column55({ name: "raw_session_payload", type: "jsonb", nullable: true })
4975
- ], StripeTransaction.prototype, "rawSessionPayload", 2);
4976
- __decorateClass([
4977
- Column55({ name: "raw_session_response", type: "jsonb", nullable: true })
4978
- ], StripeTransaction.prototype, "rawSessionResponse", 2);
4979
4983
  __decorateClass([
4980
4984
  Column55({ name: "billing_details", type: "jsonb", nullable: true })
4981
4985
  ], StripeTransaction.prototype, "billingDetails", 2);
4982
4986
  __decorateClass([
4983
4987
  Column55({ name: "payment_method_details", type: "jsonb", nullable: true })
4984
4988
  ], StripeTransaction.prototype, "paymentMethodDetails", 2);
4989
+ __decorateClass([
4990
+ Column55({ name: "raw_session_payload", type: "jsonb", nullable: true })
4991
+ ], StripeTransaction.prototype, "rawSessionPayload", 2);
4992
+ __decorateClass([
4993
+ Column55({ name: "raw_session_response", type: "jsonb", nullable: true })
4994
+ ], StripeTransaction.prototype, "rawSessionResponse", 2);
4985
4995
  StripeTransaction = __decorateClass([
4986
4996
  Entity54("stripe_transactions")
4987
4997
  ], StripeTransaction);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@experts_hub/shared",
3
- "version": "1.0.460",
3
+ "version": "1.0.462",
4
4
  "description": "Shared DTOs, interfaces, and utilities for experts hub applications",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",