wip: interface and types

This commit is contained in:
fPolic
2024-01-15 15:18:02 +01:00
parent efdc59fd53
commit 56752039cf
4 changed files with 108 additions and 1 deletions
+30
View File
@@ -0,0 +1,30 @@
import { BaseFilterable } from "../dal"
import { OperatorMap } from "../dal/utils"
/* ********** PAYMENT COLLECTION ********** */
export interface PaymentCollectionDTO {
/**
* The ID of the Payment Collection
*/
id: string
}
export interface FilterablePaymentCollectionProps
extends BaseFilterable<PaymentCollectionDTO> {
id?: string | string[]
region_id?: string | string[] | OperatorMap<string>
created_at?: OperatorMap<string>
updated_at?: OperatorMap<string>
}
/* ********** PAYMENT ********** */
export interface PaymentDTO {
/**
* The ID of the Payment Collection
*/
id: string
}
+3
View File
@@ -1 +1,4 @@
export * from "./common"
export * from "./mutations"
export * from "./service"
+3
View File
@@ -0,0 +1,3 @@
export interface CreatePaymentCollectionDTO {}
export interface UpdatePaymentCollectionDTO {}
+72 -1
View File
@@ -1,3 +1,74 @@
import { IModuleService } from "../modules-sdk"
import { Context } from "../shared-context"
import {
CreatePaymentCollectionDTO,
UpdatePaymentCollectionDTO,
} from "./mutations"
import {
FilterablePaymentCollectionProps,
PaymentCollectionDTO,
PaymentDTO,
} from "./common"
import { FindConfig } from "../common"
export interface IPaymentModuleService extends IModuleService {}
export interface IPaymentModuleService extends IModuleService {
createPaymentCollection(
data: CreatePaymentCollectionDTO[],
sharedContext?: Context
): Promise<PaymentCollectionDTO[]>
createPaymentCollection(
data: CreatePaymentCollectionDTO,
sharedContext?: Context
): Promise<PaymentCollectionDTO>
retrievePaymentCollection(
paymentCollectionId: string,
config?: FindConfig<PaymentCollectionDTO>,
sharedContext?: Context
): Promise<PaymentCollectionDTO>
listPaymentCollections(
filters?: FilterablePaymentCollectionProps,
config?: FindConfig<PaymentCollectionDTO>,
sharedContext?: Context
): Promise<[PaymentCollectionDTO[], number]>
listAndCountPaymentCollections(
filters?: FilterablePaymentCollectionProps,
config?: FindConfig<PaymentCollectionDTO>,
sharedContext?: Context
): Promise<[PaymentCollectionDTO[], number]>
updatePaymentCollection(
data: UpdatePaymentCollectionDTO[],
sharedContext?: Context
): Promise<PaymentCollectionDTO[]>
updatePaymentCollection(
data: UpdatePaymentCollectionDTO,
sharedContext?: Context
): Promise<PaymentCollectionDTO>
deletePaymentCollection(
paymentCollectionId: string[],
sharedContext?: Context
): Promise<void>
deletePaymentCollection(
paymentCollectionId: string,
sharedContext?: Context
): Promise<void>
authorizePaymentCollection(
paymentCollectionId: string,
sharedContext?: Context
): Promise<PaymentCollectionDTO>
completePaymentCollection(
paymentCollectionId: string,
sharedContext?: Context
): Promise<PaymentCollectionDTO>
capturePayment(paymentId: string): Promise<PaymentDTO>
refundPayment(paymentId: string): Promise<PaymentDTO>
createPayment()
}