@goat-it/schemas 0.0.20 → 0.0.22-beta
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/src/contexts/question/application/dto/admin-find-questions-query/admin-find-questions-query.dto.shape.d.mts +2 -1
- package/dist/src/contexts/question/application/dto/admin-find-questions-query/admin-find-questions-query.dto.shape.mjs +4 -1
- package/dist/src/contexts/question/application/dto/admin-find-questions-query/admin-find-questions-query.dto.shape.mjs.map +1 -1
- package/dist/src/contexts/question/application/dto/admin-question/admin-question.dto.shape.d.mts +2 -0
- package/dist/src/contexts/question/application/dto/admin-question/admin-question.dto.shape.mjs +2 -1
- package/dist/src/contexts/question/application/dto/admin-question/admin-question.dto.shape.mjs.map +1 -1
- package/dist/src/contexts/question/application/dto/find-questions-query/find-questions-query.dto.shape.d.mts +1 -1
- package/dist/src/contexts/question/application/dto/find-random-questions-body/find-random-questions-body.dto.shape.d.mts +4 -4
- package/dist/src/contexts/question/application/dto/question-creation/question-creation.dto.shape.d.mts +2 -0
- package/dist/src/contexts/question/application/dto/question-creation/question-creation.dto.shape.mjs +3 -2
- package/dist/src/contexts/question/application/dto/question-creation/question-creation.dto.shape.mjs.map +1 -1
- package/dist/src/contexts/question/application/dto/question-modification/question-modification.dto.shape.d.mts +2 -0
- package/dist/src/contexts/question/application/dto/question-modification/question-modification.dto.shape.mjs +3 -2
- package/dist/src/contexts/question/application/dto/question-modification/question-modification.dto.shape.mjs.map +1 -1
- package/dist/src/contexts/question/application/dto/question-stats/question-stats.dto.shape.d.mts +4 -0
- package/dist/src/contexts/question/application/dto/question-stats/question-stats.dto.shape.mjs +3 -1
- package/dist/src/contexts/question/application/dto/question-stats/question-stats.dto.shape.mjs.map +1 -1
- package/dist/src/contexts/question/application/dto/shared/zod/validators/question.dto.zod.validators.mjs +5 -1
- package/dist/src/contexts/question/application/dto/shared/zod/validators/question.dto.zod.validators.mjs.map +1 -1
- package/dist/src/contexts/question-theme/application/dto/admin-find-question-themes-query/admin-find-question-themes-query.dto.shape.d.mts +1 -0
- package/dist/src/contexts/question-theme/application/dto/admin-find-question-themes-query/admin-find-question-themes-query.dto.shape.mjs +4 -1
- package/dist/src/contexts/question-theme/application/dto/admin-find-question-themes-query/admin-find-question-themes-query.dto.shape.mjs.map +1 -1
- package/dist/src/contexts/question-theme/application/dto/question-theme-stats/question-theme-stats.dto.shape.d.mts +4 -0
- package/dist/src/contexts/question-theme/application/dto/question-theme-stats/question-theme-stats.dto.shape.mjs +3 -1
- package/dist/src/contexts/question-theme/application/dto/question-theme-stats/question-theme-stats.dto.shape.mjs.map +1 -1
- package/dist/src/shared/application/dto/constants/translation-completeness-query.dto.constants.mjs +6 -0
- package/dist/src/shared/application/dto/constants/translation-completeness-query.dto.constants.mjs.map +1 -0
- package/dist/src/shared/domain/value-objects/locale/locale.types.d.mts +3 -1
- package/dist/src/shared/infrastructure/http/zod/validators/translation-completeness/translation-completeness.zod.validators.mjs +18 -0
- package/dist/src/shared/infrastructure/http/zod/validators/translation-completeness/translation-completeness.zod.validators.mjs.map +1 -0
- package/dist/tests/shared/utils/faketories/contexts/question/dto/admin-find-questions-query/admin-find-questions-query.dto.faketory.mjs +2 -0
- package/dist/tests/shared/utils/faketories/contexts/question/dto/admin-find-questions-query/admin-find-questions-query.dto.faketory.mjs.map +1 -1
- package/dist/tests/shared/utils/faketories/contexts/question/dto/admin-question/admin-question.dto.faketory.mjs +5 -0
- package/dist/tests/shared/utils/faketories/contexts/question/dto/admin-question/admin-question.dto.faketory.mjs.map +1 -1
- package/dist/tests/shared/utils/faketories/contexts/question/dto/question-creation/question-creation.dto.faketory.mjs +5 -0
- package/dist/tests/shared/utils/faketories/contexts/question/dto/question-creation/question-creation.dto.faketory.mjs.map +1 -1
- package/dist/tests/shared/utils/faketories/contexts/question/dto/question-modification/question-modification.dto.faketory.mjs +5 -0
- package/dist/tests/shared/utils/faketories/contexts/question/dto/question-modification/question-modification.dto.faketory.mjs.map +1 -1
- package/dist/tests/shared/utils/faketories/contexts/question/dto/question-stats/question-stats.dto.faketory.mjs +10 -0
- package/dist/tests/shared/utils/faketories/contexts/question/dto/question-stats/question-stats.dto.faketory.mjs.map +1 -1
- package/dist/tests/shared/utils/faketories/contexts/question-theme/dto/admin-find-question-themes-query/admin-find-question-themes-query.dto.faketory.mjs +2 -0
- package/dist/tests/shared/utils/faketories/contexts/question-theme/dto/admin-find-question-themes-query/admin-find-question-themes-query.dto.faketory.mjs.map +1 -1
- package/dist/tests/shared/utils/faketories/contexts/question-theme/dto/question-theme-stats/question-theme-stats.dto.faketory.mjs +10 -0
- package/dist/tests/shared/utils/faketories/contexts/question-theme/dto/question-theme-stats/question-theme-stats.dto.faketory.mjs.map +1 -1
- package/package.json +5 -5
|
@@ -16,7 +16,8 @@ declare const ADMIN_FIND_QUESTIONS_QUERY_DTO: z.ZodObject<{
|
|
|
16
16
|
category: z.ZodOptional<z.ZodEnum<QuestionCategoryEnum>>;
|
|
17
17
|
"cognitive-difficulty": z.ZodOptional<z.ZodEnum<QuestionCognitiveDifficultyEnum>>;
|
|
18
18
|
"author-role": z.ZodOptional<z.ZodEnum<QuestionAuthorRoleEnum>>;
|
|
19
|
-
"theme-ids": z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodString
|
|
19
|
+
"theme-ids": z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodString>, unknown>>;
|
|
20
|
+
"is-fully-translated": z.ZodOptional<z.ZodCodec<z.ZodString, z.ZodBoolean>>;
|
|
20
21
|
}, z.core.$strip>;
|
|
21
22
|
type AdminFindQuestionsQueryDto = z.infer<typeof ADMIN_FIND_QUESTIONS_QUERY_DTO>;
|
|
22
23
|
//#endregion
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ADMIN_QUESTION_SORTABLE_FIELDS } from "../../../domain/constants/question.constants.mjs";
|
|
2
|
+
import { IS_FULLY_TRANSLATED_QUERY_KEY } from "../../../../../shared/application/dto/constants/translation-completeness-query.dto.constants.mjs";
|
|
2
3
|
import { LIMIT_QUERY_KEY } from "../../../../../shared/application/dto/constants/limit-query.dto.constants.mjs";
|
|
3
4
|
import { SORT_BY_QUERY_KEY, SORT_ORDER_QUERY_KEY } from "../../../../../shared/application/dto/constants/sort-query.dto.constants.mjs";
|
|
5
|
+
import { zIsFullyTranslated } from "../../../../../shared/infrastructure/http/zod/validators/translation-completeness/translation-completeness.zod.validators.mjs";
|
|
4
6
|
import { zLimit } from "../../../../../shared/infrastructure/http/zod/validators/limit/limit.zod.validators.mjs";
|
|
5
7
|
import { zSortOrder } from "../../../../../shared/infrastructure/http/zod/validators/sort/sort.zod.validators.mjs";
|
|
6
8
|
import { QUESTION_AUTHOR_ROLE_QUERY_KEY, QUESTION_CATEGORY_QUERY_KEY, QUESTION_COGNITIVE_DIFFICULTY_QUERY_KEY, QUESTION_STATUS_QUERY_KEY, QUESTION_THEME_IDS_QUERY_KEY } from "../shared/constants/question-filter-query.dto.constants.mjs";
|
|
@@ -16,7 +18,8 @@ const ADMIN_FIND_QUESTIONS_QUERY_DTO = z.object({
|
|
|
16
18
|
[QUESTION_CATEGORY_QUERY_KEY]: zQuestionCategory().optional(),
|
|
17
19
|
[QUESTION_COGNITIVE_DIFFICULTY_QUERY_KEY]: zQuestionCognitiveDifficulty().optional(),
|
|
18
20
|
[QUESTION_AUTHOR_ROLE_QUERY_KEY]: zQuestionAuthorRole().optional(),
|
|
19
|
-
[QUESTION_THEME_IDS_QUERY_KEY]: zQuestionThemeIdsFilter()
|
|
21
|
+
[QUESTION_THEME_IDS_QUERY_KEY]: zQuestionThemeIdsFilter(),
|
|
22
|
+
[IS_FULLY_TRANSLATED_QUERY_KEY]: zIsFullyTranslated()
|
|
20
23
|
});
|
|
21
24
|
//#endregion
|
|
22
25
|
export { ADMIN_FIND_QUESTIONS_QUERY_DTO };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-find-questions-query.dto.shape.mjs","names":[],"sources":["../../../../../../../../../src/contexts/question/application/dto/admin-find-questions-query/admin-find-questions-query.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { LIMIT_QUERY_KEY } from \"@shared/application/dto/constants/limit-query.dto.constants\";\nimport { SORT_BY_QUERY_KEY, SORT_ORDER_QUERY_KEY } from \"@shared/application/dto/constants/sort-query.dto.constants\";\nimport { zLimit } from \"@shared/infrastructure/http/zod/validators/limit/limit.zod.validators\";\nimport { zSortOrder } from \"@shared/infrastructure/http/zod/validators/sort/sort.zod.validators\";\n\nimport { ADMIN_QUESTION_SORTABLE_FIELDS } from \"@question/domain/constants/question.constants\";\nimport { QUESTION_AUTHOR_ROLE_QUERY_KEY, QUESTION_CATEGORY_QUERY_KEY, QUESTION_COGNITIVE_DIFFICULTY_QUERY_KEY, QUESTION_STATUS_QUERY_KEY, QUESTION_THEME_IDS_QUERY_KEY } from \"@question/application/dto/shared/constants/question-filter-query.dto.constants\";\nimport { QUESTION_SORT_BY_DEFAULT, QUESTION_SORT_BY_DESCRIPTION } from \"@question/application/dto/shared/zod/validators/constants/question-sort.dto.zod.validators.constants\";\nimport { zQuestionAuthorRole, zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionStatus, zQuestionThemeIdsFilter } from \"@question/application/dto/shared/zod/validators/question.dto.zod.validators\";\n\nconst ADMIN_FIND_QUESTIONS_QUERY_DTO = z.object({\n [SORT_BY_QUERY_KEY]: z.enum(ADMIN_QUESTION_SORTABLE_FIELDS)\n .optional()\n .default(QUESTION_SORT_BY_DEFAULT)\n .describe(QUESTION_SORT_BY_DESCRIPTION)\n .meta({ example: QUESTION_SORT_BY_DEFAULT }),\n [SORT_ORDER_QUERY_KEY]: zSortOrder(),\n [LIMIT_QUERY_KEY]: zLimit(),\n [QUESTION_STATUS_QUERY_KEY]: zQuestionStatus().optional(),\n [QUESTION_CATEGORY_QUERY_KEY]: zQuestionCategory().optional(),\n [QUESTION_COGNITIVE_DIFFICULTY_QUERY_KEY]: zQuestionCognitiveDifficulty().optional(),\n [QUESTION_AUTHOR_ROLE_QUERY_KEY]: zQuestionAuthorRole().optional(),\n [QUESTION_THEME_IDS_QUERY_KEY]: zQuestionThemeIdsFilter(),\n});\n\ntype AdminFindQuestionsQueryDto = z.infer<typeof ADMIN_FIND_QUESTIONS_QUERY_DTO>;\n\nexport type { AdminFindQuestionsQueryDto };\n\nexport { ADMIN_FIND_QUESTIONS_QUERY_DTO };"],"mappings":"
|
|
1
|
+
{"version":3,"file":"admin-find-questions-query.dto.shape.mjs","names":[],"sources":["../../../../../../../../../src/contexts/question/application/dto/admin-find-questions-query/admin-find-questions-query.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { IS_FULLY_TRANSLATED_QUERY_KEY } from \"@shared/application/dto/constants/translation-completeness-query.dto.constants\";\nimport { LIMIT_QUERY_KEY } from \"@shared/application/dto/constants/limit-query.dto.constants\";\nimport { SORT_BY_QUERY_KEY, SORT_ORDER_QUERY_KEY } from \"@shared/application/dto/constants/sort-query.dto.constants\";\nimport { zIsFullyTranslated } from \"@shared/infrastructure/http/zod/validators/translation-completeness/translation-completeness.zod.validators\";\nimport { zLimit } from \"@shared/infrastructure/http/zod/validators/limit/limit.zod.validators\";\nimport { zSortOrder } from \"@shared/infrastructure/http/zod/validators/sort/sort.zod.validators\";\n\nimport { ADMIN_QUESTION_SORTABLE_FIELDS } from \"@question/domain/constants/question.constants\";\nimport { QUESTION_AUTHOR_ROLE_QUERY_KEY, QUESTION_CATEGORY_QUERY_KEY, QUESTION_COGNITIVE_DIFFICULTY_QUERY_KEY, QUESTION_STATUS_QUERY_KEY, QUESTION_THEME_IDS_QUERY_KEY } from \"@question/application/dto/shared/constants/question-filter-query.dto.constants\";\nimport { QUESTION_SORT_BY_DEFAULT, QUESTION_SORT_BY_DESCRIPTION } from \"@question/application/dto/shared/zod/validators/constants/question-sort.dto.zod.validators.constants\";\nimport { zQuestionAuthorRole, zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionStatus, zQuestionThemeIdsFilter } from \"@question/application/dto/shared/zod/validators/question.dto.zod.validators\";\n\nconst ADMIN_FIND_QUESTIONS_QUERY_DTO = z.object({\n [SORT_BY_QUERY_KEY]: z.enum(ADMIN_QUESTION_SORTABLE_FIELDS)\n .optional()\n .default(QUESTION_SORT_BY_DEFAULT)\n .describe(QUESTION_SORT_BY_DESCRIPTION)\n .meta({ example: QUESTION_SORT_BY_DEFAULT }),\n [SORT_ORDER_QUERY_KEY]: zSortOrder(),\n [LIMIT_QUERY_KEY]: zLimit(),\n [QUESTION_STATUS_QUERY_KEY]: zQuestionStatus().optional(),\n [QUESTION_CATEGORY_QUERY_KEY]: zQuestionCategory().optional(),\n [QUESTION_COGNITIVE_DIFFICULTY_QUERY_KEY]: zQuestionCognitiveDifficulty().optional(),\n [QUESTION_AUTHOR_ROLE_QUERY_KEY]: zQuestionAuthorRole().optional(),\n [QUESTION_THEME_IDS_QUERY_KEY]: zQuestionThemeIdsFilter(),\n [IS_FULLY_TRANSLATED_QUERY_KEY]: zIsFullyTranslated(),\n});\n\ntype AdminFindQuestionsQueryDto = z.infer<typeof ADMIN_FIND_QUESTIONS_QUERY_DTO>;\n\nexport type { AdminFindQuestionsQueryDto };\n\nexport { ADMIN_FIND_QUESTIONS_QUERY_DTO };"],"mappings":";;;;;;;;;;;;AAcA,MAAM,iCAAiC,EAAE,OAAO;EAC7C,oBAAoB,EAAE,KAAK,8BAA8B,CAAC,CACxD,SAAS,CAAC,CACV,QAAQ,wBAAwB,CAAC,CACjC,SAAS,4BAA4B,CAAC,CACtC,KAAK,EAAE,SAAS,yBAAyB,CAAC;EAC5C,uBAAuB,WAAW;EAClC,kBAAkB,OAAO;EACzB,4BAA4B,gBAAgB,CAAC,CAAC,SAAS;EACvD,8BAA8B,kBAAkB,CAAC,CAAC,SAAS;EAC3D,0CAA0C,6BAA6B,CAAC,CAAC,SAAS;EAClF,iCAAiC,oBAAoB,CAAC,CAAC,SAAS;EAChE,+BAA+B,wBAAwB;EACvD,gCAAgC,mBAAmB;AACtD,CAAC"}
|
package/dist/src/contexts/question/application/dto/admin-question/admin-question.dto.shape.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { QuestionThemeStatusEnum } from "../../../../question-theme/domain/types/question-theme.value-objects.mjs";
|
|
2
|
+
import { LocaleEnum } from "../../../../../shared/domain/value-objects/locale/locale.types.mjs";
|
|
2
3
|
import { QuestionCategoryEnum, QuestionCognitiveDifficultyEnum, QuestionStatusEnum } from "../../../domain/types/question.value-objects.mjs";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
//#region ../../src/contexts/question/application/dto/admin-question/admin-question.dto.shape.d.ts
|
|
@@ -48,6 +49,7 @@ declare const ADMIN_QUESTION_DTO: z.ZodObject<{
|
|
|
48
49
|
comment: z.ZodOptional<z.ZodString>;
|
|
49
50
|
}, z.core.$strict>>;
|
|
50
51
|
sourceUrls: z.ZodArray<z.ZodURL>;
|
|
52
|
+
applicableLocales: z.ZodOptional<z.ZodArray<z.ZodEnum<LocaleEnum>>>;
|
|
51
53
|
createdAt: z.ZodISODateTime;
|
|
52
54
|
updatedAt: z.ZodISODateTime;
|
|
53
55
|
}, z.core.$strict>;
|
package/dist/src/contexts/question/application/dto/admin-question/admin-question.dto.shape.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../../domain/constants/question.constants.mjs";
|
|
2
|
-
import { zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionCreatedAt, zQuestionId, zQuestionSourceUrls, zQuestionStatus, zQuestionUpdatedAt } from "../shared/zod/validators/question.dto.zod.validators.mjs";
|
|
2
|
+
import { zQuestionApplicableLocales, zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionCreatedAt, zQuestionId, zQuestionSourceUrls, zQuestionStatus, zQuestionUpdatedAt } from "../shared/zod/validators/question.dto.zod.validators.mjs";
|
|
3
3
|
import { ADMIN_QUESTION_CONTENT_DTO } from "./admin-question-content/admin-question-content.dto.shape.mjs";
|
|
4
4
|
import { ADMIN_QUESTION_THEME_ASSIGNMENT_DTO } from "./admin-question-theme-assignment/admin-question-theme-assignment.dto.shape.mjs";
|
|
5
5
|
import { QUESTION_REJECTION_DTO } from "../shared/question-rejection/question-rejection.dto.shape.mjs";
|
|
@@ -16,6 +16,7 @@ const ADMIN_QUESTION_DTO = z.strictObject({
|
|
|
16
16
|
status: zQuestionStatus(),
|
|
17
17
|
rejection: QUESTION_REJECTION_DTO.optional().describe("Question's rejection details, if applicable"),
|
|
18
18
|
sourceUrls: zQuestionSourceUrls(),
|
|
19
|
+
applicableLocales: zQuestionApplicableLocales(0).describe("Subset of locales this question is relevant for, if restricted"),
|
|
19
20
|
createdAt: zQuestionCreatedAt(),
|
|
20
21
|
updatedAt: zQuestionUpdatedAt()
|
|
21
22
|
});
|
package/dist/src/contexts/question/application/dto/admin-question/admin-question.dto.shape.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-question.dto.shape.mjs","names":[],"sources":["../../../../../../../../../src/contexts/question/application/dto/admin-question/admin-question.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { QUESTION_THEME_ASSIGNMENTS_MAX_ITEMS, QUESTION_THEME_ASSIGNMENTS_MIN_ITEMS } from \"@question/domain/constants/question.constants\";\nimport { ADMIN_QUESTION_THEME_ASSIGNMENT_DTO } from \"@question/application/dto/admin-question/admin-question-theme-assignment/admin-question-theme-assignment.dto.shape\";\nimport { zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionCreatedAt, zQuestionId, zQuestionSourceUrls, zQuestionStatus, zQuestionUpdatedAt } from \"@question/application/dto/shared/zod/validators/question.dto.zod.validators\";\nimport { QUESTION_REJECTION_DTO } from \"@question/application/dto/shared/question-rejection/question-rejection.dto.shape\";\nimport { QUESTION_AUTHOR_DTO } from \"@question/application/dto/shared/question-author/question-author.dto.shape\";\nimport { ADMIN_QUESTION_CONTENT_DTO } from \"@question/application/dto/admin-question/admin-question-content/admin-question-content.dto.shape\";\n\nconst ADMIN_QUESTION_DTO = z.strictObject({\n id: zQuestionId(),\n category: zQuestionCategory(),\n themes: z.array(ADMIN_QUESTION_THEME_ASSIGNMENT_DTO)\n .min(QUESTION_THEME_ASSIGNMENTS_MIN_ITEMS)\n .max(QUESTION_THEME_ASSIGNMENTS_MAX_ITEMS)\n .describe(\"Question's themes\"),\n content: ADMIN_QUESTION_CONTENT_DTO,\n cognitiveDifficulty: zQuestionCognitiveDifficulty(),\n author: QUESTION_AUTHOR_DTO,\n status: zQuestionStatus(),\n rejection: QUESTION_REJECTION_DTO\n .optional()\n .describe(\"Question's rejection details, if applicable\"),\n sourceUrls: zQuestionSourceUrls(),\n createdAt: zQuestionCreatedAt(),\n updatedAt: zQuestionUpdatedAt(),\n});\n\nexport type AdminQuestionDto = z.infer<typeof ADMIN_QUESTION_DTO>;\n\nexport { ADMIN_QUESTION_DTO };"],"mappings":";;;;;;;;AASA,MAAM,qBAAqB,EAAE,aAAa;CACxC,IAAI,YAAY;CAChB,UAAU,kBAAkB;CAC5B,QAAQ,EAAE,MAAM,mCAAmC,CAAC,CACjD,IAAA,CAAwC,CAAC,CACzC,IAAA,CAAwC,CAAC,CACzC,SAAS,mBAAmB;CAC/B,SAAS;CACT,qBAAqB,6BAA6B;CAClD,QAAQ;CACR,QAAQ,gBAAgB;CACxB,WAAW,uBACR,SAAS,CAAC,CACV,SAAS,6CAA6C;CACzD,YAAY,oBAAoB;CAChC,WAAW,mBAAmB;CAC9B,WAAW,mBAAmB;AAChC,CAAC"}
|
|
1
|
+
{"version":3,"file":"admin-question.dto.shape.mjs","names":[],"sources":["../../../../../../../../../src/contexts/question/application/dto/admin-question/admin-question.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { QUESTION_THEME_ASSIGNMENTS_MAX_ITEMS, QUESTION_THEME_ASSIGNMENTS_MIN_ITEMS } from \"@question/domain/constants/question.constants\";\nimport { ADMIN_QUESTION_THEME_ASSIGNMENT_DTO } from \"@question/application/dto/admin-question/admin-question-theme-assignment/admin-question-theme-assignment.dto.shape\";\nimport { zQuestionApplicableLocales, zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionCreatedAt, zQuestionId, zQuestionSourceUrls, zQuestionStatus, zQuestionUpdatedAt } from \"@question/application/dto/shared/zod/validators/question.dto.zod.validators\";\nimport { QUESTION_REJECTION_DTO } from \"@question/application/dto/shared/question-rejection/question-rejection.dto.shape\";\nimport { QUESTION_AUTHOR_DTO } from \"@question/application/dto/shared/question-author/question-author.dto.shape\";\nimport { ADMIN_QUESTION_CONTENT_DTO } from \"@question/application/dto/admin-question/admin-question-content/admin-question-content.dto.shape\";\n\nconst ADMIN_QUESTION_DTO = z.strictObject({\n id: zQuestionId(),\n category: zQuestionCategory(),\n themes: z.array(ADMIN_QUESTION_THEME_ASSIGNMENT_DTO)\n .min(QUESTION_THEME_ASSIGNMENTS_MIN_ITEMS)\n .max(QUESTION_THEME_ASSIGNMENTS_MAX_ITEMS)\n .describe(\"Question's themes\"),\n content: ADMIN_QUESTION_CONTENT_DTO,\n cognitiveDifficulty: zQuestionCognitiveDifficulty(),\n author: QUESTION_AUTHOR_DTO,\n status: zQuestionStatus(),\n rejection: QUESTION_REJECTION_DTO\n .optional()\n .describe(\"Question's rejection details, if applicable\"),\n sourceUrls: zQuestionSourceUrls(),\n applicableLocales: zQuestionApplicableLocales(0)\n .describe(\"Subset of locales this question is relevant for, if restricted\"),\n createdAt: zQuestionCreatedAt(),\n updatedAt: zQuestionUpdatedAt(),\n});\n\nexport type AdminQuestionDto = z.infer<typeof ADMIN_QUESTION_DTO>;\n\nexport { ADMIN_QUESTION_DTO };"],"mappings":";;;;;;;;AASA,MAAM,qBAAqB,EAAE,aAAa;CACxC,IAAI,YAAY;CAChB,UAAU,kBAAkB;CAC5B,QAAQ,EAAE,MAAM,mCAAmC,CAAC,CACjD,IAAA,CAAwC,CAAC,CACzC,IAAA,CAAwC,CAAC,CACzC,SAAS,mBAAmB;CAC/B,SAAS;CACT,qBAAqB,6BAA6B;CAClD,QAAQ;CACR,QAAQ,gBAAgB;CACxB,WAAW,uBACR,SAAS,CAAC,CACV,SAAS,6CAA6C;CACzD,YAAY,oBAAoB;CAChC,mBAAmB,2BAA2B,CAAC,CAAC,CAC7C,SAAS,gEAAgE;CAC5E,WAAW,mBAAmB;CAC9B,WAAW,mBAAmB;AAChC,CAAC"}
|
|
@@ -14,7 +14,7 @@ declare const FIND_QUESTIONS_QUERY_DTO: z.ZodObject<{
|
|
|
14
14
|
category: z.ZodOptional<z.ZodEnum<QuestionCategoryEnum>>;
|
|
15
15
|
"cognitive-difficulty": z.ZodOptional<z.ZodEnum<QuestionCognitiveDifficultyEnum>>;
|
|
16
16
|
"author-role": z.ZodOptional<z.ZodEnum<QuestionAuthorRoleEnum>>;
|
|
17
|
-
"theme-ids": z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodString
|
|
17
|
+
"theme-ids": z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodString>, unknown>>;
|
|
18
18
|
}, z.core.$strip>;
|
|
19
19
|
type FindQuestionsQueryDto = z.infer<typeof FIND_QUESTIONS_QUERY_DTO>;
|
|
20
20
|
//#endregion
|
|
@@ -3,10 +3,10 @@ import { z } from "zod";
|
|
|
3
3
|
//#region ../../src/contexts/question/application/dto/find-random-questions-body/find-random-questions-body.dto.shape.d.ts
|
|
4
4
|
declare const FIND_RANDOM_QUESTIONS_BODY_DTO: z.ZodObject<{
|
|
5
5
|
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
6
|
-
excludedIds: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodString
|
|
7
|
-
categories: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodEnum<QuestionCategoryEnum
|
|
8
|
-
cognitiveDifficulties: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodEnum<QuestionCognitiveDifficultyEnum
|
|
9
|
-
themeIds: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodString
|
|
6
|
+
excludedIds: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodString>, unknown>>;
|
|
7
|
+
categories: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodEnum<QuestionCategoryEnum>>, unknown>>;
|
|
8
|
+
cognitiveDifficulties: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodEnum<QuestionCognitiveDifficultyEnum>>, unknown>>;
|
|
9
|
+
themeIds: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodString>, unknown>>;
|
|
10
10
|
}, z.core.$strip>;
|
|
11
11
|
type FindRandomQuestionsBodyDto = z.infer<typeof FIND_RANDOM_QUESTIONS_BODY_DTO>;
|
|
12
12
|
//#endregion
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LocaleEnum } from "../../../../../shared/domain/value-objects/locale/locale.types.mjs";
|
|
1
2
|
import { QuestionCategoryEnum, QuestionCognitiveDifficultyEnum } from "../../../domain/types/question.value-objects.mjs";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
//#region ../../src/contexts/question/application/dto/question-creation/question-creation.dto.shape.d.ts
|
|
@@ -23,6 +24,7 @@ declare const QUESTION_CREATION_DTO: z.ZodObject<{
|
|
|
23
24
|
name: z.ZodString;
|
|
24
25
|
}, z.core.$strip>;
|
|
25
26
|
sourceUrls: z.ZodArray<z.ZodURL>;
|
|
27
|
+
applicableLocales: z.ZodOptional<z.ZodArray<z.ZodEnum<LocaleEnum>>>;
|
|
26
28
|
}, z.core.$strip>;
|
|
27
29
|
type QuestionCreationDto = z.infer<typeof QUESTION_CREATION_DTO>;
|
|
28
30
|
//#endregion
|
package/dist/src/contexts/question/application/dto/question-creation/question-creation.dto.shape.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../../../domain/constants/question.constants.mjs";
|
|
2
2
|
import { areValuesUniqueByKey, hasExactlyOneByKey } from "../../../../../shared/application/dto/zod/refinements/array/array.zod.refinements.mjs";
|
|
3
|
-
import { zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionSourceUrls } from "../shared/zod/validators/question.dto.zod.validators.mjs";
|
|
3
|
+
import { zQuestionApplicableLocales, zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionSourceUrls } from "../shared/zod/validators/question.dto.zod.validators.mjs";
|
|
4
4
|
import { QUESTION_AUTHOR_CREATION_DTO } from "./question-author-creation/question-author-creation.dto.shape.mjs";
|
|
5
5
|
import { QUESTION_CONTENT_CREATION_DTO } from "./question-content-creation/question-content-creation.dto.shape.mjs";
|
|
6
6
|
import { QUESTION_THEME_ASSIGNMENT_CREATION_DTO } from "./question-theme-assignment-creation/question-theme-assignment-creation.dto.shape.mjs";
|
|
@@ -12,7 +12,8 @@ const QUESTION_CREATION_DTO = z.object({
|
|
|
12
12
|
content: QUESTION_CONTENT_CREATION_DTO,
|
|
13
13
|
cognitiveDifficulty: zQuestionCognitiveDifficulty(),
|
|
14
14
|
author: QUESTION_AUTHOR_CREATION_DTO,
|
|
15
|
-
sourceUrls: zQuestionSourceUrls()
|
|
15
|
+
sourceUrls: zQuestionSourceUrls(),
|
|
16
|
+
applicableLocales: zQuestionApplicableLocales()
|
|
16
17
|
});
|
|
17
18
|
//#endregion
|
|
18
19
|
export { QUESTION_CREATION_DTO };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question-creation.dto.shape.mjs","names":[],"sources":["../../../../../../../../../src/contexts/question/application/dto/question-creation/question-creation.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { areValuesUniqueByKey, hasExactlyOneByKey } from \"@shared/application/dto/zod/refinements/array/array.zod.refinements\";\n\nimport { QUESTION_THEME_ASSIGNMENTS_MAX_ITEMS, QUESTION_THEME_ASSIGNMENTS_MIN_ITEMS } from \"@question/domain/constants/question.constants\";\nimport { QUESTION_AUTHOR_CREATION_DTO } from \"@question/application/dto/question-creation/question-author-creation/question-author-creation.dto.shape\";\nimport { QUESTION_CONTENT_CREATION_DTO } from \"@question/application/dto/question-creation/question-content-creation/question-content-creation.dto.shape\";\nimport { QUESTION_THEME_ASSIGNMENT_CREATION_DTO } from \"@question/application/dto/question-creation/question-theme-assignment-creation/question-theme-assignment-creation.dto.shape\";\nimport { zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionSourceUrls } from \"@question/application/dto/shared/zod/validators/question.dto.zod.validators\";\n\nconst QUESTION_CREATION_DTO = z.object({\n category: zQuestionCategory(),\n themes: z.array(QUESTION_THEME_ASSIGNMENT_CREATION_DTO)\n .min(QUESTION_THEME_ASSIGNMENTS_MIN_ITEMS)\n .max(QUESTION_THEME_ASSIGNMENTS_MAX_ITEMS)\n .refine(themes => areValuesUniqueByKey(themes, \"themeId\"), { message: \"Theme IDs must be unique\" })\n .refine(themes => hasExactlyOneByKey(themes, \"isPrimary\", true), { message: \"There must be exactly one primary theme\" })\n .describe(\"Question's themes\"),\n content: QUESTION_CONTENT_CREATION_DTO,\n cognitiveDifficulty: zQuestionCognitiveDifficulty(),\n author: QUESTION_AUTHOR_CREATION_DTO,\n sourceUrls: zQuestionSourceUrls(),\n});\n\nexport type QuestionCreationDto = z.infer<typeof QUESTION_CREATION_DTO>;\n\nexport { QUESTION_CREATION_DTO };"],"mappings":";;;;;;;;AAUA,MAAM,wBAAwB,EAAE,OAAO;CACrC,UAAU,kBAAkB;CAC5B,QAAQ,EAAE,MAAM,sCAAsC,CAAC,CACpD,IAAA,CAAwC,CAAC,CACzC,IAAA,CAAwC,CAAC,CACzC,QAAO,WAAU,qBAAqB,QAAQ,SAAS,GAAG,EAAE,SAAS,2BAA2B,CAAC,CAAC,CAClG,QAAO,WAAU,mBAAmB,QAAQ,aAAa,IAAI,GAAG,EAAE,SAAS,0CAA0C,CAAC,CAAC,CACvH,SAAS,mBAAmB;CAC/B,SAAS;CACT,qBAAqB,6BAA6B;CAClD,QAAQ;CACR,YAAY,oBAAoB;
|
|
1
|
+
{"version":3,"file":"question-creation.dto.shape.mjs","names":[],"sources":["../../../../../../../../../src/contexts/question/application/dto/question-creation/question-creation.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { areValuesUniqueByKey, hasExactlyOneByKey } from \"@shared/application/dto/zod/refinements/array/array.zod.refinements\";\n\nimport { QUESTION_THEME_ASSIGNMENTS_MAX_ITEMS, QUESTION_THEME_ASSIGNMENTS_MIN_ITEMS } from \"@question/domain/constants/question.constants\";\nimport { QUESTION_AUTHOR_CREATION_DTO } from \"@question/application/dto/question-creation/question-author-creation/question-author-creation.dto.shape\";\nimport { QUESTION_CONTENT_CREATION_DTO } from \"@question/application/dto/question-creation/question-content-creation/question-content-creation.dto.shape\";\nimport { QUESTION_THEME_ASSIGNMENT_CREATION_DTO } from \"@question/application/dto/question-creation/question-theme-assignment-creation/question-theme-assignment-creation.dto.shape\";\nimport { zQuestionApplicableLocales, zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionSourceUrls } from \"@question/application/dto/shared/zod/validators/question.dto.zod.validators\";\n\nconst QUESTION_CREATION_DTO = z.object({\n category: zQuestionCategory(),\n themes: z.array(QUESTION_THEME_ASSIGNMENT_CREATION_DTO)\n .min(QUESTION_THEME_ASSIGNMENTS_MIN_ITEMS)\n .max(QUESTION_THEME_ASSIGNMENTS_MAX_ITEMS)\n .refine(themes => areValuesUniqueByKey(themes, \"themeId\"), { message: \"Theme IDs must be unique\" })\n .refine(themes => hasExactlyOneByKey(themes, \"isPrimary\", true), { message: \"There must be exactly one primary theme\" })\n .describe(\"Question's themes\"),\n content: QUESTION_CONTENT_CREATION_DTO,\n cognitiveDifficulty: zQuestionCognitiveDifficulty(),\n author: QUESTION_AUTHOR_CREATION_DTO,\n sourceUrls: zQuestionSourceUrls(),\n applicableLocales: zQuestionApplicableLocales(),\n});\n\nexport type QuestionCreationDto = z.infer<typeof QUESTION_CREATION_DTO>;\n\nexport { QUESTION_CREATION_DTO };"],"mappings":";;;;;;;;AAUA,MAAM,wBAAwB,EAAE,OAAO;CACrC,UAAU,kBAAkB;CAC5B,QAAQ,EAAE,MAAM,sCAAsC,CAAC,CACpD,IAAA,CAAwC,CAAC,CACzC,IAAA,CAAwC,CAAC,CACzC,QAAO,WAAU,qBAAqB,QAAQ,SAAS,GAAG,EAAE,SAAS,2BAA2B,CAAC,CAAC,CAClG,QAAO,WAAU,mBAAmB,QAAQ,aAAa,IAAI,GAAG,EAAE,SAAS,0CAA0C,CAAC,CAAC,CACvH,SAAS,mBAAmB;CAC/B,SAAS;CACT,qBAAqB,6BAA6B;CAClD,QAAQ;CACR,YAAY,oBAAoB;CAChC,mBAAmB,2BAA2B;AAChD,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LocaleEnum } from "../../../../../shared/domain/value-objects/locale/locale.types.mjs";
|
|
1
2
|
import { QuestionCategoryEnum, QuestionCognitiveDifficultyEnum } from "../../../domain/types/question.value-objects.mjs";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
//#region ../../src/contexts/question/application/dto/question-modification/question-modification.dto.shape.d.ts
|
|
@@ -11,6 +12,7 @@ declare const QUESTION_MODIFICATION_DTO: z.ZodObject<{
|
|
|
11
12
|
context: z.ZodOptional<z.ZodObject<Record<"en" | "fr" | "es" | "de" | "it" | "pt", z.ZodOptional<z.ZodString>>, z.core.$strip>>;
|
|
12
13
|
trivia: z.ZodOptional<z.ZodObject<Record<"en" | "fr" | "es" | "de" | "it" | "pt", z.ZodOptional<z.ZodArray<z.ZodString>>>, z.core.$strip>>;
|
|
13
14
|
}, z.core.$strip>>;
|
|
15
|
+
applicableLocales: z.ZodOptional<z.ZodArray<z.ZodEnum<LocaleEnum>>>;
|
|
14
16
|
}, z.core.$strip>;
|
|
15
17
|
type QuestionModificationDto = z.infer<typeof QUESTION_MODIFICATION_DTO>;
|
|
16
18
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionSourceUrls } from "../shared/zod/validators/question.dto.zod.validators.mjs";
|
|
1
|
+
import { zQuestionApplicableLocales, zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionSourceUrls } from "../shared/zod/validators/question.dto.zod.validators.mjs";
|
|
2
2
|
import { QUESTION_CONTENT_MODIFICATION_DTO } from "./question-content-modification/question-content-modification.dto.shape.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region ../../src/contexts/question/application/dto/question-modification/question-modification.dto.shape.ts
|
|
@@ -6,7 +6,8 @@ const QUESTION_MODIFICATION_DTO = z.object({
|
|
|
6
6
|
category: zQuestionCategory().optional(),
|
|
7
7
|
cognitiveDifficulty: zQuestionCognitiveDifficulty().optional(),
|
|
8
8
|
sourceUrls: zQuestionSourceUrls().optional(),
|
|
9
|
-
content: QUESTION_CONTENT_MODIFICATION_DTO.optional()
|
|
9
|
+
content: QUESTION_CONTENT_MODIFICATION_DTO.optional(),
|
|
10
|
+
applicableLocales: zQuestionApplicableLocales(0).describe("Subset of locales this question is relevant for; submit an empty array to clear the restriction (all locales required again)")
|
|
10
11
|
});
|
|
11
12
|
//#endregion
|
|
12
13
|
export { QUESTION_MODIFICATION_DTO };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question-modification.dto.shape.mjs","names":[],"sources":["../../../../../../../../../src/contexts/question/application/dto/question-modification/question-modification.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionSourceUrls } from \"@question/application/dto/shared/zod/validators/question.dto.zod.validators\";\nimport { QUESTION_CONTENT_MODIFICATION_DTO } from \"@question/application/dto/question-modification/question-content-modification/question-content-modification.dto.shape\";\n\nconst QUESTION_MODIFICATION_DTO = z.object({\n category: zQuestionCategory()\n .optional(),\n cognitiveDifficulty: zQuestionCognitiveDifficulty()\n .optional(),\n sourceUrls: zQuestionSourceUrls()\n .optional(),\n content: QUESTION_CONTENT_MODIFICATION_DTO\n .optional(),\n});\n\ntype QuestionModificationDto = z.infer<typeof QUESTION_MODIFICATION_DTO>;\n\nexport type { QuestionModificationDto };\n\nexport { QUESTION_MODIFICATION_DTO };"],"mappings":";;;;AAKA,MAAM,4BAA4B,EAAE,OAAO;CACzC,UAAU,kBAAkB,CAAC,CAC1B,SAAS;CACZ,qBAAqB,6BAA6B,CAAC,CAChD,SAAS;CACZ,YAAY,oBAAoB,CAAC,CAC9B,SAAS;CACZ,SAAS,kCACN,SAAS;
|
|
1
|
+
{"version":3,"file":"question-modification.dto.shape.mjs","names":[],"sources":["../../../../../../../../../src/contexts/question/application/dto/question-modification/question-modification.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { zQuestionApplicableLocales, zQuestionCategory, zQuestionCognitiveDifficulty, zQuestionSourceUrls } from \"@question/application/dto/shared/zod/validators/question.dto.zod.validators\";\nimport { QUESTION_CONTENT_MODIFICATION_DTO } from \"@question/application/dto/question-modification/question-content-modification/question-content-modification.dto.shape\";\n\nconst QUESTION_MODIFICATION_DTO = z.object({\n category: zQuestionCategory()\n .optional(),\n cognitiveDifficulty: zQuestionCognitiveDifficulty()\n .optional(),\n sourceUrls: zQuestionSourceUrls()\n .optional(),\n content: QUESTION_CONTENT_MODIFICATION_DTO\n .optional(),\n applicableLocales: zQuestionApplicableLocales(0)\n .describe(\"Subset of locales this question is relevant for; submit an empty array to clear the restriction (all locales required again)\"),\n});\n\ntype QuestionModificationDto = z.infer<typeof QUESTION_MODIFICATION_DTO>;\n\nexport type { QuestionModificationDto };\n\nexport { QUESTION_MODIFICATION_DTO };"],"mappings":";;;;AAKA,MAAM,4BAA4B,EAAE,OAAO;CACzC,UAAU,kBAAkB,CAAC,CAC1B,SAAS;CACZ,qBAAqB,6BAA6B,CAAC,CAChD,SAAS;CACZ,YAAY,oBAAoB,CAAC,CAC9B,SAAS;CACZ,SAAS,kCACN,SAAS;CACZ,mBAAmB,2BAA2B,CAAC,CAAC,CAC7C,SAAS,8HAA8H;AAC5I,CAAC"}
|
package/dist/src/contexts/question/application/dto/question-stats/question-stats.dto.shape.d.mts
CHANGED
|
@@ -31,6 +31,10 @@ declare const QUESTION_STATS_DTO: z.ZodObject<{
|
|
|
31
31
|
"duplicate-question": "duplicate-question";
|
|
32
32
|
other: "other";
|
|
33
33
|
}>, z.ZodNumber>;
|
|
34
|
+
byTranslationCompleteness: z.ZodObject<{
|
|
35
|
+
fullyTranslated: z.ZodNumber;
|
|
36
|
+
incomplete: z.ZodNumber;
|
|
37
|
+
}, z.core.$strict>;
|
|
34
38
|
}, z.core.$strict>;
|
|
35
39
|
type QuestionStatsDto = z.infer<typeof QUESTION_STATS_DTO>;
|
|
36
40
|
//#endregion
|
package/dist/src/contexts/question/application/dto/question-stats/question-stats.dto.shape.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { QUESTION_AUTHOR_ROLES, QUESTION_CATEGORIES, QUESTION_COGNITIVE_DIFFICULTIES, QUESTION_REJECTION_TYPES, QUESTION_STATUSES } from "../../../domain/constants/question.constants.mjs";
|
|
2
|
+
import { zTranslationCompletenessStats } from "../../../../../shared/infrastructure/http/zod/validators/translation-completeness/translation-completeness.zod.validators.mjs";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
//#region ../../src/contexts/question/application/dto/question-stats/question-stats.dto.shape.ts
|
|
4
5
|
const QUESTION_STATS_DTO = z.strictObject({
|
|
@@ -7,7 +8,8 @@ const QUESTION_STATS_DTO = z.strictObject({
|
|
|
7
8
|
byCategory: z.record(z.enum(QUESTION_CATEGORIES), z.number().int().nonnegative()).describe("Number of questions per category"),
|
|
8
9
|
byCognitiveDifficulty: z.record(z.enum(QUESTION_COGNITIVE_DIFFICULTIES), z.number().int().nonnegative()).describe("Number of questions per cognitive difficulty"),
|
|
9
10
|
byAuthorRole: z.record(z.enum(QUESTION_AUTHOR_ROLES), z.number().int().nonnegative()).describe("Number of questions per author role"),
|
|
10
|
-
byRejectionType: z.record(z.enum(QUESTION_REJECTION_TYPES), z.number().int().nonnegative()).describe("Number of rejected questions per rejection type")
|
|
11
|
+
byRejectionType: z.record(z.enum(QUESTION_REJECTION_TYPES), z.number().int().nonnegative()).describe("Number of rejected questions per rejection type"),
|
|
12
|
+
byTranslationCompleteness: zTranslationCompletenessStats().describe("Translation completeness breakdown")
|
|
11
13
|
});
|
|
12
14
|
//#endregion
|
|
13
15
|
export { QUESTION_STATS_DTO };
|
package/dist/src/contexts/question/application/dto/question-stats/question-stats.dto.shape.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question-stats.dto.shape.mjs","names":[],"sources":["../../../../../../../../../src/contexts/question/application/dto/question-stats/question-stats.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport {\n QUESTION_AUTHOR_ROLES,\n QUESTION_CATEGORIES,\n QUESTION_COGNITIVE_DIFFICULTIES,\n QUESTION_REJECTION_TYPES,\n QUESTION_STATUSES,\n} from \"@question/domain/constants/question.constants\";\n\nconst QUESTION_STATS_DTO = z.strictObject({\n total: z.number().int().nonnegative().describe(\"Total number of questions\"),\n byStatus: z.record(z.enum(QUESTION_STATUSES), z.number().int().nonnegative())\n .describe(\"Number of questions per status\"),\n byCategory: z.record(z.enum(QUESTION_CATEGORIES), z.number().int().nonnegative())\n .describe(\"Number of questions per category\"),\n byCognitiveDifficulty: z.record(z.enum(QUESTION_COGNITIVE_DIFFICULTIES), z.number().int().nonnegative())\n .describe(\"Number of questions per cognitive difficulty\"),\n byAuthorRole: z.record(z.enum(QUESTION_AUTHOR_ROLES), z.number().int().nonnegative())\n .describe(\"Number of questions per author role\"),\n byRejectionType: z.record(z.enum(QUESTION_REJECTION_TYPES), z.number().int().nonnegative())\n .describe(\"Number of rejected questions per rejection type\"),\n});\n\ntype QuestionStatsDto = z.infer<typeof QUESTION_STATS_DTO>;\n\nexport { QUESTION_STATS_DTO };\n\nexport type { QuestionStatsDto };"],"mappings":"
|
|
1
|
+
{"version":3,"file":"question-stats.dto.shape.mjs","names":[],"sources":["../../../../../../../../../src/contexts/question/application/dto/question-stats/question-stats.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { zTranslationCompletenessStats } from \"@shared/infrastructure/http/zod/validators/translation-completeness/translation-completeness.zod.validators\";\n\nimport {\n QUESTION_AUTHOR_ROLES,\n QUESTION_CATEGORIES,\n QUESTION_COGNITIVE_DIFFICULTIES,\n QUESTION_REJECTION_TYPES,\n QUESTION_STATUSES,\n} from \"@question/domain/constants/question.constants\";\n\nconst QUESTION_STATS_DTO = z.strictObject({\n total: z.number().int().nonnegative().describe(\"Total number of questions\"),\n byStatus: z.record(z.enum(QUESTION_STATUSES), z.number().int().nonnegative())\n .describe(\"Number of questions per status\"),\n byCategory: z.record(z.enum(QUESTION_CATEGORIES), z.number().int().nonnegative())\n .describe(\"Number of questions per category\"),\n byCognitiveDifficulty: z.record(z.enum(QUESTION_COGNITIVE_DIFFICULTIES), z.number().int().nonnegative())\n .describe(\"Number of questions per cognitive difficulty\"),\n byAuthorRole: z.record(z.enum(QUESTION_AUTHOR_ROLES), z.number().int().nonnegative())\n .describe(\"Number of questions per author role\"),\n byRejectionType: z.record(z.enum(QUESTION_REJECTION_TYPES), z.number().int().nonnegative())\n .describe(\"Number of rejected questions per rejection type\"),\n byTranslationCompleteness: zTranslationCompletenessStats()\n .describe(\"Translation completeness breakdown\"),\n});\n\ntype QuestionStatsDto = z.infer<typeof QUESTION_STATS_DTO>;\n\nexport { QUESTION_STATS_DTO };\n\nexport type { QuestionStatsDto };"],"mappings":";;;;AAYA,MAAM,qBAAqB,EAAE,aAAa;CACxC,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,2BAA2B;CAC1E,UAAU,EAAE,OAAO,EAAE,KAAK,iBAAiB,GAAG,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC,CAC1E,SAAS,gCAAgC;CAC5C,YAAY,EAAE,OAAO,EAAE,KAAK,mBAAmB,GAAG,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC,CAC9E,SAAS,kCAAkC;CAC9C,uBAAuB,EAAE,OAAO,EAAE,KAAK,+BAA+B,GAAG,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC,CACrG,SAAS,8CAA8C;CAC1D,cAAc,EAAE,OAAO,EAAE,KAAK,qBAAqB,GAAG,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC,CAClF,SAAS,qCAAqC;CACjD,iBAAiB,EAAE,OAAO,EAAE,KAAK,wBAAwB,GAAG,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC,CACxF,SAAS,iDAAiD;CAC7D,2BAA2B,8BAA8B,CAAC,CACvD,SAAS,oCAAoC;AAClD,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LOCALES } from "../../../../../../../shared/domain/value-objects/locale/locale.constants.mjs";
|
|
1
2
|
import { QUESTION_AUTHOR_ROLES, QUESTION_CATEGORIES, QUESTION_COGNITIVE_DIFFICULTIES, QUESTION_STATUSES } from "../../../../../domain/constants/question.constants.mjs";
|
|
2
3
|
import { areValuesUniqueFromStrings } from "../../../../../../../shared/application/dto/zod/refinements/array/array.zod.refinements.mjs";
|
|
3
4
|
import { normalizeToArray } from "../../../../../../../shared/application/dto/zod/preprocessors/array/array.zod.preprocessors.mjs";
|
|
@@ -18,6 +19,9 @@ function zQuestionStatus() {
|
|
|
18
19
|
function zQuestionCategory() {
|
|
19
20
|
return z.enum(QUESTION_CATEGORIES).describe("Question's category");
|
|
20
21
|
}
|
|
22
|
+
function zQuestionApplicableLocales(minItems = 1) {
|
|
23
|
+
return z.array(z.enum(LOCALES)).min(minItems).max(LOCALES.length).refine(areValuesUniqueFromStrings, { message: "Locales must be unique" }).optional().describe("Subset of locales this question is relevant for; omit if relevant for all locales");
|
|
24
|
+
}
|
|
21
25
|
function zQuestionSourceUrls() {
|
|
22
26
|
return z.array(z.url()).min(1).max(5).refine(areValuesUniqueFromStrings, { message: "Source URLs must be unique" }).describe("List of unique source URLs for the question").meta({ example: ["https://example.com/source1", "https://example.com/source2"] });
|
|
23
27
|
}
|
|
@@ -43,6 +47,6 @@ function zQuestionUpdatedAt() {
|
|
|
43
47
|
return zIsoDateTime().describe("Question's last update date");
|
|
44
48
|
}
|
|
45
49
|
//#endregion
|
|
46
|
-
export { zQuestionAuthorRole, zQuestionCategoriesFilter, zQuestionCategory, zQuestionCognitiveDifficultiesFilter, zQuestionCognitiveDifficulty, zQuestionCreatedAt, zQuestionExcludedIdsFilter, zQuestionId, zQuestionSourceUrls, zQuestionStatus, zQuestionThemeIdsFilter, zQuestionUpdatedAt };
|
|
50
|
+
export { zQuestionApplicableLocales, zQuestionAuthorRole, zQuestionCategoriesFilter, zQuestionCategory, zQuestionCognitiveDifficultiesFilter, zQuestionCognitiveDifficulty, zQuestionCreatedAt, zQuestionExcludedIdsFilter, zQuestionId, zQuestionSourceUrls, zQuestionStatus, zQuestionThemeIdsFilter, zQuestionUpdatedAt };
|
|
47
51
|
|
|
48
52
|
//# sourceMappingURL=question.dto.zod.validators.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question.dto.zod.validators.mjs","names":[],"sources":["../../../../../../../../../../../src/contexts/question/application/dto/shared/zod/validators/question.dto.zod.validators.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { areValuesUniqueFromStrings } from \"@shared/application/dto/zod/refinements/array/array.zod.refinements\";\nimport { normalizeToArray } from \"@shared/application/dto/zod/preprocessors/array/array.zod.preprocessors\";\nimport { zCreateFilterArray } from \"@shared/application/dto/zod/validators/array/array.zod.validators\";\nimport { zIsoDateTime, zMongoId } from \"@shared/infrastructure/http/zod/validators/string/string.zod.validators\";\n\nimport { QUESTION_AUTHOR_ROLES, QUESTION_CATEGORIES, QUESTION_SOURCE_URLS_MAX_ITEMS, QUESTION_SOURCE_URLS_MIN_ITEMS, QUESTION_STATUSES, QUESTION_COGNITIVE_DIFFICULTIES } from \"@question/domain/constants/question.constants\";\nimport { FIND_RANDOM_QUESTIONS_BODY_EXCLUDED_IDS_MAXIMUM, FIND_RANDOM_QUESTIONS_BODY_EXCLUDED_IDS_MINIMUM } from \"@question/application/dto/find-random-questions-body/constants/find-random-questions-body.dto.constants\";\nimport type { QuestionAuthorRoleEnum, QuestionCategoryEnum, QuestionStatusEnum, QuestionCognitiveDifficultyEnum } from \"@question/domain/types/question.value-objects\";\n\nimport type { ZodEnum, ZodURL, ZodArray, ZodString, ZodISODateTime, ZodOptional, ZodPreprocess } from \"zod\";\n\nfunction zQuestionAuthorRole(): ZodEnum<QuestionAuthorRoleEnum> {\n return z.enum(QUESTION_AUTHOR_ROLES)\n .describe(\"Question author's role\");\n}\n\nfunction zQuestionCognitiveDifficulty(): ZodEnum<QuestionCognitiveDifficultyEnum> {\n return z.enum(QUESTION_COGNITIVE_DIFFICULTIES)\n .describe(\"Question's cognitive difficulty level\");\n}\n\nfunction zQuestionStatus(): ZodEnum<QuestionStatusEnum> {\n return z.enum(QUESTION_STATUSES)\n .describe(\"Question's status\");\n}\n\nfunction zQuestionCategory(): ZodEnum<QuestionCategoryEnum> {\n return z.enum(QUESTION_CATEGORIES)\n .describe(\"Question's category\");\n}\n\nfunction zQuestionSourceUrls(): ZodArray<ZodURL> {\n return z.array(z.url())\n .min(QUESTION_SOURCE_URLS_MIN_ITEMS)\n .max(QUESTION_SOURCE_URLS_MAX_ITEMS)\n .refine(areValuesUniqueFromStrings, { message: \"Source URLs must be unique\" })\n .describe(\"List of unique source URLs for the question\")\n .meta({ example: [\"https://example.com/source1\", \"https://example.com/source2\"] });\n}\n\nfunction zQuestionExcludedIdsFilter(): ZodOptional<ZodPreprocess<ZodArray<ZodString>>> {\n return zCreateFilterArray(\n zMongoId().describe(\"Question ID to exclude\"),\n \"Excluded IDs must be unique\",\n \"List of question IDs to exclude from the random pool\",\n FIND_RANDOM_QUESTIONS_BODY_EXCLUDED_IDS_MINIMUM,\n FIND_RANDOM_QUESTIONS_BODY_EXCLUDED_IDS_MAXIMUM,\n );\n}\n\nfunction zQuestionCategoriesFilter(): ZodOptional<ZodPreprocess<ZodArray<ZodEnum<QuestionCategoryEnum>>>> {\n return zCreateFilterArray(\n z.enum(QUESTION_CATEGORIES),\n \"Categories must be unique\",\n \"List of categories to include (OR logic)\",\n 1,\n );\n}\n\nfunction zQuestionCognitiveDifficultiesFilter(): ZodOptional<ZodPreprocess<ZodArray<ZodEnum<QuestionCognitiveDifficultyEnum>>>> {\n return zCreateFilterArray(\n z.enum(QUESTION_COGNITIVE_DIFFICULTIES),\n \"Cognitive difficulties must be unique\",\n \"List of cognitive difficulties to include (OR logic)\",\n 1,\n );\n}\n\nfunction zQuestionThemeIdsFilter(): ZodOptional<ZodPreprocess<ZodArray<ZodString>>> {\n return z.preprocess(\n normalizeToArray,\n z.array(zMongoId().describe(\"Theme ID to filter questions by\")).min(1),\n )\n .optional()\n .describe(\"List of theme IDs to filter questions by (OR logic)\");\n}\n\nfunction zQuestionId(): ZodString {\n return zMongoId()\n .describe(\"Question's unique identifier\");\n}\n\nfunction zQuestionCreatedAt(): ZodISODateTime {\n return zIsoDateTime()\n .describe(\"Question's creation date\");\n}\n\nfunction zQuestionUpdatedAt(): ZodISODateTime {\n return zIsoDateTime()\n .describe(\"Question's last update date\");\n}\n\nexport {\n zQuestionAuthorRole,\n zQuestionCognitiveDifficulty,\n zQuestionStatus,\n zQuestionCategory,\n zQuestionSourceUrls,\n zQuestionExcludedIdsFilter,\n zQuestionCategoriesFilter,\n zQuestionCognitiveDifficultiesFilter,\n zQuestionThemeIdsFilter,\n zQuestionId,\n zQuestionCreatedAt,\n zQuestionUpdatedAt,\n};"],"mappings":"
|
|
1
|
+
{"version":3,"file":"question.dto.zod.validators.mjs","names":[],"sources":["../../../../../../../../../../../src/contexts/question/application/dto/shared/zod/validators/question.dto.zod.validators.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { areValuesUniqueFromStrings } from \"@shared/application/dto/zod/refinements/array/array.zod.refinements\";\nimport { normalizeToArray } from \"@shared/application/dto/zod/preprocessors/array/array.zod.preprocessors\";\nimport { zCreateFilterArray } from \"@shared/application/dto/zod/validators/array/array.zod.validators\";\nimport { LOCALES } from \"@shared/domain/value-objects/locale/locale.constants\";\nimport { zIsoDateTime, zMongoId } from \"@shared/infrastructure/http/zod/validators/string/string.zod.validators\";\n\nimport { QUESTION_AUTHOR_ROLES, QUESTION_CATEGORIES, QUESTION_SOURCE_URLS_MAX_ITEMS, QUESTION_SOURCE_URLS_MIN_ITEMS, QUESTION_STATUSES, QUESTION_COGNITIVE_DIFFICULTIES } from \"@question/domain/constants/question.constants\";\nimport { FIND_RANDOM_QUESTIONS_BODY_EXCLUDED_IDS_MAXIMUM, FIND_RANDOM_QUESTIONS_BODY_EXCLUDED_IDS_MINIMUM } from \"@question/application/dto/find-random-questions-body/constants/find-random-questions-body.dto.constants\";\nimport type { QuestionAuthorRoleEnum, QuestionCategoryEnum, QuestionStatusEnum, QuestionCognitiveDifficultyEnum } from \"@question/domain/types/question.value-objects\";\n\nimport type { ZodEnum, ZodURL, ZodArray, ZodString, ZodISODateTime, ZodOptional, ZodPreprocess } from \"zod\";\n\nimport type { LocaleEnum } from \"@shared/domain/value-objects/locale/locale.types\";\n\nfunction zQuestionAuthorRole(): ZodEnum<QuestionAuthorRoleEnum> {\n return z.enum(QUESTION_AUTHOR_ROLES)\n .describe(\"Question author's role\");\n}\n\nfunction zQuestionCognitiveDifficulty(): ZodEnum<QuestionCognitiveDifficultyEnum> {\n return z.enum(QUESTION_COGNITIVE_DIFFICULTIES)\n .describe(\"Question's cognitive difficulty level\");\n}\n\nfunction zQuestionStatus(): ZodEnum<QuestionStatusEnum> {\n return z.enum(QUESTION_STATUSES)\n .describe(\"Question's status\");\n}\n\nfunction zQuestionCategory(): ZodEnum<QuestionCategoryEnum> {\n return z.enum(QUESTION_CATEGORIES)\n .describe(\"Question's category\");\n}\n\nfunction zQuestionApplicableLocales(minItems = 1): ZodOptional<ZodArray<ZodEnum<LocaleEnum>>> {\n return z.array(z.enum(LOCALES))\n .min(minItems)\n .max(LOCALES.length)\n .refine(areValuesUniqueFromStrings, { message: \"Locales must be unique\" })\n .optional()\n .describe(\"Subset of locales this question is relevant for; omit if relevant for all locales\");\n}\n\nfunction zQuestionSourceUrls(): ZodArray<ZodURL> {\n return z.array(z.url())\n .min(QUESTION_SOURCE_URLS_MIN_ITEMS)\n .max(QUESTION_SOURCE_URLS_MAX_ITEMS)\n .refine(areValuesUniqueFromStrings, { message: \"Source URLs must be unique\" })\n .describe(\"List of unique source URLs for the question\")\n .meta({ example: [\"https://example.com/source1\", \"https://example.com/source2\"] });\n}\n\nfunction zQuestionExcludedIdsFilter(): ZodOptional<ZodPreprocess<ZodArray<ZodString>>> {\n return zCreateFilterArray(\n zMongoId().describe(\"Question ID to exclude\"),\n \"Excluded IDs must be unique\",\n \"List of question IDs to exclude from the random pool\",\n FIND_RANDOM_QUESTIONS_BODY_EXCLUDED_IDS_MINIMUM,\n FIND_RANDOM_QUESTIONS_BODY_EXCLUDED_IDS_MAXIMUM,\n );\n}\n\nfunction zQuestionCategoriesFilter(): ZodOptional<ZodPreprocess<ZodArray<ZodEnum<QuestionCategoryEnum>>>> {\n return zCreateFilterArray(\n z.enum(QUESTION_CATEGORIES),\n \"Categories must be unique\",\n \"List of categories to include (OR logic)\",\n 1,\n );\n}\n\nfunction zQuestionCognitiveDifficultiesFilter(): ZodOptional<ZodPreprocess<ZodArray<ZodEnum<QuestionCognitiveDifficultyEnum>>>> {\n return zCreateFilterArray(\n z.enum(QUESTION_COGNITIVE_DIFFICULTIES),\n \"Cognitive difficulties must be unique\",\n \"List of cognitive difficulties to include (OR logic)\",\n 1,\n );\n}\n\nfunction zQuestionThemeIdsFilter(): ZodOptional<ZodPreprocess<ZodArray<ZodString>>> {\n return z.preprocess(\n normalizeToArray,\n z.array(zMongoId().describe(\"Theme ID to filter questions by\")).min(1),\n )\n .optional()\n .describe(\"List of theme IDs to filter questions by (OR logic)\");\n}\n\nfunction zQuestionId(): ZodString {\n return zMongoId()\n .describe(\"Question's unique identifier\");\n}\n\nfunction zQuestionCreatedAt(): ZodISODateTime {\n return zIsoDateTime()\n .describe(\"Question's creation date\");\n}\n\nfunction zQuestionUpdatedAt(): ZodISODateTime {\n return zIsoDateTime()\n .describe(\"Question's last update date\");\n}\n\nexport {\n zQuestionAuthorRole,\n zQuestionCognitiveDifficulty,\n zQuestionStatus,\n zQuestionCategory,\n zQuestionApplicableLocales,\n zQuestionSourceUrls,\n zQuestionExcludedIdsFilter,\n zQuestionCategoriesFilter,\n zQuestionCognitiveDifficultiesFilter,\n zQuestionThemeIdsFilter,\n zQuestionId,\n zQuestionCreatedAt,\n zQuestionUpdatedAt,\n};"],"mappings":";;;;;;;;;AAgBA,SAAS,sBAAuD;CAC9D,OAAO,EAAE,KAAK,qBAAqB,CAAC,CACjC,SAAS,wBAAwB;AACtC;AAEA,SAAS,+BAAyE;CAChF,OAAO,EAAE,KAAK,+BAA+B,CAAC,CAC3C,SAAS,uCAAuC;AACrD;AAEA,SAAS,kBAA+C;CACtD,OAAO,EAAE,KAAK,iBAAiB,CAAC,CAC7B,SAAS,mBAAmB;AACjC;AAEA,SAAS,oBAAmD;CAC1D,OAAO,EAAE,KAAK,mBAAmB,CAAC,CAC/B,SAAS,qBAAqB;AACnC;AAEA,SAAS,2BAA2B,WAAW,GAA+C;CAC5F,OAAO,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,CAAC,CAC5B,IAAI,QAAQ,CAAC,CACb,IAAI,QAAQ,MAAM,CAAC,CACnB,OAAO,4BAA4B,EAAE,SAAS,yBAAyB,CAAC,CAAC,CACzE,SAAS,CAAC,CACV,SAAS,mFAAmF;AACjG;AAEA,SAAS,sBAAwC;CAC/C,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CACpB,IAAA,CAAkC,CAAC,CACnC,IAAA,CAAkC,CAAC,CACnC,OAAO,4BAA4B,EAAE,SAAS,6BAA6B,CAAC,CAAC,CAC7E,SAAS,6CAA6C,CAAC,CACvD,KAAK,EAAE,SAAS,CAAC,+BAA+B,6BAA6B,EAAE,CAAC;AACrF;AAEA,SAAS,6BAA8E;CACrF,OAAO,mBACL,SAAS,CAAC,CAAC,SAAS,wBAAwB,GAC5C,+BACA,wDAAA,GAEA,+CACF;AACF;AAEA,SAAS,4BAAiG;CACxG,OAAO,mBACL,EAAE,KAAK,mBAAmB,GAC1B,6BACA,4CACA,CACF;AACF;AAEA,SAAS,uCAAuH;CAC9H,OAAO,mBACL,EAAE,KAAK,+BAA+B,GACtC,yCACA,wDACA,CACF;AACF;AAEA,SAAS,0BAA2E;CAClF,OAAO,EAAE,WACP,kBACA,EAAE,MAAM,SAAS,CAAC,CAAC,SAAS,iCAAiC,CAAC,CAAC,CAAC,IAAI,CAAC,CACvE,CAAC,CACE,SAAS,CAAC,CACV,SAAS,qDAAqD;AACnE;AAEA,SAAS,cAAyB;CAChC,OAAO,SAAS,CAAC,CACd,SAAS,8BAA8B;AAC5C;AAEA,SAAS,qBAAqC;CAC5C,OAAO,aAAa,CAAC,CAClB,SAAS,0BAA0B;AACxC;AAEA,SAAS,qBAAqC;CAC5C,OAAO,aAAa,CAAC,CAClB,SAAS,6BAA6B;AAC3C"}
|
|
@@ -14,6 +14,7 @@ declare const ADMIN_FIND_QUESTION_THEMES_QUERY_DTO: z.ZodObject<{
|
|
|
14
14
|
}>>>;
|
|
15
15
|
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
16
16
|
status: z.ZodOptional<z.ZodEnum<QuestionThemeStatusEnum>>;
|
|
17
|
+
"is-fully-translated": z.ZodOptional<z.ZodCodec<z.ZodString, z.ZodBoolean>>;
|
|
17
18
|
}, z.core.$strip>;
|
|
18
19
|
type AdminFindQuestionThemesQueryDto = z.infer<typeof ADMIN_FIND_QUESTION_THEMES_QUERY_DTO>;
|
|
19
20
|
//#endregion
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { SORT_ORDERS } from "../../../../../shared/domain/constants/sort/sort.constants.mjs";
|
|
2
|
+
import { IS_FULLY_TRANSLATED_QUERY_KEY } from "../../../../../shared/application/dto/constants/translation-completeness-query.dto.constants.mjs";
|
|
2
3
|
import { LIMIT_QUERY_KEY } from "../../../../../shared/application/dto/constants/limit-query.dto.constants.mjs";
|
|
3
4
|
import { SORT_BY_QUERY_KEY, SORT_ORDER_QUERY_KEY } from "../../../../../shared/application/dto/constants/sort-query.dto.constants.mjs";
|
|
5
|
+
import { zIsFullyTranslated } from "../../../../../shared/infrastructure/http/zod/validators/translation-completeness/translation-completeness.zod.validators.mjs";
|
|
4
6
|
import { zLimit } from "../../../../../shared/infrastructure/http/zod/validators/limit/limit.zod.validators.mjs";
|
|
5
7
|
import { ADMIN_QUESTION_THEME_SORTABLE_FIELDS } from "../../../domain/constants/question-theme.constants.mjs";
|
|
6
8
|
import { zQuestionThemeStatus } from "../zod/validators/question-theme.dto.zod.validators.mjs";
|
|
@@ -11,7 +13,8 @@ const ADMIN_FIND_QUESTION_THEMES_QUERY_DTO = z.object({
|
|
|
11
13
|
[SORT_BY_QUERY_KEY]: z.enum(ADMIN_QUESTION_THEME_SORTABLE_FIELDS).optional().default(QUESTION_THEME_SORT_BY_DEFAULT).describe(QUESTION_THEME_SORT_BY_DESCRIPTION).meta({ example: QUESTION_THEME_SORT_BY_DEFAULT }),
|
|
12
14
|
[SORT_ORDER_QUERY_KEY]: z.enum(SORT_ORDERS).optional().default("asc").describe(QUESTION_THEME_SORT_ORDER_DESCRIPTION).meta({ example: "asc" }),
|
|
13
15
|
[LIMIT_QUERY_KEY]: zLimit(),
|
|
14
|
-
status: zQuestionThemeStatus().optional()
|
|
16
|
+
status: zQuestionThemeStatus().optional(),
|
|
17
|
+
[IS_FULLY_TRANSLATED_QUERY_KEY]: zIsFullyTranslated()
|
|
15
18
|
});
|
|
16
19
|
//#endregion
|
|
17
20
|
export { ADMIN_FIND_QUESTION_THEMES_QUERY_DTO };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-find-question-themes-query.dto.shape.mjs","names":[],"sources":["../../../../../../../../../src/contexts/question-theme/application/dto/admin-find-question-themes-query/admin-find-question-themes-query.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { ADMIN_QUESTION_THEME_SORTABLE_FIELDS } from \"@question-theme/domain/constants/question-theme.constants\";\nimport { zQuestionThemeStatus } from \"@question-theme/application/dto/zod/validators/question-theme.dto.zod.validators\";\nimport { QUESTION_THEME_SORT_BY_DEFAULT, QUESTION_THEME_SORT_BY_DESCRIPTION, QUESTION_THEME_SORT_ORDER_DEFAULT, QUESTION_THEME_SORT_ORDER_DESCRIPTION } from \"@question-theme/application/dto/zod/validators/constants/question-theme-sort.dto.zod.validators.constants\";\n\nimport { SORT_ORDERS } from \"@shared/domain/constants/sort/sort.constants\";\nimport { SORT_BY_QUERY_KEY, SORT_ORDER_QUERY_KEY } from \"@shared/application/dto/constants/sort-query.dto.constants\";\nimport { LIMIT_QUERY_KEY } from \"@shared/application/dto/constants/limit-query.dto.constants\";\nimport { zLimit } from \"@shared/infrastructure/http/zod/validators/limit/limit.zod.validators\";\n\nconst ADMIN_FIND_QUESTION_THEMES_QUERY_DTO = z.object({\n [SORT_BY_QUERY_KEY]: z.enum(ADMIN_QUESTION_THEME_SORTABLE_FIELDS)\n .optional()\n .default(QUESTION_THEME_SORT_BY_DEFAULT)\n .describe(QUESTION_THEME_SORT_BY_DESCRIPTION)\n .meta({ example: QUESTION_THEME_SORT_BY_DEFAULT }),\n [SORT_ORDER_QUERY_KEY]: z.enum(SORT_ORDERS)\n .optional()\n .default(QUESTION_THEME_SORT_ORDER_DEFAULT)\n .describe(QUESTION_THEME_SORT_ORDER_DESCRIPTION)\n .meta({ example: QUESTION_THEME_SORT_ORDER_DEFAULT }),\n [LIMIT_QUERY_KEY]: zLimit(),\n status: zQuestionThemeStatus().optional(),\n});\n\ntype AdminFindQuestionThemesQueryDto = z.infer<typeof ADMIN_FIND_QUESTION_THEMES_QUERY_DTO>;\n\nexport type { AdminFindQuestionThemesQueryDto };\n\nexport { ADMIN_FIND_QUESTION_THEMES_QUERY_DTO };"],"mappings":"
|
|
1
|
+
{"version":3,"file":"admin-find-question-themes-query.dto.shape.mjs","names":[],"sources":["../../../../../../../../../src/contexts/question-theme/application/dto/admin-find-question-themes-query/admin-find-question-themes-query.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { ADMIN_QUESTION_THEME_SORTABLE_FIELDS } from \"@question-theme/domain/constants/question-theme.constants\";\nimport { zQuestionThemeStatus } from \"@question-theme/application/dto/zod/validators/question-theme.dto.zod.validators\";\nimport { QUESTION_THEME_SORT_BY_DEFAULT, QUESTION_THEME_SORT_BY_DESCRIPTION, QUESTION_THEME_SORT_ORDER_DEFAULT, QUESTION_THEME_SORT_ORDER_DESCRIPTION } from \"@question-theme/application/dto/zod/validators/constants/question-theme-sort.dto.zod.validators.constants\";\n\nimport { IS_FULLY_TRANSLATED_QUERY_KEY } from \"@shared/application/dto/constants/translation-completeness-query.dto.constants\";\nimport { SORT_ORDERS } from \"@shared/domain/constants/sort/sort.constants\";\nimport { SORT_BY_QUERY_KEY, SORT_ORDER_QUERY_KEY } from \"@shared/application/dto/constants/sort-query.dto.constants\";\nimport { LIMIT_QUERY_KEY } from \"@shared/application/dto/constants/limit-query.dto.constants\";\nimport { zIsFullyTranslated } from \"@shared/infrastructure/http/zod/validators/translation-completeness/translation-completeness.zod.validators\";\nimport { zLimit } from \"@shared/infrastructure/http/zod/validators/limit/limit.zod.validators\";\n\nconst ADMIN_FIND_QUESTION_THEMES_QUERY_DTO = z.object({\n [SORT_BY_QUERY_KEY]: z.enum(ADMIN_QUESTION_THEME_SORTABLE_FIELDS)\n .optional()\n .default(QUESTION_THEME_SORT_BY_DEFAULT)\n .describe(QUESTION_THEME_SORT_BY_DESCRIPTION)\n .meta({ example: QUESTION_THEME_SORT_BY_DEFAULT }),\n [SORT_ORDER_QUERY_KEY]: z.enum(SORT_ORDERS)\n .optional()\n .default(QUESTION_THEME_SORT_ORDER_DEFAULT)\n .describe(QUESTION_THEME_SORT_ORDER_DESCRIPTION)\n .meta({ example: QUESTION_THEME_SORT_ORDER_DEFAULT }),\n [LIMIT_QUERY_KEY]: zLimit(),\n status: zQuestionThemeStatus().optional(),\n [IS_FULLY_TRANSLATED_QUERY_KEY]: zIsFullyTranslated(),\n});\n\ntype AdminFindQuestionThemesQueryDto = z.infer<typeof ADMIN_FIND_QUESTION_THEMES_QUERY_DTO>;\n\nexport type { AdminFindQuestionThemesQueryDto };\n\nexport { ADMIN_FIND_QUESTION_THEMES_QUERY_DTO };"],"mappings":";;;;;;;;;;;AAaA,MAAM,uCAAuC,EAAE,OAAO;EACnD,oBAAoB,EAAE,KAAK,oCAAoC,CAAC,CAC9D,SAAS,CAAC,CACV,QAAQ,8BAA8B,CAAC,CACvC,SAAS,kCAAkC,CAAC,CAC5C,KAAK,EAAE,SAAS,+BAA+B,CAAC;EAClD,uBAAuB,EAAE,KAAK,WAAW,CAAC,CACxC,SAAS,CAAC,CACV,QAAA,KAAyC,CAAC,CAC1C,SAAS,qCAAqC,CAAC,CAC/C,KAAK,EAAE,SAAA,MAA2C,CAAC;EACrD,kBAAkB,OAAO;CAC1B,QAAQ,qBAAqB,CAAC,CAAC,SAAS;EACvC,gCAAgC,mBAAmB;AACtD,CAAC"}
|
|
@@ -11,6 +11,10 @@ declare const QUESTION_THEME_STATS_DTO: z.ZodObject<{
|
|
|
11
11
|
themeSlug: z.ZodString;
|
|
12
12
|
activeQuestionCount: z.ZodNumber;
|
|
13
13
|
}, z.core.$strict>>;
|
|
14
|
+
byTranslationCompleteness: z.ZodObject<{
|
|
15
|
+
fullyTranslated: z.ZodNumber;
|
|
16
|
+
incomplete: z.ZodNumber;
|
|
17
|
+
}, z.core.$strict>;
|
|
14
18
|
}, z.core.$strict>;
|
|
15
19
|
type QuestionThemeStatsDto = z.infer<typeof QUESTION_THEME_STATS_DTO>;
|
|
16
20
|
//#endregion
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { zTranslationCompletenessStats } from "../../../../../shared/infrastructure/http/zod/validators/translation-completeness/translation-completeness.zod.validators.mjs";
|
|
1
2
|
import { QUESTION_THEME_STATUSES } from "../../../domain/constants/question-theme.constants.mjs";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
//#region ../../src/contexts/question-theme/application/dto/question-theme-stats/question-theme-stats.dto.shape.ts
|
|
@@ -8,7 +9,8 @@ const QUESTION_THEME_STATS_DTO = z.strictObject({
|
|
|
8
9
|
themeId: z.string().describe("Theme's unique identifier"),
|
|
9
10
|
themeSlug: z.string().describe("Theme's slug"),
|
|
10
11
|
activeQuestionCount: z.number().int().nonnegative().describe("Number of active questions referencing this theme (includes 0 for themes with no active questions)")
|
|
11
|
-
})).describe("Active question count per theme, sorted alphabetically by slug")
|
|
12
|
+
})).describe("Active question count per theme, sorted alphabetically by slug"),
|
|
13
|
+
byTranslationCompleteness: zTranslationCompletenessStats().describe("Translation completeness breakdown")
|
|
12
14
|
});
|
|
13
15
|
//#endregion
|
|
14
16
|
export { QUESTION_THEME_STATS_DTO };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question-theme-stats.dto.shape.mjs","names":[],"sources":["../../../../../../../../../src/contexts/question-theme/application/dto/question-theme-stats/question-theme-stats.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { QUESTION_THEME_STATUSES } from \"@question-theme/domain/constants/question-theme.constants\";\n\nconst QUESTION_THEME_STATS_DTO = z.strictObject({\n total: z.number().int().nonnegative().describe(\"Total number of question themes\"),\n byStatus: z\n .record(z.enum(QUESTION_THEME_STATUSES), z.number().int().nonnegative())\n .describe(\"Number of question themes per status\"),\n byQuestionCount: z\n .array(z.strictObject({\n themeId: z.string().describe(\"Theme's unique identifier\"),\n themeSlug: z.string().describe(\"Theme's slug\"),\n activeQuestionCount: z\n .number()\n .int()\n .nonnegative()\n .describe(\"Number of active questions referencing this theme (includes 0 for themes with no active questions)\"),\n }))\n .describe(\"Active question count per theme, sorted alphabetically by slug\"),\n});\n\ntype QuestionThemeStatsDto = z.infer<typeof QUESTION_THEME_STATS_DTO>;\n\nexport { QUESTION_THEME_STATS_DTO };\n\nexport type { QuestionThemeStatsDto };"],"mappings":"
|
|
1
|
+
{"version":3,"file":"question-theme-stats.dto.shape.mjs","names":[],"sources":["../../../../../../../../../src/contexts/question-theme/application/dto/question-theme-stats/question-theme-stats.dto.shape.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { QUESTION_THEME_STATUSES } from \"@question-theme/domain/constants/question-theme.constants\";\n\nimport { zTranslationCompletenessStats } from \"@shared/infrastructure/http/zod/validators/translation-completeness/translation-completeness.zod.validators\";\n\nconst QUESTION_THEME_STATS_DTO = z.strictObject({\n total: z.number().int().nonnegative().describe(\"Total number of question themes\"),\n byStatus: z\n .record(z.enum(QUESTION_THEME_STATUSES), z.number().int().nonnegative())\n .describe(\"Number of question themes per status\"),\n byQuestionCount: z\n .array(z.strictObject({\n themeId: z.string().describe(\"Theme's unique identifier\"),\n themeSlug: z.string().describe(\"Theme's slug\"),\n activeQuestionCount: z\n .number()\n .int()\n .nonnegative()\n .describe(\"Number of active questions referencing this theme (includes 0 for themes with no active questions)\"),\n }))\n .describe(\"Active question count per theme, sorted alphabetically by slug\"),\n byTranslationCompleteness: zTranslationCompletenessStats()\n .describe(\"Translation completeness breakdown\"),\n});\n\ntype QuestionThemeStatsDto = z.infer<typeof QUESTION_THEME_STATS_DTO>;\n\nexport { QUESTION_THEME_STATS_DTO };\n\nexport type { QuestionThemeStatsDto };"],"mappings":";;;;AAMA,MAAM,2BAA2B,EAAE,aAAa;CAC9C,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,iCAAiC;CAChF,UAAU,EACP,OAAO,EAAE,KAAK,uBAAuB,GAAG,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC,CACvE,SAAS,sCAAsC;CAClD,iBAAiB,EACd,MAAM,EAAE,aAAa;EACpB,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,2BAA2B;EACxD,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS,cAAc;EAC7C,qBAAqB,EAClB,OAAO,CAAC,CACR,IAAI,CAAC,CACL,YAAY,CAAC,CACb,SAAS,oGAAoG;CAClH,CAAC,CAAC,CAAC,CACF,SAAS,gEAAgE;CAC5E,2BAA2B,8BAA8B,CAAC,CACvD,SAAS,oCAAoC;AAClD,CAAC"}
|
package/dist/src/shared/application/dto/constants/translation-completeness-query.dto.constants.mjs
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region ../../src/shared/application/dto/constants/translation-completeness-query.dto.constants.ts
|
|
2
|
+
const IS_FULLY_TRANSLATED_QUERY_KEY = "is-fully-translated";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { IS_FULLY_TRANSLATED_QUERY_KEY };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=translation-completeness-query.dto.constants.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translation-completeness-query.dto.constants.mjs","names":[],"sources":["../../../../../../../../src/shared/application/dto/constants/translation-completeness-query.dto.constants.ts"],"sourcesContent":["const IS_FULLY_TRANSLATED_QUERY_KEY = \"is-fully-translated\";\n\nexport { IS_FULLY_TRANSLATED_QUERY_KEY };"],"mappings":";AAAA,MAAM,gCAAgC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { TupleToEnum } from "../../../types/enum.types.mjs";
|
|
1
2
|
import { LOCALES } from "./locale.constants.mjs";
|
|
2
3
|
import { TupleToUnion } from "type-fest";
|
|
3
4
|
//#region ../../src/shared/domain/value-objects/locale/locale.types.d.ts
|
|
4
5
|
type Locale = TupleToUnion<typeof LOCALES>;
|
|
6
|
+
type LocaleEnum = TupleToEnum<typeof LOCALES>;
|
|
5
7
|
type LocalizationOptions = {
|
|
6
8
|
locale: Locale;
|
|
7
9
|
fallbackLocale: Locale;
|
|
@@ -9,5 +11,5 @@ type LocalizationOptions = {
|
|
|
9
11
|
type LocalizedText = Record<Locale, string>;
|
|
10
12
|
type LocalizedTexts = Record<Locale, string[]>;
|
|
11
13
|
//#endregion
|
|
12
|
-
export type { Locale, LocalizationOptions, LocalizedText, LocalizedTexts };
|
|
14
|
+
export type { Locale, LocaleEnum, LocalizationOptions, LocalizedText, LocalizedTexts };
|
|
13
15
|
//# sourceMappingURL=locale.types.d.mts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region ../../src/shared/infrastructure/http/zod/validators/translation-completeness/translation-completeness.zod.validators.ts
|
|
3
|
+
function zIsFullyTranslated() {
|
|
4
|
+
return z.stringbool({
|
|
5
|
+
truthy: ["true"],
|
|
6
|
+
falsy: ["false"]
|
|
7
|
+
}).optional().describe("Filters resources by translation completeness: 'true' returns only fully translated resources, 'false' returns only incomplete ones. A resource is fully translated when all mandatory LocalizedText/LocalizedTexts fields have a value in every applicable locale, and all optional LocalizedText/LocalizedTexts fields are either absent (never translated) or have a value in every applicable locale. Applicable locales come from the resource's applicableLocales field: if absent or empty, all 6 supported locales apply (en, fr, es, de, it, pt).");
|
|
8
|
+
}
|
|
9
|
+
function zTranslationCompletenessStats() {
|
|
10
|
+
return z.strictObject({
|
|
11
|
+
fullyTranslated: z.number().int().nonnegative().describe("Number of resources that are fully translated across all locales"),
|
|
12
|
+
incomplete: z.number().int().nonnegative().describe("Number of resources missing at least one locale in at least one field")
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { zIsFullyTranslated, zTranslationCompletenessStats };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=translation-completeness.zod.validators.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translation-completeness.zod.validators.mjs","names":[],"sources":["../../../../../../../../../../src/shared/infrastructure/http/zod/validators/translation-completeness/translation-completeness.zod.validators.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport type { ZodBoolean, ZodCodec, ZodNumber, ZodObject, ZodOptional, ZodString } from \"zod\";\n\nfunction zIsFullyTranslated(): ZodOptional<ZodCodec<ZodString, ZodBoolean>> {\n return z.stringbool({ truthy: [\"true\"], falsy: [\"false\"] })\n .optional()\n .describe(\"Filters resources by translation completeness: 'true' returns only fully translated resources, 'false' returns only incomplete ones. \" +\n \"A resource is fully translated when all mandatory LocalizedText/LocalizedTexts fields have a value \" +\n \"in every applicable locale, and all optional LocalizedText/LocalizedTexts fields are either absent (never translated) \" +\n \"or have a value in every applicable locale. \" +\n \"Applicable locales come from the resource's applicableLocales field: if absent or empty, \" +\n \"all 6 supported locales apply (en, fr, es, de, it, pt).\");\n}\n\nfunction zTranslationCompletenessStats(): ZodObject<z.util.Writeable<{ fullyTranslated: ZodNumber; incomplete: ZodNumber }>, z.core.$strict> {\n return z.strictObject({\n fullyTranslated: z.number().int().nonnegative()\n .describe(\"Number of resources that are fully translated across all locales\"),\n incomplete: z.number().int().nonnegative()\n .describe(\"Number of resources missing at least one locale in at least one field\"),\n });\n}\n\nexport { zIsFullyTranslated, zTranslationCompletenessStats };"],"mappings":";;AAIA,SAAS,qBAAmE;CAC1E,OAAO,EAAE,WAAW;EAAE,QAAQ,CAAC,MAAM;EAAG,OAAO,CAAC,OAAO;CAAE,CAAC,CAAC,CACxD,SAAS,CAAC,CACV,SAAS,4hBAKiD;AAC/D;AAEA,SAAS,gCAAoI;CAC3I,OAAO,EAAE,aAAa;EACpB,iBAAiB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CAC5C,SAAS,kEAAkE;EAC9E,YAAY,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CACvC,SAAS,uEAAuE;CACrF,CAAC;AACH"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SORT_ORDERS } from "../../../../../../../../src/shared/domain/constants/sort/sort.constants.mjs";
|
|
2
2
|
import "../../../../../../../../src/shared/infrastructure/http/zod/validators/limit/constants/limit.zod.validators.constants.mjs";
|
|
3
3
|
import { ADMIN_QUESTION_SORTABLE_FIELDS, QUESTION_AUTHOR_ROLES, QUESTION_CATEGORIES, QUESTION_COGNITIVE_DIFFICULTIES, QUESTION_STATUSES } from "../../../../../../../../src/contexts/question/domain/constants/question.constants.mjs";
|
|
4
|
+
import { IS_FULLY_TRANSLATED_QUERY_KEY } from "../../../../../../../../src/shared/application/dto/constants/translation-completeness-query.dto.constants.mjs";
|
|
4
5
|
import { LIMIT_QUERY_KEY } from "../../../../../../../../src/shared/application/dto/constants/limit-query.dto.constants.mjs";
|
|
5
6
|
import { SORT_BY_QUERY_KEY, SORT_ORDER_QUERY_KEY } from "../../../../../../../../src/shared/application/dto/constants/sort-query.dto.constants.mjs";
|
|
6
7
|
import { QUESTION_AUTHOR_ROLE_QUERY_KEY, QUESTION_CATEGORY_QUERY_KEY, QUESTION_COGNITIVE_DIFFICULTY_QUERY_KEY, QUESTION_STATUS_QUERY_KEY, QUESTION_THEME_IDS_QUERY_KEY } from "../../../../../../../../src/contexts/question/application/dto/shared/constants/question-filter-query.dto.constants.mjs";
|
|
@@ -16,6 +17,7 @@ function createFakeAdminFindQuestionsQueryDto(overrides = {}) {
|
|
|
16
17
|
[QUESTION_COGNITIVE_DIFFICULTY_QUERY_KEY]: faker.helpers.maybe(() => faker.helpers.arrayElement(QUESTION_COGNITIVE_DIFFICULTIES)),
|
|
17
18
|
[QUESTION_AUTHOR_ROLE_QUERY_KEY]: faker.helpers.maybe(() => faker.helpers.arrayElement(QUESTION_AUTHOR_ROLES)),
|
|
18
19
|
[QUESTION_THEME_IDS_QUERY_KEY]: faker.helpers.maybe(() => [faker.database.mongodbObjectId()]),
|
|
20
|
+
[IS_FULLY_TRANSLATED_QUERY_KEY]: faker.helpers.maybe(() => faker.datatype.boolean()),
|
|
19
21
|
...overrides
|
|
20
22
|
};
|
|
21
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-find-questions-query.dto.faketory.mjs","names":[],"sources":["../../../../../../../../../../../tests/shared/utils/faketories/contexts/question/dto/admin-find-questions-query/admin-find-questions-query.dto.faketory.ts"],"sourcesContent":["import { faker } from \"@faker-js/faker\";\n\nimport { SORT_ORDERS } from \"@shared/domain/constants/sort/sort.constants\";\nimport { SORT_BY_QUERY_KEY, SORT_ORDER_QUERY_KEY } from \"@shared/application/dto/constants/sort-query.dto.constants\";\nimport { LIMIT_QUERY_KEY } from \"@shared/application/dto/constants/limit-query.dto.constants\";\nimport { LIMIT_DEFAULT, LIMIT_MINIMUM } from \"@shared/infrastructure/http/zod/validators/limit/constants/limit.zod.validators.constants\";\n\nimport { ADMIN_QUESTION_SORTABLE_FIELDS, QUESTION_AUTHOR_ROLES, QUESTION_CATEGORIES, QUESTION_COGNITIVE_DIFFICULTIES, QUESTION_STATUSES } from \"@question/domain/constants/question.constants\";\nimport { QUESTION_AUTHOR_ROLE_QUERY_KEY, QUESTION_CATEGORY_QUERY_KEY, QUESTION_COGNITIVE_DIFFICULTY_QUERY_KEY, QUESTION_STATUS_QUERY_KEY, QUESTION_THEME_IDS_QUERY_KEY } from \"@question/application/dto/shared/constants/question-filter-query.dto.constants\";\nimport type { AdminFindQuestionsQueryDto } from \"@question/application/dto/admin-find-questions-query/admin-find-questions-query.dto.shape\";\n\nfunction createFakeAdminFindQuestionsQueryDto(overrides: Partial<AdminFindQuestionsQueryDto> = {}): AdminFindQuestionsQueryDto {\n return {\n [SORT_BY_QUERY_KEY]: faker.helpers.arrayElement(ADMIN_QUESTION_SORTABLE_FIELDS),\n [SORT_ORDER_QUERY_KEY]: faker.helpers.arrayElement(SORT_ORDERS),\n [LIMIT_QUERY_KEY]: faker.helpers.maybe(() => faker.number.int({ min: LIMIT_MINIMUM })) ?? LIMIT_DEFAULT,\n [QUESTION_STATUS_QUERY_KEY]: faker.helpers.maybe(() => faker.helpers.arrayElement(QUESTION_STATUSES)),\n [QUESTION_CATEGORY_QUERY_KEY]: faker.helpers.maybe(() => faker.helpers.arrayElement(QUESTION_CATEGORIES)),\n [QUESTION_COGNITIVE_DIFFICULTY_QUERY_KEY]: faker.helpers.maybe(() => faker.helpers.arrayElement(QUESTION_COGNITIVE_DIFFICULTIES)),\n [QUESTION_AUTHOR_ROLE_QUERY_KEY]: faker.helpers.maybe(() => faker.helpers.arrayElement(QUESTION_AUTHOR_ROLES)),\n [QUESTION_THEME_IDS_QUERY_KEY]: faker.helpers.maybe(() => [faker.database.mongodbObjectId()]),\n ...overrides,\n };\n}\n\nexport { createFakeAdminFindQuestionsQueryDto };"],"mappings":"
|
|
1
|
+
{"version":3,"file":"admin-find-questions-query.dto.faketory.mjs","names":[],"sources":["../../../../../../../../../../../tests/shared/utils/faketories/contexts/question/dto/admin-find-questions-query/admin-find-questions-query.dto.faketory.ts"],"sourcesContent":["import { faker } from \"@faker-js/faker\";\n\nimport { SORT_ORDERS } from \"@shared/domain/constants/sort/sort.constants\";\nimport { SORT_BY_QUERY_KEY, SORT_ORDER_QUERY_KEY } from \"@shared/application/dto/constants/sort-query.dto.constants\";\nimport { LIMIT_QUERY_KEY } from \"@shared/application/dto/constants/limit-query.dto.constants\";\nimport { LIMIT_DEFAULT, LIMIT_MINIMUM } from \"@shared/infrastructure/http/zod/validators/limit/constants/limit.zod.validators.constants\";\nimport { IS_FULLY_TRANSLATED_QUERY_KEY } from \"@shared/application/dto/constants/translation-completeness-query.dto.constants\";\n\nimport { ADMIN_QUESTION_SORTABLE_FIELDS, QUESTION_AUTHOR_ROLES, QUESTION_CATEGORIES, QUESTION_COGNITIVE_DIFFICULTIES, QUESTION_STATUSES } from \"@question/domain/constants/question.constants\";\nimport { QUESTION_AUTHOR_ROLE_QUERY_KEY, QUESTION_CATEGORY_QUERY_KEY, QUESTION_COGNITIVE_DIFFICULTY_QUERY_KEY, QUESTION_STATUS_QUERY_KEY, QUESTION_THEME_IDS_QUERY_KEY } from \"@question/application/dto/shared/constants/question-filter-query.dto.constants\";\nimport type { AdminFindQuestionsQueryDto } from \"@question/application/dto/admin-find-questions-query/admin-find-questions-query.dto.shape\";\n\nfunction createFakeAdminFindQuestionsQueryDto(overrides: Partial<AdminFindQuestionsQueryDto> = {}): AdminFindQuestionsQueryDto {\n return {\n [SORT_BY_QUERY_KEY]: faker.helpers.arrayElement(ADMIN_QUESTION_SORTABLE_FIELDS),\n [SORT_ORDER_QUERY_KEY]: faker.helpers.arrayElement(SORT_ORDERS),\n [LIMIT_QUERY_KEY]: faker.helpers.maybe(() => faker.number.int({ min: LIMIT_MINIMUM })) ?? LIMIT_DEFAULT,\n [QUESTION_STATUS_QUERY_KEY]: faker.helpers.maybe(() => faker.helpers.arrayElement(QUESTION_STATUSES)),\n [QUESTION_CATEGORY_QUERY_KEY]: faker.helpers.maybe(() => faker.helpers.arrayElement(QUESTION_CATEGORIES)),\n [QUESTION_COGNITIVE_DIFFICULTY_QUERY_KEY]: faker.helpers.maybe(() => faker.helpers.arrayElement(QUESTION_COGNITIVE_DIFFICULTIES)),\n [QUESTION_AUTHOR_ROLE_QUERY_KEY]: faker.helpers.maybe(() => faker.helpers.arrayElement(QUESTION_AUTHOR_ROLES)),\n [QUESTION_THEME_IDS_QUERY_KEY]: faker.helpers.maybe(() => [faker.database.mongodbObjectId()]),\n [IS_FULLY_TRANSLATED_QUERY_KEY]: faker.helpers.maybe(() => faker.datatype.boolean()),\n ...overrides,\n };\n}\n\nexport { createFakeAdminFindQuestionsQueryDto };"],"mappings":";;;;;;;;;AAYA,SAAS,qCAAqC,YAAiD,CAAC,GAA+B;CAC7H,OAAO;GACJ,oBAAoB,MAAM,QAAQ,aAAa,8BAA8B;GAC7E,uBAAuB,MAAM,QAAQ,aAAa,WAAW;GAC7D,kBAAkB,MAAM,QAAQ,YAAY,MAAM,OAAO,IAAI,EAAE,KAAA,EAAmB,CAAC,CAAC,KAAA;GACpF,4BAA4B,MAAM,QAAQ,YAAY,MAAM,QAAQ,aAAa,iBAAiB,CAAC;GACnG,8BAA8B,MAAM,QAAQ,YAAY,MAAM,QAAQ,aAAa,mBAAmB,CAAC;GACvG,0CAA0C,MAAM,QAAQ,YAAY,MAAM,QAAQ,aAAa,+BAA+B,CAAC;GAC/H,iCAAiC,MAAM,QAAQ,YAAY,MAAM,QAAQ,aAAa,qBAAqB,CAAC;GAC5G,+BAA+B,MAAM,QAAQ,YAAY,CAAC,MAAM,SAAS,gBAAgB,CAAC,CAAC;GAC3F,gCAAgC,MAAM,QAAQ,YAAY,MAAM,SAAS,QAAQ,CAAC;EACnF,GAAG;CACL;AACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LOCALES } from "../../../../../../../../src/shared/domain/value-objects/locale/locale.constants.mjs";
|
|
1
2
|
import { QUESTION_CATEGORIES, QUESTION_COGNITIVE_DIFFICULTIES, QUESTION_STATUSES } from "../../../../../../../../src/contexts/question/domain/constants/question.constants.mjs";
|
|
2
3
|
import { createFakeAdminQuestionContentDto } from "./admin-question-content/admin-question-content.dto.faketory.mjs";
|
|
3
4
|
import { createFakeAdminQuestionThemeAssignmentDto } from "./admin-question-theme-assignment/admin-question-theme-assignment.dto.faketory.mjs";
|
|
@@ -16,6 +17,10 @@ function createFakeAdminQuestionDto(adminQuestionDto = {}) {
|
|
|
16
17
|
status: faker.helpers.arrayElement(QUESTION_STATUSES),
|
|
17
18
|
rejection: faker.helpers.maybe(createFakeQuestionRejectionDto),
|
|
18
19
|
sourceUrls: faker.helpers.uniqueArray(() => faker.internet.url(), 2),
|
|
20
|
+
applicableLocales: faker.helpers.maybe(() => faker.helpers.arrayElements(LOCALES, {
|
|
21
|
+
min: 1,
|
|
22
|
+
max: LOCALES.length
|
|
23
|
+
})),
|
|
19
24
|
createdAt: faker.date.anytime().toISOString(),
|
|
20
25
|
updatedAt: faker.date.anytime().toISOString(),
|
|
21
26
|
...adminQuestionDto
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-question.dto.faketory.mjs","names":[],"sources":["../../../../../../../../../../../tests/shared/utils/faketories/contexts/question/dto/admin-question/admin-question.dto.faketory.ts"],"sourcesContent":["import { faker } from \"@faker-js/faker\";\n\nimport type { AdminQuestionDto } from \"@question/application/dto/admin-question/admin-question.dto.shape\";\nimport { QUESTION_CATEGORIES, QUESTION_COGNITIVE_DIFFICULTIES, QUESTION_STATUSES } from \"@question/domain/constants/question.constants\";\n\nimport { createFakeAdminQuestionThemeAssignmentDto } from \"@faketories/contexts/question/dto/admin-question/admin-question-theme-assignment/admin-question-theme-assignment.dto.faketory\";\nimport { createFakeAdminQuestionContentDto } from \"@faketories/contexts/question/dto/admin-question/admin-question-content/admin-question-content.dto.faketory\";\nimport { createFakeQuestionAuthorDto } from \"@faketories/contexts/question/dto/shared/question-author/question-author.dto.faketory\";\nimport { createFakeQuestionRejectionDto } from \"@faketories/contexts/question/dto/shared/question-rejection/question-rejection.dto.faketory\";\n\nfunction createFakeAdminQuestionDto(adminQuestionDto: Partial<AdminQuestionDto> = {}): AdminQuestionDto {\n return {\n id: faker.database.mongodbObjectId(),\n category: faker.helpers.arrayElement(QUESTION_CATEGORIES),\n themes: [createFakeAdminQuestionThemeAssignmentDto()],\n content: createFakeAdminQuestionContentDto(),\n cognitiveDifficulty: faker.helpers.arrayElement(QUESTION_COGNITIVE_DIFFICULTIES),\n author: createFakeQuestionAuthorDto(),\n status: faker.helpers.arrayElement(QUESTION_STATUSES),\n rejection: faker.helpers.maybe(createFakeQuestionRejectionDto),\n sourceUrls: faker.helpers.uniqueArray(() => faker.internet.url(), 2),\n createdAt: faker.date.anytime().toISOString(),\n updatedAt: faker.date.anytime().toISOString(),\n ...adminQuestionDto,\n };\n}\n\nexport {\n createFakeAdminQuestionDto,\n};"],"mappings":"
|
|
1
|
+
{"version":3,"file":"admin-question.dto.faketory.mjs","names":[],"sources":["../../../../../../../../../../../tests/shared/utils/faketories/contexts/question/dto/admin-question/admin-question.dto.faketory.ts"],"sourcesContent":["import { faker } from \"@faker-js/faker\";\n\nimport { LOCALES } from \"@shared/domain/value-objects/locale/locale.constants\";\n\nimport type { AdminQuestionDto } from \"@question/application/dto/admin-question/admin-question.dto.shape\";\nimport { QUESTION_CATEGORIES, QUESTION_COGNITIVE_DIFFICULTIES, QUESTION_STATUSES } from \"@question/domain/constants/question.constants\";\n\nimport { createFakeAdminQuestionThemeAssignmentDto } from \"@faketories/contexts/question/dto/admin-question/admin-question-theme-assignment/admin-question-theme-assignment.dto.faketory\";\nimport { createFakeAdminQuestionContentDto } from \"@faketories/contexts/question/dto/admin-question/admin-question-content/admin-question-content.dto.faketory\";\nimport { createFakeQuestionAuthorDto } from \"@faketories/contexts/question/dto/shared/question-author/question-author.dto.faketory\";\nimport { createFakeQuestionRejectionDto } from \"@faketories/contexts/question/dto/shared/question-rejection/question-rejection.dto.faketory\";\n\nfunction createFakeAdminQuestionDto(adminQuestionDto: Partial<AdminQuestionDto> = {}): AdminQuestionDto {\n return {\n id: faker.database.mongodbObjectId(),\n category: faker.helpers.arrayElement(QUESTION_CATEGORIES),\n themes: [createFakeAdminQuestionThemeAssignmentDto()],\n content: createFakeAdminQuestionContentDto(),\n cognitiveDifficulty: faker.helpers.arrayElement(QUESTION_COGNITIVE_DIFFICULTIES),\n author: createFakeQuestionAuthorDto(),\n status: faker.helpers.arrayElement(QUESTION_STATUSES),\n rejection: faker.helpers.maybe(createFakeQuestionRejectionDto),\n sourceUrls: faker.helpers.uniqueArray(() => faker.internet.url(), 2),\n applicableLocales: faker.helpers.maybe(() => faker.helpers.arrayElements(LOCALES, { min: 1, max: LOCALES.length })),\n createdAt: faker.date.anytime().toISOString(),\n updatedAt: faker.date.anytime().toISOString(),\n ...adminQuestionDto,\n };\n}\n\nexport {\n createFakeAdminQuestionDto,\n};"],"mappings":";;;;;;;;AAYA,SAAS,2BAA2B,mBAA8C,CAAC,GAAqB;CACtG,OAAO;EACL,IAAI,MAAM,SAAS,gBAAgB;EACnC,UAAU,MAAM,QAAQ,aAAa,mBAAmB;EACxD,QAAQ,CAAC,0CAA0C,CAAC;EACpD,SAAS,kCAAkC;EAC3C,qBAAqB,MAAM,QAAQ,aAAa,+BAA+B;EAC/E,QAAQ,4BAA4B;EACpC,QAAQ,MAAM,QAAQ,aAAa,iBAAiB;EACpD,WAAW,MAAM,QAAQ,MAAM,8BAA8B;EAC7D,YAAY,MAAM,QAAQ,kBAAkB,MAAM,SAAS,IAAI,GAAG,CAAC;EACnE,mBAAmB,MAAM,QAAQ,YAAY,MAAM,QAAQ,cAAc,SAAS;GAAE,KAAK;GAAG,KAAK,QAAQ;EAAO,CAAC,CAAC;EAClH,WAAW,MAAM,KAAK,QAAQ,CAAC,CAAC,YAAY;EAC5C,WAAW,MAAM,KAAK,QAAQ,CAAC,CAAC,YAAY;EAC5C,GAAG;CACL;AACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LOCALES } from "../../../../../../../../src/shared/domain/value-objects/locale/locale.constants.mjs";
|
|
1
2
|
import { QUESTION_CATEGORIES, QUESTION_COGNITIVE_DIFFICULTIES } from "../../../../../../../../src/contexts/question/domain/constants/question.constants.mjs";
|
|
2
3
|
import { createFakeQuestionAuthorCreationDto } from "./question-author-creation/question-author-creation.dto.faketory.mjs";
|
|
3
4
|
import { createFakeQuestionContentCreationDto } from "./question-content-creation/question-content-creation.dto.faketory.mjs";
|
|
@@ -12,6 +13,10 @@ function createFakeQuestionCreationDto(creationDto = {}) {
|
|
|
12
13
|
cognitiveDifficulty: faker.helpers.arrayElement(QUESTION_COGNITIVE_DIFFICULTIES),
|
|
13
14
|
author: createFakeQuestionAuthorCreationDto(),
|
|
14
15
|
sourceUrls: faker.helpers.uniqueArray(() => faker.internet.url(), 2),
|
|
16
|
+
applicableLocales: faker.helpers.maybe(() => faker.helpers.arrayElements(LOCALES, {
|
|
17
|
+
min: 1,
|
|
18
|
+
max: LOCALES.length
|
|
19
|
+
})),
|
|
15
20
|
...creationDto
|
|
16
21
|
};
|
|
17
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question-creation.dto.faketory.mjs","names":[],"sources":["../../../../../../../../../../../tests/shared/utils/faketories/contexts/question/dto/question-creation/question-creation.dto.faketory.ts"],"sourcesContent":["import { faker } from \"@faker-js/faker\";\n\nimport type { QuestionCreationDto } from \"@question/application/dto/question-creation/question-creation.dto.shape\";\nimport { QUESTION_CATEGORIES, QUESTION_COGNITIVE_DIFFICULTIES } from \"@question/domain/constants/question.constants\";\n\nimport { createFakeQuestionContentCreationDto } from \"@faketories/contexts/question/dto/question-creation/question-content-creation/question-content-creation.dto.faketory\";\nimport { createFakeQuestionThemeAssignmentCreationDto } from \"@faketories/contexts/question/dto/question-creation/question-theme-assignment-creation/question-theme-assignment-creation.dto.faketory\";\nimport { createFakeQuestionAuthorCreationDto } from \"@faketories/contexts/question/dto/question-creation/question-author-creation/question-author-creation.dto.faketory\";\n\nfunction createFakeQuestionCreationDto(creationDto: Partial<QuestionCreationDto> = {}): QuestionCreationDto {\n return {\n category: faker.helpers.arrayElement(QUESTION_CATEGORIES),\n themes: [createFakeQuestionThemeAssignmentCreationDto()],\n content: createFakeQuestionContentCreationDto(),\n cognitiveDifficulty: faker.helpers.arrayElement(QUESTION_COGNITIVE_DIFFICULTIES),\n author: createFakeQuestionAuthorCreationDto(),\n sourceUrls: faker.helpers.uniqueArray(() => faker.internet.url(), 2),\n ...creationDto,\n };\n}\n\nexport { createFakeQuestionCreationDto };"],"mappings":"
|
|
1
|
+
{"version":3,"file":"question-creation.dto.faketory.mjs","names":[],"sources":["../../../../../../../../../../../tests/shared/utils/faketories/contexts/question/dto/question-creation/question-creation.dto.faketory.ts"],"sourcesContent":["import { faker } from \"@faker-js/faker\";\n\nimport { LOCALES } from \"@shared/domain/value-objects/locale/locale.constants\";\n\nimport type { QuestionCreationDto } from \"@question/application/dto/question-creation/question-creation.dto.shape\";\nimport { QUESTION_CATEGORIES, QUESTION_COGNITIVE_DIFFICULTIES } from \"@question/domain/constants/question.constants\";\n\nimport { createFakeQuestionContentCreationDto } from \"@faketories/contexts/question/dto/question-creation/question-content-creation/question-content-creation.dto.faketory\";\nimport { createFakeQuestionThemeAssignmentCreationDto } from \"@faketories/contexts/question/dto/question-creation/question-theme-assignment-creation/question-theme-assignment-creation.dto.faketory\";\nimport { createFakeQuestionAuthorCreationDto } from \"@faketories/contexts/question/dto/question-creation/question-author-creation/question-author-creation.dto.faketory\";\n\nfunction createFakeQuestionCreationDto(creationDto: Partial<QuestionCreationDto> = {}): QuestionCreationDto {\n return {\n category: faker.helpers.arrayElement(QUESTION_CATEGORIES),\n themes: [createFakeQuestionThemeAssignmentCreationDto()],\n content: createFakeQuestionContentCreationDto(),\n cognitiveDifficulty: faker.helpers.arrayElement(QUESTION_COGNITIVE_DIFFICULTIES),\n author: createFakeQuestionAuthorCreationDto(),\n sourceUrls: faker.helpers.uniqueArray(() => faker.internet.url(), 2),\n applicableLocales: faker.helpers.maybe(() => faker.helpers.arrayElements(LOCALES, { min: 1, max: LOCALES.length })),\n ...creationDto,\n };\n}\n\nexport { createFakeQuestionCreationDto };"],"mappings":";;;;;;;AAWA,SAAS,8BAA8B,cAA4C,CAAC,GAAwB;CAC1G,OAAO;EACL,UAAU,MAAM,QAAQ,aAAa,mBAAmB;EACxD,QAAQ,CAAC,6CAA6C,CAAC;EACvD,SAAS,qCAAqC;EAC9C,qBAAqB,MAAM,QAAQ,aAAa,+BAA+B;EAC/E,QAAQ,oCAAoC;EAC5C,YAAY,MAAM,QAAQ,kBAAkB,MAAM,SAAS,IAAI,GAAG,CAAC;EACnE,mBAAmB,MAAM,QAAQ,YAAY,MAAM,QAAQ,cAAc,SAAS;GAAE,KAAK;GAAG,KAAK,QAAQ;EAAO,CAAC,CAAC;EAClH,GAAG;CACL;AACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LOCALES } from "../../../../../../../../src/shared/domain/value-objects/locale/locale.constants.mjs";
|
|
1
2
|
import { QUESTION_CATEGORIES, QUESTION_COGNITIVE_DIFFICULTIES } from "../../../../../../../../src/contexts/question/domain/constants/question.constants.mjs";
|
|
2
3
|
import { createFakeLocalizedText, createFakeLocalizedTexts } from "../../../../shared/locale/locale.faketory.mjs";
|
|
3
4
|
import { faker } from "@faker-js/faker";
|
|
@@ -17,6 +18,10 @@ function createFakeQuestionModificationDto(overrides = {}) {
|
|
|
17
18
|
cognitiveDifficulty: faker.helpers.maybe(() => faker.helpers.arrayElement(QUESTION_COGNITIVE_DIFFICULTIES)),
|
|
18
19
|
sourceUrls: faker.helpers.maybe(() => [faker.internet.url(), faker.internet.url()]),
|
|
19
20
|
content: faker.helpers.maybe(createFakeQuestionContentModificationDto),
|
|
21
|
+
applicableLocales: faker.helpers.maybe(() => faker.helpers.arrayElements(LOCALES, {
|
|
22
|
+
min: 1,
|
|
23
|
+
max: LOCALES.length
|
|
24
|
+
})),
|
|
20
25
|
...overrides
|
|
21
26
|
};
|
|
22
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question-modification.dto.faketory.mjs","names":[],"sources":["../../../../../../../../../../../tests/shared/utils/faketories/contexts/question/dto/question-modification/question-modification.dto.faketory.ts"],"sourcesContent":["import { faker } from \"@faker-js/faker\";\n\nimport { QUESTION_CATEGORIES, QUESTION_COGNITIVE_DIFFICULTIES } from \"@question/domain/constants/question.constants\";\nimport type { QuestionContentModificationDto } from \"@question/application/dto/question-modification/question-content-modification/question-content-modification.dto.shape\";\nimport type { QuestionModificationDto } from \"@question/application/dto/question-modification/question-modification.dto.shape\";\n\nimport { createFakeLocalizedText, createFakeLocalizedTexts } from \"@faketories/shared/locale/locale.faketory\";\n\nfunction createFakeQuestionContentModificationDto(overrides: Partial<QuestionContentModificationDto> = {}): QuestionContentModificationDto {\n return {\n statement: faker.helpers.maybe(createFakeLocalizedText),\n answer: faker.helpers.maybe(createFakeLocalizedText),\n context: faker.helpers.maybe(createFakeLocalizedText),\n trivia: faker.helpers.maybe(createFakeLocalizedTexts),\n ...overrides,\n };\n}\n\nfunction createFakeQuestionModificationDto(overrides: Partial<QuestionModificationDto> = {}): QuestionModificationDto {\n return {\n category: faker.helpers.maybe(() => faker.helpers.arrayElement(QUESTION_CATEGORIES)),\n cognitiveDifficulty: faker.helpers.maybe(() => faker.helpers.arrayElement(QUESTION_COGNITIVE_DIFFICULTIES)),\n sourceUrls: faker.helpers.maybe(() => [faker.internet.url(), faker.internet.url()]),\n content: faker.helpers.maybe(createFakeQuestionContentModificationDto),\n ...overrides,\n };\n}\n\nexport {\n createFakeQuestionContentModificationDto,\n createFakeQuestionModificationDto,\n};"],"mappings":"
|
|
1
|
+
{"version":3,"file":"question-modification.dto.faketory.mjs","names":[],"sources":["../../../../../../../../../../../tests/shared/utils/faketories/contexts/question/dto/question-modification/question-modification.dto.faketory.ts"],"sourcesContent":["import { faker } from \"@faker-js/faker\";\n\nimport { LOCALES } from \"@shared/domain/value-objects/locale/locale.constants\";\n\nimport { QUESTION_CATEGORIES, QUESTION_COGNITIVE_DIFFICULTIES } from \"@question/domain/constants/question.constants\";\nimport type { QuestionContentModificationDto } from \"@question/application/dto/question-modification/question-content-modification/question-content-modification.dto.shape\";\nimport type { QuestionModificationDto } from \"@question/application/dto/question-modification/question-modification.dto.shape\";\n\nimport { createFakeLocalizedText, createFakeLocalizedTexts } from \"@faketories/shared/locale/locale.faketory\";\n\nfunction createFakeQuestionContentModificationDto(overrides: Partial<QuestionContentModificationDto> = {}): QuestionContentModificationDto {\n return {\n statement: faker.helpers.maybe(createFakeLocalizedText),\n answer: faker.helpers.maybe(createFakeLocalizedText),\n context: faker.helpers.maybe(createFakeLocalizedText),\n trivia: faker.helpers.maybe(createFakeLocalizedTexts),\n ...overrides,\n };\n}\n\nfunction createFakeQuestionModificationDto(overrides: Partial<QuestionModificationDto> = {}): QuestionModificationDto {\n return {\n category: faker.helpers.maybe(() => faker.helpers.arrayElement(QUESTION_CATEGORIES)),\n cognitiveDifficulty: faker.helpers.maybe(() => faker.helpers.arrayElement(QUESTION_COGNITIVE_DIFFICULTIES)),\n sourceUrls: faker.helpers.maybe(() => [faker.internet.url(), faker.internet.url()]),\n content: faker.helpers.maybe(createFakeQuestionContentModificationDto),\n applicableLocales: faker.helpers.maybe(() => faker.helpers.arrayElements(LOCALES, { min: 1, max: LOCALES.length })),\n ...overrides,\n };\n}\n\nexport {\n createFakeQuestionContentModificationDto,\n createFakeQuestionModificationDto,\n};"],"mappings":";;;;;AAUA,SAAS,yCAAyC,YAAqD,CAAC,GAAmC;CACzI,OAAO;EACL,WAAW,MAAM,QAAQ,MAAM,uBAAuB;EACtD,QAAQ,MAAM,QAAQ,MAAM,uBAAuB;EACnD,SAAS,MAAM,QAAQ,MAAM,uBAAuB;EACpD,QAAQ,MAAM,QAAQ,MAAM,wBAAwB;EACpD,GAAG;CACL;AACF;AAEA,SAAS,kCAAkC,YAA8C,CAAC,GAA4B;CACpH,OAAO;EACL,UAAU,MAAM,QAAQ,YAAY,MAAM,QAAQ,aAAa,mBAAmB,CAAC;EACnF,qBAAqB,MAAM,QAAQ,YAAY,MAAM,QAAQ,aAAa,+BAA+B,CAAC;EAC1G,YAAY,MAAM,QAAQ,YAAY,CAAC,MAAM,SAAS,IAAI,GAAG,MAAM,SAAS,IAAI,CAAC,CAAC;EAClF,SAAS,MAAM,QAAQ,MAAM,wCAAwC;EACrE,mBAAmB,MAAM,QAAQ,YAAY,MAAM,QAAQ,cAAc,SAAS;GAAE,KAAK;GAAG,KAAK,QAAQ;EAAO,CAAC,CAAC;EAClH,GAAG;CACL;AACF"}
|
|
@@ -93,6 +93,16 @@ function createFakeQuestionStatsDto(overrides = {}) {
|
|
|
93
93
|
max: 20
|
|
94
94
|
})
|
|
95
95
|
},
|
|
96
|
+
byTranslationCompleteness: {
|
|
97
|
+
fullyTranslated: faker.number.int({
|
|
98
|
+
min: 0,
|
|
99
|
+
max: 20
|
|
100
|
+
}),
|
|
101
|
+
incomplete: faker.number.int({
|
|
102
|
+
min: 0,
|
|
103
|
+
max: 20
|
|
104
|
+
})
|
|
105
|
+
},
|
|
96
106
|
...overrides
|
|
97
107
|
};
|
|
98
108
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question-stats.dto.faketory.mjs","names":[],"sources":["../../../../../../../../../../../tests/shared/utils/faketories/contexts/question/dto/question-stats/question-stats.dto.faketory.ts"],"sourcesContent":["import { faker } from \"@faker-js/faker\";\n\nimport {\n QUESTION_AUTHOR_ROLE_ADMIN,\n QUESTION_AUTHOR_ROLE_AI,\n QUESTION_AUTHOR_ROLE_GAME,\n QUESTION_STATUS_ACTIVE,\n QUESTION_STATUS_ARCHIVED,\n QUESTION_STATUS_PENDING,\n QUESTION_STATUS_REJECTED,\n} from \"@question/domain/constants/question.constants\";\nimport type { QuestionStatsDto } from \"@question/application/dto/question-stats/question-stats.dto.shape\";\n\nfunction createFakeQuestionStatsDto(overrides: Partial<QuestionStatsDto> = {}): QuestionStatsDto {\n return {\n total: faker.number.int({ min: 0, max: 100 }),\n byStatus: {\n [QUESTION_STATUS_PENDING]: faker.number.int({ min: 0, max: 20 }),\n [QUESTION_STATUS_ACTIVE]: faker.number.int({ min: 0, max: 20 }),\n [QUESTION_STATUS_ARCHIVED]: faker.number.int({ min: 0, max: 20 }),\n [QUESTION_STATUS_REJECTED]: faker.number.int({ min: 0, max: 20 }),\n },\n byCategory: {\n trivia: faker.number.int({ min: 0, max: 20 }),\n lexicon: faker.number.int({ min: 0, max: 20 }),\n riddle: faker.number.int({ min: 0, max: 20 }),\n explanation: faker.number.int({ min: 0, max: 20 }),\n },\n byCognitiveDifficulty: {\n easy: faker.number.int({ min: 0, max: 20 }),\n medium: faker.number.int({ min: 0, max: 20 }),\n hard: faker.number.int({ min: 0, max: 20 }),\n },\n byAuthorRole: {\n [QUESTION_AUTHOR_ROLE_ADMIN]: faker.number.int({ min: 0, max: 20 }),\n [QUESTION_AUTHOR_ROLE_GAME]: faker.number.int({ min: 0, max: 20 }),\n [QUESTION_AUTHOR_ROLE_AI]: faker.number.int({ min: 0, max: 20 }),\n },\n byRejectionType: {\n \"inappropriate-content\": faker.number.int({ min: 0, max: 20 }),\n \"incorrect-information\": faker.number.int({ min: 0, max: 20 }),\n \"poor-quality\": faker.number.int({ min: 0, max: 20 }),\n \"duplicate-question\": faker.number.int({ min: 0, max: 20 }),\n \"other\": faker.number.int({ min: 0, max: 20 }),\n },\n ...overrides,\n };\n}\n\nexport { createFakeQuestionStatsDto };"],"mappings":";;;AAaA,SAAS,2BAA2B,YAAuC,CAAC,GAAqB;CAC/F,OAAO;EACL,OAAO,MAAM,OAAO,IAAI;GAAE,KAAK;GAAG,KAAK;EAAI,CAAC;EAC5C,UAAU;IACP,0BAA0B,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;IAC9D,yBAAyB,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;IAC7D,2BAA2B,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;IAC/D,2BAA2B,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;EAClE;EACA,YAAY;GACV,QAAQ,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;GAC5C,SAAS,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;GAC7C,QAAQ,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;GAC5C,aAAa,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;EACnD;EACA,uBAAuB;GACrB,MAAM,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;GAC1C,QAAQ,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;GAC5C,MAAM,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;EAC5C;EACA,cAAc;IACX,6BAA6B,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;IACjE,4BAA4B,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;IACtC,OAAA,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;EACjE;EACA,iBAAiB;GACf,yBAAyB,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;GAC7D,yBAAyB,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;GAC7D,gBAAgB,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;GACpD,sBAAsB,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;GAC1D,SAAS,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;EAC/C;EACA,GAAG;CACL;AACF"}
|
|
1
|
+
{"version":3,"file":"question-stats.dto.faketory.mjs","names":[],"sources":["../../../../../../../../../../../tests/shared/utils/faketories/contexts/question/dto/question-stats/question-stats.dto.faketory.ts"],"sourcesContent":["import { faker } from \"@faker-js/faker\";\n\nimport {\n QUESTION_AUTHOR_ROLE_ADMIN,\n QUESTION_AUTHOR_ROLE_AI,\n QUESTION_AUTHOR_ROLE_GAME,\n QUESTION_STATUS_ACTIVE,\n QUESTION_STATUS_ARCHIVED,\n QUESTION_STATUS_PENDING,\n QUESTION_STATUS_REJECTED,\n} from \"@question/domain/constants/question.constants\";\nimport type { QuestionStatsDto } from \"@question/application/dto/question-stats/question-stats.dto.shape\";\n\nfunction createFakeQuestionStatsDto(overrides: Partial<QuestionStatsDto> = {}): QuestionStatsDto {\n return {\n total: faker.number.int({ min: 0, max: 100 }),\n byStatus: {\n [QUESTION_STATUS_PENDING]: faker.number.int({ min: 0, max: 20 }),\n [QUESTION_STATUS_ACTIVE]: faker.number.int({ min: 0, max: 20 }),\n [QUESTION_STATUS_ARCHIVED]: faker.number.int({ min: 0, max: 20 }),\n [QUESTION_STATUS_REJECTED]: faker.number.int({ min: 0, max: 20 }),\n },\n byCategory: {\n trivia: faker.number.int({ min: 0, max: 20 }),\n lexicon: faker.number.int({ min: 0, max: 20 }),\n riddle: faker.number.int({ min: 0, max: 20 }),\n explanation: faker.number.int({ min: 0, max: 20 }),\n },\n byCognitiveDifficulty: {\n easy: faker.number.int({ min: 0, max: 20 }),\n medium: faker.number.int({ min: 0, max: 20 }),\n hard: faker.number.int({ min: 0, max: 20 }),\n },\n byAuthorRole: {\n [QUESTION_AUTHOR_ROLE_ADMIN]: faker.number.int({ min: 0, max: 20 }),\n [QUESTION_AUTHOR_ROLE_GAME]: faker.number.int({ min: 0, max: 20 }),\n [QUESTION_AUTHOR_ROLE_AI]: faker.number.int({ min: 0, max: 20 }),\n },\n byRejectionType: {\n \"inappropriate-content\": faker.number.int({ min: 0, max: 20 }),\n \"incorrect-information\": faker.number.int({ min: 0, max: 20 }),\n \"poor-quality\": faker.number.int({ min: 0, max: 20 }),\n \"duplicate-question\": faker.number.int({ min: 0, max: 20 }),\n \"other\": faker.number.int({ min: 0, max: 20 }),\n },\n byTranslationCompleteness: {\n fullyTranslated: faker.number.int({ min: 0, max: 20 }),\n incomplete: faker.number.int({ min: 0, max: 20 }),\n },\n ...overrides,\n };\n}\n\nexport { createFakeQuestionStatsDto };"],"mappings":";;;AAaA,SAAS,2BAA2B,YAAuC,CAAC,GAAqB;CAC/F,OAAO;EACL,OAAO,MAAM,OAAO,IAAI;GAAE,KAAK;GAAG,KAAK;EAAI,CAAC;EAC5C,UAAU;IACP,0BAA0B,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;IAC9D,yBAAyB,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;IAC7D,2BAA2B,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;IAC/D,2BAA2B,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;EAClE;EACA,YAAY;GACV,QAAQ,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;GAC5C,SAAS,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;GAC7C,QAAQ,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;GAC5C,aAAa,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;EACnD;EACA,uBAAuB;GACrB,MAAM,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;GAC1C,QAAQ,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;GAC5C,MAAM,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;EAC5C;EACA,cAAc;IACX,6BAA6B,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;IACjE,4BAA4B,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;IACtC,OAAA,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;EACjE;EACA,iBAAiB;GACf,yBAAyB,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;GAC7D,yBAAyB,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;GAC7D,gBAAgB,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;GACpD,sBAAsB,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;GAC1D,SAAS,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;EAC/C;EACA,2BAA2B;GACzB,iBAAiB,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;GACrD,YAAY,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;EAClD;EACA,GAAG;CACL;AACF"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SORT_ORDERS } from "../../../../../../../../src/shared/domain/constants/sort/sort.constants.mjs";
|
|
2
2
|
import "../../../../../../../../src/shared/infrastructure/http/zod/validators/limit/constants/limit.zod.validators.constants.mjs";
|
|
3
|
+
import { IS_FULLY_TRANSLATED_QUERY_KEY } from "../../../../../../../../src/shared/application/dto/constants/translation-completeness-query.dto.constants.mjs";
|
|
3
4
|
import { LIMIT_QUERY_KEY } from "../../../../../../../../src/shared/application/dto/constants/limit-query.dto.constants.mjs";
|
|
4
5
|
import { SORT_BY_QUERY_KEY, SORT_ORDER_QUERY_KEY } from "../../../../../../../../src/shared/application/dto/constants/sort-query.dto.constants.mjs";
|
|
5
6
|
import { ADMIN_QUESTION_THEME_SORTABLE_FIELDS, QUESTION_THEME_STATUSES } from "../../../../../../../../src/contexts/question-theme/domain/constants/question-theme.constants.mjs";
|
|
@@ -11,6 +12,7 @@ function createFakeAdminFindQuestionThemesQueryDto(overrides = {}) {
|
|
|
11
12
|
[SORT_ORDER_QUERY_KEY]: faker.helpers.arrayElement(SORT_ORDERS),
|
|
12
13
|
[LIMIT_QUERY_KEY]: faker.helpers.maybe(() => faker.number.int({ min: 0 })) ?? 50,
|
|
13
14
|
status: faker.helpers.maybe(() => faker.helpers.arrayElement(QUESTION_THEME_STATUSES)),
|
|
15
|
+
[IS_FULLY_TRANSLATED_QUERY_KEY]: faker.helpers.maybe(() => faker.datatype.boolean()),
|
|
14
16
|
...overrides
|
|
15
17
|
};
|
|
16
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-find-question-themes-query.dto.faketory.mjs","names":[],"sources":["../../../../../../../../../../../tests/shared/utils/faketories/contexts/question-theme/dto/admin-find-question-themes-query/admin-find-question-themes-query.dto.faketory.ts"],"sourcesContent":["import { faker } from \"@faker-js/faker\";\n\nimport { ADMIN_QUESTION_THEME_SORTABLE_FIELDS, QUESTION_THEME_STATUSES } from \"@question-theme/domain/constants/question-theme.constants\";\n\nimport { SORT_ORDERS } from \"@shared/domain/constants/sort/sort.constants\";\nimport { SORT_BY_QUERY_KEY, SORT_ORDER_QUERY_KEY } from \"@shared/application/dto/constants/sort-query.dto.constants\";\nimport { LIMIT_QUERY_KEY } from \"@shared/application/dto/constants/limit-query.dto.constants\";\nimport { LIMIT_DEFAULT, LIMIT_MINIMUM } from \"@shared/infrastructure/http/zod/validators/limit/constants/limit.zod.validators.constants\";\n\nimport type { AdminFindQuestionThemesQueryDto } from \"@question-theme/application/dto/admin-find-question-themes-query/admin-find-question-themes-query.dto.shape\";\n\nfunction createFakeAdminFindQuestionThemesQueryDto(overrides: Partial<AdminFindQuestionThemesQueryDto> = {}): AdminFindQuestionThemesQueryDto {\n return {\n [SORT_BY_QUERY_KEY]: faker.helpers.arrayElement(ADMIN_QUESTION_THEME_SORTABLE_FIELDS),\n [SORT_ORDER_QUERY_KEY]: faker.helpers.arrayElement(SORT_ORDERS),\n [LIMIT_QUERY_KEY]: faker.helpers.maybe(() => faker.number.int({ min: LIMIT_MINIMUM })) ?? LIMIT_DEFAULT,\n status: faker.helpers.maybe(() => faker.helpers.arrayElement(QUESTION_THEME_STATUSES)),\n ...overrides,\n };\n}\n\nexport { createFakeAdminFindQuestionThemesQueryDto };"],"mappings":"
|
|
1
|
+
{"version":3,"file":"admin-find-question-themes-query.dto.faketory.mjs","names":[],"sources":["../../../../../../../../../../../tests/shared/utils/faketories/contexts/question-theme/dto/admin-find-question-themes-query/admin-find-question-themes-query.dto.faketory.ts"],"sourcesContent":["import { faker } from \"@faker-js/faker\";\n\nimport { ADMIN_QUESTION_THEME_SORTABLE_FIELDS, QUESTION_THEME_STATUSES } from \"@question-theme/domain/constants/question-theme.constants\";\n\nimport { IS_FULLY_TRANSLATED_QUERY_KEY } from \"@shared/application/dto/constants/translation-completeness-query.dto.constants\";\nimport { SORT_ORDERS } from \"@shared/domain/constants/sort/sort.constants\";\nimport { SORT_BY_QUERY_KEY, SORT_ORDER_QUERY_KEY } from \"@shared/application/dto/constants/sort-query.dto.constants\";\nimport { LIMIT_QUERY_KEY } from \"@shared/application/dto/constants/limit-query.dto.constants\";\nimport { LIMIT_DEFAULT, LIMIT_MINIMUM } from \"@shared/infrastructure/http/zod/validators/limit/constants/limit.zod.validators.constants\";\n\nimport type { AdminFindQuestionThemesQueryDto } from \"@question-theme/application/dto/admin-find-question-themes-query/admin-find-question-themes-query.dto.shape\";\n\nfunction createFakeAdminFindQuestionThemesQueryDto(overrides: Partial<AdminFindQuestionThemesQueryDto> = {}): AdminFindQuestionThemesQueryDto {\n return {\n [SORT_BY_QUERY_KEY]: faker.helpers.arrayElement(ADMIN_QUESTION_THEME_SORTABLE_FIELDS),\n [SORT_ORDER_QUERY_KEY]: faker.helpers.arrayElement(SORT_ORDERS),\n [LIMIT_QUERY_KEY]: faker.helpers.maybe(() => faker.number.int({ min: LIMIT_MINIMUM })) ?? LIMIT_DEFAULT,\n status: faker.helpers.maybe(() => faker.helpers.arrayElement(QUESTION_THEME_STATUSES)),\n [IS_FULLY_TRANSLATED_QUERY_KEY]: faker.helpers.maybe(() => faker.datatype.boolean()),\n ...overrides,\n };\n}\n\nexport { createFakeAdminFindQuestionThemesQueryDto };"],"mappings":";;;;;;;;AAYA,SAAS,0CAA0C,YAAsD,CAAC,GAAoC;CAC5I,OAAO;GACJ,oBAAoB,MAAM,QAAQ,aAAa,oCAAoC;GACnF,uBAAuB,MAAM,QAAQ,aAAa,WAAW;GAC7D,kBAAkB,MAAM,QAAQ,YAAY,MAAM,OAAO,IAAI,EAAE,KAAA,EAAmB,CAAC,CAAC,KAAA;EACrF,QAAQ,MAAM,QAAQ,YAAY,MAAM,QAAQ,aAAa,uBAAuB,CAAC;GACpF,gCAAgC,MAAM,QAAQ,YAAY,MAAM,SAAS,QAAQ,CAAC;EACnF,GAAG;CACL;AACF"}
|
|
@@ -28,6 +28,16 @@ function createFakeQuestionThemeStatsDto(overrides = {}) {
|
|
|
28
28
|
min: 0,
|
|
29
29
|
max: 5
|
|
30
30
|
} }),
|
|
31
|
+
byTranslationCompleteness: {
|
|
32
|
+
fullyTranslated: faker.number.int({
|
|
33
|
+
min: 0,
|
|
34
|
+
max: 30
|
|
35
|
+
}),
|
|
36
|
+
incomplete: faker.number.int({
|
|
37
|
+
min: 0,
|
|
38
|
+
max: 30
|
|
39
|
+
})
|
|
40
|
+
},
|
|
31
41
|
...overrides
|
|
32
42
|
};
|
|
33
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question-theme-stats.dto.faketory.mjs","names":[],"sources":["../../../../../../../../../../../tests/shared/utils/faketories/contexts/question-theme/dto/question-theme-stats/question-theme-stats.dto.faketory.ts"],"sourcesContent":["import { faker } from \"@faker-js/faker\";\n\nimport { DEFAULT_QUESTION_THEME_STATUS, QUESTION_THEME_STATUS_ARCHIVED } from \"@question-theme/domain/constants/question-theme.constants\";\n\nimport type { QuestionThemeStatsDto } from \"@question-theme/application/dto/question-theme-stats/question-theme-stats.dto.shape\";\n\nfunction createFakeQuestionThemeStatsDto(overrides: Partial<QuestionThemeStatsDto> = {}): QuestionThemeStatsDto {\n return {\n total: faker.number.int({ min: 0, max: 50 }),\n byStatus: {\n [DEFAULT_QUESTION_THEME_STATUS]: faker.number.int({ min: 0, max: 30 }),\n [QUESTION_THEME_STATUS_ARCHIVED]: faker.number.int({ min: 0, max: 30 }),\n },\n byQuestionCount: faker.helpers.multiple(\n () => ({\n themeId: faker.database.mongodbObjectId(),\n themeSlug: faker.lorem.slug(),\n activeQuestionCount: faker.number.int({ min: 0, max: 50 }),\n }),\n { count: { min: 0, max: 5 } },\n ),\n ...overrides,\n };\n}\n\nexport { createFakeQuestionThemeStatsDto };"],"mappings":";;;AAMA,SAAS,gCAAgC,YAA4C,CAAC,GAA0B;CAC9G,OAAO;EACL,OAAO,MAAM,OAAO,IAAI;GAAE,KAAK;GAAG,KAAK;EAAG,CAAC;EAC3C,UAAU;IACP,gCAAgC,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;IACpE,iCAAiC,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;EACxE;EACA,iBAAiB,MAAM,QAAQ,gBACtB;GACL,SAAS,MAAM,SAAS,gBAAgB;GACxC,WAAW,MAAM,MAAM,KAAK;GAC5B,qBAAqB,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;EAC3D,IACA,EAAE,OAAO;GAAE,KAAK;GAAG,KAAK;EAAE,EAAE,CAC9B;EACA,GAAG;CACL;AACF"}
|
|
1
|
+
{"version":3,"file":"question-theme-stats.dto.faketory.mjs","names":[],"sources":["../../../../../../../../../../../tests/shared/utils/faketories/contexts/question-theme/dto/question-theme-stats/question-theme-stats.dto.faketory.ts"],"sourcesContent":["import { faker } from \"@faker-js/faker\";\n\nimport { DEFAULT_QUESTION_THEME_STATUS, QUESTION_THEME_STATUS_ARCHIVED } from \"@question-theme/domain/constants/question-theme.constants\";\n\nimport type { QuestionThemeStatsDto } from \"@question-theme/application/dto/question-theme-stats/question-theme-stats.dto.shape\";\n\nfunction createFakeQuestionThemeStatsDto(overrides: Partial<QuestionThemeStatsDto> = {}): QuestionThemeStatsDto {\n return {\n total: faker.number.int({ min: 0, max: 50 }),\n byStatus: {\n [DEFAULT_QUESTION_THEME_STATUS]: faker.number.int({ min: 0, max: 30 }),\n [QUESTION_THEME_STATUS_ARCHIVED]: faker.number.int({ min: 0, max: 30 }),\n },\n byQuestionCount: faker.helpers.multiple(\n () => ({\n themeId: faker.database.mongodbObjectId(),\n themeSlug: faker.lorem.slug(),\n activeQuestionCount: faker.number.int({ min: 0, max: 50 }),\n }),\n { count: { min: 0, max: 5 } },\n ),\n byTranslationCompleteness: {\n fullyTranslated: faker.number.int({ min: 0, max: 30 }),\n incomplete: faker.number.int({ min: 0, max: 30 }),\n },\n ...overrides,\n };\n}\n\nexport { createFakeQuestionThemeStatsDto };"],"mappings":";;;AAMA,SAAS,gCAAgC,YAA4C,CAAC,GAA0B;CAC9G,OAAO;EACL,OAAO,MAAM,OAAO,IAAI;GAAE,KAAK;GAAG,KAAK;EAAG,CAAC;EAC3C,UAAU;IACP,gCAAgC,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;IACpE,iCAAiC,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;EACxE;EACA,iBAAiB,MAAM,QAAQ,gBACtB;GACL,SAAS,MAAM,SAAS,gBAAgB;GACxC,WAAW,MAAM,MAAM,KAAK;GAC5B,qBAAqB,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;EAC3D,IACA,EAAE,OAAO;GAAE,KAAK;GAAG,KAAK;EAAE,EAAE,CAC9B;EACA,2BAA2B;GACzB,iBAAiB,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;GACrD,YAAY,MAAM,OAAO,IAAI;IAAE,KAAK;IAAG,KAAK;GAAG,CAAC;EAClD;EACA,GAAG;CACL;AACF"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goat-it/schemas",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.22-beta",
|
|
5
5
|
"description": "Shared types, constants and Zod schemas for the Goat It projects.",
|
|
6
6
|
"author": "Antoine ZANARDI",
|
|
7
7
|
"license": "MIT",
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
"@arethetypeswrong/core": "^0.18.5",
|
|
15
15
|
"tsdown": "^0.22.14",
|
|
16
16
|
"typescript": "^6.0.3",
|
|
17
|
-
"zod": "^4.4
|
|
17
|
+
"zod": "^4.5.4"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@faker-js/faker": ">=10.
|
|
21
|
-
"zod": "^4.4
|
|
20
|
+
"@faker-js/faker": ">=10.6.0",
|
|
21
|
+
"zod": "^4.5.4"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"type-fest": "^5.
|
|
67
|
+
"type-fest": "^5.9.0"
|
|
68
68
|
},
|
|
69
69
|
"sideEffects": false,
|
|
70
70
|
"scripts": {
|