@lssm/example.marketplace 0.0.0-canary-20251217083314 → 1.41.1
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.
- package/dist/docs/index.js +1 -1
- package/dist/docs/marketplace.docblock.js +5 -61
- package/dist/entities/index.js +1 -45
- package/dist/entities/order.js +1 -173
- package/dist/entities/payout.js +1 -162
- package/dist/entities/product.js +1 -161
- package/dist/entities/review.js +1 -152
- package/dist/entities/store.js +1 -110
- package/dist/example.js +1 -50
- package/dist/index.js +1 -27
- package/dist/marketplace.feature.js +1 -308
- package/dist/order/index.js +1 -6
- package/dist/order/order.contracts.js +1 -74
- package/dist/order/order.enum.js +1 -22
- package/dist/order/order.event.js +1 -193
- package/dist/order/order.presentation.js +1 -72
- package/dist/order/order.schema.js +1 -156
- package/dist/payout/index.js +1 -6
- package/dist/payout/payout.contracts.js +1 -32
- package/dist/payout/payout.enum.js +1 -17
- package/dist/payout/payout.event.js +1 -84
- package/dist/payout/payout.presentation.js +1 -50
- package/dist/payout/payout.schema.js +1 -117
- package/dist/product/index.js +1 -6
- package/dist/product/product.contracts.js +1 -65
- package/dist/product/product.enum.js +1 -18
- package/dist/product/product.event.js +1 -103
- package/dist/product/product.presentation.js +1 -72
- package/dist/product/product.schema.js +1 -177
- package/dist/review/index.js +1 -6
- package/dist/review/review.contracts.js +1 -65
- package/dist/review/review.enum.js +1 -16
- package/dist/review/review.event.js +1 -76
- package/dist/review/review.presentation.js +1 -50
- package/dist/review/review.schema.js +1 -157
- package/dist/store/index.js +1 -6
- package/dist/store/store.contracts.js +1 -41
- package/dist/store/store.enum.js +1 -16
- package/dist/store/store.event.js +1 -72
- package/dist/store/store.presentation.js +1 -50
- package/dist/store/store.schema.js +1 -94
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +53 -53
- package/dist/docs/index.d.ts +0 -1
- package/dist/docs/marketplace.docblock.d.ts +0 -1
- package/dist/entities/index.d.ts +0 -308
- package/dist/entities/order.d.ts +0 -104
- package/dist/entities/payout.d.ts +0 -91
- package/dist/entities/product.d.ts +0 -92
- package/dist/entities/review.d.ts +0 -82
- package/dist/entities/store.d.ts +0 -59
- package/dist/example.d.ts +0 -39
- package/dist/index.d.ts +0 -21
- package/dist/libs/contracts/dist/capabilities/openbanking.js +0 -88
- package/dist/libs/contracts/dist/client/index.js +0 -5
- package/dist/libs/contracts/dist/client/react/feature-render.js +0 -2
- package/dist/libs/contracts/dist/client/react/form-render.js +0 -4
- package/dist/libs/contracts/dist/client/react/index.js +0 -4
- package/dist/libs/contracts/dist/contract-registry/index.js +0 -1
- package/dist/libs/contracts/dist/contract-registry/schemas.js +0 -60
- package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/index.js +0 -29
- package/dist/libs/contracts/dist/docs/presentations.js +0 -71
- package/dist/libs/contracts/dist/docs/registry.js +0 -44
- package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +0 -80
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -57
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -357
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -37
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -16
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +0 -20
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -48
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -79
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -84
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -45
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -67
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -40
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -69
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -47
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -62
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -155
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -20
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -101
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +0 -20
- package/dist/libs/contracts/dist/events.js +0 -10
- package/dist/libs/contracts/dist/experiments/evaluator.js +0 -1
- package/dist/libs/contracts/dist/index.js +0 -71
- package/dist/libs/contracts/dist/install.js +0 -2
- package/dist/libs/contracts/dist/integrations/contracts.js +0 -377
- package/dist/libs/contracts/dist/integrations/index.js +0 -18
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +0 -228
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +0 -159
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +0 -3
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +0 -210
- package/dist/libs/contracts/dist/integrations/openbanking/models.js +0 -242
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +0 -13
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +0 -52
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +0 -75
- package/dist/libs/contracts/dist/integrations/providers/gmail.js +0 -87
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +0 -66
- package/dist/libs/contracts/dist/integrations/providers/index.js +0 -11
- package/dist/libs/contracts/dist/integrations/providers/mistral.js +0 -68
- package/dist/libs/contracts/dist/integrations/providers/postmark.js +0 -68
- package/dist/libs/contracts/dist/integrations/providers/powens.js +0 -116
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js +0 -73
- package/dist/libs/contracts/dist/integrations/providers/registry.js +0 -10
- package/dist/libs/contracts/dist/integrations/providers/stripe.js +0 -83
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +0 -61
- package/dist/libs/contracts/dist/jsonschema.js +0 -1
- package/dist/libs/contracts/dist/knowledge/contracts.js +0 -306
- package/dist/libs/contracts/dist/knowledge/index.js +0 -7
- package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +0 -38
- package/dist/libs/contracts/dist/knowledge/spaces/index.js +0 -6
- package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +0 -37
- package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +0 -34
- package/dist/libs/contracts/dist/llm/exporters.js +0 -19
- package/dist/libs/contracts/dist/llm/index.js +0 -2
- package/dist/libs/contracts/dist/llm/prompts.js +0 -1
- package/dist/libs/contracts/dist/onboarding-base.js +0 -196
- package/dist/libs/contracts/dist/openapi.js +0 -1
- package/dist/libs/contracts/dist/ownership.js +0 -21
- package/dist/libs/contracts/dist/presentations.js +0 -1
- package/dist/libs/contracts/dist/presentations.v2.js +0 -11
- package/dist/libs/contracts/dist/prompt.js +0 -1
- package/dist/libs/contracts/dist/promptRegistry.js +0 -1
- package/dist/libs/contracts/dist/regenerator/index.js +0 -1
- package/dist/libs/contracts/dist/regenerator/service.js +0 -6
- package/dist/libs/contracts/dist/registry.js +0 -2
- package/dist/libs/contracts/dist/resources.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/EnumType.js +0 -2
- package/dist/libs/contracts/dist/schema/dist/FieldType.js +0 -49
- package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -236
- package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +0 -34
- package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/entity/index.js +0 -2
- package/dist/libs/contracts/dist/schema/dist/entity/types.js +0 -1
- package/dist/libs/contracts/dist/schema/dist/index.js +0 -6
- package/dist/libs/contracts/dist/server/graphql-pothos.js +0 -6
- package/dist/libs/contracts/dist/server/index.js +0 -8
- package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +0 -4
- package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +0 -2
- package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +0 -1
- package/dist/libs/contracts/dist/server/mcp/registerResources.js +0 -2
- package/dist/libs/contracts/dist/server/mcp/registerTools.js +0 -1
- package/dist/libs/contracts/dist/server/provider-mcp.js +0 -1
- package/dist/libs/contracts/dist/server/rest-elysia.js +0 -1
- package/dist/libs/contracts/dist/server/rest-express.js +0 -1
- package/dist/libs/contracts/dist/server/rest-generic.js +0 -1
- package/dist/libs/contracts/dist/server/rest-next-app.js +0 -1
- package/dist/libs/contracts/dist/server/rest-next-pages.js +0 -1
- package/dist/libs/contracts/dist/spec.js +0 -34
- package/dist/libs/contracts/dist/telemetry/index.js +0 -1
- package/dist/libs/contracts/dist/telemetry/tracker.js +0 -1
- package/dist/libs/contracts/dist/tests/index.js +0 -1
- package/dist/libs/contracts/dist/tests/runner.js +0 -2
- package/dist/libs/contracts/dist/workflow/index.js +0 -1
- package/dist/libs/contracts/dist/workflow/runner.js +0 -1
- package/dist/libs/schema/dist/EnumType.js +0 -56
- package/dist/libs/schema/dist/FieldType.js +0 -49
- package/dist/libs/schema/dist/ScalarTypeEnum.js +0 -236
- package/dist/libs/schema/dist/SchemaModel.js +0 -39
- package/dist/libs/schema/dist/entity/defineEntity.js +0 -236
- package/dist/libs/schema/dist/entity/index.js +0 -2
- package/dist/libs/schema/dist/entity/types.js +0 -1
- package/dist/libs/schema/dist/index.js +0 -6
- package/dist/marketplace.feature.d.ts +0 -11
- package/dist/order/index.d.ts +0 -5
- package/dist/order/order.contracts.d.ts +0 -367
- package/dist/order/order.enum.d.ts +0 -9
- package/dist/order/order.event.d.ts +0 -144
- package/dist/order/order.presentation.d.ts +0 -8
- package/dist/order/order.schema.d.ts +0 -164
- package/dist/payout/index.d.ts +0 -5
- package/dist/payout/payout.contracts.d.ts +0 -96
- package/dist/payout/payout.enum.d.ts +0 -9
- package/dist/payout/payout.event.d.ts +0 -62
- package/dist/payout/payout.presentation.d.ts +0 -7
- package/dist/payout/payout.schema.d.ts +0 -156
- package/dist/product/index.d.ts +0 -5
- package/dist/product/product.contracts.d.ts +0 -272
- package/dist/product/product.enum.d.ts +0 -9
- package/dist/product/product.event.d.ts +0 -72
- package/dist/product/product.presentation.d.ts +0 -8
- package/dist/product/product.schema.d.ts +0 -217
- package/dist/review/index.d.ts +0 -5
- package/dist/review/review.contracts.d.ts +0 -236
- package/dist/review/review.enum.d.ts +0 -9
- package/dist/review/review.event.d.ts +0 -54
- package/dist/review/review.presentation.d.ts +0 -7
- package/dist/review/review.schema.d.ts +0 -189
- package/dist/store/index.d.ts +0 -5
- package/dist/store/store.contracts.d.ts +0 -130
- package/dist/store/store.enum.d.ts +0 -9
- package/dist/store/store.event.d.ts +0 -50
- package/dist/store/store.presentation.d.ts +0 -7
- package/dist/store/store.schema.d.ts +0 -83
|
@@ -1,74 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CreateOrderInputModel, OrderModel, UpdateOrderStatusInputModel } from "./order.schema.js";
|
|
3
|
-
|
|
4
|
-
//#region src/order/order.contracts.ts
|
|
5
|
-
const OWNERS = ["@example.marketplace"];
|
|
6
|
-
/**
|
|
7
|
-
* Create a new order.
|
|
8
|
-
*/
|
|
9
|
-
const CreateOrderContract = defineCommand({
|
|
10
|
-
meta: {
|
|
11
|
-
name: "marketplace.order.create",
|
|
12
|
-
version: 1,
|
|
13
|
-
stability: "stable",
|
|
14
|
-
owners: [...OWNERS],
|
|
15
|
-
tags: [
|
|
16
|
-
"marketplace",
|
|
17
|
-
"order",
|
|
18
|
-
"create"
|
|
19
|
-
],
|
|
20
|
-
description: "Create a new order.",
|
|
21
|
-
goal: "Allow buyers to purchase products.",
|
|
22
|
-
context: "Checkout flow."
|
|
23
|
-
},
|
|
24
|
-
io: {
|
|
25
|
-
input: CreateOrderInputModel,
|
|
26
|
-
output: OrderModel
|
|
27
|
-
},
|
|
28
|
-
policy: { auth: "user" },
|
|
29
|
-
sideEffects: {
|
|
30
|
-
emits: [{
|
|
31
|
-
name: "marketplace.order.created",
|
|
32
|
-
version: 1,
|
|
33
|
-
when: "Order is created",
|
|
34
|
-
payload: OrderModel
|
|
35
|
-
}],
|
|
36
|
-
audit: ["marketplace.order.created"]
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
/**
|
|
40
|
-
* Update order status.
|
|
41
|
-
*/
|
|
42
|
-
const UpdateOrderStatusContract = defineCommand({
|
|
43
|
-
meta: {
|
|
44
|
-
name: "marketplace.order.updateStatus",
|
|
45
|
-
version: 1,
|
|
46
|
-
stability: "stable",
|
|
47
|
-
owners: [...OWNERS],
|
|
48
|
-
tags: [
|
|
49
|
-
"marketplace",
|
|
50
|
-
"order",
|
|
51
|
-
"status"
|
|
52
|
-
],
|
|
53
|
-
description: "Update order status.",
|
|
54
|
-
goal: "Track order fulfillment.",
|
|
55
|
-
context: "Order management."
|
|
56
|
-
},
|
|
57
|
-
io: {
|
|
58
|
-
input: UpdateOrderStatusInputModel,
|
|
59
|
-
output: OrderModel
|
|
60
|
-
},
|
|
61
|
-
policy: { auth: "user" },
|
|
62
|
-
sideEffects: {
|
|
63
|
-
emits: [{
|
|
64
|
-
name: "marketplace.order.statusUpdated",
|
|
65
|
-
version: 1,
|
|
66
|
-
when: "Status changes",
|
|
67
|
-
payload: OrderModel
|
|
68
|
-
}],
|
|
69
|
-
audit: ["marketplace.order.statusUpdated"]
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
//#endregion
|
|
74
|
-
export { CreateOrderContract, UpdateOrderStatusContract };
|
|
1
|
+
import{CreateOrderInputModel as e,OrderModel as t,UpdateOrderStatusInputModel as n}from"./order.schema.js";import{defineCommand as r}from"@lssm/lib.contracts/spec";const i=[`@example.marketplace`],a=r({meta:{name:`marketplace.order.create`,version:1,stability:`stable`,owners:[...i],tags:[`marketplace`,`order`,`create`],description:`Create a new order.`,goal:`Allow buyers to purchase products.`,context:`Checkout flow.`},io:{input:e,output:t},policy:{auth:`user`},sideEffects:{emits:[{name:`marketplace.order.created`,version:1,when:`Order is created`,payload:t}],audit:[`marketplace.order.created`]}}),o=r({meta:{name:`marketplace.order.updateStatus`,version:1,stability:`stable`,owners:[...i],tags:[`marketplace`,`order`,`status`],description:`Update order status.`,goal:`Track order fulfillment.`,context:`Order management.`},io:{input:n,output:t},policy:{auth:`user`},sideEffects:{emits:[{name:`marketplace.order.statusUpdated`,version:1,when:`Status changes`,payload:t}],audit:[`marketplace.order.statusUpdated`]}});export{a as CreateOrderContract,o as UpdateOrderStatusContract};
|
package/dist/order/order.enum.js
CHANGED
|
@@ -1,22 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "../libs/schema/dist/index.js";
|
|
3
|
-
|
|
4
|
-
//#region src/order/order.enum.ts
|
|
5
|
-
/**
|
|
6
|
-
* Order status enum.
|
|
7
|
-
*/
|
|
8
|
-
const OrderStatusEnum = defineEnum("OrderStatus", [
|
|
9
|
-
"PENDING",
|
|
10
|
-
"PAID",
|
|
11
|
-
"PROCESSING",
|
|
12
|
-
"SHIPPED",
|
|
13
|
-
"DELIVERED",
|
|
14
|
-
"COMPLETED",
|
|
15
|
-
"CANCELLED",
|
|
16
|
-
"REFUNDED",
|
|
17
|
-
"PARTIALLY_REFUNDED",
|
|
18
|
-
"DISPUTED"
|
|
19
|
-
]);
|
|
20
|
-
|
|
21
|
-
//#endregion
|
|
22
|
-
export { OrderStatusEnum };
|
|
1
|
+
import{defineEnum as e}from"@lssm/lib.schema";const t=e(`OrderStatus`,[`PENDING`,`PAID`,`PROCESSING`,`SHIPPED`,`DELIVERED`,`COMPLETED`,`CANCELLED`,`REFUNDED`,`PARTIALLY_REFUNDED`,`DISPUTED`]);export{t as OrderStatusEnum};
|
|
@@ -1,193 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { defineSchemaModel } from "../libs/schema/dist/SchemaModel.js";
|
|
3
|
-
import "../libs/schema/dist/index.js";
|
|
4
|
-
import { defineEvent } from "../libs/contracts/dist/events.js";
|
|
5
|
-
import "../libs/contracts/dist/index.js";
|
|
6
|
-
|
|
7
|
-
//#region src/order/order.event.ts
|
|
8
|
-
const OrderCreatedPayload = defineSchemaModel({
|
|
9
|
-
name: "OrderCreatedEventPayload",
|
|
10
|
-
fields: {
|
|
11
|
-
orderId: {
|
|
12
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
13
|
-
isOptional: false
|
|
14
|
-
},
|
|
15
|
-
orderNumber: {
|
|
16
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
17
|
-
isOptional: false
|
|
18
|
-
},
|
|
19
|
-
buyerId: {
|
|
20
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
21
|
-
isOptional: false
|
|
22
|
-
},
|
|
23
|
-
storeId: {
|
|
24
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
25
|
-
isOptional: false
|
|
26
|
-
},
|
|
27
|
-
total: {
|
|
28
|
-
type: ScalarTypeEnum.Float_unsecure(),
|
|
29
|
-
isOptional: false
|
|
30
|
-
},
|
|
31
|
-
currency: {
|
|
32
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
33
|
-
isOptional: false
|
|
34
|
-
},
|
|
35
|
-
itemCount: {
|
|
36
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
37
|
-
isOptional: false
|
|
38
|
-
},
|
|
39
|
-
timestamp: {
|
|
40
|
-
type: ScalarTypeEnum.DateTime(),
|
|
41
|
-
isOptional: false
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
const OrderPaidPayload = defineSchemaModel({
|
|
46
|
-
name: "OrderPaidEventPayload",
|
|
47
|
-
fields: {
|
|
48
|
-
orderId: {
|
|
49
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
50
|
-
isOptional: false
|
|
51
|
-
},
|
|
52
|
-
orderNumber: {
|
|
53
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
54
|
-
isOptional: false
|
|
55
|
-
},
|
|
56
|
-
total: {
|
|
57
|
-
type: ScalarTypeEnum.Float_unsecure(),
|
|
58
|
-
isOptional: false
|
|
59
|
-
},
|
|
60
|
-
paymentMethod: {
|
|
61
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
62
|
-
isOptional: false
|
|
63
|
-
},
|
|
64
|
-
timestamp: {
|
|
65
|
-
type: ScalarTypeEnum.DateTime(),
|
|
66
|
-
isOptional: false
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
const OrderStatusUpdatedPayload = defineSchemaModel({
|
|
71
|
-
name: "OrderStatusUpdatedEventPayload",
|
|
72
|
-
fields: {
|
|
73
|
-
orderId: {
|
|
74
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
75
|
-
isOptional: false
|
|
76
|
-
},
|
|
77
|
-
orderNumber: {
|
|
78
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
79
|
-
isOptional: false
|
|
80
|
-
},
|
|
81
|
-
previousStatus: {
|
|
82
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
83
|
-
isOptional: false
|
|
84
|
-
},
|
|
85
|
-
newStatus: {
|
|
86
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
87
|
-
isOptional: false
|
|
88
|
-
},
|
|
89
|
-
updatedBy: {
|
|
90
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
91
|
-
isOptional: false
|
|
92
|
-
},
|
|
93
|
-
timestamp: {
|
|
94
|
-
type: ScalarTypeEnum.DateTime(),
|
|
95
|
-
isOptional: false
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
const OrderShippedPayload = defineSchemaModel({
|
|
100
|
-
name: "OrderShippedEventPayload",
|
|
101
|
-
fields: {
|
|
102
|
-
orderId: {
|
|
103
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
104
|
-
isOptional: false
|
|
105
|
-
},
|
|
106
|
-
orderNumber: {
|
|
107
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
108
|
-
isOptional: false
|
|
109
|
-
},
|
|
110
|
-
trackingNumber: {
|
|
111
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
112
|
-
isOptional: true
|
|
113
|
-
},
|
|
114
|
-
trackingUrl: {
|
|
115
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
116
|
-
isOptional: true
|
|
117
|
-
},
|
|
118
|
-
carrier: {
|
|
119
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
120
|
-
isOptional: true
|
|
121
|
-
},
|
|
122
|
-
timestamp: {
|
|
123
|
-
type: ScalarTypeEnum.DateTime(),
|
|
124
|
-
isOptional: false
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
const OrderCompletedPayload = defineSchemaModel({
|
|
129
|
-
name: "OrderCompletedEventPayload",
|
|
130
|
-
fields: {
|
|
131
|
-
orderId: {
|
|
132
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
133
|
-
isOptional: false
|
|
134
|
-
},
|
|
135
|
-
orderNumber: {
|
|
136
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
137
|
-
isOptional: false
|
|
138
|
-
},
|
|
139
|
-
buyerId: {
|
|
140
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
141
|
-
isOptional: false
|
|
142
|
-
},
|
|
143
|
-
storeId: {
|
|
144
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
145
|
-
isOptional: false
|
|
146
|
-
},
|
|
147
|
-
total: {
|
|
148
|
-
type: ScalarTypeEnum.Float_unsecure(),
|
|
149
|
-
isOptional: false
|
|
150
|
-
},
|
|
151
|
-
sellerPayout: {
|
|
152
|
-
type: ScalarTypeEnum.Float_unsecure(),
|
|
153
|
-
isOptional: false
|
|
154
|
-
},
|
|
155
|
-
timestamp: {
|
|
156
|
-
type: ScalarTypeEnum.DateTime(),
|
|
157
|
-
isOptional: false
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
const OrderCreatedEvent = defineEvent({
|
|
162
|
-
name: "marketplace.order.created",
|
|
163
|
-
version: 1,
|
|
164
|
-
description: "A new order has been created.",
|
|
165
|
-
payload: OrderCreatedPayload
|
|
166
|
-
});
|
|
167
|
-
const OrderPaidEvent = defineEvent({
|
|
168
|
-
name: "marketplace.order.paid",
|
|
169
|
-
version: 1,
|
|
170
|
-
description: "An order has been paid.",
|
|
171
|
-
payload: OrderPaidPayload
|
|
172
|
-
});
|
|
173
|
-
const OrderStatusUpdatedEvent = defineEvent({
|
|
174
|
-
name: "marketplace.order.statusUpdated",
|
|
175
|
-
version: 1,
|
|
176
|
-
description: "An order status has been updated.",
|
|
177
|
-
payload: OrderStatusUpdatedPayload
|
|
178
|
-
});
|
|
179
|
-
const OrderShippedEvent = defineEvent({
|
|
180
|
-
name: "marketplace.order.shipped",
|
|
181
|
-
version: 1,
|
|
182
|
-
description: "An order has been shipped.",
|
|
183
|
-
payload: OrderShippedPayload
|
|
184
|
-
});
|
|
185
|
-
const OrderCompletedEvent = defineEvent({
|
|
186
|
-
name: "marketplace.order.completed",
|
|
187
|
-
version: 1,
|
|
188
|
-
description: "An order has been completed.",
|
|
189
|
-
payload: OrderCompletedPayload
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
//#endregion
|
|
193
|
-
export { OrderCompletedEvent, OrderCreatedEvent, OrderPaidEvent, OrderShippedEvent, OrderStatusUpdatedEvent };
|
|
1
|
+
import{ScalarTypeEnum as e,defineSchemaModel as t}from"@lssm/lib.schema";import{defineEvent as n}from"@lssm/lib.contracts";const r=t({name:`OrderCreatedEventPayload`,fields:{orderId:{type:e.String_unsecure(),isOptional:!1},orderNumber:{type:e.String_unsecure(),isOptional:!1},buyerId:{type:e.String_unsecure(),isOptional:!1},storeId:{type:e.String_unsecure(),isOptional:!1},total:{type:e.Float_unsecure(),isOptional:!1},currency:{type:e.String_unsecure(),isOptional:!1},itemCount:{type:e.Int_unsecure(),isOptional:!1},timestamp:{type:e.DateTime(),isOptional:!1}}}),i=t({name:`OrderPaidEventPayload`,fields:{orderId:{type:e.String_unsecure(),isOptional:!1},orderNumber:{type:e.String_unsecure(),isOptional:!1},total:{type:e.Float_unsecure(),isOptional:!1},paymentMethod:{type:e.String_unsecure(),isOptional:!1},timestamp:{type:e.DateTime(),isOptional:!1}}}),a=t({name:`OrderStatusUpdatedEventPayload`,fields:{orderId:{type:e.String_unsecure(),isOptional:!1},orderNumber:{type:e.String_unsecure(),isOptional:!1},previousStatus:{type:e.String_unsecure(),isOptional:!1},newStatus:{type:e.String_unsecure(),isOptional:!1},updatedBy:{type:e.String_unsecure(),isOptional:!1},timestamp:{type:e.DateTime(),isOptional:!1}}}),o=t({name:`OrderShippedEventPayload`,fields:{orderId:{type:e.String_unsecure(),isOptional:!1},orderNumber:{type:e.String_unsecure(),isOptional:!1},trackingNumber:{type:e.String_unsecure(),isOptional:!0},trackingUrl:{type:e.String_unsecure(),isOptional:!0},carrier:{type:e.String_unsecure(),isOptional:!0},timestamp:{type:e.DateTime(),isOptional:!1}}}),s=t({name:`OrderCompletedEventPayload`,fields:{orderId:{type:e.String_unsecure(),isOptional:!1},orderNumber:{type:e.String_unsecure(),isOptional:!1},buyerId:{type:e.String_unsecure(),isOptional:!1},storeId:{type:e.String_unsecure(),isOptional:!1},total:{type:e.Float_unsecure(),isOptional:!1},sellerPayout:{type:e.Float_unsecure(),isOptional:!1},timestamp:{type:e.DateTime(),isOptional:!1}}}),c=n({name:`marketplace.order.created`,version:1,description:`A new order has been created.`,payload:r}),l=n({name:`marketplace.order.paid`,version:1,description:`An order has been paid.`,payload:i}),u=n({name:`marketplace.order.statusUpdated`,version:1,description:`An order status has been updated.`,payload:a}),d=n({name:`marketplace.order.shipped`,version:1,description:`An order has been shipped.`,payload:o}),f=n({name:`marketplace.order.completed`,version:1,description:`An order has been completed.`,payload:s});export{f as OrderCompletedEvent,c as OrderCreatedEvent,l as OrderPaidEvent,d as OrderShippedEvent,u as OrderStatusUpdatedEvent};
|
|
@@ -1,72 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
//#region src/order/order.presentation.ts
|
|
4
|
-
const OrderListPresentation = {
|
|
5
|
-
meta: {
|
|
6
|
-
name: "marketplace.order.list",
|
|
7
|
-
version: 1,
|
|
8
|
-
description: "List of orders with status and tracking",
|
|
9
|
-
domain: "marketplace",
|
|
10
|
-
owners: ["@marketplace-team"],
|
|
11
|
-
tags: [
|
|
12
|
-
"marketplace",
|
|
13
|
-
"order",
|
|
14
|
-
"list"
|
|
15
|
-
]
|
|
16
|
-
},
|
|
17
|
-
source: {
|
|
18
|
-
type: "component",
|
|
19
|
-
framework: "react",
|
|
20
|
-
componentKey: "OrderList",
|
|
21
|
-
props: OrderModel
|
|
22
|
-
},
|
|
23
|
-
targets: ["react", "markdown"],
|
|
24
|
-
policy: { flags: ["marketplace.orders.enabled"] }
|
|
25
|
-
};
|
|
26
|
-
const OrderDetailPresentation = {
|
|
27
|
-
meta: {
|
|
28
|
-
name: "marketplace.order.detail",
|
|
29
|
-
version: 1,
|
|
30
|
-
description: "Order detail with items and shipping info",
|
|
31
|
-
domain: "marketplace",
|
|
32
|
-
owners: ["@marketplace-team"],
|
|
33
|
-
tags: [
|
|
34
|
-
"marketplace",
|
|
35
|
-
"order",
|
|
36
|
-
"detail"
|
|
37
|
-
]
|
|
38
|
-
},
|
|
39
|
-
source: {
|
|
40
|
-
type: "component",
|
|
41
|
-
framework: "react",
|
|
42
|
-
componentKey: "OrderDetail",
|
|
43
|
-
props: OrderModel
|
|
44
|
-
},
|
|
45
|
-
targets: ["react", "markdown"],
|
|
46
|
-
policy: { flags: ["marketplace.orders.enabled"] }
|
|
47
|
-
};
|
|
48
|
-
const CheckoutPresentation = {
|
|
49
|
-
meta: {
|
|
50
|
-
name: "marketplace.checkout",
|
|
51
|
-
version: 1,
|
|
52
|
-
description: "Checkout flow with cart and payment",
|
|
53
|
-
domain: "marketplace",
|
|
54
|
-
owners: ["@marketplace-team"],
|
|
55
|
-
tags: [
|
|
56
|
-
"marketplace",
|
|
57
|
-
"checkout",
|
|
58
|
-
"cart"
|
|
59
|
-
]
|
|
60
|
-
},
|
|
61
|
-
source: {
|
|
62
|
-
type: "component",
|
|
63
|
-
framework: "react",
|
|
64
|
-
componentKey: "Checkout",
|
|
65
|
-
props: OrderModel
|
|
66
|
-
},
|
|
67
|
-
targets: ["react"],
|
|
68
|
-
policy: { flags: ["marketplace.checkout.enabled"] }
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
//#endregion
|
|
72
|
-
export { CheckoutPresentation, OrderDetailPresentation, OrderListPresentation };
|
|
1
|
+
import{OrderModel as e}from"./order.schema.js";const t={meta:{name:`marketplace.order.list`,version:1,description:`List of orders with status and tracking`,domain:`marketplace`,owners:[`@marketplace-team`],tags:[`marketplace`,`order`,`list`]},source:{type:`component`,framework:`react`,componentKey:`OrderList`,props:e},targets:[`react`,`markdown`],policy:{flags:[`marketplace.orders.enabled`]}},n={meta:{name:`marketplace.order.detail`,version:1,description:`Order detail with items and shipping info`,domain:`marketplace`,owners:[`@marketplace-team`],tags:[`marketplace`,`order`,`detail`]},source:{type:`component`,framework:`react`,componentKey:`OrderDetail`,props:e},targets:[`react`,`markdown`],policy:{flags:[`marketplace.orders.enabled`]}},r={meta:{name:`marketplace.checkout`,version:1,description:`Checkout flow with cart and payment`,domain:`marketplace`,owners:[`@marketplace-team`],tags:[`marketplace`,`checkout`,`cart`]},source:{type:`component`,framework:`react`,componentKey:`Checkout`,props:e},targets:[`react`],policy:{flags:[`marketplace.checkout.enabled`]}};export{r as CheckoutPresentation,n as OrderDetailPresentation,t as OrderListPresentation};
|
|
@@ -1,156 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { defineSchemaModel } from "../libs/schema/dist/SchemaModel.js";
|
|
3
|
-
import "../libs/schema/dist/index.js";
|
|
4
|
-
import { OrderStatusEnum } from "./order.enum.js";
|
|
5
|
-
|
|
6
|
-
//#region src/order/order.schema.ts
|
|
7
|
-
/**
|
|
8
|
-
* An order item.
|
|
9
|
-
*/
|
|
10
|
-
const OrderItemModel = defineSchemaModel({
|
|
11
|
-
name: "OrderItemModel",
|
|
12
|
-
fields: {
|
|
13
|
-
id: {
|
|
14
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
15
|
-
isOptional: false
|
|
16
|
-
},
|
|
17
|
-
productId: {
|
|
18
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
19
|
-
isOptional: false
|
|
20
|
-
},
|
|
21
|
-
productName: {
|
|
22
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
23
|
-
isOptional: false
|
|
24
|
-
},
|
|
25
|
-
unitPrice: {
|
|
26
|
-
type: ScalarTypeEnum.Float_unsecure(),
|
|
27
|
-
isOptional: false
|
|
28
|
-
},
|
|
29
|
-
quantity: {
|
|
30
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
31
|
-
isOptional: false
|
|
32
|
-
},
|
|
33
|
-
subtotal: {
|
|
34
|
-
type: ScalarTypeEnum.Float_unsecure(),
|
|
35
|
-
isOptional: false
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
/**
|
|
40
|
-
* An order.
|
|
41
|
-
*/
|
|
42
|
-
const OrderModel = defineSchemaModel({
|
|
43
|
-
name: "OrderModel",
|
|
44
|
-
description: "An order",
|
|
45
|
-
fields: {
|
|
46
|
-
id: {
|
|
47
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
48
|
-
isOptional: false
|
|
49
|
-
},
|
|
50
|
-
orderNumber: {
|
|
51
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
52
|
-
isOptional: false
|
|
53
|
-
},
|
|
54
|
-
buyerId: {
|
|
55
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
56
|
-
isOptional: false
|
|
57
|
-
},
|
|
58
|
-
storeId: {
|
|
59
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
60
|
-
isOptional: false
|
|
61
|
-
},
|
|
62
|
-
status: {
|
|
63
|
-
type: OrderStatusEnum,
|
|
64
|
-
isOptional: false
|
|
65
|
-
},
|
|
66
|
-
subtotal: {
|
|
67
|
-
type: ScalarTypeEnum.Float_unsecure(),
|
|
68
|
-
isOptional: false
|
|
69
|
-
},
|
|
70
|
-
shippingTotal: {
|
|
71
|
-
type: ScalarTypeEnum.Float_unsecure(),
|
|
72
|
-
isOptional: false
|
|
73
|
-
},
|
|
74
|
-
taxTotal: {
|
|
75
|
-
type: ScalarTypeEnum.Float_unsecure(),
|
|
76
|
-
isOptional: false
|
|
77
|
-
},
|
|
78
|
-
total: {
|
|
79
|
-
type: ScalarTypeEnum.Float_unsecure(),
|
|
80
|
-
isOptional: false
|
|
81
|
-
},
|
|
82
|
-
currency: {
|
|
83
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
84
|
-
isOptional: false
|
|
85
|
-
},
|
|
86
|
-
items: {
|
|
87
|
-
type: OrderItemModel,
|
|
88
|
-
isArray: true,
|
|
89
|
-
isOptional: true
|
|
90
|
-
},
|
|
91
|
-
createdAt: {
|
|
92
|
-
type: ScalarTypeEnum.DateTime(),
|
|
93
|
-
isOptional: false
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
/**
|
|
98
|
-
* Input for creating an order.
|
|
99
|
-
*/
|
|
100
|
-
const CreateOrderInputModel = defineSchemaModel({
|
|
101
|
-
name: "CreateOrderInput",
|
|
102
|
-
fields: {
|
|
103
|
-
storeId: {
|
|
104
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
105
|
-
isOptional: false
|
|
106
|
-
},
|
|
107
|
-
items: {
|
|
108
|
-
type: ScalarTypeEnum.JSON(),
|
|
109
|
-
isOptional: false,
|
|
110
|
-
description: "Array of {productId, variantId?, quantity}"
|
|
111
|
-
},
|
|
112
|
-
shippingAddress: {
|
|
113
|
-
type: ScalarTypeEnum.JSON(),
|
|
114
|
-
isOptional: true
|
|
115
|
-
},
|
|
116
|
-
billingAddress: {
|
|
117
|
-
type: ScalarTypeEnum.JSON(),
|
|
118
|
-
isOptional: true
|
|
119
|
-
},
|
|
120
|
-
buyerNote: {
|
|
121
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
122
|
-
isOptional: true
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
/**
|
|
127
|
-
* Input for updating order status.
|
|
128
|
-
*/
|
|
129
|
-
const UpdateOrderStatusInputModel = defineSchemaModel({
|
|
130
|
-
name: "UpdateOrderStatusInput",
|
|
131
|
-
fields: {
|
|
132
|
-
orderId: {
|
|
133
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
134
|
-
isOptional: false
|
|
135
|
-
},
|
|
136
|
-
status: {
|
|
137
|
-
type: OrderStatusEnum,
|
|
138
|
-
isOptional: false
|
|
139
|
-
},
|
|
140
|
-
trackingNumber: {
|
|
141
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
142
|
-
isOptional: true
|
|
143
|
-
},
|
|
144
|
-
trackingUrl: {
|
|
145
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
146
|
-
isOptional: true
|
|
147
|
-
},
|
|
148
|
-
note: {
|
|
149
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
150
|
-
isOptional: true
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
//#endregion
|
|
156
|
-
export { CreateOrderInputModel, OrderItemModel, OrderModel, UpdateOrderStatusInputModel };
|
|
1
|
+
import{OrderStatusEnum as e}from"./order.enum.js";import{ScalarTypeEnum as t,defineSchemaModel as n}from"@lssm/lib.schema";const r=n({name:`OrderItemModel`,fields:{id:{type:t.String_unsecure(),isOptional:!1},productId:{type:t.String_unsecure(),isOptional:!1},productName:{type:t.String_unsecure(),isOptional:!1},unitPrice:{type:t.Float_unsecure(),isOptional:!1},quantity:{type:t.Int_unsecure(),isOptional:!1},subtotal:{type:t.Float_unsecure(),isOptional:!1}}}),i=n({name:`OrderModel`,description:`An order`,fields:{id:{type:t.String_unsecure(),isOptional:!1},orderNumber:{type:t.String_unsecure(),isOptional:!1},buyerId:{type:t.String_unsecure(),isOptional:!1},storeId:{type:t.String_unsecure(),isOptional:!1},status:{type:e,isOptional:!1},subtotal:{type:t.Float_unsecure(),isOptional:!1},shippingTotal:{type:t.Float_unsecure(),isOptional:!1},taxTotal:{type:t.Float_unsecure(),isOptional:!1},total:{type:t.Float_unsecure(),isOptional:!1},currency:{type:t.String_unsecure(),isOptional:!1},items:{type:r,isArray:!0,isOptional:!0},createdAt:{type:t.DateTime(),isOptional:!1}}}),a=n({name:`CreateOrderInput`,fields:{storeId:{type:t.String_unsecure(),isOptional:!1},items:{type:t.JSON(),isOptional:!1,description:`Array of {productId, variantId?, quantity}`},shippingAddress:{type:t.JSON(),isOptional:!0},billingAddress:{type:t.JSON(),isOptional:!0},buyerNote:{type:t.String_unsecure(),isOptional:!0}}}),o=n({name:`UpdateOrderStatusInput`,fields:{orderId:{type:t.String_unsecure(),isOptional:!1},status:{type:e,isOptional:!1},trackingNumber:{type:t.String_unsecure(),isOptional:!0},trackingUrl:{type:t.String_unsecure(),isOptional:!0},note:{type:t.String_unsecure(),isOptional:!0}}});export{a as CreateOrderInputModel,r as OrderItemModel,i as OrderModel,o as UpdateOrderStatusInputModel};
|
package/dist/payout/index.js
CHANGED
|
@@ -1,6 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ListPayoutsInputModel, ListPayoutsOutputModel, PayoutModel } from "./payout.schema.js";
|
|
3
|
-
import { ListPayoutsContract } from "./payout.contracts.js";
|
|
4
|
-
import { PayoutCreatedEvent, PayoutPaidEvent } from "./payout.event.js";
|
|
5
|
-
|
|
6
|
-
export { ListPayoutsContract, ListPayoutsInputModel, ListPayoutsOutputModel, PayoutCreatedEvent, PayoutModel, PayoutPaidEvent, PayoutStatusEnum };
|
|
1
|
+
import{PayoutStatusEnum as e}from"./payout.enum.js";import{ListPayoutsInputModel as t,ListPayoutsOutputModel as n,PayoutModel as r}from"./payout.schema.js";import{ListPayoutsContract as i}from"./payout.contracts.js";import{PayoutCreatedEvent as a,PayoutPaidEvent as o}from"./payout.event.js";export{i as ListPayoutsContract,t as ListPayoutsInputModel,n as ListPayoutsOutputModel,a as PayoutCreatedEvent,r as PayoutModel,o as PayoutPaidEvent,e as PayoutStatusEnum};
|
|
@@ -1,32 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ListPayoutsInputModel, ListPayoutsOutputModel } from "./payout.schema.js";
|
|
3
|
-
|
|
4
|
-
//#region src/payout/payout.contracts.ts
|
|
5
|
-
const OWNERS = ["@example.marketplace"];
|
|
6
|
-
/**
|
|
7
|
-
* List payouts for a store.
|
|
8
|
-
*/
|
|
9
|
-
const ListPayoutsContract = defineQuery({
|
|
10
|
-
meta: {
|
|
11
|
-
name: "marketplace.payout.list",
|
|
12
|
-
version: 1,
|
|
13
|
-
stability: "stable",
|
|
14
|
-
owners: [...OWNERS],
|
|
15
|
-
tags: [
|
|
16
|
-
"marketplace",
|
|
17
|
-
"payout",
|
|
18
|
-
"list"
|
|
19
|
-
],
|
|
20
|
-
description: "List payouts for a store.",
|
|
21
|
-
goal: "View payout history.",
|
|
22
|
-
context: "Seller dashboard."
|
|
23
|
-
},
|
|
24
|
-
io: {
|
|
25
|
-
input: ListPayoutsInputModel,
|
|
26
|
-
output: ListPayoutsOutputModel
|
|
27
|
-
},
|
|
28
|
-
policy: { auth: "user" }
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
//#endregion
|
|
32
|
-
export { ListPayoutsContract };
|
|
1
|
+
import{ListPayoutsInputModel as e,ListPayoutsOutputModel as t}from"./payout.schema.js";import{defineQuery as n}from"@lssm/lib.contracts/spec";const r=n({meta:{name:`marketplace.payout.list`,version:1,stability:`stable`,owners:[...[`@example.marketplace`]],tags:[`marketplace`,`payout`,`list`],description:`List payouts for a store.`,goal:`View payout history.`,context:`Seller dashboard.`},io:{input:e,output:t},policy:{auth:`user`}});export{r as ListPayoutsContract};
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "../libs/schema/dist/index.js";
|
|
3
|
-
|
|
4
|
-
//#region src/payout/payout.enum.ts
|
|
5
|
-
/**
|
|
6
|
-
* Payout status enum.
|
|
7
|
-
*/
|
|
8
|
-
const PayoutStatusEnum = defineEnum("PayoutStatus", [
|
|
9
|
-
"PENDING",
|
|
10
|
-
"PROCESSING",
|
|
11
|
-
"PAID",
|
|
12
|
-
"FAILED",
|
|
13
|
-
"CANCELLED"
|
|
14
|
-
]);
|
|
15
|
-
|
|
16
|
-
//#endregion
|
|
17
|
-
export { PayoutStatusEnum };
|
|
1
|
+
import{defineEnum as e}from"@lssm/lib.schema";const t=e(`PayoutStatus`,[`PENDING`,`PROCESSING`,`PAID`,`FAILED`,`CANCELLED`]);export{t as PayoutStatusEnum};
|
|
@@ -1,84 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { defineSchemaModel } from "../libs/schema/dist/SchemaModel.js";
|
|
3
|
-
import "../libs/schema/dist/index.js";
|
|
4
|
-
import { defineEvent } from "../libs/contracts/dist/events.js";
|
|
5
|
-
import "../libs/contracts/dist/index.js";
|
|
6
|
-
|
|
7
|
-
//#region src/payout/payout.event.ts
|
|
8
|
-
const PayoutCreatedPayload = defineSchemaModel({
|
|
9
|
-
name: "PayoutCreatedEventPayload",
|
|
10
|
-
fields: {
|
|
11
|
-
payoutId: {
|
|
12
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
13
|
-
isOptional: false
|
|
14
|
-
},
|
|
15
|
-
payoutNumber: {
|
|
16
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
17
|
-
isOptional: false
|
|
18
|
-
},
|
|
19
|
-
storeId: {
|
|
20
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
21
|
-
isOptional: false
|
|
22
|
-
},
|
|
23
|
-
netAmount: {
|
|
24
|
-
type: ScalarTypeEnum.Float_unsecure(),
|
|
25
|
-
isOptional: false
|
|
26
|
-
},
|
|
27
|
-
currency: {
|
|
28
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
29
|
-
isOptional: false
|
|
30
|
-
},
|
|
31
|
-
orderCount: {
|
|
32
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
33
|
-
isOptional: false
|
|
34
|
-
},
|
|
35
|
-
timestamp: {
|
|
36
|
-
type: ScalarTypeEnum.DateTime(),
|
|
37
|
-
isOptional: false
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
const PayoutPaidPayload = defineSchemaModel({
|
|
42
|
-
name: "PayoutPaidEventPayload",
|
|
43
|
-
fields: {
|
|
44
|
-
payoutId: {
|
|
45
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
46
|
-
isOptional: false
|
|
47
|
-
},
|
|
48
|
-
payoutNumber: {
|
|
49
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
50
|
-
isOptional: false
|
|
51
|
-
},
|
|
52
|
-
storeId: {
|
|
53
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
54
|
-
isOptional: false
|
|
55
|
-
},
|
|
56
|
-
netAmount: {
|
|
57
|
-
type: ScalarTypeEnum.Float_unsecure(),
|
|
58
|
-
isOptional: false
|
|
59
|
-
},
|
|
60
|
-
paymentReference: {
|
|
61
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
62
|
-
isOptional: true
|
|
63
|
-
},
|
|
64
|
-
timestamp: {
|
|
65
|
-
type: ScalarTypeEnum.DateTime(),
|
|
66
|
-
isOptional: false
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
const PayoutCreatedEvent = defineEvent({
|
|
71
|
-
name: "marketplace.payout.created",
|
|
72
|
-
version: 1,
|
|
73
|
-
description: "A payout has been created.",
|
|
74
|
-
payload: PayoutCreatedPayload
|
|
75
|
-
});
|
|
76
|
-
const PayoutPaidEvent = defineEvent({
|
|
77
|
-
name: "marketplace.payout.paid",
|
|
78
|
-
version: 1,
|
|
79
|
-
description: "A payout has been sent.",
|
|
80
|
-
payload: PayoutPaidPayload
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
//#endregion
|
|
84
|
-
export { PayoutCreatedEvent, PayoutPaidEvent };
|
|
1
|
+
import{ScalarTypeEnum as e,defineSchemaModel as t}from"@lssm/lib.schema";import{defineEvent as n}from"@lssm/lib.contracts";const r=t({name:`PayoutCreatedEventPayload`,fields:{payoutId:{type:e.String_unsecure(),isOptional:!1},payoutNumber:{type:e.String_unsecure(),isOptional:!1},storeId:{type:e.String_unsecure(),isOptional:!1},netAmount:{type:e.Float_unsecure(),isOptional:!1},currency:{type:e.String_unsecure(),isOptional:!1},orderCount:{type:e.Int_unsecure(),isOptional:!1},timestamp:{type:e.DateTime(),isOptional:!1}}}),i=t({name:`PayoutPaidEventPayload`,fields:{payoutId:{type:e.String_unsecure(),isOptional:!1},payoutNumber:{type:e.String_unsecure(),isOptional:!1},storeId:{type:e.String_unsecure(),isOptional:!1},netAmount:{type:e.Float_unsecure(),isOptional:!1},paymentReference:{type:e.String_unsecure(),isOptional:!0},timestamp:{type:e.DateTime(),isOptional:!1}}}),a=n({name:`marketplace.payout.created`,version:1,description:`A payout has been created.`,payload:r}),o=n({name:`marketplace.payout.paid`,version:1,description:`A payout has been sent.`,payload:i});export{a as PayoutCreatedEvent,o as PayoutPaidEvent};
|