fix: partial feedback address

This commit is contained in:
fPolic
2024-01-15 10:34:45 +01:00
parent a7f74bdfb8
commit aabe164793
8 changed files with 18 additions and 964 deletions
@@ -1,864 +0,0 @@
{
"namespaces": [
"public"
],
"name": "public",
"tables": [
{
"columns": {
"id": {
"name": "id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "text"
},
"currency_code": {
"name": "currency_code",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"amount": {
"name": "amount",
"type": "numeric",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "decimal"
},
"authorized_amount": {
"name": "authorized_amount",
"type": "numeric",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "decimal"
},
"refunded_amount": {
"name": "refunded_amount",
"type": "numeric",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "decimal"
},
"region_id": {
"name": "region_id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"completed_at": {
"name": "completed_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"status": {
"name": "status",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"default": "'not_paid'",
"enumItems": [
"not_paid",
"awaiting",
"authorized",
"partially_authorized",
"canceled"
],
"mappedType": "enum"
}
},
"name": "payment-collection",
"schema": "public",
"indexes": [
{
"columnNames": [
"deleted_at"
],
"composite": false,
"keyName": "IDX_payment_collection_deleted_at",
"primary": false,
"unique": false
},
{
"keyName": "payment-collection_pkey",
"columnNames": [
"id"
],
"composite": false,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "text"
},
"provider_id": {
"name": "provider_id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "text"
},
"data": {
"name": "data",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "json"
},
"name": {
"name": "name",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "text"
},
"type_detail": {
"name": "type_detail",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"description_detail": {
"name": "description_detail",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"metadata": {
"name": "metadata",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "json"
}
},
"name": "payment-method-token",
"schema": "public",
"indexes": [
{
"keyName": "payment-method-token_pkey",
"columnNames": [
"id"
],
"composite": false,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "text"
},
"is_enabled": {
"name": "is_enabled",
"type": "boolean",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"default": "true",
"mappedType": "boolean"
}
},
"name": "payment-provider",
"schema": "public",
"indexes": [
{
"keyName": "payment-provider_pkey",
"columnNames": [
"id"
],
"composite": false,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {}
},
{
"columns": {
"payment_collection_id": {
"name": "payment_collection_id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "text"
},
"payment_provider_id": {
"name": "payment_provider_id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "text"
}
},
"name": "payment-collection_payment_providers",
"schema": "public",
"indexes": [
{
"keyName": "payment-collection_payment_providers_pkey",
"columnNames": [
"payment_collection_id",
"payment_provider_id"
],
"composite": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"payment-collection_payment_providers_payment_coll_6b015_foreign": {
"constraintName": "payment-collection_payment_providers_payment_coll_6b015_foreign",
"columnNames": [
"payment_collection_id"
],
"localTableName": "public.payment-collection_payment_providers",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.payment-collection",
"deleteRule": "cascade",
"updateRule": "cascade"
},
"payment-collection_payment_providers_payment_provider_id_foreign": {
"constraintName": "payment-collection_payment_providers_payment_provider_id_foreign",
"columnNames": [
"payment_provider_id"
],
"localTableName": "public.payment-collection_payment_providers",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.payment-provider",
"deleteRule": "cascade",
"updateRule": "cascade"
}
}
},
{
"columns": {
"id": {
"name": "id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "text"
},
"currency_code": {
"name": "currency_code",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"amount": {
"name": "amount",
"type": "numeric",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "decimal"
},
"provider_id": {
"name": "provider_id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "text"
},
"data": {
"name": "data",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "json"
},
"status": {
"name": "status",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"enumItems": [
"authorized",
"pending",
"requires_more",
"error",
"canceled"
],
"mappedType": "enum"
},
"is_selected": {
"name": "is_selected",
"type": "boolean",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "boolean"
},
"authorised_at": {
"name": "authorised_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"payment_collection_id": {
"name": "payment_collection_id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "text"
}
},
"name": "payment-session",
"schema": "public",
"indexes": [
{
"columnNames": [
"payment_collection_id"
],
"composite": false,
"keyName": "IDX_payment_session_payment_collection_id",
"primary": false,
"unique": false
},
{
"keyName": "payment-session_pkey",
"columnNames": [
"id"
],
"composite": false,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"payment-session_payment_collection_id_foreign": {
"constraintName": "payment-session_payment_collection_id_foreign",
"columnNames": [
"payment_collection_id"
],
"localTableName": "public.payment-session",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.payment-collection",
"updateRule": "cascade"
}
}
},
{
"columns": {
"id": {
"name": "id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "text"
},
"amount": {
"name": "amount",
"type": "numeric",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "decimal"
},
"authorized_amount": {
"name": "authorized_amount",
"type": "numeric",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "decimal"
},
"currency_code": {
"name": "currency_code",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "text"
},
"provider_id": {
"name": "provider_id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "text"
},
"cart_id": {
"name": "cart_id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"order_id": {
"name": "order_id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"customer_id": {
"name": "customer_id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"data": {
"name": "data",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "json"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"captured_at": {
"name": "captured_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"canceled_at": {
"name": "canceled_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"payment_collection_id": {
"name": "payment_collection_id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "text"
},
"session_id": {
"name": "session_id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "text"
}
},
"name": "payment",
"schema": "public",
"indexes": [
{
"columnNames": [
"deleted_at"
],
"composite": false,
"keyName": "IDX_payment_deleted_at",
"primary": false,
"unique": false
},
{
"columnNames": [
"payment_collection_id"
],
"composite": false,
"keyName": "IDX_payment_payment_collection_id",
"primary": false,
"unique": false
},
{
"columnNames": [
"session_id"
],
"composite": false,
"keyName": "payment_session_id_unique",
"primary": false,
"unique": true
},
{
"keyName": "payment_pkey",
"columnNames": [
"id"
],
"composite": false,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"payment_payment_collection_id_foreign": {
"constraintName": "payment_payment_collection_id_foreign",
"columnNames": [
"payment_collection_id"
],
"localTableName": "public.payment",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.payment-collection",
"updateRule": "cascade"
},
"payment_session_id_foreign": {
"constraintName": "payment_session_id_foreign",
"columnNames": [
"session_id"
],
"localTableName": "public.payment",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.payment-session",
"updateRule": "cascade"
}
}
},
{
"columns": {
"id": {
"name": "id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "text"
},
"amount": {
"name": "amount",
"type": "numeric",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "decimal"
},
"payment_id": {
"name": "payment_id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "text"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"created_by": {
"name": "created_by",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
}
},
"name": "capture",
"schema": "public",
"indexes": [
{
"columnNames": [
"payment_id"
],
"composite": false,
"keyName": "IDX_capture_payment_id",
"primary": false,
"unique": false
},
{
"keyName": "capture_pkey",
"columnNames": [
"id"
],
"composite": false,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"capture_payment_id_foreign": {
"constraintName": "capture_payment_id_foreign",
"columnNames": [
"payment_id"
],
"localTableName": "public.capture",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.payment",
"deleteRule": "cascade",
"updateRule": "cascade"
}
}
},
{
"columns": {
"id": {
"name": "id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "text"
},
"amount": {
"name": "amount",
"type": "numeric",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "decimal"
},
"payment_id": {
"name": "payment_id",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "text"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"created_by": {
"name": "created_by",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
}
},
"name": "refund",
"schema": "public",
"indexes": [
{
"columnNames": [
"payment_id"
],
"composite": false,
"keyName": "IDX_refund_payment_id",
"primary": false,
"unique": false
},
{
"keyName": "refund_pkey",
"columnNames": [
"id"
],
"composite": false,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"refund_payment_id_foreign": {
"constraintName": "refund_payment_id_foreign",
"columnNames": [
"payment_id"
],
"localTableName": "public.refund",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.payment",
"deleteRule": "cascade",
"updateRule": "cascade"
}
}
}
]
}
@@ -1,84 +0,0 @@
import { Migration } from "@mikro-orm/migrations"
export class Migration20240112131027 extends Migration {
async up(): Promise<void> {
this.addSql(
'create table if not exists "payment-collection" ("id" text not null, "currency_code" text null, "amount" numeric not null, "authorized_amount" numeric null, "refunded_amount" numeric null, "region_id" text null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, "completed_at" timestamptz null, "status" text check ("status" in (\'not_paid\', \'awaiting\', \'authorized\', \'partially_authorized\', \'canceled\')) not null default \'not_paid\', constraint "payment-collection_pkey" primary key ("id"));'
)
this.addSql(
'create index "IDX_payment_collection_deleted_at" on "payment-collection" ("deleted_at");'
)
this.addSql(
'create table if not exists "payment-method-token" ("id" text not null, "provider_id" text not null, "data" jsonb null, "name" text not null, "type_detail" text null, "description_detail" text null, "metadata" jsonb null, constraint "payment-method-token_pkey" primary key ("id"));'
)
this.addSql(
'create table if not exists "payment-provider" ("id" text not null, "is_enabled" boolean not null default true, constraint "payment-provider_pkey" primary key ("id"));'
)
this.addSql(
'create table if not exists "payment-collection_payment_providers" ("payment_collection_id" text not null, "payment_provider_id" text not null, constraint "payment-collection_payment_providers_pkey" primary key ("payment_collection_id", "payment_provider_id"));'
)
this.addSql(
'create table if not exists "payment-session" ("id" text not null, "currency_code" text null, "amount" numeric not null, "provider_id" text not null, "data" jsonb null, "status" text check ("status" in (\'authorized\', \'pending\', \'requires_more\', \'error\', \'canceled\')) not null, "is_selected" boolean null, "authorised_at" timestamptz null, "payment_collection_id" text not null, constraint "payment-session_pkey" primary key ("id"));'
)
this.addSql(
'create index "IDX_payment_session_payment_collection_id" on "payment-session" ("payment_collection_id");'
)
this.addSql(
'create table if not exists "payment" ("id" text not null, "amount" numeric not null, "authorized_amount" numeric null, "currency_code" text not null, "provider_id" text not null, "cart_id" text null, "order_id" text null, "customer_id" text null, "data" jsonb null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, "captured_at" timestamptz null, "canceled_at" timestamptz null, "payment_collection_id" text not null, "session_id" text not null, constraint "payment_pkey" primary key ("id"));'
)
this.addSql(
'create index "IDX_payment_deleted_at" on "payment" ("deleted_at");'
)
this.addSql(
'create index "IDX_payment_payment_collection_id" on "payment" ("payment_collection_id");'
)
this.addSql(
'alter table "payment" add constraint "payment_session_id_unique" unique ("session_id");'
)
this.addSql(
'create table if not exists "capture" ("id" text not null, "amount" numeric not null, "payment_id" text not null, "created_at" timestamptz not null default now(), "created_by" text null, constraint "capture_pkey" primary key ("id"));'
)
this.addSql(
'create index "IDX_capture_payment_id" on "capture" ("payment_id");'
)
this.addSql(
'create table if not exists "refund" ("id" text not null, "amount" numeric not null, "payment_id" text not null, "created_at" timestamptz not null default now(), "created_by" text null, constraint "refund_pkey" primary key ("id"));'
)
this.addSql(
'create index "IDX_refund_payment_id" on "refund" ("payment_id");'
)
this.addSql(
'alter table "payment-collection_payment_providers" add constraint "payment-collection_payment_providers_payment_coll_6b015_foreign" foreign key ("payment_collection_id") references "payment-collection" ("id") on update cascade on delete cascade;'
)
this.addSql(
'alter table "payment-collection_payment_providers" add constraint "payment-collection_payment_providers_payment_provider_id_foreign" foreign key ("payment_provider_id") references "payment-provider" ("id") on update cascade on delete cascade;'
)
this.addSql(
'alter table "payment-session" add constraint "payment-session_payment_collection_id_foreign" foreign key ("payment_collection_id") references "payment-collection" ("id") on update cascade;'
)
this.addSql(
'alter table "payment" add constraint "payment_payment_collection_id_foreign" foreign key ("payment_collection_id") references "payment-collection" ("id") on update cascade;'
)
this.addSql(
'alter table "payment" add constraint "payment_session_id_foreign" foreign key ("session_id") references "payment-session" ("id") on update cascade;'
)
this.addSql(
'alter table "capture" add constraint "capture_payment_id_foreign" foreign key ("payment_id") references "payment" ("id") on update cascade on delete cascade;'
)
this.addSql(
'alter table "refund" add constraint "refund_payment_id_foreign" foreign key ("payment_id") references "payment" ("id") on update cascade on delete cascade;'
)
}
}
+2 -2
View File
@@ -45,11 +45,11 @@ export default class Capture {
@BeforeCreate()
onCreate() {
this.id = generateEntityId(this.id, "cap")
this.id = generateEntityId(this.id, "capt")
}
@OnInit()
onInit() {
this.id = generateEntityId(this.id, "cap")
this.id = generateEntityId(this.id, "capt")
}
}
@@ -1,5 +1,6 @@
import {
BeforeCreate,
Cascade,
Collection,
Entity,
Enum,
@@ -54,7 +55,7 @@ type OptionalPaymentCollectionProps =
| "completed_at"
| DAL.SoftDeletableEntityDateColumns
@Entity({ tableName: "payment-collection" })
@Entity({ tableName: "payment_collection" })
@Filter(DALUtils.mikroOrmSoftDeletableFilterOptions)
export default class PaymentCollection {
[OptionalProps]?: OptionalPaymentCollectionProps
@@ -126,22 +127,22 @@ export default class PaymentCollection {
payment_providers = new Collection<PaymentProvider>(this)
@OneToMany(() => PaymentSession, (ps) => ps.payment_collection, {
orphanRemoval: true,
cascade: [Cascade.REMOVE],
})
payment_sessions = new Collection<PaymentSession>(this)
@OneToMany(() => Payment, (payment) => payment.payment_collection, {
orphanRemoval: true,
cascade: [Cascade.REMOVE],
})
payments = new Collection<Payment>(this)
@BeforeCreate()
onCreate() {
this.id = generateEntityId(this.id, "paycol")
this.id = generateEntityId(this.id, "pay_col")
}
@OnInit()
onInit() {
this.id = generateEntityId(this.id, "paycol")
this.id = generateEntityId(this.id, "pay_col")
}
}
@@ -15,7 +15,7 @@ type OptionalPaymentMethodTokenProps =
| "description_detail"
| "metadata"
@Entity({ tableName: "payment-method-token" })
@Entity({ tableName: "payment_method_token" })
export default class PaymentMethodToken {
[OptionalProps]?: OptionalPaymentMethodTokenProps
@@ -1,6 +1,6 @@
import { Entity, PrimaryKey, Property } from "@mikro-orm/core"
@Entity({ tableName: "payment-provider" })
@Entity({ tableName: "payment_provider" })
export default class PaymentProvider {
@PrimaryKey({ columnType: "text" })
id: string
@@ -47,10 +47,10 @@ type OptionalPaymentSessionProps =
| "currency_code"
| "data"
| "is_selected"
| "authorised_at"
| "authorized_at"
| DAL.EntityDateColumns
@Entity({ tableName: "payment-session" })
@Entity({ tableName: "payment_session" })
export default class PaymentSession {
[OptionalProps]?: OptionalPaymentSessionProps
@@ -84,7 +84,7 @@ export default class PaymentSession {
columnType: "timestamptz",
nullable: true,
})
authorised_at: Date | null
authorized_at: Date | null
@ManyToOne({
index: "IDX_payment_session_payment_collection_id",
@@ -101,11 +101,11 @@ export default class PaymentSession {
@BeforeCreate()
onCreate() {
this.id = generateEntityId(this.id, "ps")
this.id = generateEntityId(this.id, "payses")
}
@OnInit()
onInit() {
this.id = generateEntityId(this.id, "ps")
this.id = generateEntityId(this.id, "payses")
}
}
+3 -2
View File
@@ -1,5 +1,6 @@
import {
BeforeCreate,
Cascade,
Collection,
Entity,
Filter,
@@ -103,12 +104,12 @@ export default class Payment {
canceled_at: Date | null
@OneToMany(() => Refund, (refund) => refund.payment, {
orphanRemoval: true,
cascade: [Cascade.REMOVE],
})
refunds = new Collection<Refund>(this)
@OneToMany(() => Capture, (capture) => capture.payment, {
orphanRemoval: true,
cascade: [Cascade.REMOVE],
})
captures = new Collection<Capture>(this)