@projectcaluma/ember-testing 11.0.0-beta.11 → 11.0.0-beta.25

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.
@@ -27,6 +27,27 @@ export default class WorkItemMock extends BaseMock {
27
27
  });
28
28
  }
29
29
 
30
+ @register("RedoWorkItemPayload")
31
+ handleRedoWorkItem(_, { input }) {
32
+ const { id } = deserialize(input);
33
+ const workItem = this.collection.find(id);
34
+
35
+ if (workItem.taskId === "distribution") {
36
+ const caseId = workItem.childCaseId;
37
+
38
+ this.collection
39
+ .where({ caseId, taskId: "complete-distribution" })
40
+ .update({ status: "READY" });
41
+ this.collection
42
+ .where({ caseId, taskId: "create-inquiry" })
43
+ .update({ status: "READY" });
44
+ }
45
+
46
+ return this.handleSavePayload.fn.call(this, _, {
47
+ input: { id, isRedoable: false, status: "READY" },
48
+ });
49
+ }
50
+
30
51
  @register("CompleteWorkItemPayload")
31
52
  handleCompleteWorkItem(_, { input }) {
32
53
  const { id } = deserialize(input);
@@ -102,6 +123,10 @@ export default class WorkItemMock extends BaseMock {
102
123
  addressedGroups: workItem.addressedGroups,
103
124
  });
104
125
  } else if (taskId === "complete-distribution") {
126
+ this.collection
127
+ .where({ childCaseId: caseId, status: "READY", taskId: "distribution" })
128
+ .update({ status: "COMPLETED", isRedoable: true });
129
+
105
130
  this.collection
106
131
  .where({ caseId, status: "READY", taskId: "inquiry" })
107
132
  .update({ status: "SKIPPED" });
@@ -116,7 +141,7 @@ export default class WorkItemMock extends BaseMock {
116
141
  }
117
142
 
118
143
  return this.handleSavePayload.fn.call(this, _, {
119
- input: { id: input.id, status: "COMPLETED" },
144
+ input: { id, status: "COMPLETED" },
120
145
  });
121
146
  }
122
147
  }
@@ -1950,8 +1950,6 @@ type Mutation {
1950
1950
  saveCompleteTaskFormTask(
1951
1951
  input: SaveCompleteTaskFormTaskInput!
1952
1952
  ): SaveCompleteTaskFormTaskPayload
1953
- startCase(input: StartCaseInput!): StartCasePayload
1954
- @deprecated(reason: "Use SaveCase mutation instead")
1955
1953
  saveCase(input: SaveCaseInput!): SaveCasePayload
1956
1954
  cancelCase(input: CancelCaseInput!): CancelCasePayload
1957
1955
  suspendCase(input: SuspendCaseInput!): SuspendCasePayload
@@ -3492,24 +3490,7 @@ enum SortableWorkItemAttributes {
3492
3490
  DEADLINE
3493
3491
  STATUS
3494
3492
  SLUG
3495
- }
3496
-
3497
- input StartCaseInput {
3498
- workflow: ID!
3499
- meta: JSONString
3500
- parentWorkItem: ID
3501
- form: ID
3502
-
3503
- """
3504
- Provide extra context for dynamic jexl transforms and events
3505
- """
3506
- context: JSONString
3507
- clientMutationId: String
3508
- }
3509
-
3510
- type StartCasePayload {
3511
- case: Case
3512
- clientMutationId: String
3493
+ CASE__DOCUMENT__FORM__NAME
3513
3494
  }
3514
3495
 
3515
3496
  """
@@ -4048,6 +4029,13 @@ type WorkItem implements Node {
4048
4029
  first: Int
4049
4030
  last: Int
4050
4031
  ): WorkItemConnection!
4032
+
4033
+ """
4034
+ This property potentially performs poorly if used in a large setof entries, as
4035
+ the evaluation of the redoable jexl configurationcannot be performed on the
4036
+ database level. Please use carefully.
4037
+ """
4038
+ isRedoable: Boolean
4051
4039
  }
4052
4040
 
4053
4041
  type WorkItemConnection {
@@ -4106,6 +4094,7 @@ input WorkItemFilterSetType {
4106
4094
  caseDocumentHasAnswer: [HasAnswerFilterType]
4107
4095
  caseMetaValue: [JSONValueFilterType]
4108
4096
  rootCaseMetaValue: [JSONValueFilterType]
4097
+ caseSearchAnswers: [SearchAnswersFilterType]
4109
4098
  invert: Boolean
4110
4099
  }
4111
4100
 
@@ -73,6 +73,7 @@ export function createBlueprint(server) {
73
73
  server.create("workflow", { slug: "distribution" });
74
74
  server.create("workflow", { slug: "inquiry" });
75
75
 
76
+ server.create("task", { slug: "distribution" });
76
77
  server.create("task", { slug: "create-inquiry" });
77
78
  server.create("task", { slug: "complete-distribution" });
78
79
  server.create("task", { slug: "inquiry" });
@@ -225,10 +226,17 @@ export function reviseInquiry(server, { inquiry }) {
225
226
  }
226
227
 
227
228
  export function createCase(server, { group }) {
229
+ const distributionWorkItem = server.create("work-item", {
230
+ taskId: "distribution",
231
+ status: "READY",
232
+ case: server.create("case"),
233
+ });
234
+
228
235
  const distributionCase = server.create("case", {
229
236
  id: "4222ab21-9c89-47de-98be-d62a8ed0ebeb",
230
237
  status: "RUNNING",
231
238
  workflowId: "distribution",
239
+ parentWorkItem: distributionWorkItem,
232
240
  });
233
241
 
234
242
  server.create("work-item", {
@@ -389,4 +397,6 @@ export default function (server, groups) {
389
397
  status: "inquiry-answer-status-positive",
390
398
  }),
391
399
  });
400
+
401
+ return distributionCase;
392
402
  }
@@ -16,4 +16,5 @@ export default Factory.extend({
16
16
  ? faker.date.past()
17
17
  : null;
18
18
  },
19
+ isRedoable: () => false,
19
20
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@projectcaluma/ember-testing",
3
- "version": "11.0.0-beta.11",
3
+ "version": "11.0.0-beta.25",
4
4
  "description": "Ember addon for testing with Caluma addons.",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -23,12 +23,12 @@
23
23
  "ember-cli-babel": "^7.26.11",
24
24
  "ember-cli-htmlbars": "^6.1.0",
25
25
  "ember-cli-mirage": "^3.0.0-alpha.3",
26
- "ember-fetch": "^8.1.1",
26
+ "ember-fetch": "^8.1.2",
27
27
  "ember-inflector": "^4.0.2",
28
28
  "graphql": "^15.8.0",
29
29
  "graphql-iso-date": "^3.6.1",
30
30
  "graphql-tools": "^4.0.8",
31
- "luxon": "^3.0.1",
31
+ "luxon": "^3.0.2",
32
32
  "miragejs": "^0.1.45"
33
33
  },
34
34
  "devDependencies": {