zova-module-pay-mock 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,34 @@
1
+ import type { IApiActionOptions } from 'zova-module-a-api';
2
+
3
+ import { Api, BeanApiBase } from 'zova-module-a-api';
4
+
5
+ import type { components, paths } from './openapi/index.js';
6
+
7
+ import { OpenApiBaseURL } from './openapi/index.js';
8
+
9
+ /** PayMockPayment_complete */
10
+ export const ApiApiPayMockPaymentcompletePath = '/api/pay/mock/payment-session/{id}/complete';
11
+ export type ApiApiPayMockPaymentcompletePath = '/api/pay/mock/payment-session/{id}/complete';
12
+ export type ApiApiPayMockPaymentcompleteMethod = 'post';
13
+ export type ApiApiPayMockPaymentcompleteRequestParams =
14
+ paths[ApiApiPayMockPaymentcompletePath][ApiApiPayMockPaymentcompleteMethod]['parameters']['path'];
15
+ export type ApiApiPayMockPaymentcompleteRequestBody =
16
+ components['schemas']['pay-mock.dto.mockPaymentComplete'];
17
+ export type ApiApiPayMockPaymentcompleteResponseBody =
18
+ paths[ApiApiPayMockPaymentcompletePath][ApiApiPayMockPaymentcompleteMethod]['responses']['200']['content']['application/json']['data'];
19
+
20
+ @Api()
21
+ export class ApiPayMockPayment extends BeanApiBase {
22
+ complete(
23
+ body: ApiApiPayMockPaymentcompleteRequestBody,
24
+ options: {
25
+ params: ApiApiPayMockPaymentcompleteRequestParams;
26
+ } & IApiActionOptions,
27
+ ) {
28
+ return this.$fetch.post<any, ApiApiPayMockPaymentcompleteResponseBody>(
29
+ this.$pathTranslate(ApiApiPayMockPaymentcompletePath, options.params),
30
+ body,
31
+ this.$configPrepare(OpenApiBaseURL(this.sys), options, true),
32
+ );
33
+ }
34
+ }
@@ -0,0 +1,13 @@
1
+ import type { IApiSchemaOptions } from 'zova-module-a-api';
2
+
3
+ import { BeanBase } from 'zova';
4
+ import { ApiSchema } from 'zova-module-a-api';
5
+
6
+ import { ApiApiPayMockPaymentcompletePath } from '../api/payMockPayment.js';
7
+
8
+ @ApiSchema()
9
+ export class ApiSchemaPayMockPayment extends BeanBase {
10
+ complete(options?: IApiSchemaOptions) {
11
+ return this.$sdk.createApiSchemas(ApiApiPayMockPaymentcompletePath, 'post', options);
12
+ }
13
+ }
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './.metadata/index.js';
@@ -0,0 +1,20 @@
1
+ import type { TableIdentity } from 'table-identity';
2
+ import type { IDecoratorModelOptions } from 'zova-module-a-model';
3
+
4
+ import { BeanModelBase, Model } from 'zova-module-a-model';
5
+
6
+ import type { ApiApiPayMockPaymentcompleteRequestBody } from '../api/payMockPayment.js';
7
+
8
+ export interface IModelOptionsPayMockPayment extends IDecoratorModelOptions {}
9
+
10
+ @Model<IModelOptionsPayMockPayment>()
11
+ export class ModelPayMockPayment extends BeanModelBase {
12
+ complete(id: TableIdentity) {
13
+ return this.$useMutationData({
14
+ mutationKey: ['complete', id],
15
+ mutationFn: async (body: ApiApiPayMockPaymentcompleteRequestBody) => {
16
+ return await this.scope.api.payMockPayment.complete(body, { params: { id } });
17
+ },
18
+ });
19
+ }
20
+ }