@molda-org/quotes-custom-orders 0.1.0-next.5 → 0.1.0-next.7
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/index.d.ts +146 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/package.json +14 -6
- package/index.d.ts +0 -20
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import type { MoldaModuleDefinition, MoldaModuleShape } from '@molda-org/module-contracts';
|
|
2
|
+
import { type ModuleRepository } from '@molda-org/module-runtime';
|
|
3
|
+
export type QuotesCustomOrdersAction = 'requestQuote' | 'reviseQuote' | 'acceptQuote' | 'approveDeliverable';
|
|
4
|
+
export type QuotesCustomOrdersView = 'quoteRequests' | 'activeCustomOrders' | 'awaitingApproval';
|
|
5
|
+
export type QuotesCustomOrdersHook = 'useQuoteRequests' | 'useCustomOrders' | 'useAwaitingApproval';
|
|
6
|
+
export interface QuotesCustomOrdersModuleShape extends MoldaModuleShape<'quotes-custom-orders', QuotesCustomOrdersAction, QuotesCustomOrdersView, QuotesCustomOrdersHook> {
|
|
7
|
+
readonly stage: 'phase-two';
|
|
8
|
+
readonly category: 'commerce';
|
|
9
|
+
readonly purpose: 'Quote requests, revision snapshots, custom-order acceptance, deliverables, and approval evidence.';
|
|
10
|
+
}
|
|
11
|
+
export type QuotesCustomOrdersModule = MoldaModuleDefinition<QuotesCustomOrdersModuleShape>;
|
|
12
|
+
export declare const QuotesCustomOrdersActionIds: readonly ["requestQuote", "reviseQuote", "acceptQuote", "approveDeliverable"];
|
|
13
|
+
export declare const QuotesCustomOrdersViewIds: readonly ["quoteRequests", "activeCustomOrders", "awaitingApproval"];
|
|
14
|
+
export declare const QuotesCustomOrdersHookIds: readonly ["useQuoteRequests", "useCustomOrders", "useAwaitingApproval"];
|
|
15
|
+
export declare const QuotesCustomOrdersSpecification: {
|
|
16
|
+
readonly id: "quotes-custom-orders";
|
|
17
|
+
readonly version: "1.0.0";
|
|
18
|
+
readonly actions: {
|
|
19
|
+
readonly requestQuote: {
|
|
20
|
+
readonly kind: "create";
|
|
21
|
+
readonly collection: "quotes";
|
|
22
|
+
readonly permission: "request.quote";
|
|
23
|
+
readonly event: "request.quote";
|
|
24
|
+
};
|
|
25
|
+
readonly reviseQuote: {
|
|
26
|
+
readonly kind: "update";
|
|
27
|
+
readonly collection: "quotes";
|
|
28
|
+
readonly permission: "revise.quote";
|
|
29
|
+
readonly event: "revise.quote";
|
|
30
|
+
};
|
|
31
|
+
readonly acceptQuote: {
|
|
32
|
+
readonly kind: "transition";
|
|
33
|
+
readonly collection: "quotes";
|
|
34
|
+
readonly permission: "accept.quote";
|
|
35
|
+
readonly event: "accept.quote";
|
|
36
|
+
readonly status: "accepted";
|
|
37
|
+
readonly allowedFrom: readonly ["draft", "sent"];
|
|
38
|
+
};
|
|
39
|
+
readonly approveDeliverable: {
|
|
40
|
+
readonly kind: "transition";
|
|
41
|
+
readonly collection: "deliverables";
|
|
42
|
+
readonly permission: "approve.deliverable";
|
|
43
|
+
readonly event: "approve.deliverable";
|
|
44
|
+
readonly status: "approved";
|
|
45
|
+
readonly allowedFrom: readonly ["awaiting-approval"];
|
|
46
|
+
readonly confirmation: "required";
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
readonly views: {
|
|
50
|
+
readonly quoteRequests: {
|
|
51
|
+
readonly kind: "list";
|
|
52
|
+
readonly collection: "quotes";
|
|
53
|
+
readonly permission: "quote.requests.read";
|
|
54
|
+
};
|
|
55
|
+
readonly activeCustomOrders: {
|
|
56
|
+
readonly kind: "list";
|
|
57
|
+
readonly collection: "custom-orders";
|
|
58
|
+
readonly permission: "active.custom.orders.read";
|
|
59
|
+
};
|
|
60
|
+
readonly awaitingApproval: {
|
|
61
|
+
readonly kind: "list";
|
|
62
|
+
readonly collection: "deliverables";
|
|
63
|
+
readonly permission: "awaiting.approval.read";
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
readonly migrations: readonly [{
|
|
67
|
+
readonly version: 1;
|
|
68
|
+
readonly description: "Create quotes-custom-orders collections and indexes";
|
|
69
|
+
}];
|
|
70
|
+
readonly fixtures: readonly [{
|
|
71
|
+
readonly id: "quotes-custom-orders-baseline";
|
|
72
|
+
readonly description: "Deterministic quotes-custom-orders production-case fixture";
|
|
73
|
+
}];
|
|
74
|
+
};
|
|
75
|
+
export declare const QuotesCustomOrdersBlueprint: import("@molda-org/module-runtime").ModuleBlueprint<{
|
|
76
|
+
[k: string]: import("@molda-org/module-runtime").ModuleActionDefinition<{
|
|
77
|
+
id: string;
|
|
78
|
+
data: Record<string, unknown>;
|
|
79
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>> | import("@molda-org/module-runtime").ModuleActionDefinition<{
|
|
80
|
+
data: Record<string, unknown>;
|
|
81
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>> | import("@molda-org/module-runtime").ModuleActionDefinition<{
|
|
82
|
+
id: string;
|
|
83
|
+
expectedRevision: number;
|
|
84
|
+
patch: Record<string, unknown>;
|
|
85
|
+
reason?: string | undefined;
|
|
86
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>> | import("@molda-org/module-runtime").ModuleActionDefinition<{
|
|
87
|
+
id: string;
|
|
88
|
+
expectedRevision: number;
|
|
89
|
+
patch: Record<string, unknown>;
|
|
90
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>>;
|
|
91
|
+
}, {
|
|
92
|
+
[k: string]: import("@molda-org/module-runtime").ModuleViewDefinition<{
|
|
93
|
+
id: string;
|
|
94
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>> | import("@molda-org/module-runtime").ModuleViewDefinition<{
|
|
95
|
+
limit: number;
|
|
96
|
+
equals?: Record<string, unknown> | undefined;
|
|
97
|
+
}, readonly import("@molda-org/module-runtime").ModuleRecord<Record<string, unknown>>[]>;
|
|
98
|
+
}>;
|
|
99
|
+
export declare function createQuotesCustomOrdersService(repository: ModuleRepository): {
|
|
100
|
+
blueprint: import("@molda-org/module-runtime").ModuleBlueprint<{
|
|
101
|
+
[k: string]: import("@molda-org/module-runtime").ModuleActionDefinition<{
|
|
102
|
+
id: string;
|
|
103
|
+
data: Record<string, unknown>;
|
|
104
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>> | import("@molda-org/module-runtime").ModuleActionDefinition<{
|
|
105
|
+
data: Record<string, unknown>;
|
|
106
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>> | import("@molda-org/module-runtime").ModuleActionDefinition<{
|
|
107
|
+
id: string;
|
|
108
|
+
expectedRevision: number;
|
|
109
|
+
patch: Record<string, unknown>;
|
|
110
|
+
reason?: string | undefined;
|
|
111
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>> | import("@molda-org/module-runtime").ModuleActionDefinition<{
|
|
112
|
+
id: string;
|
|
113
|
+
expectedRevision: number;
|
|
114
|
+
patch: Record<string, unknown>;
|
|
115
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>>;
|
|
116
|
+
}, {
|
|
117
|
+
[k: string]: import("@molda-org/module-runtime").ModuleViewDefinition<{
|
|
118
|
+
id: string;
|
|
119
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>> | import("@molda-org/module-runtime").ModuleViewDefinition<{
|
|
120
|
+
limit: number;
|
|
121
|
+
equals?: Record<string, unknown> | undefined;
|
|
122
|
+
}, readonly import("@molda-org/module-runtime").ModuleRecord<Record<string, unknown>>[]>;
|
|
123
|
+
}>;
|
|
124
|
+
executeAction<TKey extends string>(actionId: TKey, unsafeInput: {
|
|
125
|
+
id: string;
|
|
126
|
+
data: Record<string, unknown>;
|
|
127
|
+
} | {
|
|
128
|
+
data: Record<string, unknown>;
|
|
129
|
+
} | {
|
|
130
|
+
id: string;
|
|
131
|
+
expectedRevision: number;
|
|
132
|
+
patch: Record<string, unknown>;
|
|
133
|
+
reason?: string | undefined;
|
|
134
|
+
} | {
|
|
135
|
+
id: string;
|
|
136
|
+
expectedRevision: number;
|
|
137
|
+
patch: Record<string, unknown>;
|
|
138
|
+
}, invocation: import("@molda-org/module-runtime").ModuleActionInvocation): Promise<import("@molda-org/module-runtime").ModuleActionExecution<never>>;
|
|
139
|
+
executeView<TKey extends string>(viewId: TKey, unsafeInput: {
|
|
140
|
+
id: string;
|
|
141
|
+
} | {
|
|
142
|
+
limit: number;
|
|
143
|
+
equals?: Record<string, unknown> | undefined;
|
|
144
|
+
}, context: import("@molda-org/module-runtime").ModuleExecutionContext): Promise<never>;
|
|
145
|
+
};
|
|
146
|
+
export declare function createQuotesCustomOrdersRuntimeModule(repository: ModuleRepository): import("@molda-org/module-runtime").ResourceModuleContribution;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createResourceModuleContribution, createResourceModuleService, defineResourceModule, } from '@molda-org/module-runtime';
|
|
2
|
+
export const QuotesCustomOrdersActionIds = ["requestQuote", "reviseQuote", "acceptQuote", "approveDeliverable"];
|
|
3
|
+
export const QuotesCustomOrdersViewIds = ["quoteRequests", "activeCustomOrders", "awaitingApproval"];
|
|
4
|
+
export const QuotesCustomOrdersHookIds = ["useQuoteRequests", "useCustomOrders", "useAwaitingApproval"];
|
|
5
|
+
export const QuotesCustomOrdersSpecification = {
|
|
6
|
+
id: 'quotes-custom-orders',
|
|
7
|
+
version: '1.0.0',
|
|
8
|
+
actions: {
|
|
9
|
+
requestQuote: { kind: 'create', collection: 'quotes', permission: 'request.quote', event: 'request.quote' },
|
|
10
|
+
reviseQuote: { kind: 'update', collection: 'quotes', permission: 'revise.quote', event: 'revise.quote' },
|
|
11
|
+
acceptQuote: { kind: 'transition', collection: 'quotes', permission: 'accept.quote', event: 'accept.quote', status: 'accepted', allowedFrom: ["draft", "sent"] },
|
|
12
|
+
approveDeliverable: { kind: 'transition', collection: 'deliverables', permission: 'approve.deliverable', event: 'approve.deliverable', status: 'approved', allowedFrom: ["awaiting-approval"], confirmation: 'required' },
|
|
13
|
+
},
|
|
14
|
+
views: {
|
|
15
|
+
quoteRequests: { kind: 'list', collection: 'quotes', permission: 'quote.requests.read' },
|
|
16
|
+
activeCustomOrders: { kind: 'list', collection: 'custom-orders', permission: 'active.custom.orders.read' },
|
|
17
|
+
awaitingApproval: { kind: 'list', collection: 'deliverables', permission: 'awaiting.approval.read' },
|
|
18
|
+
},
|
|
19
|
+
migrations: [{ version: 1, description: 'Create quotes-custom-orders collections and indexes' }],
|
|
20
|
+
fixtures: [{ id: 'quotes-custom-orders-baseline', description: 'Deterministic quotes-custom-orders production-case fixture' }],
|
|
21
|
+
};
|
|
22
|
+
export const QuotesCustomOrdersBlueprint = defineResourceModule(QuotesCustomOrdersSpecification);
|
|
23
|
+
export function createQuotesCustomOrdersService(repository) {
|
|
24
|
+
return createResourceModuleService(QuotesCustomOrdersSpecification, repository);
|
|
25
|
+
}
|
|
26
|
+
export function createQuotesCustomOrdersRuntimeModule(repository) {
|
|
27
|
+
return createResourceModuleContribution(QuotesCustomOrdersSpecification, repository);
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,gCAAgC,EAChC,2BAA2B,EAC3B,oBAAoB,GAGrB,MAAM,2BAA2B,CAAC;AAcnC,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,cAAc,EAAC,aAAa,EAAC,aAAa,EAAC,oBAAoB,CAAU,CAAC;AACtH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,eAAe,EAAC,oBAAoB,EAAC,kBAAkB,CAAU,CAAC;AAC5G,MAAM,CAAC,MAAM,yBAAyB,GAAG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,CAAC;IAChG,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,+BAA+B,EAAE,WAAW,EAAE,4DAA4D,EAAE,CAAC;CAChF,CAAC;AAEjD,MAAM,CAAC,MAAM,2BAA2B,GAAG,oBAAoB,CAAC,+BAA+B,CAAC,CAAC;AAEjG,MAAM,UAAU,+BAA+B,CAAC,UAA4B;IAC1E,OAAO,2BAA2B,CAAC,+BAA+B,EAAE,UAAU,CAAC,CAAC;AAClF,CAAC;AAED,MAAM,UAAU,qCAAqC,CAAC,UAA4B;IAChF,OAAO,gCAAgC,CAAC,+BAA+B,EAAE,UAAU,CAAC,CAAC;AACvF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molda-org/quotes-custom-orders",
|
|
3
|
-
"version": "0.1.0-next.
|
|
3
|
+
"version": "0.1.0-next.7",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"types": "./index.d.ts",
|
|
6
5
|
"exports": {
|
|
7
6
|
".": {
|
|
8
|
-
"types": "./index.d.ts"
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"import": "./dist/index.js"
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
|
-
"
|
|
12
|
+
"dist"
|
|
13
13
|
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc -p tsconfig.json",
|
|
16
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
17
|
+
},
|
|
14
18
|
"dependencies": {
|
|
15
|
-
"@molda-org/module-contracts": "0.1.0-next.
|
|
16
|
-
"@molda-org/module-runtime": "0.1.0-next.
|
|
19
|
+
"@molda-org/module-contracts": "0.1.0-next.7",
|
|
20
|
+
"@molda-org/module-runtime": "0.1.0-next.7"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/node": "22.19.19",
|
|
24
|
+
"typescript": "5.9.3"
|
|
17
25
|
},
|
|
18
26
|
"publishConfig": {
|
|
19
27
|
"access": "public",
|
package/index.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { MoldaModuleDefinition, MoldaModuleShape } from '@molda-org/module-contracts';
|
|
2
|
-
|
|
3
|
-
export type QuotesCustomOrdersAction = 'requestQuote' | 'reviseQuote' | 'acceptQuote' | 'approveDeliverable';
|
|
4
|
-
export type QuotesCustomOrdersView = 'quoteRequests' | 'activeCustomOrders' | 'awaitingApproval';
|
|
5
|
-
export type QuotesCustomOrdersHook = 'useQuoteRequest' | 'useCustomOrder';
|
|
6
|
-
|
|
7
|
-
export interface QuotesCustomOrdersModuleShape
|
|
8
|
-
extends MoldaModuleShape<
|
|
9
|
-
'quotes-custom-orders',
|
|
10
|
-
QuotesCustomOrdersAction,
|
|
11
|
-
QuotesCustomOrdersView,
|
|
12
|
-
QuotesCustomOrdersHook
|
|
13
|
-
> {
|
|
14
|
-
readonly stage: 'phase-two';
|
|
15
|
-
readonly category: 'operations';
|
|
16
|
-
readonly purpose: 'Requests, requirements, estimates, quotes, revisions, approval, deposits, and delivery.';
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type QuotesCustomOrdersModule = MoldaModuleDefinition<QuotesCustomOrdersModuleShape>;
|
|
20
|
-
|