From c332375ff2af653314a4d68b2f6b75607e48b09d Mon Sep 17 00:00:00 2001 From: fPolic Date: Thu, 18 Jan 2024 11:56:10 +0100 Subject: [PATCH] chore: update fields to new convention --- packages/payment/src/models/capture.ts | 2 +- .../payment/src/models/payment-collection.ts | 8 ++++---- .../payment/src/models/payment-method-token.ts | 8 ++++---- packages/payment/src/models/payment-session.ts | 4 ++-- packages/payment/src/models/payment.ts | 18 +++++++++--------- packages/payment/src/models/refund.ts | 2 +- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/payment/src/models/capture.ts b/packages/payment/src/models/capture.ts index 259a7dbec3..5c8d1eb53a 100644 --- a/packages/payment/src/models/capture.ts +++ b/packages/payment/src/models/capture.ts @@ -41,7 +41,7 @@ export default class Capture { created_at: Date @Property({ columnType: "text", nullable: true }) - created_by?: string | null + created_by: string | null = null @BeforeCreate() onCreate() { diff --git a/packages/payment/src/models/payment-collection.ts b/packages/payment/src/models/payment-collection.ts index 5ebb5fa841..3cc690fea1 100644 --- a/packages/payment/src/models/payment-collection.ts +++ b/packages/payment/src/models/payment-collection.ts @@ -48,14 +48,14 @@ export default class PaymentCollection { nullable: true, serializer: optionalNumericSerializer, }) - authorized_amount?: number | null + authorized_amount: number | null = null @Property({ columnType: "numeric", nullable: true, serializer: optionalNumericSerializer, }) - refunded_amount?: number | null + refunded_amount: number | null = null @Property({ columnType: "text", index: "IDX_payment_collection_region_id" }) region_id: string @@ -80,13 +80,13 @@ export default class PaymentCollection { nullable: true, index: "IDX_payment_collection_deleted_at", }) - deleted_at?: Date | null + deleted_at: Date | null = null @Property({ columnType: "timestamptz", nullable: true, }) - completed_at?: Date | null + completed_at: Date | null = null @Enum({ items: () => PaymentCollectionStatus, diff --git a/packages/payment/src/models/payment-method-token.ts b/packages/payment/src/models/payment-method-token.ts index a1f284524d..e7af8af115 100644 --- a/packages/payment/src/models/payment-method-token.ts +++ b/packages/payment/src/models/payment-method-token.ts @@ -17,19 +17,19 @@ export default class PaymentMethodToken { provider_id: string @Property({ columnType: "jsonb", nullable: true }) - data?: Record | null + data: Record | null = null @Property({ columnType: "text" }) name: string @Property({ columnType: "text", nullable: true }) - type_detail?: string | null + type_detail: string | null = null @Property({ columnType: "text", nullable: true }) - description_detail?: string | null + description_detail: string | null = null @Property({ columnType: "jsonb", nullable: true }) - metadata?: Record | null + metadata: Record | null = null @BeforeCreate() onCreate() { diff --git a/packages/payment/src/models/payment-session.ts b/packages/payment/src/models/payment-session.ts index 868290fdc9..f001852af5 100644 --- a/packages/payment/src/models/payment-session.ts +++ b/packages/payment/src/models/payment-session.ts @@ -31,7 +31,7 @@ export default class PaymentSession { provider_id: string @Property({ columnType: "jsonb", nullable: true }) - data?: Record | null + data: Record | null = null @Enum({ items: () => PaymentSessionStatus, @@ -42,7 +42,7 @@ export default class PaymentSession { columnType: "timestamptz", nullable: true, }) - authorized_at?: Date | null + authorized_at: Date | null = null @ManyToOne({ index: "IDX_payment_session_payment_collection_id", diff --git a/packages/payment/src/models/payment.ts b/packages/payment/src/models/payment.ts index 15b6e5185a..4647be64ac 100644 --- a/packages/payment/src/models/payment.ts +++ b/packages/payment/src/models/payment.ts @@ -45,7 +45,7 @@ export default class Payment { nullable: true, serializer: optionalNumericSerializer, }) - authorized_amount?: number | null + authorized_amount: number | null = null @Property({ columnType: "text" }) currency_code: string @@ -54,19 +54,19 @@ export default class Payment { provider_id: string @Property({ columnType: "text", nullable: true }) - cart_id?: string | null + cart_id: string | null = null @Property({ columnType: "text", nullable: true }) - order_id?: string | null + order_id: string | null = null @Property({ columnType: "text", nullable: true }) - order_edit_id?: string | null + order_edit_id: string | null = null @Property({ columnType: "text", nullable: true }) - customer_id?: string | null + customer_id: string | null = null @Property({ columnType: "jsonb", nullable: true }) - data?: Record | null + data: Record | null = null @Property({ onCreate: () => new Date(), @@ -88,19 +88,19 @@ export default class Payment { nullable: true, index: "IDX_payment_deleted_at", }) - deleted_at?: Date | null + deleted_at: Date | null = null @Property({ columnType: "timestamptz", nullable: true, }) - captured_at?: Date | null + captured_at: Date | null = null @Property({ columnType: "timestamptz", nullable: true, }) - canceled_at?: Date | null + canceled_at: Date | null = null @OneToMany(() => Refund, (refund) => refund.payment, { cascade: [Cascade.REMOVE], diff --git a/packages/payment/src/models/refund.ts b/packages/payment/src/models/refund.ts index ca071ac514..4f99da250f 100644 --- a/packages/payment/src/models/refund.ts +++ b/packages/payment/src/models/refund.ts @@ -36,7 +36,7 @@ export default class Refund { created_at: Date @Property({ columnType: "text", nullable: true }) - created_by?: string | null + created_by: string | null = null @BeforeCreate() onCreate() {