@powerhousedao/contributor-billing 0.1.40 → 0.1.41
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/document-models/index.d.ts +1 -0
- package/dist/document-models/index.d.ts.map +1 -1
- package/dist/document-models/index.js +1 -0
- package/dist/document-models/resource-template/actions.d.ts +32 -0
- package/dist/document-models/resource-template/actions.d.ts.map +1 -0
- package/dist/document-models/resource-template/actions.js +12 -0
- package/dist/document-models/resource-template/gen/actions.d.ts +14 -0
- package/dist/document-models/resource-template/gen/actions.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/actions.js +6 -0
- package/dist/document-models/resource-template/gen/audience-management/actions.d.ts +12 -0
- package/dist/document-models/resource-template/gen/audience-management/actions.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/audience-management/actions.js +1 -0
- package/dist/document-models/resource-template/gen/audience-management/creators.d.ts +5 -0
- package/dist/document-models/resource-template/gen/audience-management/creators.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/audience-management/creators.js +4 -0
- package/dist/document-models/resource-template/gen/audience-management/error.d.ts +21 -0
- package/dist/document-models/resource-template/gen/audience-management/error.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/audience-management/error.js +20 -0
- package/dist/document-models/resource-template/gen/audience-management/operations.d.ts +8 -0
- package/dist/document-models/resource-template/gen/audience-management/operations.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/audience-management/operations.js +3 -0
- package/dist/document-models/resource-template/gen/creators.d.ts +13 -0
- package/dist/document-models/resource-template/gen/creators.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/creators.js +12 -0
- package/dist/document-models/resource-template/gen/document-model.d.ts +3 -0
- package/dist/document-models/resource-template/gen/document-model.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/document-model.js +410 -0
- package/dist/document-models/resource-template/gen/document-schema.d.ts +408 -0
- package/dist/document-models/resource-template/gen/document-schema.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/document-schema.js +33 -0
- package/dist/document-models/resource-template/gen/document-type.d.ts +2 -0
- package/dist/document-models/resource-template/gen/document-type.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/document-type.js +1 -0
- package/dist/document-models/resource-template/gen/facet-targeting/actions.d.ts +20 -0
- package/dist/document-models/resource-template/gen/facet-targeting/actions.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/facet-targeting/actions.js +1 -0
- package/dist/document-models/resource-template/gen/facet-targeting/creators.d.ts +7 -0
- package/dist/document-models/resource-template/gen/facet-targeting/creators.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/facet-targeting/creators.js +6 -0
- package/dist/document-models/resource-template/gen/facet-targeting/error.d.ts +28 -0
- package/dist/document-models/resource-template/gen/facet-targeting/error.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/facet-targeting/error.js +29 -0
- package/dist/document-models/resource-template/gen/facet-targeting/operations.d.ts +10 -0
- package/dist/document-models/resource-template/gen/facet-targeting/operations.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/facet-targeting/operations.js +3 -0
- package/dist/document-models/resource-template/gen/index.d.ts +17 -0
- package/dist/document-models/resource-template/gen/index.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/index.js +16 -0
- package/dist/document-models/resource-template/gen/option-group-management/actions.d.ts +16 -0
- package/dist/document-models/resource-template/gen/option-group-management/actions.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/option-group-management/actions.js +1 -0
- package/dist/document-models/resource-template/gen/option-group-management/creators.d.ts +6 -0
- package/dist/document-models/resource-template/gen/option-group-management/creators.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/option-group-management/creators.js +5 -0
- package/dist/document-models/resource-template/gen/option-group-management/error.d.ts +28 -0
- package/dist/document-models/resource-template/gen/option-group-management/error.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/option-group-management/error.js +29 -0
- package/dist/document-models/resource-template/gen/option-group-management/operations.d.ts +9 -0
- package/dist/document-models/resource-template/gen/option-group-management/operations.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/option-group-management/operations.js +3 -0
- package/dist/document-models/resource-template/gen/ph-factories.d.ts +23 -0
- package/dist/document-models/resource-template/gen/ph-factories.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/ph-factories.js +61 -0
- package/dist/document-models/resource-template/gen/reducer.d.ts +3 -0
- package/dist/document-models/resource-template/gen/reducer.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/reducer.js +98 -0
- package/dist/document-models/resource-template/gen/schema/index.d.ts +3 -0
- package/dist/document-models/resource-template/gen/schema/index.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/schema/index.js +2 -0
- package/dist/document-models/resource-template/gen/schema/types.d.ts +305 -0
- package/dist/document-models/resource-template/gen/schema/types.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/schema/types.js +1 -0
- package/dist/document-models/resource-template/gen/schema/zod.d.ts +37 -0
- package/dist/document-models/resource-template/gen/schema/zod.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/schema/zod.js +236 -0
- package/dist/document-models/resource-template/gen/service-category-management/actions.d.ts +12 -0
- package/dist/document-models/resource-template/gen/service-category-management/actions.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/service-category-management/actions.js +1 -0
- package/dist/document-models/resource-template/gen/service-category-management/creators.d.ts +5 -0
- package/dist/document-models/resource-template/gen/service-category-management/creators.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/service-category-management/creators.js +4 -0
- package/dist/document-models/resource-template/gen/service-category-management/error.d.ts +2 -0
- package/dist/document-models/resource-template/gen/service-category-management/error.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/service-category-management/error.js +1 -0
- package/dist/document-models/resource-template/gen/service-category-management/operations.d.ts +8 -0
- package/dist/document-models/resource-template/gen/service-category-management/operations.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/service-category-management/operations.js +3 -0
- package/dist/document-models/resource-template/gen/service-management/actions.d.ts +24 -0
- package/dist/document-models/resource-template/gen/service-management/actions.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/service-management/actions.js +1 -0
- package/dist/document-models/resource-template/gen/service-management/creators.d.ts +8 -0
- package/dist/document-models/resource-template/gen/service-management/creators.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/service-management/creators.js +7 -0
- package/dist/document-models/resource-template/gen/service-management/error.d.ts +52 -0
- package/dist/document-models/resource-template/gen/service-management/error.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/service-management/error.js +61 -0
- package/dist/document-models/resource-template/gen/service-management/operations.d.ts +11 -0
- package/dist/document-models/resource-template/gen/service-management/operations.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/service-management/operations.js +3 -0
- package/dist/document-models/resource-template/gen/template-management/actions.d.ts +20 -0
- package/dist/document-models/resource-template/gen/template-management/actions.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/template-management/actions.js +1 -0
- package/dist/document-models/resource-template/gen/template-management/creators.d.ts +7 -0
- package/dist/document-models/resource-template/gen/template-management/creators.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/template-management/creators.js +6 -0
- package/dist/document-models/resource-template/gen/template-management/error.d.ts +2 -0
- package/dist/document-models/resource-template/gen/template-management/error.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/template-management/error.js +1 -0
- package/dist/document-models/resource-template/gen/template-management/operations.d.ts +10 -0
- package/dist/document-models/resource-template/gen/template-management/operations.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/template-management/operations.js +3 -0
- package/dist/document-models/resource-template/gen/types.d.ts +12 -0
- package/dist/document-models/resource-template/gen/types.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/types.js +1 -0
- package/dist/document-models/resource-template/gen/utils.d.ts +15 -0
- package/dist/document-models/resource-template/gen/utils.d.ts.map +1 -0
- package/dist/document-models/resource-template/gen/utils.js +65 -0
- package/dist/document-models/resource-template/hooks.d.ts +11 -0
- package/dist/document-models/resource-template/hooks.d.ts.map +1 -0
- package/dist/document-models/resource-template/hooks.js +26 -0
- package/dist/document-models/resource-template/index.d.ts +10 -0
- package/dist/document-models/resource-template/index.d.ts.map +1 -0
- package/dist/document-models/resource-template/index.js +9 -0
- package/dist/document-models/resource-template/module.d.ts +5 -0
- package/dist/document-models/resource-template/module.d.ts.map +1 -0
- package/dist/document-models/resource-template/module.js +10 -0
- package/dist/document-models/resource-template/src/index.d.ts +2 -0
- package/dist/document-models/resource-template/src/index.d.ts.map +1 -0
- package/dist/document-models/resource-template/src/index.js +1 -0
- package/dist/document-models/resource-template/src/reducers/audience-management.d.ts +3 -0
- package/dist/document-models/resource-template/src/reducers/audience-management.d.ts.map +1 -0
- package/dist/document-models/resource-template/src/reducers/audience-management.js +17 -0
- package/dist/document-models/resource-template/src/reducers/facet-targeting.d.ts +3 -0
- package/dist/document-models/resource-template/src/reducers/facet-targeting.d.ts.map +1 -0
- package/dist/document-models/resource-template/src/reducers/facet-targeting.js +46 -0
- package/dist/document-models/resource-template/src/reducers/option-group-management.d.ts +3 -0
- package/dist/document-models/resource-template/src/reducers/option-group-management.d.ts.map +1 -0
- package/dist/document-models/resource-template/src/reducers/option-group-management.js +42 -0
- package/dist/document-models/resource-template/src/reducers/service-category-management.d.ts +3 -0
- package/dist/document-models/resource-template/src/reducers/service-category-management.d.ts.map +1 -0
- package/dist/document-models/resource-template/src/reducers/service-category-management.js +10 -0
- package/dist/document-models/resource-template/src/reducers/service-management.d.ts +3 -0
- package/dist/document-models/resource-template/src/reducers/service-management.d.ts.map +1 -0
- package/dist/document-models/resource-template/src/reducers/service-management.js +68 -0
- package/dist/document-models/resource-template/src/reducers/template-management.d.ts +3 -0
- package/dist/document-models/resource-template/src/reducers/template-management.d.ts.map +1 -0
- package/dist/document-models/resource-template/src/reducers/template-management.js +32 -0
- package/dist/document-models/resource-template/src/tests/audience-management.test.d.ts +6 -0
- package/dist/document-models/resource-template/src/tests/audience-management.test.d.ts.map +1 -0
- package/dist/document-models/resource-template/src/tests/audience-management.test.js +29 -0
- package/dist/document-models/resource-template/src/tests/document-model.test.d.ts +10 -0
- package/dist/document-models/resource-template/src/tests/document-model.test.d.ts.map +1 -0
- package/dist/document-models/resource-template/src/tests/document-model.test.js +104 -0
- package/dist/document-models/resource-template/src/tests/facet-targeting.test.d.ts +6 -0
- package/dist/document-models/resource-template/src/tests/facet-targeting.test.d.ts.map +1 -0
- package/dist/document-models/resource-template/src/tests/facet-targeting.test.js +49 -0
- package/dist/document-models/resource-template/src/tests/option-group-management.test.d.ts +6 -0
- package/dist/document-models/resource-template/src/tests/option-group-management.test.d.ts.map +1 -0
- package/dist/document-models/resource-template/src/tests/option-group-management.test.js +39 -0
- package/dist/document-models/resource-template/src/tests/service-category-management.test.d.ts +6 -0
- package/dist/document-models/resource-template/src/tests/service-category-management.test.d.ts.map +1 -0
- package/dist/document-models/resource-template/src/tests/service-category-management.test.js +29 -0
- package/dist/document-models/resource-template/src/tests/service-management.test.d.ts +6 -0
- package/dist/document-models/resource-template/src/tests/service-management.test.d.ts.map +1 -0
- package/dist/document-models/resource-template/src/tests/service-management.test.js +59 -0
- package/dist/document-models/resource-template/src/tests/template-management.test.d.ts +6 -0
- package/dist/document-models/resource-template/src/tests/template-management.test.d.ts.map +1 -0
- package/dist/document-models/resource-template/src/tests/template-management.test.js +49 -0
- package/dist/document-models/resource-template/src/utils.d.ts +2 -0
- package/dist/document-models/resource-template/src/utils.d.ts.map +1 -0
- package/dist/document-models/resource-template/src/utils.js +1 -0
- package/dist/document-models/resource-template/utils.d.ts +14 -0
- package/dist/document-models/resource-template/utils.d.ts.map +1 -0
- package/dist/document-models/resource-template/utils.js +7 -0
- package/dist/document-models/service-offering/actions.d.ts +2 -0
- package/dist/document-models/service-offering/actions.d.ts.map +1 -1
- package/dist/document-models/service-offering/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/service-offering/gen/document-model.js +47 -2
- package/dist/document-models/service-offering/gen/document-schema.d.ts +35 -16
- package/dist/document-models/service-offering/gen/document-schema.d.ts.map +1 -1
- package/dist/document-models/service-offering/gen/offering-management/actions.d.ts +10 -2
- package/dist/document-models/service-offering/gen/offering-management/actions.d.ts.map +1 -1
- package/dist/document-models/service-offering/gen/offering-management/creators.d.ts +4 -2
- package/dist/document-models/service-offering/gen/offering-management/creators.d.ts.map +1 -1
- package/dist/document-models/service-offering/gen/offering-management/creators.js +3 -1
- package/dist/document-models/service-offering/gen/offering-management/error.d.ts +20 -1
- package/dist/document-models/service-offering/gen/offering-management/error.d.ts.map +1 -1
- package/dist/document-models/service-offering/gen/offering-management/error.js +25 -0
- package/dist/document-models/service-offering/gen/offering-management/operations.d.ts +3 -1
- package/dist/document-models/service-offering/gen/offering-management/operations.d.ts.map +1 -1
- package/dist/document-models/service-offering/gen/ph-factories.d.ts.map +1 -1
- package/dist/document-models/service-offering/gen/ph-factories.js +1 -0
- package/dist/document-models/service-offering/gen/reducer.d.ts +1 -1
- package/dist/document-models/service-offering/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/service-offering/gen/reducer.js +9 -1
- package/dist/document-models/service-offering/gen/schema/types.d.ts +21 -11
- package/dist/document-models/service-offering/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/service-offering/gen/schema/zod.d.ts +3 -1
- package/dist/document-models/service-offering/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/service-offering/gen/schema/zod.js +14 -0
- package/dist/document-models/service-offering/gen/utils.d.ts.map +1 -1
- package/dist/document-models/service-offering/gen/utils.js +1 -0
- package/dist/document-models/service-offering/src/reducers/offering-management.d.ts.map +1 -1
- package/dist/document-models/service-offering/src/reducers/offering-management.js +22 -4
- package/dist/document-models/service-offering/src/reducers/option-group-management.d.ts.map +1 -1
- package/dist/document-models/service-offering/src/reducers/option-group-management.js +8 -11
- package/dist/document-models/service-offering/src/reducers/service-management.d.ts.map +1 -1
- package/dist/document-models/service-offering/src/reducers/service-management.js +12 -15
- package/dist/document-models/service-offering/src/reducers/tier-management.d.ts.map +1 -1
- package/dist/document-models/service-offering/src/reducers/tier-management.js +19 -21
- package/dist/document-models/service-offering/src/tests/offering-management.test.js +1 -81
- package/dist/document-models/service-offering/src/tests/tier-management.test.d.ts +4 -0
- package/dist/document-models/service-offering/src/tests/tier-management.test.d.ts.map +1 -1
- package/dist/document-models/service-offering/src/tests/tier-management.test.js +109 -1
- package/dist/editors/builder-team-admin/components/DriveExplorer.d.ts.map +1 -1
- package/dist/editors/builder-team-admin/components/DriveExplorer.js +4 -0
- package/dist/editors/builder-team-admin/components/FolderTree.d.ts +1 -1
- package/dist/editors/builder-team-admin/components/FolderTree.d.ts.map +1 -1
- package/dist/editors/builder-team-admin/components/FolderTree.js +134 -9
- package/dist/editors/builder-team-admin/components/ResourcesServices.d.ts +8 -0
- package/dist/editors/builder-team-admin/components/ResourcesServices.d.ts.map +1 -0
- package/dist/editors/builder-team-admin/components/ResourcesServices.js +76 -0
- package/dist/editors/builder-team-admin/hooks/useResourcesServicesAutoPlacement.d.ts +27 -0
- package/dist/editors/builder-team-admin/hooks/useResourcesServicesAutoPlacement.d.ts.map +1 -0
- package/dist/editors/builder-team-admin/hooks/useResourcesServicesAutoPlacement.js +123 -0
- package/dist/editors/index.d.ts +1 -0
- package/dist/editors/index.d.ts.map +1 -1
- package/dist/editors/index.js +1 -0
- package/dist/editors/resource-template-editor/components/FacetTargeting.d.ts +9 -0
- package/dist/editors/resource-template-editor/components/FacetTargeting.d.ts.map +1 -0
- package/dist/editors/resource-template-editor/components/FacetTargeting.js +451 -0
- package/dist/editors/resource-template-editor/components/TemplateInfo.d.ts +9 -0
- package/dist/editors/resource-template-editor/components/TemplateInfo.d.ts.map +1 -0
- package/dist/editors/resource-template-editor/components/TemplateInfo.js +988 -0
- package/dist/editors/resource-template-editor/editor.d.ts +2 -0
- package/dist/editors/resource-template-editor/editor.d.ts.map +1 -0
- package/dist/editors/resource-template-editor/editor.js +149 -0
- package/dist/editors/resource-template-editor/module.d.ts +4 -0
- package/dist/editors/resource-template-editor/module.d.ts.map +1 -0
- package/dist/editors/resource-template-editor/module.js +10 -0
- package/dist/editors/service-offering-editor/components/ResourceTemplateSelector.d.ts +9 -0
- package/dist/editors/service-offering-editor/components/ResourceTemplateSelector.d.ts.map +1 -0
- package/dist/editors/service-offering-editor/components/ResourceTemplateSelector.js +1050 -0
- package/dist/editors/service-offering-editor/components/ServicesList.d.ts.map +1 -1
- package/dist/editors/service-offering-editor/components/ServicesList.js +1 -1
- package/dist/editors/service-offering-editor/components/TabNavigation.d.ts.map +1 -1
- package/dist/editors/service-offering-editor/components/TabNavigation.js +17 -3
- package/dist/editors/service-offering-editor/components/TheMatrix.d.ts.map +1 -1
- package/dist/editors/service-offering-editor/components/TheMatrix.js +284 -25
- package/dist/editors/service-offering-editor/editor.d.ts.map +1 -1
- package/dist/editors/service-offering-editor/editor.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/style.css +25 -0
- package/package.json +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export const resourceTemplateOptionGroupManagementOperations = {
|
|
2
|
+
addOptionGroupOperation(state, action) {
|
|
3
|
+
state.optionGroups.push({
|
|
4
|
+
id: action.input.id,
|
|
5
|
+
name: action.input.name,
|
|
6
|
+
description: action.input.description || null,
|
|
7
|
+
isAddOn: action.input.isAddOn,
|
|
8
|
+
defaultSelected: action.input.defaultSelected
|
|
9
|
+
});
|
|
10
|
+
state.lastModified = action.input.lastModified;
|
|
11
|
+
},
|
|
12
|
+
updateOptionGroupOperation(state, action) {
|
|
13
|
+
const optionGroup = state.optionGroups.find(og => og.id === action.input.id);
|
|
14
|
+
if (optionGroup) {
|
|
15
|
+
if (action.input.name) {
|
|
16
|
+
optionGroup.name = action.input.name;
|
|
17
|
+
}
|
|
18
|
+
if (action.input.description !== undefined) {
|
|
19
|
+
optionGroup.description = action.input.description || null;
|
|
20
|
+
}
|
|
21
|
+
if (action.input.isAddOn !== undefined && action.input.isAddOn !== null) {
|
|
22
|
+
optionGroup.isAddOn = action.input.isAddOn;
|
|
23
|
+
}
|
|
24
|
+
if (action.input.defaultSelected !== undefined && action.input.defaultSelected !== null) {
|
|
25
|
+
optionGroup.defaultSelected = action.input.defaultSelected;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
state.lastModified = action.input.lastModified;
|
|
29
|
+
},
|
|
30
|
+
deleteOptionGroupOperation(state, action) {
|
|
31
|
+
const optionGroupIndex = state.optionGroups.findIndex(og => og.id === action.input.id);
|
|
32
|
+
if (optionGroupIndex !== -1) {
|
|
33
|
+
state.services.forEach(service => {
|
|
34
|
+
if (service.optionGroupId === action.input.id) {
|
|
35
|
+
service.optionGroupId = null;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
state.optionGroups.splice(optionGroupIndex, 1);
|
|
39
|
+
}
|
|
40
|
+
state.lastModified = action.input.lastModified;
|
|
41
|
+
},
|
|
42
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ResourceTemplateServiceCategoryManagementOperations } from "@powerhousedao/contributor-billing/document-models/resource-template";
|
|
2
|
+
export declare const resourceTemplateServiceCategoryManagementOperations: ResourceTemplateServiceCategoryManagementOperations;
|
|
3
|
+
//# sourceMappingURL=service-category-management.d.ts.map
|
package/dist/document-models/resource-template/src/reducers/service-category-management.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-category-management.d.ts","sourceRoot":"","sources":["../../../../../document-models/resource-template/src/reducers/service-category-management.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mDAAmD,EAAE,MAAM,sEAAsE,CAAC;AAEhJ,eAAO,MAAM,mDAAmD,EAAE,mDAU/D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const resourceTemplateServiceCategoryManagementOperations = {
|
|
2
|
+
setSetupServicesOperation(state, action) {
|
|
3
|
+
state.setupServices = action.input.services;
|
|
4
|
+
state.lastModified = action.input.lastModified;
|
|
5
|
+
},
|
|
6
|
+
setRecurringServicesOperation(state, action) {
|
|
7
|
+
state.recurringServices = action.input.services;
|
|
8
|
+
state.lastModified = action.input.lastModified;
|
|
9
|
+
},
|
|
10
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ResourceTemplateServiceManagementOperations } from "@powerhousedao/contributor-billing/document-models/resource-template";
|
|
2
|
+
export declare const resourceTemplateServiceManagementOperations: ResourceTemplateServiceManagementOperations;
|
|
3
|
+
//# sourceMappingURL=service-management.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-management.d.ts","sourceRoot":"","sources":["../../../../../document-models/resource-template/src/reducers/service-management.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2CAA2C,EAAE,MAAM,sEAAsE,CAAC;AAExI,eAAO,MAAM,2CAA2C,EAAE,2CAoEvD,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export const resourceTemplateServiceManagementOperations = {
|
|
2
|
+
addServiceOperation(state, action) {
|
|
3
|
+
state.services.push({
|
|
4
|
+
id: action.input.id,
|
|
5
|
+
title: action.input.title,
|
|
6
|
+
description: action.input.description || null,
|
|
7
|
+
parentServiceId: action.input.parentServiceId || null,
|
|
8
|
+
displayOrder: action.input.displayOrder || null,
|
|
9
|
+
isSetupFormation: action.input.isSetupFormation || false,
|
|
10
|
+
optionGroupId: action.input.optionGroupId || null,
|
|
11
|
+
facetBindings: []
|
|
12
|
+
});
|
|
13
|
+
state.lastModified = action.input.lastModified;
|
|
14
|
+
},
|
|
15
|
+
updateServiceOperation(state, action) {
|
|
16
|
+
const service = state.services.find(s => s.id === action.input.id);
|
|
17
|
+
if (service) {
|
|
18
|
+
if (action.input.title) {
|
|
19
|
+
service.title = action.input.title;
|
|
20
|
+
}
|
|
21
|
+
if (action.input.description !== undefined && action.input.description !== null) {
|
|
22
|
+
service.description = action.input.description;
|
|
23
|
+
}
|
|
24
|
+
if (action.input.parentServiceId !== undefined) {
|
|
25
|
+
service.parentServiceId = action.input.parentServiceId || null;
|
|
26
|
+
}
|
|
27
|
+
if (action.input.displayOrder !== undefined && action.input.displayOrder !== null) {
|
|
28
|
+
service.displayOrder = action.input.displayOrder;
|
|
29
|
+
}
|
|
30
|
+
if (action.input.isSetupFormation !== undefined && action.input.isSetupFormation !== null) {
|
|
31
|
+
service.isSetupFormation = action.input.isSetupFormation;
|
|
32
|
+
}
|
|
33
|
+
if (action.input.optionGroupId !== undefined) {
|
|
34
|
+
service.optionGroupId = action.input.optionGroupId || null;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
state.lastModified = action.input.lastModified;
|
|
38
|
+
},
|
|
39
|
+
deleteServiceOperation(state, action) {
|
|
40
|
+
const serviceIndex = state.services.findIndex(s => s.id === action.input.id);
|
|
41
|
+
if (serviceIndex !== -1) {
|
|
42
|
+
state.services.splice(serviceIndex, 1);
|
|
43
|
+
}
|
|
44
|
+
state.lastModified = action.input.lastModified;
|
|
45
|
+
},
|
|
46
|
+
addFacetBindingOperation(state, action) {
|
|
47
|
+
const service = state.services.find(s => s.id === action.input.serviceId);
|
|
48
|
+
if (service) {
|
|
49
|
+
service.facetBindings.push({
|
|
50
|
+
id: action.input.bindingId,
|
|
51
|
+
facetName: action.input.facetName,
|
|
52
|
+
facetType: action.input.facetType,
|
|
53
|
+
supportedOptions: action.input.supportedOptions
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
state.lastModified = action.input.lastModified;
|
|
57
|
+
},
|
|
58
|
+
removeFacetBindingOperation(state, action) {
|
|
59
|
+
const service = state.services.find(s => s.id === action.input.serviceId);
|
|
60
|
+
if (service) {
|
|
61
|
+
const bindingIndex = service.facetBindings.findIndex(fb => fb.id === action.input.bindingId);
|
|
62
|
+
if (bindingIndex !== -1) {
|
|
63
|
+
service.facetBindings.splice(bindingIndex, 1);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
state.lastModified = action.input.lastModified;
|
|
67
|
+
},
|
|
68
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ResourceTemplateTemplateManagementOperations } from "@powerhousedao/contributor-billing/document-models/resource-template";
|
|
2
|
+
export declare const resourceTemplateTemplateManagementOperations: ResourceTemplateTemplateManagementOperations;
|
|
3
|
+
//# sourceMappingURL=template-management.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-management.d.ts","sourceRoot":"","sources":["../../../../../document-models/resource-template/src/reducers/template-management.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4CAA4C,EAAE,MAAM,sEAAsE,CAAC;AAEzI,eAAO,MAAM,4CAA4C,EAAE,4CAgCxD,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export const resourceTemplateTemplateManagementOperations = {
|
|
2
|
+
updateTemplateInfoOperation(state, action) {
|
|
3
|
+
if (action.input.title) {
|
|
4
|
+
state.title = action.input.title;
|
|
5
|
+
}
|
|
6
|
+
if (action.input.summary) {
|
|
7
|
+
state.summary = action.input.summary;
|
|
8
|
+
}
|
|
9
|
+
if (action.input.description !== undefined) {
|
|
10
|
+
state.description = action.input.description || null;
|
|
11
|
+
}
|
|
12
|
+
if (action.input.thumbnailUrl !== undefined) {
|
|
13
|
+
state.thumbnailUrl = action.input.thumbnailUrl || null;
|
|
14
|
+
}
|
|
15
|
+
if (action.input.infoLink !== undefined) {
|
|
16
|
+
state.infoLink = action.input.infoLink || null;
|
|
17
|
+
}
|
|
18
|
+
state.lastModified = action.input.lastModified;
|
|
19
|
+
},
|
|
20
|
+
updateTemplateStatusOperation(state, action) {
|
|
21
|
+
state.status = action.input.status;
|
|
22
|
+
state.lastModified = action.input.lastModified;
|
|
23
|
+
},
|
|
24
|
+
setOperatorOperation(state, action) {
|
|
25
|
+
state.operatorId = action.input.operatorId;
|
|
26
|
+
state.lastModified = action.input.lastModified;
|
|
27
|
+
},
|
|
28
|
+
setTemplateIdOperation(state, action) {
|
|
29
|
+
state.id = action.input.id;
|
|
30
|
+
state.lastModified = action.input.lastModified;
|
|
31
|
+
},
|
|
32
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audience-management.test.d.ts","sourceRoot":"","sources":["../../../../../document-models/resource-template/src/tests/audience-management.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a scaffold file meant for customization:
|
|
3
|
+
* - change it by adding new tests or modifying the existing ones
|
|
4
|
+
*/
|
|
5
|
+
import { describe, it, expect } from "vitest";
|
|
6
|
+
import { generateMock } from "@powerhousedao/codegen";
|
|
7
|
+
import { reducer, utils, isResourceTemplateDocument, addTargetAudience, AddTargetAudienceInputSchema, removeTargetAudience, RemoveTargetAudienceInputSchema, } from "@powerhousedao/contributor-billing/document-models/resource-template";
|
|
8
|
+
describe("AudienceManagement Operations", () => {
|
|
9
|
+
it("should handle addTargetAudience operation", () => {
|
|
10
|
+
const document = utils.createDocument();
|
|
11
|
+
const input = generateMock(AddTargetAudienceInputSchema());
|
|
12
|
+
const updatedDocument = reducer(document, addTargetAudience(input));
|
|
13
|
+
expect(isResourceTemplateDocument(updatedDocument)).toBe(true);
|
|
14
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
15
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("ADD_TARGET_AUDIENCE");
|
|
16
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
17
|
+
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
18
|
+
});
|
|
19
|
+
it("should handle removeTargetAudience operation", () => {
|
|
20
|
+
const document = utils.createDocument();
|
|
21
|
+
const input = generateMock(RemoveTargetAudienceInputSchema());
|
|
22
|
+
const updatedDocument = reducer(document, removeTargetAudience(input));
|
|
23
|
+
expect(isResourceTemplateDocument(updatedDocument)).toBe(true);
|
|
24
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
25
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("REMOVE_TARGET_AUDIENCE");
|
|
26
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
27
|
+
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a scaffold file meant for customization:
|
|
3
|
+
* - change it by adding new tests or modifying the existing ones
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* This is a scaffold file meant for customization:
|
|
7
|
+
* - change it by adding new tests or modifying the existing ones
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=document-model.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-model.test.d.ts","sourceRoot":"","sources":["../../../../../document-models/resource-template/src/tests/document-model.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;;GAGG"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a scaffold file meant for customization:
|
|
3
|
+
* - change it by adding new tests or modifying the existing ones
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* This is a scaffold file meant for customization:
|
|
7
|
+
* - change it by adding new tests or modifying the existing ones
|
|
8
|
+
*/
|
|
9
|
+
import { describe, it, expect } from "vitest";
|
|
10
|
+
import { utils, initialGlobalState, initialLocalState, resourceTemplateDocumentType, isResourceTemplateDocument, assertIsResourceTemplateDocument, isResourceTemplateState, assertIsResourceTemplateState, } from "@powerhousedao/contributor-billing/document-models/resource-template";
|
|
11
|
+
import { ZodError } from "zod";
|
|
12
|
+
describe("ResourceTemplate Document Model", () => {
|
|
13
|
+
it("should create a new ResourceTemplate document", () => {
|
|
14
|
+
const document = utils.createDocument();
|
|
15
|
+
expect(document).toBeDefined();
|
|
16
|
+
expect(document.header.documentType).toBe(resourceTemplateDocumentType);
|
|
17
|
+
});
|
|
18
|
+
it("should create a new ResourceTemplate document with a valid initial state", () => {
|
|
19
|
+
const document = utils.createDocument();
|
|
20
|
+
expect(document.state.global).toStrictEqual(initialGlobalState);
|
|
21
|
+
expect(document.state.local).toStrictEqual(initialLocalState);
|
|
22
|
+
expect(isResourceTemplateDocument(document)).toBe(true);
|
|
23
|
+
expect(isResourceTemplateState(document.state)).toBe(true);
|
|
24
|
+
});
|
|
25
|
+
it("should reject a document that is not a ResourceTemplate document", () => {
|
|
26
|
+
const wrongDocumentType = utils.createDocument();
|
|
27
|
+
wrongDocumentType.header.documentType = "the-wrong-thing-1234";
|
|
28
|
+
try {
|
|
29
|
+
expect(assertIsResourceTemplateDocument(wrongDocumentType)).toThrow();
|
|
30
|
+
expect(isResourceTemplateDocument(wrongDocumentType)).toBe(false);
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
expect(error).toBeInstanceOf(ZodError);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const wrongState = utils.createDocument();
|
|
37
|
+
// @ts-expect-error - we are testing the error case
|
|
38
|
+
wrongState.state.global = {
|
|
39
|
+
...{ notWhat: "you want" },
|
|
40
|
+
};
|
|
41
|
+
try {
|
|
42
|
+
expect(isResourceTemplateState(wrongState.state)).toBe(false);
|
|
43
|
+
expect(assertIsResourceTemplateState(wrongState.state)).toThrow();
|
|
44
|
+
expect(isResourceTemplateDocument(wrongState)).toBe(false);
|
|
45
|
+
expect(assertIsResourceTemplateDocument(wrongState)).toThrow();
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
expect(error).toBeInstanceOf(ZodError);
|
|
49
|
+
}
|
|
50
|
+
const wrongInitialState = utils.createDocument();
|
|
51
|
+
// @ts-expect-error - we are testing the error case
|
|
52
|
+
wrongInitialState.initialState.global = {
|
|
53
|
+
...{ notWhat: "you want" },
|
|
54
|
+
};
|
|
55
|
+
try {
|
|
56
|
+
expect(isResourceTemplateState(wrongInitialState.state)).toBe(false);
|
|
57
|
+
expect(assertIsResourceTemplateState(wrongInitialState.state)).toThrow();
|
|
58
|
+
expect(isResourceTemplateDocument(wrongInitialState)).toBe(false);
|
|
59
|
+
expect(assertIsResourceTemplateDocument(wrongInitialState)).toThrow();
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
expect(error).toBeInstanceOf(ZodError);
|
|
63
|
+
}
|
|
64
|
+
const missingIdInHeader = utils.createDocument();
|
|
65
|
+
// @ts-expect-error - we are testing the error case
|
|
66
|
+
delete missingIdInHeader.header.id;
|
|
67
|
+
try {
|
|
68
|
+
expect(isResourceTemplateDocument(missingIdInHeader)).toBe(false);
|
|
69
|
+
expect(assertIsResourceTemplateDocument(missingIdInHeader)).toThrow();
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
expect(error).toBeInstanceOf(ZodError);
|
|
73
|
+
}
|
|
74
|
+
const missingNameInHeader = utils.createDocument();
|
|
75
|
+
// @ts-expect-error - we are testing the error case
|
|
76
|
+
delete missingNameInHeader.header.name;
|
|
77
|
+
try {
|
|
78
|
+
expect(isResourceTemplateDocument(missingNameInHeader)).toBe(false);
|
|
79
|
+
expect(assertIsResourceTemplateDocument(missingNameInHeader)).toThrow();
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
expect(error).toBeInstanceOf(ZodError);
|
|
83
|
+
}
|
|
84
|
+
const missingCreatedAtUtcIsoInHeader = utils.createDocument();
|
|
85
|
+
// @ts-expect-error - we are testing the error case
|
|
86
|
+
delete missingCreatedAtUtcIsoInHeader.header.createdAtUtcIso;
|
|
87
|
+
try {
|
|
88
|
+
expect(isResourceTemplateDocument(missingCreatedAtUtcIsoInHeader)).toBe(false);
|
|
89
|
+
expect(assertIsResourceTemplateDocument(missingCreatedAtUtcIsoInHeader)).toThrow();
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
expect(error).toBeInstanceOf(ZodError);
|
|
93
|
+
}
|
|
94
|
+
const missingLastModifiedAtUtcIsoInHeader = utils.createDocument();
|
|
95
|
+
// @ts-expect-error - we are testing the error case
|
|
96
|
+
delete missingLastModifiedAtUtcIsoInHeader.header.lastModifiedAtUtcIso;
|
|
97
|
+
try {
|
|
98
|
+
expect(isResourceTemplateDocument(missingLastModifiedAtUtcIsoInHeader)).toBe(false);
|
|
99
|
+
expect(assertIsResourceTemplateDocument(missingLastModifiedAtUtcIsoInHeader)).toThrow();
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
expect(error).toBeInstanceOf(ZodError);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"facet-targeting.test.d.ts","sourceRoot":"","sources":["../../../../../document-models/resource-template/src/tests/facet-targeting.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a scaffold file meant for customization:
|
|
3
|
+
* - change it by adding new tests or modifying the existing ones
|
|
4
|
+
*/
|
|
5
|
+
import { describe, it, expect } from "vitest";
|
|
6
|
+
import { generateMock } from "@powerhousedao/codegen";
|
|
7
|
+
import { reducer, utils, isResourceTemplateDocument, setFacetTarget, SetFacetTargetInputSchema, removeFacetTarget, RemoveFacetTargetInputSchema, addFacetOption, AddFacetOptionInputSchema, removeFacetOption, RemoveFacetOptionInputSchema, } from "@powerhousedao/contributor-billing/document-models/resource-template";
|
|
8
|
+
describe("FacetTargeting Operations", () => {
|
|
9
|
+
it("should handle setFacetTarget operation", () => {
|
|
10
|
+
const document = utils.createDocument();
|
|
11
|
+
const input = generateMock(SetFacetTargetInputSchema());
|
|
12
|
+
const updatedDocument = reducer(document, setFacetTarget(input));
|
|
13
|
+
expect(isResourceTemplateDocument(updatedDocument)).toBe(true);
|
|
14
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
15
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("SET_FACET_TARGET");
|
|
16
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
17
|
+
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
18
|
+
});
|
|
19
|
+
it("should handle removeFacetTarget operation", () => {
|
|
20
|
+
const document = utils.createDocument();
|
|
21
|
+
const input = generateMock(RemoveFacetTargetInputSchema());
|
|
22
|
+
const updatedDocument = reducer(document, removeFacetTarget(input));
|
|
23
|
+
expect(isResourceTemplateDocument(updatedDocument)).toBe(true);
|
|
24
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
25
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("REMOVE_FACET_TARGET");
|
|
26
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
27
|
+
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
28
|
+
});
|
|
29
|
+
it("should handle addFacetOption operation", () => {
|
|
30
|
+
const document = utils.createDocument();
|
|
31
|
+
const input = generateMock(AddFacetOptionInputSchema());
|
|
32
|
+
const updatedDocument = reducer(document, addFacetOption(input));
|
|
33
|
+
expect(isResourceTemplateDocument(updatedDocument)).toBe(true);
|
|
34
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
35
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("ADD_FACET_OPTION");
|
|
36
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
37
|
+
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
38
|
+
});
|
|
39
|
+
it("should handle removeFacetOption operation", () => {
|
|
40
|
+
const document = utils.createDocument();
|
|
41
|
+
const input = generateMock(RemoveFacetOptionInputSchema());
|
|
42
|
+
const updatedDocument = reducer(document, removeFacetOption(input));
|
|
43
|
+
expect(isResourceTemplateDocument(updatedDocument)).toBe(true);
|
|
44
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
45
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("REMOVE_FACET_OPTION");
|
|
46
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
47
|
+
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
48
|
+
});
|
|
49
|
+
});
|
package/dist/document-models/resource-template/src/tests/option-group-management.test.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"option-group-management.test.d.ts","sourceRoot":"","sources":["../../../../../document-models/resource-template/src/tests/option-group-management.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a scaffold file meant for customization:
|
|
3
|
+
* - change it by adding new tests or modifying the existing ones
|
|
4
|
+
*/
|
|
5
|
+
import { describe, it, expect } from "vitest";
|
|
6
|
+
import { generateMock } from "@powerhousedao/codegen";
|
|
7
|
+
import { reducer, utils, isResourceTemplateDocument, addOptionGroup, AddOptionGroupInputSchema, updateOptionGroup, UpdateOptionGroupInputSchema, deleteOptionGroup, DeleteOptionGroupInputSchema, } from "@powerhousedao/contributor-billing/document-models/resource-template";
|
|
8
|
+
describe("OptionGroupManagement Operations", () => {
|
|
9
|
+
it("should handle addOptionGroup operation", () => {
|
|
10
|
+
const document = utils.createDocument();
|
|
11
|
+
const input = generateMock(AddOptionGroupInputSchema());
|
|
12
|
+
const updatedDocument = reducer(document, addOptionGroup(input));
|
|
13
|
+
expect(isResourceTemplateDocument(updatedDocument)).toBe(true);
|
|
14
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
15
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("ADD_OPTION_GROUP");
|
|
16
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
17
|
+
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
18
|
+
});
|
|
19
|
+
it("should handle updateOptionGroup operation", () => {
|
|
20
|
+
const document = utils.createDocument();
|
|
21
|
+
const input = generateMock(UpdateOptionGroupInputSchema());
|
|
22
|
+
const updatedDocument = reducer(document, updateOptionGroup(input));
|
|
23
|
+
expect(isResourceTemplateDocument(updatedDocument)).toBe(true);
|
|
24
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
25
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("UPDATE_OPTION_GROUP");
|
|
26
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
27
|
+
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
28
|
+
});
|
|
29
|
+
it("should handle deleteOptionGroup operation", () => {
|
|
30
|
+
const document = utils.createDocument();
|
|
31
|
+
const input = generateMock(DeleteOptionGroupInputSchema());
|
|
32
|
+
const updatedDocument = reducer(document, deleteOptionGroup(input));
|
|
33
|
+
expect(isResourceTemplateDocument(updatedDocument)).toBe(true);
|
|
34
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
35
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("DELETE_OPTION_GROUP");
|
|
36
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
37
|
+
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
38
|
+
});
|
|
39
|
+
});
|
package/dist/document-models/resource-template/src/tests/service-category-management.test.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-category-management.test.d.ts","sourceRoot":"","sources":["../../../../../document-models/resource-template/src/tests/service-category-management.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a scaffold file meant for customization:
|
|
3
|
+
* - change it by adding new tests or modifying the existing ones
|
|
4
|
+
*/
|
|
5
|
+
import { describe, it, expect } from "vitest";
|
|
6
|
+
import { generateMock } from "@powerhousedao/codegen";
|
|
7
|
+
import { reducer, utils, isResourceTemplateDocument, setSetupServices, SetSetupServicesInputSchema, setRecurringServices, SetRecurringServicesInputSchema, } from "@powerhousedao/contributor-billing/document-models/resource-template";
|
|
8
|
+
describe("ServiceCategoryManagement Operations", () => {
|
|
9
|
+
it("should handle setSetupServices operation", () => {
|
|
10
|
+
const document = utils.createDocument();
|
|
11
|
+
const input = generateMock(SetSetupServicesInputSchema());
|
|
12
|
+
const updatedDocument = reducer(document, setSetupServices(input));
|
|
13
|
+
expect(isResourceTemplateDocument(updatedDocument)).toBe(true);
|
|
14
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
15
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("SET_SETUP_SERVICES");
|
|
16
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
17
|
+
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
18
|
+
});
|
|
19
|
+
it("should handle setRecurringServices operation", () => {
|
|
20
|
+
const document = utils.createDocument();
|
|
21
|
+
const input = generateMock(SetRecurringServicesInputSchema());
|
|
22
|
+
const updatedDocument = reducer(document, setRecurringServices(input));
|
|
23
|
+
expect(isResourceTemplateDocument(updatedDocument)).toBe(true);
|
|
24
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
25
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("SET_RECURRING_SERVICES");
|
|
26
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
27
|
+
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-management.test.d.ts","sourceRoot":"","sources":["../../../../../document-models/resource-template/src/tests/service-management.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a scaffold file meant for customization:
|
|
3
|
+
* - change it by adding new tests or modifying the existing ones
|
|
4
|
+
*/
|
|
5
|
+
import { describe, it, expect } from "vitest";
|
|
6
|
+
import { generateMock } from "@powerhousedao/codegen";
|
|
7
|
+
import { reducer, utils, isResourceTemplateDocument, addService, AddServiceInputSchema, updateService, UpdateServiceInputSchema, deleteService, DeleteServiceInputSchema, addFacetBinding, AddFacetBindingInputSchema, removeFacetBinding, RemoveFacetBindingInputSchema, } from "@powerhousedao/contributor-billing/document-models/resource-template";
|
|
8
|
+
describe("ServiceManagement Operations", () => {
|
|
9
|
+
it("should handle addService operation", () => {
|
|
10
|
+
const document = utils.createDocument();
|
|
11
|
+
const input = generateMock(AddServiceInputSchema());
|
|
12
|
+
const updatedDocument = reducer(document, addService(input));
|
|
13
|
+
expect(isResourceTemplateDocument(updatedDocument)).toBe(true);
|
|
14
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
15
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("ADD_SERVICE");
|
|
16
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
17
|
+
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
18
|
+
});
|
|
19
|
+
it("should handle updateService operation", () => {
|
|
20
|
+
const document = utils.createDocument();
|
|
21
|
+
const input = generateMock(UpdateServiceInputSchema());
|
|
22
|
+
const updatedDocument = reducer(document, updateService(input));
|
|
23
|
+
expect(isResourceTemplateDocument(updatedDocument)).toBe(true);
|
|
24
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
25
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("UPDATE_SERVICE");
|
|
26
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
27
|
+
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
28
|
+
});
|
|
29
|
+
it("should handle deleteService operation", () => {
|
|
30
|
+
const document = utils.createDocument();
|
|
31
|
+
const input = generateMock(DeleteServiceInputSchema());
|
|
32
|
+
const updatedDocument = reducer(document, deleteService(input));
|
|
33
|
+
expect(isResourceTemplateDocument(updatedDocument)).toBe(true);
|
|
34
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
35
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("DELETE_SERVICE");
|
|
36
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
37
|
+
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
38
|
+
});
|
|
39
|
+
it("should handle addFacetBinding operation", () => {
|
|
40
|
+
const document = utils.createDocument();
|
|
41
|
+
const input = generateMock(AddFacetBindingInputSchema());
|
|
42
|
+
const updatedDocument = reducer(document, addFacetBinding(input));
|
|
43
|
+
expect(isResourceTemplateDocument(updatedDocument)).toBe(true);
|
|
44
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
45
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("ADD_FACET_BINDING");
|
|
46
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
47
|
+
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
48
|
+
});
|
|
49
|
+
it("should handle removeFacetBinding operation", () => {
|
|
50
|
+
const document = utils.createDocument();
|
|
51
|
+
const input = generateMock(RemoveFacetBindingInputSchema());
|
|
52
|
+
const updatedDocument = reducer(document, removeFacetBinding(input));
|
|
53
|
+
expect(isResourceTemplateDocument(updatedDocument)).toBe(true);
|
|
54
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
55
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("REMOVE_FACET_BINDING");
|
|
56
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
57
|
+
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-management.test.d.ts","sourceRoot":"","sources":["../../../../../document-models/resource-template/src/tests/template-management.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a scaffold file meant for customization:
|
|
3
|
+
* - change it by adding new tests or modifying the existing ones
|
|
4
|
+
*/
|
|
5
|
+
import { describe, it, expect } from "vitest";
|
|
6
|
+
import { generateMock } from "@powerhousedao/codegen";
|
|
7
|
+
import { reducer, utils, isResourceTemplateDocument, updateTemplateInfo, UpdateTemplateInfoInputSchema, updateTemplateStatus, UpdateTemplateStatusInputSchema, setOperator, SetOperatorInputSchema, setTemplateId, SetTemplateIdInputSchema, } from "@powerhousedao/contributor-billing/document-models/resource-template";
|
|
8
|
+
describe("TemplateManagement Operations", () => {
|
|
9
|
+
it("should handle updateTemplateInfo operation", () => {
|
|
10
|
+
const document = utils.createDocument();
|
|
11
|
+
const input = generateMock(UpdateTemplateInfoInputSchema());
|
|
12
|
+
const updatedDocument = reducer(document, updateTemplateInfo(input));
|
|
13
|
+
expect(isResourceTemplateDocument(updatedDocument)).toBe(true);
|
|
14
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
15
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("UPDATE_TEMPLATE_INFO");
|
|
16
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
17
|
+
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
18
|
+
});
|
|
19
|
+
it("should handle updateTemplateStatus operation", () => {
|
|
20
|
+
const document = utils.createDocument();
|
|
21
|
+
const input = generateMock(UpdateTemplateStatusInputSchema());
|
|
22
|
+
const updatedDocument = reducer(document, updateTemplateStatus(input));
|
|
23
|
+
expect(isResourceTemplateDocument(updatedDocument)).toBe(true);
|
|
24
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
25
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("UPDATE_TEMPLATE_STATUS");
|
|
26
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
27
|
+
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
28
|
+
});
|
|
29
|
+
it("should handle setOperator operation", () => {
|
|
30
|
+
const document = utils.createDocument();
|
|
31
|
+
const input = generateMock(SetOperatorInputSchema());
|
|
32
|
+
const updatedDocument = reducer(document, setOperator(input));
|
|
33
|
+
expect(isResourceTemplateDocument(updatedDocument)).toBe(true);
|
|
34
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
35
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("SET_OPERATOR");
|
|
36
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
37
|
+
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
38
|
+
});
|
|
39
|
+
it("should handle setTemplateId operation", () => {
|
|
40
|
+
const document = utils.createDocument();
|
|
41
|
+
const input = generateMock(SetTemplateIdInputSchema());
|
|
42
|
+
const updatedDocument = reducer(document, setTemplateId(input));
|
|
43
|
+
expect(isResourceTemplateDocument(updatedDocument)).toBe(true);
|
|
44
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
45
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("SET_TEMPLATE_ID");
|
|
46
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
47
|
+
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
48
|
+
});
|
|
49
|
+
});
|