@webitel/api-services 1.0.8 → 1.0.10
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/package.json +1 -1
- package/src/api/clients/caseStatusConditions/caseStatusConditions.ts +2 -2
- package/src/api/clients/cases/cases.ts +6 -3
- package/src/api/clients/wtTypes/adjunctTypeRecords/adjunctTypeRecords.ts +3 -3
- package/src/api/clients/wtTypes/adjunctTypes/adjunctTypes.ts +1 -1
- package/src/validations/calendar/__tests__/calendar.validations.spec.ts +13 -0
- package/src/validations/calendar/calendar.validations.ts +3 -3
- package/types/.tsbuildinfo +1 -1
- package/types/api/clients/caseStatusConditions/caseStatusConditions.d.ts +4 -4
- package/types/api/clients/cases/cases.d.ts +5 -2
- package/types/api/clients/wtTypes/adjunctTypeRecords/adjunctTypeRecords.d.ts +2 -2
- package/types/api/clients/wtTypes/adjunctTypes/adjunctTypes.d.ts +2 -2
- package/types/validations/calendar/calendar.validations.d.ts +8 -0
package/package.json
CHANGED
|
@@ -257,11 +257,14 @@ const addCase = async ({ itemInstance }: AddItemParams) => {
|
|
|
257
257
|
};
|
|
258
258
|
|
|
259
259
|
const patchCase = async ({
|
|
260
|
-
changes,
|
|
260
|
+
changes = {},
|
|
261
261
|
etag,
|
|
262
262
|
}: {
|
|
263
|
-
|
|
264
|
-
|
|
263
|
+
id?: ApiId;
|
|
264
|
+
itemId?: ApiId;
|
|
265
|
+
changes?: ApiParams;
|
|
266
|
+
parentId?: ApiId;
|
|
267
|
+
etag?: ApiId;
|
|
265
268
|
}) => {
|
|
266
269
|
const body = applyTransform(changes, [
|
|
267
270
|
sanitizeToWire(getShallowFieldsToSendFromZodSchema(UpdateCase2Body)),
|
|
@@ -144,8 +144,8 @@ const deleteAdjunctTypeRecord = async ({
|
|
|
144
144
|
parentId,
|
|
145
145
|
id,
|
|
146
146
|
}: {
|
|
147
|
-
parentId
|
|
148
|
-
id
|
|
147
|
+
parentId?: ApiId;
|
|
148
|
+
id?: ApiId | ApiId[];
|
|
149
149
|
}) => {
|
|
150
150
|
const ids = (
|
|
151
151
|
Array.isArray(id)
|
|
@@ -155,7 +155,7 @@ const deleteAdjunctTypeRecord = async ({
|
|
|
155
155
|
]
|
|
156
156
|
).map(String);
|
|
157
157
|
try {
|
|
158
|
-
await getDictionaries().deleteData2(parentId, ids);
|
|
158
|
+
await getDictionaries().deleteData2(String(parentId), ids);
|
|
159
159
|
} catch (err) {
|
|
160
160
|
throw applyTransform(err, [
|
|
161
161
|
notify,
|
|
@@ -154,7 +154,7 @@ const updateAdjunctType = async ({
|
|
|
154
154
|
}
|
|
155
155
|
};
|
|
156
156
|
|
|
157
|
-
const deleteAdjunctType = async ({ id }: { id
|
|
157
|
+
const deleteAdjunctType = async ({ id }: { id?: ApiId | ApiId[] }) => {
|
|
158
158
|
const repo = (
|
|
159
159
|
Array.isArray(id)
|
|
160
160
|
? id
|
|
@@ -456,6 +456,19 @@ describe('calendarSchema', () => {
|
|
|
456
456
|
});
|
|
457
457
|
|
|
458
458
|
describe('excepts', () => {
|
|
459
|
+
it('rejects an except with an empty name', () => {
|
|
460
|
+
const result = calendarSchema.safeParse({
|
|
461
|
+
...minimalValidInput,
|
|
462
|
+
excepts: [
|
|
463
|
+
{
|
|
464
|
+
name: '',
|
|
465
|
+
},
|
|
466
|
+
],
|
|
467
|
+
});
|
|
468
|
+
|
|
469
|
+
expect(result.success).toBe(false);
|
|
470
|
+
});
|
|
471
|
+
|
|
459
472
|
it('accepts valid except objects', () => {
|
|
460
473
|
const excepts = [
|
|
461
474
|
{
|
|
@@ -155,8 +155,8 @@ export const getCalendarDayRangeIssues = (
|
|
|
155
155
|
});
|
|
156
156
|
};
|
|
157
157
|
|
|
158
|
-
const
|
|
159
|
-
name: z.string().
|
|
158
|
+
export const calendarExceptSchema = z.object({
|
|
159
|
+
name: z.string().min(1),
|
|
160
160
|
date: z
|
|
161
161
|
.union([
|
|
162
162
|
z.number(),
|
|
@@ -210,5 +210,5 @@ export const calendarSchema = z.object<
|
|
|
210
210
|
expires: z.boolean().optional().default(false),
|
|
211
211
|
accepts: acceptsOfDayUiArraySchema.default(defaultAccepts),
|
|
212
212
|
specials: z.array(acceptOfDayUiSchema).default(defaultSpecials),
|
|
213
|
-
excepts: z.array(
|
|
213
|
+
excepts: z.array(calendarExceptSchema).optional().default([]),
|
|
214
214
|
});
|