@molda-org/rentals 0.1.0-next.1 → 0.1.0-next.11
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 +174 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/package.json +16 -5
- package/index.d.ts +0 -20
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import type { MoldaModuleDefinition, MoldaModuleShape } from '@molda-org/module-contracts';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { type ModuleRepository } from '@molda-org/module-runtime';
|
|
4
|
+
export type RentalsAction = 'createRental' | 'confirmPickup' | 'extendRental' | 'confirmReturn';
|
|
5
|
+
export type RentalsView = 'availableRentals' | 'activeRentals' | 'overdueReturns';
|
|
6
|
+
export type RentalsHook = 'useRentalAvailability' | 'useRentals' | 'useOverdueReturns';
|
|
7
|
+
export interface RentalsModuleShape extends MoldaModuleShape<'rentals', RentalsAction, RentalsView, RentalsHook> {
|
|
8
|
+
readonly stage: 'phase-two';
|
|
9
|
+
readonly category: 'operations';
|
|
10
|
+
readonly purpose: 'Rental inventory, availability, pickup, extension, return inspection, fees, and overdue tracking.';
|
|
11
|
+
}
|
|
12
|
+
export type RentalsModule = MoldaModuleDefinition<RentalsModuleShape>;
|
|
13
|
+
export declare const RentalsActionIds: readonly ["createRental", "confirmPickup", "extendRental", "confirmReturn"];
|
|
14
|
+
export declare const RentalsViewIds: readonly ["availableRentals", "activeRentals", "overdueReturns"];
|
|
15
|
+
export declare const RentalsHookIds: readonly ["useRentalAvailability", "useRentals", "useOverdueReturns"];
|
|
16
|
+
export declare const RentalsSpecification: {
|
|
17
|
+
readonly id: "rentals";
|
|
18
|
+
readonly version: "1.0.0";
|
|
19
|
+
readonly collections: {
|
|
20
|
+
readonly rentals: z.ZodObject<{
|
|
21
|
+
inventoryId: z.ZodString;
|
|
22
|
+
customerId: z.ZodString;
|
|
23
|
+
startsAt: z.ZodString;
|
|
24
|
+
endsAt: z.ZodString;
|
|
25
|
+
status: z.ZodEnum<{
|
|
26
|
+
reserved: "reserved";
|
|
27
|
+
active: "active";
|
|
28
|
+
overdue: "overdue";
|
|
29
|
+
returned: "returned";
|
|
30
|
+
}>;
|
|
31
|
+
transitionReason: z.ZodOptional<z.ZodString>;
|
|
32
|
+
}, z.core.$strict>;
|
|
33
|
+
readonly 'rental-inventory': z.ZodObject<{
|
|
34
|
+
name: z.ZodString;
|
|
35
|
+
available: z.ZodBoolean;
|
|
36
|
+
depositMinor: z.ZodNumber;
|
|
37
|
+
currency: z.ZodString;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
};
|
|
40
|
+
readonly actions: {
|
|
41
|
+
readonly createRental: {
|
|
42
|
+
readonly kind: "create";
|
|
43
|
+
readonly collection: "rentals";
|
|
44
|
+
readonly permission: "create.rental";
|
|
45
|
+
readonly event: "create.rental";
|
|
46
|
+
readonly validate: ({ value, transaction }: {
|
|
47
|
+
readonly value: import("@molda-org/module-runtime").ModuleEntityValue;
|
|
48
|
+
readonly current: import("@molda-org/module-runtime").ModuleRecord | null;
|
|
49
|
+
readonly transaction: import("@molda-org/module-runtime").ModuleTransaction;
|
|
50
|
+
}) => Promise<void>;
|
|
51
|
+
};
|
|
52
|
+
readonly confirmPickup: {
|
|
53
|
+
readonly kind: "transition";
|
|
54
|
+
readonly collection: "rentals";
|
|
55
|
+
readonly permission: "confirm.pickup";
|
|
56
|
+
readonly event: "confirm.pickup";
|
|
57
|
+
readonly status: "active";
|
|
58
|
+
readonly allowedFrom: readonly ["reserved"];
|
|
59
|
+
readonly confirmation: "required";
|
|
60
|
+
};
|
|
61
|
+
readonly extendRental: {
|
|
62
|
+
readonly kind: "update";
|
|
63
|
+
readonly collection: "rentals";
|
|
64
|
+
readonly permission: "extend.rental";
|
|
65
|
+
readonly event: "extend.rental";
|
|
66
|
+
};
|
|
67
|
+
readonly confirmReturn: {
|
|
68
|
+
readonly kind: "transition";
|
|
69
|
+
readonly collection: "rentals";
|
|
70
|
+
readonly permission: "confirm.return";
|
|
71
|
+
readonly event: "confirm.return";
|
|
72
|
+
readonly status: "returned";
|
|
73
|
+
readonly allowedFrom: readonly ["active", "overdue"];
|
|
74
|
+
readonly confirmation: "required";
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
readonly views: {
|
|
78
|
+
readonly availableRentals: {
|
|
79
|
+
readonly kind: "list";
|
|
80
|
+
readonly collection: "rental-inventory";
|
|
81
|
+
readonly permission: "available.rentals.read";
|
|
82
|
+
};
|
|
83
|
+
readonly activeRentals: {
|
|
84
|
+
readonly kind: "list";
|
|
85
|
+
readonly collection: "rentals";
|
|
86
|
+
readonly permission: "active.rentals.read";
|
|
87
|
+
};
|
|
88
|
+
readonly overdueReturns: {
|
|
89
|
+
readonly kind: "list";
|
|
90
|
+
readonly collection: "rentals";
|
|
91
|
+
readonly permission: "overdue.returns.read";
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
readonly migrations: readonly [{
|
|
95
|
+
readonly version: 1;
|
|
96
|
+
readonly description: "Create rentals collections and indexes";
|
|
97
|
+
}];
|
|
98
|
+
readonly fixtures: readonly [{
|
|
99
|
+
readonly id: "rentals-baseline";
|
|
100
|
+
readonly description: "Deterministic rentals production-case fixture";
|
|
101
|
+
}];
|
|
102
|
+
};
|
|
103
|
+
export declare const RentalsBlueprint: import("@molda-org/module-runtime").ModuleBlueprint<{
|
|
104
|
+
[k: string]: import("@molda-org/module-runtime").ModuleActionDefinition<{
|
|
105
|
+
id: string;
|
|
106
|
+
data: Record<string, unknown>;
|
|
107
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>> | import("@molda-org/module-runtime").ModuleActionDefinition<{
|
|
108
|
+
data: Record<string, unknown>;
|
|
109
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>> | import("@molda-org/module-runtime").ModuleActionDefinition<{
|
|
110
|
+
id: string;
|
|
111
|
+
expectedRevision: number;
|
|
112
|
+
patch: Record<string, unknown>;
|
|
113
|
+
reason?: string | undefined;
|
|
114
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>> | import("@molda-org/module-runtime").ModuleActionDefinition<{
|
|
115
|
+
id: string;
|
|
116
|
+
expectedRevision: number;
|
|
117
|
+
patch: Record<string, unknown>;
|
|
118
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>>;
|
|
119
|
+
}, {
|
|
120
|
+
[k: string]: import("@molda-org/module-runtime").ModuleViewDefinition<{
|
|
121
|
+
id: string;
|
|
122
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>> | import("@molda-org/module-runtime").ModuleViewDefinition<{
|
|
123
|
+
limit: number;
|
|
124
|
+
equals?: Record<string, unknown> | undefined;
|
|
125
|
+
}, readonly import("@molda-org/module-runtime").ModuleRecord<Record<string, unknown>>[]>;
|
|
126
|
+
}>;
|
|
127
|
+
export declare function createRentalsService(repository: ModuleRepository): {
|
|
128
|
+
blueprint: import("@molda-org/module-runtime").ModuleBlueprint<{
|
|
129
|
+
[k: string]: import("@molda-org/module-runtime").ModuleActionDefinition<{
|
|
130
|
+
id: string;
|
|
131
|
+
data: Record<string, unknown>;
|
|
132
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>> | import("@molda-org/module-runtime").ModuleActionDefinition<{
|
|
133
|
+
data: Record<string, unknown>;
|
|
134
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>> | import("@molda-org/module-runtime").ModuleActionDefinition<{
|
|
135
|
+
id: string;
|
|
136
|
+
expectedRevision: number;
|
|
137
|
+
patch: Record<string, unknown>;
|
|
138
|
+
reason?: string | undefined;
|
|
139
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>> | import("@molda-org/module-runtime").ModuleActionDefinition<{
|
|
140
|
+
id: string;
|
|
141
|
+
expectedRevision: number;
|
|
142
|
+
patch: Record<string, unknown>;
|
|
143
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>>;
|
|
144
|
+
}, {
|
|
145
|
+
[k: string]: import("@molda-org/module-runtime").ModuleViewDefinition<{
|
|
146
|
+
id: string;
|
|
147
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>> | import("@molda-org/module-runtime").ModuleViewDefinition<{
|
|
148
|
+
limit: number;
|
|
149
|
+
equals?: Record<string, unknown> | undefined;
|
|
150
|
+
}, readonly import("@molda-org/module-runtime").ModuleRecord<Record<string, unknown>>[]>;
|
|
151
|
+
}>;
|
|
152
|
+
executeAction<TKey extends string>(actionId: TKey, unsafeInput: {
|
|
153
|
+
id: string;
|
|
154
|
+
data: Record<string, unknown>;
|
|
155
|
+
} | {
|
|
156
|
+
data: Record<string, unknown>;
|
|
157
|
+
} | {
|
|
158
|
+
id: string;
|
|
159
|
+
expectedRevision: number;
|
|
160
|
+
patch: Record<string, unknown>;
|
|
161
|
+
reason?: string | undefined;
|
|
162
|
+
} | {
|
|
163
|
+
id: string;
|
|
164
|
+
expectedRevision: number;
|
|
165
|
+
patch: Record<string, unknown>;
|
|
166
|
+
}, invocation: import("@molda-org/module-runtime").ModuleActionInvocation): Promise<import("@molda-org/module-runtime").ModuleActionExecution<never>>;
|
|
167
|
+
executeView<TKey extends string>(viewId: TKey, unsafeInput: {
|
|
168
|
+
id: string;
|
|
169
|
+
} | {
|
|
170
|
+
limit: number;
|
|
171
|
+
equals?: Record<string, unknown> | undefined;
|
|
172
|
+
}, context: import("@molda-org/module-runtime").ModuleExecutionContext): Promise<never>;
|
|
173
|
+
};
|
|
174
|
+
export declare function createRentalsRuntimeModule(repository: ModuleRepository): import("@molda-org/module-runtime").ResourceModuleContribution;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createResourceModuleContribution, createResourceModuleService, defineResourceModule, ModuleConflictError, } from '@molda-org/module-runtime';
|
|
3
|
+
export const RentalsActionIds = ["createRental", "confirmPickup", "extendRental", "confirmReturn"];
|
|
4
|
+
export const RentalsViewIds = ["availableRentals", "activeRentals", "overdueReturns"];
|
|
5
|
+
export const RentalsHookIds = ["useRentalAvailability", "useRentals", "useOverdueReturns"];
|
|
6
|
+
export const RentalsSpecification = {
|
|
7
|
+
id: 'rentals',
|
|
8
|
+
version: '1.0.0',
|
|
9
|
+
collections: {
|
|
10
|
+
'rentals': z.object({ inventoryId: z.string().min(1).max(200), customerId: z.string().min(1).max(200), startsAt: z.string().datetime({ offset: true }), endsAt: z.string().datetime({ offset: true }), status: z.enum(['reserved', 'active', 'overdue', 'returned']), transitionReason: z.string().max(1_000).optional() }).strict().refine((value) => Date.parse(value.startsAt) < Date.parse(value.endsAt), { message: 'Rental end must be after start' }),
|
|
11
|
+
'rental-inventory': z.object({ name: z.string().min(1).max(200), available: z.boolean(), depositMinor: z.number().int().nonnegative(), currency: z.string().length(3) }).strict(),
|
|
12
|
+
},
|
|
13
|
+
actions: {
|
|
14
|
+
createRental: {
|
|
15
|
+
kind: 'create', collection: 'rentals', permission: 'create.rental', event: 'create.rental',
|
|
16
|
+
validate: async ({ value, transaction }) => {
|
|
17
|
+
const rentals = await transaction.list('rentals', { equals: { inventoryId: value.inventoryId }, limit: 500 });
|
|
18
|
+
const overlaps = rentals.some(({ value: rental }) => rental.status !== 'returned' &&
|
|
19
|
+
Date.parse(String(value.startsAt)) < Date.parse(String(rental.endsAt)) &&
|
|
20
|
+
Date.parse(String(value.endsAt)) > Date.parse(String(rental.startsAt)));
|
|
21
|
+
if (overlaps)
|
|
22
|
+
throw new ModuleConflictError('Rental overlaps an active rental for this inventory item');
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
confirmPickup: { kind: 'transition', collection: 'rentals', permission: 'confirm.pickup', event: 'confirm.pickup', status: 'active', allowedFrom: ["reserved"], confirmation: 'required' },
|
|
26
|
+
extendRental: { kind: 'update', collection: 'rentals', permission: 'extend.rental', event: 'extend.rental' },
|
|
27
|
+
confirmReturn: { kind: 'transition', collection: 'rentals', permission: 'confirm.return', event: 'confirm.return', status: 'returned', allowedFrom: ["active", "overdue"], confirmation: 'required' },
|
|
28
|
+
},
|
|
29
|
+
views: {
|
|
30
|
+
availableRentals: { kind: 'list', collection: 'rental-inventory', permission: 'available.rentals.read' },
|
|
31
|
+
activeRentals: { kind: 'list', collection: 'rentals', permission: 'active.rentals.read' },
|
|
32
|
+
overdueReturns: { kind: 'list', collection: 'rentals', permission: 'overdue.returns.read' },
|
|
33
|
+
},
|
|
34
|
+
migrations: [{ version: 1, description: 'Create rentals collections and indexes' }],
|
|
35
|
+
fixtures: [{ id: 'rentals-baseline', description: 'Deterministic rentals production-case fixture' }],
|
|
36
|
+
};
|
|
37
|
+
export const RentalsBlueprint = defineResourceModule(RentalsSpecification);
|
|
38
|
+
export function createRentalsService(repository) {
|
|
39
|
+
return createResourceModuleService(RentalsSpecification, repository);
|
|
40
|
+
}
|
|
41
|
+
export function createRentalsRuntimeModule(repository) {
|
|
42
|
+
return createResourceModuleContribution(RentalsSpecification, repository);
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,gCAAgC,EAChC,2BAA2B,EAC3B,oBAAoB,EACpB,mBAAmB,GAGpB,MAAM,2BAA2B,CAAC;AAcnC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,cAAc,EAAC,eAAe,EAAC,cAAc,EAAC,eAAe,CAAU,CAAC;AACzG,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,kBAAkB,EAAC,eAAe,EAAC,gBAAgB,CAAU,CAAC;AAC7F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AAC;AAC5E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,18 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molda-org/rentals",
|
|
3
|
-
"version": "0.1.0-next.
|
|
3
|
+
"version": "0.1.0-next.11",
|
|
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
|
+
"prepack": "npm run build",
|
|
17
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
18
|
+
},
|
|
14
19
|
"dependencies": {
|
|
15
|
-
"@molda-org/module-contracts": "0.1.0-next.
|
|
20
|
+
"@molda-org/module-contracts": "0.1.0-next.11",
|
|
21
|
+
"@molda-org/module-runtime": "0.1.0-next.11",
|
|
22
|
+
"zod": "4.6.5"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/node": "22.19.19",
|
|
26
|
+
"typescript": "5.9.3"
|
|
16
27
|
},
|
|
17
28
|
"publishConfig": {
|
|
18
29
|
"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 RentalsAction = 'createRental' | 'confirmPickup' | 'extendRental' | 'confirmReturn';
|
|
4
|
-
export type RentalsView = 'availableRentals' | 'activeRentals' | 'overdueReturns';
|
|
5
|
-
export type RentalsHook = 'useRentalAvailability' | 'useRental';
|
|
6
|
-
|
|
7
|
-
export interface RentalsModuleShape
|
|
8
|
-
extends MoldaModuleShape<
|
|
9
|
-
'rentals',
|
|
10
|
-
RentalsAction,
|
|
11
|
-
RentalsView,
|
|
12
|
-
RentalsHook
|
|
13
|
-
> {
|
|
14
|
-
readonly stage: 'phase-two';
|
|
15
|
-
readonly category: 'operations';
|
|
16
|
-
readonly purpose: 'Rentable inventory, availability, booking periods, deposits, pickup, and return.';
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type RentalsModule = MoldaModuleDefinition<RentalsModuleShape>;
|
|
20
|
-
|