Files
orders/src/saas/generated/order/saas-actions.ts

219 lines
5.6 KiB
TypeScript

// Generated by cool saas-model generate. DO NOT EDIT.
import { defineInjectedSaasAction } from '@cool-midway/module-runtime';
export type DemoGoodsBatchInfoInput = {
ids: number[];
};
export type DemoGoodsBatchInfoOutput = {
list: Record<string, unknown>[];
};
export type DemoGoodsReleaseStockInput = {
goodsId: number;
orderNo: string;
quantity: number;
};
export type DemoGoodsReleaseStockOutput = {
currentStock: number;
goodsId: number;
};
export type DemoGoodsReserveStockInput = {
goodsId: number;
quantity: number;
};
export type DemoGoodsReserveStockOutput = {
goodsId: number;
remainingStock: number;
};
export const SaasActions = {
Demo: {
GoodsBatchInfo: defineInjectedSaasAction<DemoGoodsBatchInfoInput, DemoGoodsBatchInfoOutput>({
"kind": "action",
"name": "goods.batchInfo",
"access": "read",
"actionName": "goods.batchInfo",
"idempotent": false,
"moduleCode": "demo",
"inputSchema": {
"type": "object",
"required": [
"ids"
],
"properties": {
"ids": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1
},
"minItems": 1
}
},
"additionalProperties": false
},
"callerPolicy": {
"kind": "module",
"allowedModules": [
"order"
]
},
"contractKind": "saas.action.import",
"outputSchema": {
"type": "object",
"required": [
"list"
],
"properties": {
"list": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
},
"additionalProperties": false
},
"inputChecksum": "b2e0c5fd68adc75e2687c6a1ce01b8270240b42df6511efd6d922ea3242bc264",
"actionChecksum": "3978a7ba9a3e0f91842031fd323ec63b3816eef68cb8dc82ffad6d187de8b7ea",
"outputChecksum": "fe644424ef6a9e462b56edc9f70f48bb218783c69469469d4310de48589a0df5",
"contractVersion": 1,
"providerReleaseId": 41,
"consumerModuleCode": "order",
"providerModuleCode": "demo",
"providerReleaseVersion": "1.0.1"
}),
GoodsReleaseStock: defineInjectedSaasAction<DemoGoodsReleaseStockInput, DemoGoodsReleaseStockOutput>({
"kind": "action",
"name": "goods.releaseStock",
"access": "write",
"actionName": "goods.releaseStock",
"idempotent": true,
"moduleCode": "demo",
"inputSchema": {
"type": "object",
"required": [
"goodsId",
"quantity",
"orderNo"
],
"properties": {
"goodsId": {
"type": "integer",
"minimum": 1
},
"orderNo": {
"type": "string",
"maxLength": 64,
"minLength": 1
},
"quantity": {
"type": "integer",
"minimum": 1
}
},
"additionalProperties": false
},
"callerPolicy": {
"kind": "module",
"allowedModules": [
"order"
]
},
"contractKind": "saas.action.import",
"outputSchema": {
"type": "object",
"required": [
"goodsId",
"currentStock"
],
"properties": {
"goodsId": {
"type": "integer"
},
"currentStock": {
"type": "integer",
"minimum": 0
}
},
"additionalProperties": false
},
"inputChecksum": "c363d259b5108d069650a2554309eb3eb165d98723596595958e00acf8410abe",
"actionChecksum": "63423abe8557075caf668a91795f95a45195759a6b82e755d8af51ddfc71996e",
"outputChecksum": "a632b9f89518c3c17861454b74173a4880d5e8482639d3ff7f761aee4d061bd9",
"contractVersion": 1,
"commandEventType": "saas.workflow.demo.goods.releaseStock",
"providerReleaseId": 41,
"consumerModuleCode": "order",
"providerModuleCode": "demo",
"providerReleaseVersion": "1.0.1",
"commandEventContractChecksum": "18a727b91cf9410c3b7ac14e3a8799dbbfa8937f84667bfe7e31e21e662396be"
}),
GoodsReserveStock: defineInjectedSaasAction<DemoGoodsReserveStockInput, DemoGoodsReserveStockOutput>({
"kind": "action",
"name": "goods.reserveStock",
"access": "write",
"actionName": "goods.reserveStock",
"idempotent": true,
"moduleCode": "demo",
"inputSchema": {
"type": "object",
"required": [
"goodsId",
"quantity"
],
"properties": {
"goodsId": {
"type": "integer",
"minimum": 1
},
"quantity": {
"type": "integer",
"minimum": 1
}
},
"additionalProperties": false
},
"callerPolicy": {
"kind": "module",
"allowedModules": [
"order"
]
},
"contractKind": "saas.action.import",
"outputSchema": {
"type": "object",
"required": [
"goodsId",
"remainingStock"
],
"properties": {
"goodsId": {
"type": "integer"
},
"remainingStock": {
"type": "integer",
"minimum": 0
}
},
"additionalProperties": false
},
"inputChecksum": "6fbfa4d2324c4c0bdc621cbfd256353284e27495f59f47231b7d897b82a4e7b6",
"actionChecksum": "773465c93790e8df9119149e1efb4c4d8d2510298a24af7aa825662540ff37d5",
"outputChecksum": "545bd8b0bf6eb8670b21497236038187ee0f1df1544a318b16a399458fcb796e",
"contractVersion": 1,
"commandEventType": "saas.workflow.demo.goods.reserveStock",
"providerReleaseId": 41,
"consumerModuleCode": "order",
"providerModuleCode": "demo",
"providerReleaseVersion": "1.0.1",
"commandEventContractChecksum": "ffbecad3a3d63b8bf92fde701dfaa11c8502a2c5f9f6bbb89b755e214024c3ae"
})
}
} as const;