feat(core-flows,payment,medusa,types): Refund reasons management API (#8436)

* feat(core-flows,payment,medusa,types): add ability to set and manage refund reasons

* fix(payment): validate total amount when refunding payment (#8437)

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>

* feature: introduce additional_data to the product endpoints (#8405)

* chore(docs): Generated References (#8440)

Generated the following references:
- `product`

* chore: align payment database schema

* Update packages/core/core-flows/src/payment-collection/steps/create-refund-reasons.ts

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>

* chore: address review

---------

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
Co-authored-by: Harminder Virk <virk.officials@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
Riqwan Thamir
2024-08-06 11:47:42 +02:00
committed by GitHub
parent 8fb079786d
commit 0ff5b975e7
36 changed files with 2412 additions and 9 deletions
@@ -4,6 +4,7 @@ import {
DALUtils,
MikroOrmBigNumberProperty,
Searchable,
createPsqlIndexStatementHelper,
generateEntityId,
} from "@medusajs/utils"
import {
@@ -28,7 +29,13 @@ import Refund from "./refund"
type OptionalPaymentProps = DAL.ModelDateColumns
@Entity({ tableName: "payment" })
const tableName = "payment"
const ProviderIdIndex = createPsqlIndexStatementHelper({
tableName,
columns: "provider_id",
})
@Entity({ tableName })
@Filter(DALUtils.mikroOrmSoftDeletableFilterOptions)
export default class Payment {
[OptionalProps]?: OptionalPaymentProps
@@ -46,6 +53,7 @@ export default class Payment {
currency_code: string
@Property({ columnType: "text" })
@ProviderIdIndex.MikroORMIndex()
provider_id: string
@Searchable()