@goat-it/schemas 0.0.20 → 0.0.21-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 +1 -0
- 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/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-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/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/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 +2 -2
|
@@ -17,6 +17,7 @@ declare const ADMIN_FIND_QUESTIONS_QUERY_DTO: z.ZodObject<{
|
|
|
17
17
|
"cognitive-difficulty": z.ZodOptional<z.ZodEnum<QuestionCognitiveDifficultyEnum>>;
|
|
18
18
|
"author-role": z.ZodOptional<z.ZodEnum<QuestionAuthorRoleEnum>>;
|
|
19
19
|
"theme-ids": z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodString>>>;
|
|
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/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"}
|
|
@@ -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"}
|
|
@@ -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 whether every LocalizedText/LocalizedTexts field has all 6 supported locales set");
|
|
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 whether every LocalizedText/LocalizedTexts field has all 6 supported locales set\");\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,uGAAuG;AACrH;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"}
|
|
@@ -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.21-beta",
|
|
5
5
|
"description": "Shared types, constants and Zod schemas for the Goat It projects.",
|
|
6
6
|
"author": "Antoine ZANARDI",
|
|
7
7
|
"license": "MIT",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"zod": "^4.4.3"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@faker-js/faker": ">=10.
|
|
20
|
+
"@faker-js/faker": ">=10.6.0",
|
|
21
21
|
"zod": "^4.4.3"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|