chore: update fields to new convention

This commit is contained in:
fPolic
2024-01-18 11:56:10 +01:00
parent d5af7cc5f9
commit c332375ff2
6 changed files with 21 additions and 21 deletions

View File

@@ -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() {

View File

@@ -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,

View File

@@ -17,19 +17,19 @@ export default class PaymentMethodToken {
provider_id: string
@Property({ columnType: "jsonb", nullable: true })
data?: Record<string, unknown> | null
data: Record<string, unknown> | 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<string, unknown> | null
metadata: Record<string, unknown> | null = null
@BeforeCreate()
onCreate() {

View File

@@ -31,7 +31,7 @@ export default class PaymentSession {
provider_id: string
@Property({ columnType: "jsonb", nullable: true })
data?: Record<string, unknown> | null
data: Record<string, unknown> | 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",

View File

@@ -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<string, unknown> | null
data: Record<string, unknown> | 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],

View File

@@ -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() {